feat: Change global mouse interaction

- Add .body_intro to intro screen
- Change mouse over identifier
- Introduce HippieFade as global function
- Replace #js_mob with HippieFade
- Remove old partial
This commit is contained in:
sthag 2025-10-25 09:32:22 +02:00
parent 65d80fcbc4
commit ac8f55a7c9
8 changed files with 62 additions and 40 deletions

View file

@ -11,16 +11,6 @@ function setup() {
console.dir(hippie);
console.groupEnd();
}
// WANNABE MODULE Mouse over effect
// With CSS only
if ($('#js_mob').length && viewHover) {
$('#js_mob').addClass('mouse_over');
}
// if (viewHover) {
// $('body').prepend('<div id="js_mob" class="mouse_over"></div>');
// }
// With JS
}
// MODULE Scroll navigation
@ -70,6 +60,27 @@ function HippieScroll($tp, $dn) {
});
}
function HippieFade(toggleElement, initState) {
'use strict';
const fragment = document.createDocumentFragment();
const overlay = document.createElement('div');
overlay.id = 'mouse-overlay';
if (initState) {
overlay.classList.add('active');
}
toggleElement.addEventListener('click', function () {
overlay.classList.toggle('active');
});
fragment.appendChild(overlay);
document.body.style.position = 'relative';
document.body.prepend(fragment);
}
// MODULE Meta elements
function HippieMeta($ma, $pp) {
'use strict';

View file

@ -27,4 +27,4 @@ const flagColors = [
'b7e0f0',
'6bc7d9',
'52bed1'
]
];