-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
87 lines (76 loc) · 2.45 KB
/
index.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>At My Worst</title>
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Montserrat:wght@400;700&display=swap">
<style>
body {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
background: linear-gradient(135deg, #667eea, #764ba2);
font-family: 'Montserrat', sans-serif;
color: #fff;
}
.lyrics-container {
background-color: rgba(0, 0, 0, 0.7);
padding: 40px 50px;
border-radius: 15px;
box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
text-align: center;
max-width: 700px;
line-height: 1.8;
border: 1px solid #fff;
}
#lyrics {
font-size: 1.5em;
font-weight: 400;
white-space: pre-wrap;
word-break: break-word;
color: #ffeb3b;
text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.3);
}
.fade-in {
animation: fadeIn 2s ease-in-out;
}
@keyframes fadeIn {
from {
opacity: 0;
transform: translateY(20px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
</style>
</head>
<body>
<div class="lyrics-container">
<p id="lyrics"></p>
</div>
<script>
const lyricsText = `I Nneed somebody who can love me at my worst\nNo, I'm not perfect, but I hope you see my worth\n'Cause it's only you, nobody new, I put you first\nAnd for you, girl, I swear I'd do the worst`;
const lyricsElement = document.getElementById('lyrics');
let index = 0;
function typeWriter() {
if (index < lyricsText.length) {
if (lyricsText[index] === '\n') {
lyricsElement.innerHTML += '<br>';
} else {
lyricsElement.innerHTML += lyricsText[index];
}
index++;
setTimeout(typeWriter, 68);
} else {
lyricsElement.classList.add('fade-in');
}
}
document.addEventListener('DOMContentLoaded', typeWriter);
</script>
</body>
</html>