@@ -91,17 +91,17 @@ function fetchRepos(force = false) {
91
91
function updateRepos ( data ) {
92
92
const repoContainer = document . querySelector ( ".repo-container" ) ;
93
93
data . forEach ( ( val ) => {
94
- // Creating Repo card
94
+ /* Creating Repo card */
95
95
let repoItem = createElement ( "div" , { class : "col-md-6 col-lg-4 repo-item" } ) ;
96
96
let box = createElement ( "div" , { class : "box" } ) ;
97
97
let icon = createElement ( "div" , { class : "icon" } ) ;
98
98
99
- // Fetching image for repository
99
+ /* Fetching image for repository */
100
100
let iconImg = val . name . split ( "-" ) [ 0 ] . toLowerCase ( ) ;
101
101
let imgSource = "" ;
102
102
103
103
if ( iconImg === "website" ) {
104
- // For devcans website repo
104
+ /* For devcans website repo */
105
105
imgSource = "assets/img/icon.png"
106
106
} else {
107
107
if ( iconImg === "web" ) {
@@ -123,7 +123,7 @@ function updateRepos(data){
123
123
repoContainer . appendChild ( repoItem ) ;
124
124
} ) ;
125
125
126
- // Setting up listener for show more button
126
+ /* Setting up listener for show more button */
127
127
const button = document . querySelector ( ".more-btn" ) ;
128
128
button . addEventListener ( "click" , ( ) => {
129
129
button . childNodes [ 1 ] . classList . toggle ( "more-btn-inactive" ) ;
@@ -232,7 +232,7 @@ function createElement(tag, options = {}, html = "") {
232
232
return e ;
233
233
}
234
234
235
- // Slider
235
+ /* Slider */
236
236
let index = 1 ;
237
237
let slideContainer ;
238
238
let slider ;
@@ -363,43 +363,42 @@ class TypeWriter {
363
363
this . type ( ) ;
364
364
}
365
365
366
- // Type method
366
+ /* Type method */
367
367
type ( ) {
368
- // current index of word
368
+ /* current index of word */
369
369
const current = this . wordIndex % this . words . length ;
370
- // Get full text of current word
370
+ /* Get full text of current word */
371
371
const fullText = this . words [ current ] ;
372
372
373
- // Check if deleting
373
+ /* Check if deleting */
374
374
if ( this . isDeleting ) {
375
- // Remove char
375
+ /* Remove char */
376
376
this . text = fullText . substring ( 0 , this . text . length - 1 ) ;
377
377
} else {
378
- // Add char
378
+ /* Add char */
379
379
this . text = fullText . substring ( 0 , this . text . length + 1 ) ;
380
380
}
381
381
382
- // Insert text into element
382
+ /* Insert text into element */
383
383
this . textElement . innerHTML = this . text ;
384
384
385
- // Initial type Speed
385
+ /* Initial type Speed */
386
386
let typeSpeed = 250 ;
387
387
388
388
if ( this . isDeleting ) {
389
389
typeSpeed /= 2 ;
390
390
}
391
391
392
- // If word is complete
392
+ /* If word is complete */
393
393
if ( ! this . isDeleting && this . text === fullText ) {
394
- // Make pause at end
394
+ /* Make pause at end */
395
395
typeSpeed = this . wait ;
396
- // Set delete to true
396
+ /* Set delete to true */
397
397
this . isDeleting = true ;
398
398
} else if ( this . isDeleting && this . text === "" ) {
399
399
this . isDeleting = false ;
400
- //
401
400
this . wordIndex ++ ;
402
- // Pause before start typing
401
+ /* Pause before start typing */
403
402
typeSpeed = 500 ;
404
403
}
405
404
setTimeout ( ( ) => this . type ( ) , typeSpeed ) ;
@@ -450,7 +449,7 @@ function init() {
450
449
const textElement = document . querySelector ( ".txt-type" ) ;
451
450
const words = JSON . parse ( textElement . getAttribute ( "data-words" ) ) ;
452
451
const wait = textElement . getAttribute ( "data-wait" ) ;
453
- // init TypeWriter
452
+ /* init TypeWriter */
454
453
455
454
new TypeWriter ( textElement , words , wait ) ;
456
455
}
0 commit comments