summaryrefslogtreecommitdiff
path: root/script.js
blob: 19b17a616e69f8ba711089c51c447967df3856c2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
const unlockPhrases = ['irene', 'tien', 'zee', 'ren'];
const inputField = document.getElementById('password');
const lockscreen = document.getElementById('lockscreen');
const mainpage = document.getElementById('main-page');
const audio = document.querySelector('audio');
if(inputField){
    if (sessionStorage.getItem('unlocked') === 'true') {
        lockscreen.style.display = 'none';
        mainpage.style.zIndex = '1';
    }
    inputField.addEventListener('input', () => {
        const typedInput = inputField.value.toLowerCase();

        if (unlockPhrases.some(phrase => typedInput.includes(phrase))) {
            sessionStorage.setItem('unlocked', 'true');
            lockscreen.style.transition = 'opacity 0.5s ease-out';
            lockscreen.style.opacity = '0';
            setTimeout(() => {
                lockscreen.remove();
                mainpage.style.zIndex = '1';
            }, 500);
            audio.volume = 0;
            audio.play();
            
            const fadeIn = setInterval(() => {
                if (audio.volume < 0.2) {
                    audio.volume += 0.005;
                } else {
                    clearInterval(fadeIn);
                }
            }, 100);
            }
        
        if (typedInput.length > 20) inputField.value = '';
    });

}
const thankLetterContainer = document.getElementById('thank-letter-container');
const iloveirene = document.getElementById("lockscreen-container");
const pawImage = document.getElementById("paw-lockscreen-image");
if (pawImage) {
    pawImage.addEventListener("click", () => {
        console.log("Paw clicked");
        pawImage.style.transition = 'all 0.7s ease-out';
        pawImage.style.height = '300px';
        
        setTimeout(() => {
            iloveirene.style.transition = 'opacity 0.7s ease-out';
            iloveirene.style.opacity = '0';
            pawImage.style.opacity = '0';
            
            setTimeout(() => {
                iloveirene.remove();
                pawImage.remove();
                thankLetterContainer.style.display = 'flex';
            }, 700);
        }, 700);
        
    });
}