-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
211 lines (202 loc) · 8.04 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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="Probably the most complete UI kit out there. Multiple functionalities and controls added, extended color palette and beautiful typography, designed as its own extended version of Bootstrap at the highest level of quality. ">
<meta name="author" content="Webpixels">
<title>TypeWrite - Animation</title>
<!-- Fonts -->
<link href="https://fonts.googleapis.com/css?family=Nunito:400,600,700,800|Roboto:400,500,700" rel="stylesheet">
<!-- Theme CSS -->
<link type="text/css" href="./assets/css/theme.css" rel="stylesheet">
<!-- Demo CSS - No need to use these in your project -->
<link type="text/css" href="./assets/css/demo.css" rel="stylesheet">
<style>
@import url('https://fonts.googleapis.com/css2?family=Castoro');
span.typed-text {
color: #10be00;
position: relative;
font-size: 50px;
color: #10be00;
font-weight: 900;
top: -130px;
left: 130px;
font-family: 'Castoro', serif;
}
.animation_p{
display: inline-block;
font-size: 50px;
font-weight: bold;
}
span.cursor {
display: inline-block;
background-color: rgb(51, 248, 1);
margin-left: 0.1rem;
width: 3px;
font-size: 50px;
position: relative;
color: white;
top: -130px;
left: 130px;
animation: blink 1s infinite;
}
span.cursor.typing {
animation: none;
}
@keyframes blink {
0% { background-color: rgb(61, 231, 9); }
49% { background-color: rgb(61, 231, 9); }
50% { background-color: transparent; }
99% { background-color: transparent; }
100% { background-color: rgb(61, 231, 9); }
}
.bg-primary {
background-color: #030303 !important;
}
.text_70{
font-size: 150px;
color: white;
display: inline-block;
font-family: 'Castoro', serif;
}
.year{
position: relative;
font-size: 50px;
color: white;
top: -50px;
left: 30px;
font-family: 'Castoro', serif;
}
@media screen and (max-width: 380px) {
.year{
font-size: 20px;
}
.text_70{
font-size: 70px;
}
span.typed-text {
font-size: 20px;
}
span.cursor {
font-size: 20px;
}
}
</style>
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-transparent navbar-dark bg-dark py-4">
<div class="container">
<a class="navbar-brand" href="./"><strong>TypeWrite</strong> Animation</a>
<button class="navbar-toggler" type="button" data-action="offcanvas-open" data-target="#navbar_main" aria-controls="navbar_main" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="navbar-collapse offcanvas-collapse" id="navbar_main">
<ul class="navbar-nav ml-auto align-items-lg-center">
<h6 class="dropdown-header font-weight-600 d-lg-none px-0">Menu</h6>
<li class="nav-item active">
<a class="nav-link" href="./index.html">Overview</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbar_main_dropdown_1" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Pages</a>
<div class="dropdown-menu" aria-labelledby="navbar_1_dropdown_1">
<a class="dropdown-item" href="#">Homepage</a>
<a class="dropdown-item" href="#">About us</a>
<a class="dropdown-item" href="#">Sign in</a>
<a class="dropdown-item" href="#">Contact</a>
</div>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Docs</a>
</li>
<div class="dropdown-divider d-lg-none my-4"></div>
<h6 class="dropdown-header font-weight-600 d-lg-none px-0">Social Media</h6>
<li class="nav-item">
<a class="nav-link nav-link-icon" href="#" target="_blank"><i class="fab fa-instagram"></i><span class="ml-2 d-lg-none">Instagram</span></a>
</li>
<li class="nav-item">
<a class="nav-link nav-link-icon" href="#" target="_blank"><i class="fab fa-facebook"></i><span class="ml-2 d-lg-none">Facebook</span></a>
</li>
<li class="nav-item">
<a class="nav-link nav-link-icon" href="#" target="_blank"><i class="fab fa-dribbble"></i><span class="ml-2 d-lg-none">Dribbble</span></a>
</li>
<li class="nav-item">
<a class="nav-link nav-link-icon" href="#" target="_blank"><i class="fab fa-github"></i><span class="ml-2 d-lg-none">Github</span></a>
</li>
</ul>
</div>
</div>
</nav>
<main class="main">
<section class="spotlight parallax bg-cover bg-size--cover" data-spotlight="fullscreen" style="background-image: url('assets/images/backgrounds/img-1.jpg')">
<span class="mask bg-primary alpha-7"></span>
<div class="spotlight-holder py-lg pt-lg-xl">
<div class="container d-flex align-items-center no-padding">
<div class="col">
<div class="row cols-xs-space align-items-center text-center text-md-left justify-content-center">
<div class="col-7">
<div class="text-center mt-5">
<div><p class="text_70">70</p><span class="year">YEARS OF</span><p><span class="typed-text"></span><span class="cursor"> </span></p></div>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
</footer>
<script>
const typedTextSpan = document.querySelector(".typed-text");
const cursorSpan = document.querySelector(".cursor");
const textArray = ["PASSION", "SERVICE", "INSPIRATION", "LEGACY"];
const typingDelay = 200;
const erasingDelay = 100;
const newTextDelay = 2000; // Delay between current and next text
let textArrayIndex = 0;
let charIndex = 0;
function type() {
if (charIndex < textArray[textArrayIndex].length) {
if(!cursorSpan.classList.contains("typing")) cursorSpan.classList.add("typing");
typedTextSpan.textContent += textArray[textArrayIndex].charAt(charIndex);
charIndex++;
setTimeout(type, typingDelay);
}
else {
cursorSpan.classList.remove("typing");
setTimeout(erase, newTextDelay);
}
}
function erase() {
if (charIndex > 0) {
if(!cursorSpan.classList.contains("typing")) cursorSpan.classList.add("typing");
typedTextSpan.textContent = textArray[textArrayIndex].substring(0, charIndex-1);
charIndex--;
setTimeout(erase, erasingDelay);
}
else {
cursorSpan.classList.remove("typing");
textArrayIndex++;
if(textArrayIndex>=textArray.length) textArrayIndex=0;
setTimeout(type, typingDelay + 1100);
}
}
document.addEventListener("DOMContentLoaded", function() { // On DOM Load initiate the effect
if(textArray.length) setTimeout(type, newTextDelay + 250);
});
</script>
<!-- Core -->
<script src="./assets/vendor/jquery/jquery.min.js"></script>
<script src="./assets/vendor/popper/popper.min.js"></script>
<script src="./assets/js/bootstrap/bootstrap.min.js"></script>
<!-- FontAwesome 5 -->
<script src="./assets/vendor/fontawesome/js/fontawesome-all.min.js" defer></script>
<!-- Page plugins -->
<script src="./assets/vendor/bootstrap-select/js/bootstrap-select.min.js"></script>
<script src="./assets/vendor/bootstrap-tagsinput/bootstrap-tagsinput.min.js"></script>
<script src="./assets/vendor/input-mask/input-mask.min.js"></script>
<script src="./assets/vendor/nouislider/js/nouislider.min.js"></script>
<script src="./assets/vendor/textarea-autosize/textarea-autosize.min.js"></script>
<!-- Theme JS -->
<script src="./assets/js/theme.js"></script>
</body>
</html>