-
Notifications
You must be signed in to change notification settings - Fork 193
/
Copy pathshining-text.html
73 lines (64 loc) · 1.57 KB
/
shining-text.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Shining Text</title>
<style>
body {
display: flex;
flex-direction: column;
height: 100vh;
justify-content: center;
align-items: center;
background: linear-gradient(rgba(16, 16, 16, 0.8), rgba(16, 16, 16, 0.8));
background-size: cover;
}
p {
margin: 0em 5em 4em 5em;
}
h1,
p {
text-align: left;
line-height: 1.8;
}
.glowIn {
color: white;
}
.glowIn span {
animation: glow-in 0.8s both;
}
@keyframes glow-in {
from {
opacity: 0;
}
65% {
opacity: 1;
text-shadow: 0 0 25px white;
}
75% {
opacity: 1;
}
to {
opacity: 0.7;
}
}
</style>
</head>
<body>
<h1 class="glowIn">Hello World</h1>
<p class="glowIn">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Mattis pellentesque id nibh tortor. Suspendisse ultrices gravida dictum fusce ut placerat orci nulla. A lacus vestibulum sed arcu.</p>
</body>
<script>
var glowInTexts = document.querySelectorAll(".glowIn");
glowInTexts.forEach(function (glowInText) {
var letters = glowInText.textContent.split("");
glowInText.textContent = "";
letters.forEach(function (letter, i) {
var span = document.createElement("span");
span.textContent = letter;
span.style.animationDelay = i * 0.05 + "s";
glowInText.append(span);
});
});
</script>
</html>