Skip to content

Commit 546f6a1

Browse files
committed
[REFACTOR] style.css, main.js
maintain consistency
1 parent f64b9a8 commit 546f6a1

2 files changed

Lines changed: 18 additions & 18 deletions

File tree

assets/css/style.css

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@import url('https://fonts.googleapis.com/css?family=Raleway:200,100,400');
1+
@import url("https://fonts.googleapis.com/css?family=Raleway:200,100,400");
22

33
@font-face {
44
font-family: "Material Icons";
@@ -31,7 +31,7 @@ html {
3131
}
3232

3333
body {
34-
font-family: 'Raleway', sans-serif;
34+
font-family: "Raleway", sans-serif;
3535
display: flex;
3636
min-height: 100vh;
3737
width: 100%;
@@ -144,7 +144,7 @@ ul.collapsible .collapsible-body {
144144
}
145145

146146
.welcome-msg {
147-
font-family: 'Raleway', sans-serif;
147+
font-family: "Raleway", sans-serif;
148148
font-size: 20px;
149149
color: #ccc;
150150
}
@@ -160,7 +160,7 @@ ul.collapsible .collapsible-body {
160160
.welcome {
161161
height: 100vh;
162162
margin-bottom: 2em;
163-
background: #333 url('../img/bg-1.jpeg') no-repeat center center / cover;
163+
background: #333 url("../img/bg-1.jpeg") no-repeat center center / cover;
164164
}
165165

166166
h1, h2 {
@@ -181,4 +181,4 @@ h2 {
181181
/* Cursor */
182182
.txt-type > .txt {
183183
border-right: 0.1rem solid #ccc;
184-
}
184+
}

assets/js/main.js

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -191,25 +191,25 @@ class TypeWriter {
191191
constructor(textElement, words, wait = 3000) {
192192
this.textElement = textElement;
193193
this.words = words;
194-
this.text = '';
194+
this.text = "";
195195
this.wordIndex = 0;
196196
this.wait = parseInt(wait, 10);
197197
this.isDeleting = false;
198198
this.type();
199199
}
200200

201201
// Type method
202-
type(){
202+
type() {
203203
// current index of word
204204
const current = this.wordIndex % this.words.length;
205205
// Get full text of current word
206206
const fullText = this.words[current];
207-
207+
208208
// Check if deleting
209-
if(this.isDeleting){
209+
if (this.isDeleting) {
210210
// Remove char
211211
this.text = fullText.substring(0, this.text.length - 1);
212-
}else{
212+
} else {
213213
// Add char
214214
this.text = fullText.substring(0, this.text.length + 1);
215215
}
@@ -220,17 +220,17 @@ class TypeWriter {
220220
// Initial type Speed
221221
let typeSpeed = 250;
222222

223-
if(this.isDeleting){
223+
if (this.isDeleting) {
224224
typeSpeed /= 2;
225225
}
226226

227227
// If word is complete
228-
if(!this.isDeleting && this.text === fullText){
228+
if (!this.isDeleting && this.text === fullText) {
229229
// Make pause at end
230230
typeSpeed = this.wait;
231231
// Set delete to true
232232
this.isDeleting = true;
233-
}else if(this.isDeleting && this.text === ''){
233+
} else if (this.isDeleting && this.text === "") {
234234
this.isDeleting = false;
235235
//
236236
this.wordIndex++;
@@ -241,11 +241,11 @@ class TypeWriter {
241241
}
242242
}
243243

244-
function init(){
245-
const textElement = document.querySelector('.txt-type');
246-
const words = JSON.parse(textElement.getAttribute('data-words'));
247-
const wait = textElement.getAttribute('data-wait');
244+
function init() {
245+
const textElement = document.querySelector(".txt-type");
246+
const words = JSON.parse(textElement.getAttribute("data-words"));
247+
const wait = textElement.getAttribute("data-wait");
248248
// init TypeWriter
249249

250250
new TypeWriter(textElement, words, wait);
251-
}
251+
}

0 commit comments

Comments
 (0)