fix nav active
This commit is contained in:
parent
f7dab87c76
commit
be017ded2b
79
color.css
79
color.css
@ -535,3 +535,82 @@ input:checked + .slider:before {
|
||||
#copy-link-button:hover {
|
||||
background-color: #45a049;
|
||||
}
|
||||
|
||||
/* --- Zoom Overlay Feature --- */
|
||||
|
||||
#zoom-overlay {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
background-color: rgba(0, 0, 0, 0.75); /* Dark, semi-transparent background */
|
||||
z-index: 1001; /* Ensure it's on top of everything */
|
||||
|
||||
/* Use flexbox to center the content */
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
|
||||
/* Start hidden and transition opacity */
|
||||
opacity: 0;
|
||||
visibility: hidden;
|
||||
transition: opacity 0.3s ease, visibility 0.3s ease;
|
||||
|
||||
cursor: zoom-out; /* Hint to the user how to close it */
|
||||
}
|
||||
|
||||
/* The class we'll toggle with JavaScript to show the overlay */
|
||||
#zoom-overlay.is-active {
|
||||
opacity: 1;
|
||||
visibility: visible;
|
||||
}
|
||||
|
||||
/* The container for the zoomed-in palette balloons */
|
||||
#zoomed-palette-content {
|
||||
width: 90vw;
|
||||
height: 80vh;
|
||||
padding: 20px;
|
||||
|
||||
/* Looks like the original palette */
|
||||
background-color: #e8e8e8;
|
||||
background-image: url("https://www.transparenttextures.com/patterns/asfalt-light.png");
|
||||
border-radius: 15px;
|
||||
|
||||
/* Allow scrolling if there are many balloons */
|
||||
overflow-y: auto;
|
||||
|
||||
/* Arrange the cloned balloons */
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
gap: 20px;
|
||||
|
||||
cursor: default; /* Use a normal cursor for the content itself */
|
||||
}
|
||||
|
||||
/* Make the balloons and their names larger in the zoom view */
|
||||
#zoomed-palette-content .swatch-wrapper {
|
||||
transform: scale(1.1);
|
||||
}
|
||||
|
||||
/* --- Definitive Rules for Larger Selected Balloons --- */
|
||||
/* Using !important to forcefully override any other conflicting styles. */
|
||||
|
||||
/* This rule ensures the wrapper can expand to fit the larger balloon */
|
||||
#selected-palette .swatch-wrapper {
|
||||
width: auto !important;
|
||||
max-width: none !important;
|
||||
}
|
||||
|
||||
/* This rule sets the new, larger size for the balloon swatch */
|
||||
#selected-palette .color-swatch {
|
||||
width: 130px !important;
|
||||
height: 177px !important;
|
||||
}
|
||||
|
||||
/* This rule re-aligns the balloon string to match the new height */
|
||||
#selected-palette .balloon-string-svg {
|
||||
top: 108px !important;
|
||||
}
|
||||
148
index.html
148
index.html
@ -1,103 +1,93 @@
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Beach Party Balloons Color Palette Picker</title>
|
||||
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Autour+One&display=swap" rel="stylesheet">
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bulma@1.0.2/css/bulma.min.css">
|
||||
<link href="https://fonts.googleapis.com/css2?family=Autour+One&display=swap" rel="stylesheet">
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bulma@1.0.2/css/bulma.min.css">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.7.2/css/all.min.css" integrity="sha512-Evv84Mr4kqVGRNSgIGL/F/aIDqQb7xQ2vcrdIwxfjThSH8CSR7PBEakCr51Ck+w+/U6swU2Im1vVX0SVk9ABhg==" crossorigin="anonymous" referrerpolicy="no-referrer" />
|
||||
|
||||
<link rel="stylesheet" href="../style.css">
|
||||
<link rel="stylesheet" href="color.css">
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="../assets/favicon/apple-touch-icon.png">
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="../assets/favicon/favicon-32x32.png">
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="../assets/favicon/favicon-16x16.png">
|
||||
<link rel="manifest" href="../assets/favicon/site.webmanifest">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.7.2/css/all.min.css" integrity="sha512-Evv84Mr4kqVGRNSgIGL/F/aIDqQb7xQ2vcrdIwxfjThSH8CSR7PBEakCr51Ck+w+/U6swU2Im1vVX0SVk9ABhg==" crossorigin="anonymous" referrerpolicy="no-referrer" />
|
||||
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="../assets/favicon/apple-touch-icon.png">
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="../assets/favicon/favicon-32x32.png">
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="../assets/favicon/favicon-16x16.png">
|
||||
<link rel="manifest" href="../assets/favicon/site.webmanifest">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<nav class="navbar is-info is-spaced has-shadow" role="navigation" aria-label="main navigation">
|
||||
<div class="navbar-brand is-size-1">
|
||||
<a class="navbar-item" href="/">
|
||||
<img style="background-color: white;" src="../assets/logo/BeachPartyBalloons-logo.webp" alt="Beach Party Balloons logo">
|
||||
<nav class="navbar is-info is-spaced has-shadow" role="navigation" aria-label="main navigation">
|
||||
<div class="navbar-brand is-size-1">
|
||||
<a class="navbar-item" href="/">
|
||||
<img style="background-color: white;" src="../assets/logo/BeachPartyBalloons-logo.webp" alt="Beach Party Balloons logo">
|
||||
</a>
|
||||
|
||||
|
||||
</a>
|
||||
|
||||
<a role="button" class="navbar-burger" aria-label="menu" aria-expanded="false" data-target="navbarBasicExample">
|
||||
<span aria-hidden="true"></span>
|
||||
<span aria-hidden="true"></span>
|
||||
<span aria-hidden="true"></span>
|
||||
<span aria-hidden="true"></span>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div id="navbarBasicExample" class="navbar-menu has-text-right">
|
||||
<div class="navbar-end">
|
||||
<a class="navbar-item is-tab" href="/">
|
||||
Home
|
||||
</a>
|
||||
|
||||
<a class="navbar-item" href="../about/">
|
||||
About Us
|
||||
</a>
|
||||
<a class="navbar-item" href="../faq/">
|
||||
FAQ
|
||||
</a>
|
||||
<a class="navbar-item" href="../terms/">
|
||||
Terms
|
||||
</a>
|
||||
<!-- <div class="navbar-item "> -->
|
||||
<a class="navbar-item" href="../gallery/">
|
||||
Gallery
|
||||
</a>
|
||||
<a class="navbar-item" href="../contact/">
|
||||
Contact
|
||||
</a>
|
||||
<a class="navbar-item" href="../color/">
|
||||
Colors
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="navbar-end">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</nav>
|
||||
|
||||
<div id="selected-palette">
|
||||
<div class="palette-header-row">
|
||||
<h2 class="has-text-dark">Your Palette</h2>
|
||||
<div id="palette-controls">
|
||||
<label class="switch">
|
||||
<input type="checkbox" id="toggle-animation" checked>
|
||||
<span class="slider"></span>
|
||||
</label>
|
||||
<button id="shuffle-palette" title="Shuffle Palette">🔀</button>
|
||||
<button id="share-palette" title="Share Palette">🔗</button>
|
||||
<a role="button" class="navbar-burger" aria-label="menu" aria-expanded="false" data-target="navbarBasicExample">
|
||||
<span aria-hidden="true"></span>
|
||||
<span aria-hidden="true"></span>
|
||||
<span aria-hidden="true"></span>
|
||||
<span aria-hidden="true"></span>
|
||||
</a>
|
||||
</div>
|
||||
</div> <div id="palette-colors"></div>
|
||||
<button id="clear-palette" class="has-text-dark">Clear Palette</button>
|
||||
</div>
|
||||
|
||||
<div class="palette-modal-backdrop">
|
||||
<div class="palette-modal">
|
||||
<h3>Share Your Palette</h3>
|
||||
<div id="modal-color-list"></div>
|
||||
<button id="close-modal">Close</button>
|
||||
</div>
|
||||
</div>
|
||||
<div id="color-families"></div>
|
||||
<div id="navbarBasicExample" class="navbar-menu has-text-right">
|
||||
<div class="navbar-end">
|
||||
<a class="navbar-item is-tab" href="/">Home</a>
|
||||
<a class="navbar-item" href="../about/">About Us</a>
|
||||
<a class="navbar-item" href="../faq/">FAQ</a>
|
||||
<a class="navbar-item" href="../terms/">Terms</a>
|
||||
<a class="navbar-item" href="../gallery/">Gallery</a>
|
||||
<a class="navbar-item is-active is-tab" href="../color/">Colors</a>
|
||||
<a class="navbar-item" href="../contact/">Contact</a>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<main>
|
||||
<div id="selected-palette">
|
||||
<div class="palette-header-row">
|
||||
<h2 class="has-text-dark">Your Palette</h2>
|
||||
<div id="palette-controls">
|
||||
<label class="switch" title="Toggle Animations">
|
||||
<input type="checkbox" id="toggle-animation" checked>
|
||||
<span class="slider"></span>
|
||||
</label>
|
||||
<button id="shuffle-palette" title="Shuffle Palette">🔀</button>
|
||||
<button id="share-palette" title="Share Palette">🔗</button>
|
||||
<button id="zoom-palette" title="Zoom In Palette">🔍</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="palette-colors">
|
||||
</div>
|
||||
|
||||
<button id="clear-palette" class="has-text-dark">Clear Palette</button>
|
||||
</div>
|
||||
|
||||
<div id="color-families">
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<footer>
|
||||
<p>Made with 🎨 and 🎈 | Chris © 2025</p>
|
||||
</footer>
|
||||
|
||||
<div class="palette-modal-backdrop">
|
||||
<div class="palette-modal">
|
||||
<h3>Share Your Palette</h3>
|
||||
<div id="modal-color-list"></div>
|
||||
<button id="close-modal">Close</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="zoom-overlay">
|
||||
<div id="zoomed-palette-content"></div>
|
||||
</div>
|
||||
|
||||
<script src="script.js"></script>
|
||||
<script src="../script.js"></script>
|
||||
|
||||
|
||||
53
script.js
53
script.js
@ -350,3 +350,56 @@ modalBackdrop.addEventListener('click', (event) => {
|
||||
modalBackdrop.style.display = 'none';
|
||||
}
|
||||
});
|
||||
|
||||
// --- Zoom Palette Functionality ---
|
||||
|
||||
const zoomButton = document.getElementById('zoom-palette');
|
||||
const zoomOverlay = document.getElementById('zoom-overlay');
|
||||
const zoomedPaletteContent = document.getElementById('zoomed-palette-content');
|
||||
|
||||
// --- Event Listener to OPEN the zoom view ---
|
||||
zoomButton.addEventListener('click', () => {
|
||||
// Don't do anything if the palette is empty
|
||||
if (selectedPalette.length === 0) {
|
||||
alert("Palette is empty. Add some colors to zoom in!");
|
||||
return;
|
||||
}
|
||||
|
||||
// Get the original container of the colored balloons
|
||||
const originalPaletteColors = document.getElementById('palette-colors');
|
||||
|
||||
// Clear any old content and create a deep clone of the balloons
|
||||
zoomedPaletteContent.innerHTML = '';
|
||||
const clonedContent = originalPaletteColors.cloneNode(true);
|
||||
|
||||
// The clone doesn't need its own ID
|
||||
clonedContent.id = '';
|
||||
|
||||
// Append the cloned balloons to our zoom container
|
||||
zoomedPaletteContent.appendChild(clonedContent);
|
||||
|
||||
// Show the overlay by adding the .is-active class
|
||||
zoomOverlay.classList.add('is-active');
|
||||
});
|
||||
|
||||
// --- Function to CLOSE the zoom view ---
|
||||
function closeZoomView() {
|
||||
zoomOverlay.classList.remove('is-active');
|
||||
}
|
||||
|
||||
// --- Two ways to CLOSE the view for easy access ---
|
||||
|
||||
// 1. Click on the dark background (the overlay itself)
|
||||
zoomOverlay.addEventListener('click', (event) => {
|
||||
// Only close if the click is on the overlay, not the content inside
|
||||
if (event.target === zoomOverlay) {
|
||||
closeZoomView();
|
||||
}
|
||||
});
|
||||
|
||||
// 2. Press the 'Escape' key
|
||||
document.addEventListener('keydown', (event) => {
|
||||
if (event.key === 'Escape' && zoomOverlay.classList.contains('is-active')) {
|
||||
closeZoomView();
|
||||
}
|
||||
});
|
||||
Loading…
x
Reference in New Issue
Block a user