This commit is contained in:
Mateus Cezário Barreto 2025-11-18 15:21:41 -03:00
commit e2ce3d6cb7
4 changed files with 80 additions and 54 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 542 KiB

View file

@ -270,17 +270,24 @@ div.ficha figure
padding: 0; padding: 0;
} }
div.ficha figure img div.ficha img
{ {
margin: 0; margin: 0;
aspect-ratio: 3 / 4; aspect-ratio: 3 / 4;
}
div.ficha:not(.easteregg-visible) img
{
animation-name: image-change; animation-name: image-change;
animation-timing-function: ease-in-out; animation-timing-function: ease-in-out;
animation-iteration-count: infinite; animation-iteration-count: infinite;
animation-duration: 10s; animation-duration: 10s;
} }
div.ficha div.description div.ficha.easteregg-visible img:not(.easteregg)
{ opacity: 0; }
div.ficha div.description, div.ficha div.easteregg
{ {
grid-row: 2; grid-row: 2;
grid-column: 1 / 3; grid-column: 1 / 3;
@ -308,43 +315,55 @@ div.ficha div.description
40%, 80% { transform: translateX(8px) rotate(1deg); } 40%, 80% { transform: translateX(8px) rotate(1deg); }
} }
.animate-shake { .animate-shake
animation: shake 0.3s ease-in-out; { animation: shake 0.3s ease-in-out; }
div.easteregg-visible
{ animation: glow 1s infinite alternate ease-in-out; }
@keyframes glow {
0% {
border-color: orange;
box-shadow: 0 0 10px orange,
0 0 20px orange;
} }
.easteregg-transition { 100% {
transition: max-height 0.5s ease-in-out, opacity 0.3s ease-in; border-color: red;
overflow: hidden; box-shadow: 0 0 10px red,
0 0 30px red;
}
} }
.easteregg-hidden { div.easteregg-visible div.description
max-height: 0; { display: none; }
opacity: 0;
padding: 0 1.5rem; /* Maintain horizontal padding space */
}
.easteregg-visible { div:not(.easteregg-visible) .easteregg
max-height: 300px; /* Arbitrary large height for expansion */ { display: none; }
opacity: 1;
padding-top: 1rem; div.easteregg-visible .easteregg
padding-bottom: 1.5rem; { display: block; }
}
div.ficha figure img:nth-of-type(1) div.ficha figure img:nth-of-type(1)
{ animation-delay: 0s;} { animation-delay: 0s;}
div.ficha figure img:nth-of-type(2) div.ficha figure img:not(:nth-of-type(1))
{ {
animation-delay: 5s;
opacity: 0;
position: absolute; position: absolute;
left: 0rem; left: 0rem;
top: 0rem; top: 0rem;
width: 100%;; width: 100%;
padding: inherit; padding: inherit;
box-sizing: border-box; box-sizing: border-box;
} }
div.ficha figure img:not(:nth-of-type(1)):not(.easteregg)
{ opacity: 0; animation-delay: 5s; }
div.ficha img.easteregg
{ opacity: 1; }
@media print @media print
{ {
:root :root

View file

@ -5,7 +5,7 @@ for (const card of cards)
card.addEventListener('click', handleCardClick); card.addEventListener('click', handleCardClick);
} }
const content = document.querySelector('div.ficha .easteregg'); const eastereggContainers = document.querySelectorAll('div.ficha:has(.easteregg)');
const messageBox = document.getElementById('message-box'); const messageBox = document.getElementById('message-box');
@ -16,28 +16,30 @@ const expandDuration = 5000;
let hideTimeoutId = null; let hideTimeoutId = null;
function hideContent() { function hideEastereggs() {
content.classList.remove('easteregg-visible'); for (const div of eastereggContainers)
content.classList.add('easteregg-hidden'); {
messageBox.textContent = ''; div.classList.remove('easteregg-visible');
div.classList.add('easteregg-hidden');
}
} }
function expandContent() { function expandEastereggs() {
// Show content for (const div of eastereggContainers)
content.classList.remove('easteregg-hidden'); {
content.classList.add('easteregg-visible'); div.classList.add('easteregg-visible');
messageBox.textContent = 'Secret content unlocked!'; div.classList.remove('easteregg-hidden');
}
// Clear any existing timeout and set a new one // Clear any existing timeout and set a new one
if (hideTimeoutId) { if (hideTimeoutId) {
clearTimeout(hideTimeoutId); clearTimeout(hideTimeoutId);
} }
hideTimeoutId = setTimeout(() => { hideTimeoutId = setTimeout(
hideContent(); () => { hideEastereggs(); },
// Optionally reset the count after the content hides, expandDuration
// but we already reset it immediately below. );
}, expandDuration);
clickCount = 0; clickCount = 0;
} }
@ -51,26 +53,27 @@ function handleCardClick(event) {
{ element = element.parentElement } { element = element.parentElement }
element.classList.add('animate-shake'); element.classList.add('animate-shake');
setTimeout(() => {
element.classList.remove('animate-shake'); setTimeout(
}, 300); // Duration of the shake animation () => { element.classList.remove('animate-shake'); },
300
);
// Determine if the click is 'in a row' // Determine if the click is 'in a row'
if (now - lastClickTime < clickThreshold) { if (now - lastClickTime < clickThreshold)
clickCount++; { clickCount++; }
} else { else
{
clickCount = 1; clickCount = 1;
if (content.classList.contains('easteregg-visible')) { if (element.classList.contains('easteregg-visible'))
hideContent(); { hideEastereggs(); }
}
} }
lastClickTime = now; lastClickTime = now;
// Check for the 3-click trigger // Check for the 3-click trigger
if (clickCount >= 3) { if (clickCount >= 3)
expandContent(); { expandEastereggs(); }
}
} }
window.onload = () => { hideContent(); } window.onload = () => { hideEastereggs(); }

View file

@ -15,6 +15,8 @@
<img src="/chapa-sigmoide/mateus.jpg"> <img src="/chapa-sigmoide/mateus.jpg">
<img src="/chapa-sigmoide/mateus-avatar.png"/> <img src="/chapa-sigmoide/mateus-avatar.png"/>
<img class="easteregg" src="/chapa-sigmoide/mateus-easteregg.gif"/>
</figure> </figure>
<div class="description"> <div class="description">
@ -22,10 +24,12 @@
<p><strong>Gosta de:</strong> programação, Linux, código aberto, Hollow Knight, Undertale, Deltarune, Chuunibyo.</p> <p><strong>Gosta de:</strong> programação, Linux, código aberto, Hollow Knight, Undertale, Deltarune, Chuunibyo.</p>
<p class="easteregg">Easteregg</p>
<p><a href="mateus">Mais</a></p> <p><a href="mateus">Mais</a></p>
</div> </div>
<div class="easteregg">
<p>UwU</p>
</div>
</div> </div>
<div class="ficha"> <div class="ficha">