-
Notifications
You must be signed in to change notification settings - Fork 0
/
sad.html
110 lines (102 loc) · 4.12 KB
/
sad.html
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Karna Kamu Aku Rela Lyrics</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #f0f0f0;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
}
.lyrics-container {
text-align: center;
display: none;
}
.line {
margin: 10px 0;
color: red;
font-size: 1.5em;
white-space: nowrap;
overflow: hidden;
border-right: 3px solid red;
width: 0;
opacity: 0;
position: absolute;
left: 50%;
transform: translateX(-50%);
}
.start-button {
padding: 10px 20px;
font-size: 16px;
border: none;
border-radius: 5px;
background-color: #007BFF;
color: white;
cursor: pointer;
}
.start-button:hover {
background-color: #0056b3;
}
@keyframes typing {
from { width: 0; opacity: 1; }
to { width: 100%; opacity: 1; }
}
@keyframes blink-caret {
from, to { border-color: transparent; }
50% { border-color: red; }
}
</style>
</head>
<body>
<button class="start-button">Mulai Sayank</button>
<div class="lyrics-container">
<div id="lyrics">
<p class="line" data-delay="1000" data-duration="2000">Karna kamu aku rela</p>
<p class="line" data-delay="3000" data-duration="2000">Menunggu semua</p>
<p class="line" data-delay="5000" data-duration="1000">Sungguh berat</p>
<p class="line" data-delay="6000" data-duration="1000">yang kurasa,</p>
<p class="line" data-delay="7000" data-duration="2000">Karna Kamu Aku</p>
<p class="line" data-delay="9000" data-duration="2000">Tetap Bertahan Meski Pun</p>
<p class="line" data-delay="11000" data-duration="2000">Kini engkau di peluk nya</p>
<p class="line" data-delay="13000" data-duration="4000">Masih Mungkinkah semua</p>
<p class="line" data-delay="17000" data-duration="2000">Abadi</p>
<p class="line" data-delay="19000" data-duration="1000">Seperti Dahulu</p>
<p class="line" data-delay="20000" data-duration="3000">Karna Mu Selalu Karna Mu</p>
<p class="line" data-delay="23000" data-duration="4000">Ku Cemburu</p>
</div>
</div>
<audio id="background-music" src="sadcuy.mp3"></audio>
<script>
document.addEventListener('DOMContentLoaded', () => {
const startButton = document.querySelector('.start-button');
const lyricsContainer = document.querySelector('.lyrics-container');
const lines = document.querySelectorAll('.line');
const backgroundMusic = document.getElementById('background-music');
startButton.addEventListener('click', () => {
startButton.style.display = 'none';
lyricsContainer.style.display = 'block';
backgroundMusic.play();
lines.forEach(line => {
const delay = line.getAttribute('data-delay');
const duration = line.getAttribute('data-duration');
setTimeout(() => {
line.style.animation = `typing ${duration}ms steps(${duration / 100}, end), blink-caret 0.75s step-end infinite`;
line.style.width = '100%';
line.style.opacity = 1;
setTimeout(() => {
line.style.opacity = 0;
}, duration);
}, delay);
});
});
});
</script>
</body>
</html>