santinomistico
This commit is contained in:
parent
ec1de70645
commit
9ad3ba43f9
60
index.php
60
index.php
|
|
@ -3,6 +3,13 @@ session_start();
|
||||||
$roleName = isset($_SESSION['role_name']) ? $_SESSION['role_name'] : null;
|
$roleName = isset($_SESSION['role_name']) ? $_SESSION['role_name'] : null;
|
||||||
$isLogged = isset($_SESSION['user_id']);
|
$isLogged = isset($_SESSION['user_id']);
|
||||||
$username = isset($_SESSION['username']) ? $_SESSION['username'] : null;
|
$username = isset($_SESSION['username']) ? $_SESSION['username'] : null;
|
||||||
|
// Flag di sessione: mostra l'effetto solo una volta per sessione
|
||||||
|
$alessioCandidate = $isLogged && $username && stripos($username, 'alessio') !== false;
|
||||||
|
$showBlessingOnce = false;
|
||||||
|
if ($alessioCandidate && empty($_SESSION['alessio_blessed'])) {
|
||||||
|
$showBlessingOnce = true;
|
||||||
|
$_SESSION['alessio_blessed'] = true;
|
||||||
|
}
|
||||||
?>
|
?>
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="it">
|
<html lang="it">
|
||||||
|
|
@ -12,6 +19,16 @@ $username = isset($_SESSION['username']) ? $_SESSION['username'] : null;
|
||||||
<title>Biblioteca | Home</title>
|
<title>Biblioteca | Home</title>
|
||||||
<script src="https://cdn.tailwindcss.com"></script>
|
<script src="https://cdn.tailwindcss.com"></script>
|
||||||
<script src="https://code.jquery.com/jquery-3.7.1.min.js"></script>
|
<script src="https://code.jquery.com/jquery-3.7.1.min.js"></script>
|
||||||
|
<style>
|
||||||
|
#alessioBlessing{position:fixed;left:50%;transform:translateX(-50%);top:-300px;width:220px;height:220px;pointer-events:none;z-index:9999;opacity:0;}
|
||||||
|
#alessioBlessing .halo{position:absolute;top:-20px;left:50%;transform:translateX(-50%);width:150px;height:150px;border-radius:50%;box-shadow:0 0 30px 15px rgba(255,215,0,0.7) inset,0 0 25px 10px rgba(255,215,0,0.6);background:radial-gradient(circle, rgba(255,238,169,0.7) 0%, rgba(255,204,0,0.4) 60%, rgba(255,204,0,0.1) 100%);}
|
||||||
|
#alessioBlessing .photo{position:absolute;bottom:0;left:50%;transform:translateX(-50%);width:120px;height:160px;border-radius:10px;object-fit:cover;box-shadow:0 10px 25px rgba(0,0,0,0.15);}
|
||||||
|
#alessioBlessing .sparkles{position:absolute;inset:0;}
|
||||||
|
#alessioBlessing .sparkles span{position:absolute;width:6px;height:6px;background:#ffd700;border-radius:50%;box-shadow:0 0 10px #ffd700;opacity:.9;animation:twinkle 1.2s infinite ease-in-out;}
|
||||||
|
@keyframes twinkle{0%,100%{transform:translateY(0) scale(1);opacity:.3;}50%{transform:translateY(-6px) scale(1.2);opacity:1;}}
|
||||||
|
@keyframes descendTop{0%{top:-300px;opacity:0;}30%{top:18%;opacity:1;}60%{top:35%;opacity:1;}85%{top:60%;opacity:.9;}100%{top:110%;opacity:0;}}
|
||||||
|
#alessioBlessing.run{animation:descendTop 4.8s ease-in-out forwards;}
|
||||||
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body class="bg-[#f8fafc] text-[#545454]">
|
<body class="bg-[#f8fafc] text-[#545454]">
|
||||||
<nav class="w-full bg-[#545454] text-white shadow">
|
<nav class="w-full bg-[#545454] text-white shadow">
|
||||||
|
|
@ -227,6 +244,49 @@ $username = isset($_SESSION['username']) ? $_SESSION['username'] : null;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const isAlessioOnce = <?php echo ($showBlessingOnce ? 'true' : 'false'); ?>;
|
||||||
|
if (isAlessioOnce) {
|
||||||
|
const $b = $(
|
||||||
|
'<div id="alessioBlessing">\
|
||||||
|
<div class="halo"></div>\
|
||||||
|
<img class="photo" src="./assets/santino.png" alt="Santino" onerror="this.style.display=\'none\'" />\
|
||||||
|
<div class="sparkles"></div>\
|
||||||
|
</div>'
|
||||||
|
);
|
||||||
|
$('body').append($b);
|
||||||
|
$b.find('.photo').attr('src','./assets/img/santino.png').attr('alt','Santino Alessio');
|
||||||
|
const $s = $b.find('.sparkles');
|
||||||
|
for (let i = 0; i < 18; i++) {
|
||||||
|
const $sp = $('<span/>');
|
||||||
|
$sp.css({
|
||||||
|
left: (Math.random() * 200) + 'px',
|
||||||
|
top: (Math.random() * 200) + 'px',
|
||||||
|
animationDelay: (Math.random() * 1.2) + 's'
|
||||||
|
});
|
||||||
|
$s.append($sp);
|
||||||
|
}
|
||||||
|
// Avvia animazione, riproduce l'MP3 celestiale e rimuove
|
||||||
|
function playHeavenly(){
|
||||||
|
try {
|
||||||
|
const audio = new Audio('./assets/sound/heavenly.mp3');
|
||||||
|
audio.volume = 0.7;
|
||||||
|
audio.play().catch(() => {
|
||||||
|
const once = function(){
|
||||||
|
audio.play().catch(()=>{});
|
||||||
|
document.removeEventListener('click', once);
|
||||||
|
document.removeEventListener('keydown', once);
|
||||||
|
document.removeEventListener('touchstart', once);
|
||||||
|
};
|
||||||
|
document.addEventListener('click', once, { once: true });
|
||||||
|
document.addEventListener('keydown', once, { once: true });
|
||||||
|
document.addEventListener('touchstart', once, { once: true });
|
||||||
|
});
|
||||||
|
} catch(e){}
|
||||||
|
}
|
||||||
|
setTimeout(function(){ $b.addClass('run'); playHeavenly(); }, 150);
|
||||||
|
setTimeout(function(){ $b.remove(); }, 5200);
|
||||||
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue