This commit is contained in:
sakrecoer 2025-06-30 01:10:28 +02:00
parent e0181fb930
commit d08c3cc0a1
4 changed files with 43 additions and 33 deletions

View file

@ -1,3 +1,5 @@
{{ define "navigation" }}
{{ partial "body/navigation.html" . }}
{{ end }}
@ -11,6 +13,47 @@
{{ define "main" }}
<main>
<style>
@media (max-width: 768px) {
/* Apply grayscale to the root HTML element (affects children) */
html {
filter: grayscale(100%);
transition: filter 5s ease;
}
/* Color mode (when scrolling) */
html.color-mode {
filter: grayscale(0%);
}
/* Fix for child elements inheriting filters incorrectly */
html * {
filter: none !important; /* Prevents double-filtering */
}
}
</style>
<script>
// Only run on mobile
if (window.matchMedia("(max-width: 768px)").matches) {
let scrollTimeout;
const html = document.documentElement;
window.addEventListener('scroll', () => {
// Add color mode
html.classList.add('color-mode');
// Reset timeout on scroll
clearTimeout(scrollTimeout);
// Revert to grayscale after 1 second of no scrolling
scrollTimeout = setTimeout(() => {
html.classList.remove('color-mode');
}, 1000);
}, { passive: true }); // Optimized for performance
}
</script>
{{ partial "body/now.html" . }}
{{ partial "body/discog.html" . }}

View file

@ -1,17 +1,6 @@
<style>
#gancio {
* {
filter: grayscale(100%);
transition: filter 17s linear;
}
*:hover {
filter: grayscale(0%) !important;
transition: filter .1s linear;
}
display: flex;
flex-wrap: wrap;
justify-content: space-between;

View file

@ -1,17 +1,6 @@
<style>
#gang {
* {
filter: grayscale(100%);
transition: filter 17s linear;
}
*:hover {
filter: grayscale(0%) !important;
transition: filter .1s linear;
}
display: flex;
flex-wrap: wrap;
justify-content: space-between;

View file

@ -2,17 +2,6 @@
#peertube {
* {
filter: grayscale(100%);
transition: filter 17s linear;
}
*:hover {
filter: grayscale(0%) !important;
transition: filter .1s linear;
}
display: flex;
flex-wrap: wrap;
flex-direction: row;