1
1
const changingText = document . getElementById ( "changingText" ) ;
2
- const cngArray = [ 'Web Developer' , 'Graphics Designer' , 'Web Designer' , 'Frontend Developer' , 'Full stack Developer' , 'Backend Developer' , 'Degital Marketer' , 'On Page SEO Expert' ] ;
3
- let currentIndex = 0
2
+ const cngArray = [
3
+ "Web Development" ,
4
+ "Frontend Development" ,
5
+ "Backend Development" ,
6
+ "Mobile app Development" ,
7
+ "Full stack" ,
8
+ "Cross Platform App" ,
9
+ "Desktop app Development" ,
10
+ "Flutter" ,
11
+ "FrameWorks" ,
12
+ "E-commerce" ,
13
+ "Git/GitHab" ,
14
+ "Docker" ,
15
+ "DataBases" ,
16
+ "Server Structure" ,
17
+ "Linux" ,
18
+ ] ;
19
+ let currentIndex = 0 ;
4
20
5
21
function Slider ( ) {
6
- changingText . textContent = cngArray [ currentIndex ] ;
7
- currentIndex = ( currentIndex + 1 ) % cngArray . length ;
22
+ changingText . textContent = cngArray [ currentIndex ] ;
23
+ currentIndex = ( currentIndex + 1 ) % cngArray . length ;
8
24
}
9
25
10
26
setInterval ( Slider , 2000 ) ;
11
27
12
-
13
-
14
-
15
-
16
28
// Skill > Circle --------------//-----------///------------///
17
29
18
- const circle = document . querySelectorAll ( ' .circle' ) ;
30
+ const circle = document . querySelectorAll ( " .circle" ) ;
19
31
const skill = document . querySelectorAll ( ".skill" ) ;
20
32
21
33
function isElementInViewport ( element ) {
22
- const rect = element . getBoundingClientRect ( ) ;
23
- return (
24
- rect . top >= 0 &&
25
- rect . left >= 0 &&
26
- rect . bottom <= ( window . innerHeight || document . documentElement . clientHeight ) &&
27
- rect . right <= ( window . innerWidth || document . documentElement . clientWidth )
28
- ) ;
34
+ const rect = element . getBoundingClientRect ( ) ;
35
+ return (
36
+ rect . top >= 0 &&
37
+ rect . left >= 0 &&
38
+ rect . bottom <=
39
+ ( window . innerHeight || document . documentElement . clientHeight ) &&
40
+ rect . right <= ( window . innerWidth || document . documentElement . clientWidth )
41
+ ) ;
29
42
}
30
43
31
- circle . forEach ( elem => {
32
- var dots = elem . getAttribute ( "data-dots" ) ;
33
- var marked = elem . getAttribute ( "data-percent" ) ;
34
- var parcent = Math . floor ( dots * marked / 100 )
35
- var points = "" ;
36
- var rotate = 360 / dots ;
37
-
38
- for ( let i = 0 ; i < dots ; i ++ ) {
39
- points += `<div class="points" style="--i:${ i } ; --rot:${ rotate } deg;"></div>`
40
-
41
- }
42
-
43
- elem . innerHTML = points ;
44
-
45
- window . addEventListener ( 'scroll' , async function handleScroll ( ) {
46
- circle . forEach ( element => {
47
- if ( isElementInViewport ( element ) ) {
48
- const pointMarked = elem . querySelectorAll ( '.points' ) ;
49
- for ( let s = 0 ; s < parcent ; s ++ ) {
50
- pointMarked [ s ] . classList . add ( 'marked' ) ;
51
- // console.log(pointMarked[s])
52
- }
53
- }
54
- } ) ;
55
- } )
56
-
57
- } )
58
-
59
- const bar = document . querySelectorAll ( ".fillBar" ) ;
60
- window . addEventListener ( 'scroll' , async function handleScroll2 ( ) {
61
- bar . forEach ( element => {
62
- if ( isElementInViewport ( element ) ) {
63
- element . classList . add ( 'run' )
64
-
44
+ circle . forEach ( ( elem ) => {
45
+ var dots = elem . getAttribute ( "data-dots" ) ;
46
+ var marked = elem . getAttribute ( "data-percent" ) ;
47
+ var parcent = Math . floor ( ( dots * marked ) / 100 ) ;
48
+ var points = "" ;
49
+ var rotate = 360 / dots ;
50
+
51
+ for ( let i = 0 ; i < dots ; i ++ ) {
52
+ points += `<div class="points" style="--i:${ i } ; --rot:${ rotate } deg;"></div>` ;
53
+ }
54
+
55
+ elem . innerHTML = points ;
56
+
57
+ window . addEventListener ( "scroll" , async function handleScroll ( ) {
58
+ circle . forEach ( ( element ) => {
59
+ if ( isElementInViewport ( element ) ) {
60
+ const pointMarked = elem . querySelectorAll ( ".points" ) ;
61
+ for ( let s = 0 ; s < parcent ; s ++ ) {
62
+ pointMarked [ s ] . classList . add ( "marked" ) ;
63
+ // console.log(pointMarked[s])
65
64
}
66
- } )
67
- } )
68
-
69
-
65
+ }
66
+ } ) ;
67
+ } ) ;
68
+ } ) ;
70
69
70
+ const bar = document . querySelectorAll ( ".fillBar" ) ;
71
+ window . addEventListener ( "scroll" , async function handleScroll2 ( ) {
72
+ bar . forEach ( ( element ) => {
73
+ if ( isElementInViewport ( element ) ) {
74
+ element . classList . add ( "run" ) ;
75
+ }
76
+ } ) ;
77
+ } ) ;
71
78
72
79
// navigation button -------------------//-------------//------------------//-------------/------------------//----
73
80
74
81
const navbtn = document . getElementById ( "navbtn" ) ;
75
- const navli = document . querySelector ( ' .navlist' ) ;
82
+ const navli = document . querySelector ( " .navlist" ) ;
76
83
77
84
function togglehide ( ) {
78
- if ( navli . style . display == ' none' ) {
79
- navli . style . display = ' block'
80
- } else {
81
- navli . style . display = ' none'
82
- }
85
+ if ( navli . style . display == " none" ) {
86
+ navli . style . display = " block" ;
87
+ } else {
88
+ navli . style . display = " none" ;
89
+ }
83
90
}
84
91
85
- navbtn . addEventListener ( ' click' , togglehide ) ;
92
+ navbtn . addEventListener ( " click" , togglehide ) ;
86
93
87
- window . addEventListener ( 'scroll' , navhide = ( ) => {
88
- if ( navli . style . display === 'block' ) {
89
- navli . style . display = 'none' ;
94
+ window . addEventListener (
95
+ "scroll" ,
96
+ ( navhide = ( ) => {
97
+ if ( navli . style . display === "block" ) {
98
+ navli . style . display = "none" ;
90
99
}
91
- } ) ;
92
-
100
+ } )
101
+ ) ;
93
102
94
103
// light theme ///////////////////////////////////////////////////////////////
95
104
const lightTheme = document . getElementById ( "light-theme" ) ;
96
- const lightbtn = document . getElementById ( 'light' )
97
- console . log ( lightTheme )
98
-
99
-
100
- if ( window . matchMedia && window . matchMedia ( '(prefers-color-scheme: dark)' ) . matches ) {
101
- lightTheme . innerHTML = `<link rel="stylesheet" href="style.css">`
105
+ const lightbtn = document . getElementById ( "light" ) ;
106
+ console . log ( lightTheme ) ;
107
+
108
+ if (
109
+ window . matchMedia &&
110
+ window . matchMedia ( "(prefers-color-scheme: dark)" ) . matches
111
+ ) {
112
+ lightTheme . innerHTML = `<link rel="stylesheet" href="style.css">` ;
102
113
} else {
103
- lightTheme . innerHTML = `<link rel="stylesheet" href="light.css">` ;
114
+ lightTheme . innerHTML = `<link rel="stylesheet" href="light.css">` ;
104
115
}
105
116
106
-
107
-
108
117
// lightTheme.innerHTML = '<link rel="stylesheet" href="light.css" id="light-theme">'
109
- function theme ( ) {
110
- if ( lightTheme . href == "style.css" ) {
111
- lightTheme . href = "light.css"
112
- } else {
113
- lightTheme . href = "style.css"
114
- }
118
+ function theme ( ) {
119
+ if ( lightTheme . href == "style.css" ) {
120
+ lightTheme . href = "light.css" ;
121
+ } else {
122
+ lightTheme . href = "style.css" ;
123
+ }
115
124
}
116
- lightbtn . addEventListener ( 'click' , theme )
125
+ lightbtn . addEventListener ( "click" , theme ) ;
126
+
127
+ // =============== PortFolio Posts ===================
128
+
129
+ // const postParent = document.getElementById("post-parent");
130
+ // const post = postCardTemplate(data[0]);
131
+
132
+ // postParent.appendChild(post);
0 commit comments