Skip to content

Commit 867b353

Browse files
authored
Update index.html
1 parent 5e4e051 commit 867b353

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

index.html

+14-3
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,19 @@
1515
/* Cookie banner styling */
1616
#cookie-banner {
1717
position: fixed;
18-
bottom: 0;
18+
bottom: -100px; /* Initially hide the banner off-screen */
19+
left: 0;
1920
width: 100%;
2021
background-color: #333;
2122
color: white;
2223
text-align: center;
23-
padding: 10px;
24+
padding: 15px;
2425
display: none;
2526
z-index: 1000;
27+
border-top-right-radius: 10px;
28+
border-top-left-radius: 10px;
29+
box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
30+
transition: bottom 0.5s ease-in-out; /* Slide-in effect */
2631
}
2732
#cookie-banner button {
2833
background-color: #4CAF50;
@@ -79,13 +84,19 @@ <h1>Welcome to Our School SMP!</h1>
7984
function checkCookieConsent() {
8085
if (!localStorage.getItem('cookiesAccepted')) {
8186
document.getElementById('cookie-banner').style.display = 'block';
87+
setTimeout(function() {
88+
document.getElementById('cookie-banner').style.bottom = '0'; // Animate the banner from below
89+
}, 100); // Short delay before sliding in
8290
}
8391
}
8492

8593
// Function to handle the acceptance of cookies
8694
document.getElementById('accept-cookies').addEventListener('click', function() {
8795
localStorage.setItem('cookiesAccepted', 'true'); // Store cookie consent in localStorage
88-
document.getElementById('cookie-banner').style.display = 'none'; // Hide the banner
96+
document.getElementById('cookie-banner').style.bottom = '-100px'; // Hide the banner by sliding it out
97+
setTimeout(function() {
98+
document.getElementById('cookie-banner').style.display = 'none'; // Completely hide it after animation
99+
}, 500); // Wait for the slide-out animation to finish
89100
});
90101

91102
// Check cookie consent status on page load

0 commit comments

Comments
 (0)