added zoom in buttons
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Test Zoom Persistence</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Testing localStorage for zoom visibility</h1>
|
||||
|
||||
<button onclick="closeZoom()">Close Zoom (set to 'false')</button>
|
||||
<button onclick="showZoom()">Show Zoom (set to 'true')</button>
|
||||
<button onclick="clearZoom()">Clear localStorage</button>
|
||||
<button onclick="checkValue()">Check Current Value</button>
|
||||
|
||||
<div id="output" style="margin-top: 20px; padding: 10px; background: #f0f0f0;"></div>
|
||||
|
||||
<script>
|
||||
function closeZoom() {
|
||||
localStorage.setItem('cv-zoom-visible', 'false');
|
||||
checkValue();
|
||||
}
|
||||
|
||||
function showZoom() {
|
||||
localStorage.setItem('cv-zoom-visible', 'true');
|
||||
checkValue();
|
||||
}
|
||||
|
||||
function clearZoom() {
|
||||
localStorage.removeItem('cv-zoom-visible');
|
||||
checkValue();
|
||||
}
|
||||
|
||||
function checkValue() {
|
||||
const value = localStorage.getItem('cv-zoom-visible');
|
||||
const output = document.getElementById('output');
|
||||
|
||||
output.innerHTML = `
|
||||
<strong>Current value:</strong> ${value === null ? 'null (not set)' : `"${value}"`}<br>
|
||||
<strong>Type:</strong> ${typeof value}<br>
|
||||
<strong>Is 'false'?</strong> ${value === 'false'}<br>
|
||||
<strong>Is 'true'?</strong> ${value === 'true'}<br>
|
||||
<strong>Is null?</strong> ${value === null}
|
||||
`;
|
||||
}
|
||||
|
||||
// Check on load
|
||||
checkValue();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user