forked from Vishal-raj-1/Awesome-JavaScript-Projects
-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
258 lines (251 loc) · 6.81 KB
/
script.js
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
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
let projectData = [
{
projectName: "Note App",
projectImage: "assets/GIFs/noteApp.gif",
projectUrl: "public/note-app.html",
},
{
projectName: "Calculator",
projectImage: "assets/GIFs/calculator.gif",
projectUrl: "public/calculator.html",
},
{
projectName: "Color Flipper",
projectImage: "assets/GIFs/colorFlipper.gif",
projectUrl: "public/color-flipper.html",
},
{
projectName: "Dynamic Quote Generator",
projectImage: "assets/GIFs/dynamicQuote.gif",
projectUrl: "public/Dynamic-quotegenerator.html",
},
{
projectName: "Counter",
projectImage: "assets/GIFs/counter.gif",
projectUrl: "public/counter.html",
},
{
projectName: "Local Storage",
projectImage: "assets/Images/localstorage.jpeg",
projectUrl: "public/localstorage.html",
},
{
projectName: "Image Slide",
projectImage: "assets/GIFs/imageSlide.gif",
projectUrl: "public/ImageSlide.html",
},
{
projectName: "Sidenav",
projectImage: "assets/GIFs/sidenav.gif",
projectUrl: "public/Sidenav.html",
},
{
projectName: "Mole Game",
projectImage: "assets/GIFs/whackMole.gif",
projectUrl: "public/molegame.html",
},
{
projectName: "Click and Drag",
projectImage: "assets/GIFs/clickandDrag.gif",
projectUrl: "public/clickanddrag.html",
},
{
projectName: "Bouncing Balls",
projectImage: "assets/GIFs/bouncingBalls.gif",
projectUrl: "public/BouncingBalls.html",
},
{
projectName: "Reviews",
projectImage: "assets/GIFs/reviews.gif",
projectUrl: "public/reviews.html",
},
{
projectName: "Stop Watch",
projectImage: "assets/GIFs/stopWatch.gif",
projectUrl: "public/StopWatch.html",
},
{
projectName: "Animated Counter",
projectImage: "assets/GIFs/animatedCounter.gif",
projectUrl: "public/animatedCounter.html",
},
{
projectName: "Music Player",
projectImage: "assets/GIFs/musicPlayer.gif",
projectUrl: "public/music_player.html",
},
{
projectName: "Maze Game",
projectImage: "assets/GIFs/maze.gif",
projectUrl: "public/maze.html",
},
{
projectName: "Drizzle of Hearts",
projectImage: "assets/GIFs/heart.gif",
projectUrl: "public/hearts.html",
},
{
projectName: "Drum Kit",
projectImage: "assets/GIFs/drum-kit.gif",
projectUrl: "public/drumKit.html",
},
{
projectName: "Netflix Clone",
projectImage: "assets/GIFs/netflix.gif",
projectUrl: "public/netflix.html",
},
{
projectName: "Analog Clock",
projectImage: "assets/GIFs/analogClock.gif",
projectUrl: "public/Analogclock.html",
},
{
projectName: "Digital Clock",
projectImage: "assets/GIFs/digitalClock.gif",
projectUrl: "public/digitalClock.html",
},
{
projectName: "Text Generator",
projectImage: "assets/GIFs/textGenerator.gif",
projectUrl: "public/textGenerator.html",
},
{
projectName: "New Year Count Down",
projectImage: "assets/GIFs/newYearCountdown.gif",
projectUrl: "public/newyearcountdown.html",
},
{
projectName: "Password Generator",
projectImage: "assets/GIFs/passwordGenerator.gif",
projectUrl: "public/passwordGenerator.html",
},
{
projectName: "BMI Calculator",
projectImage: "assets/Images/BMICalculator.png",
projectUrl: "public/BMICalculator.html",
},
{
projectName: "URL Shortner",
projectImage: "assets/GIFs/urlShortner.gif",
projectUrl: "public/url-shortner.html",
},
{
projectName: "Mario Game",
projectImage: "assets/GIFs/mario.gif",
projectUrl: "public/mario.html",
},
{
projectName: "Drawing App",
projectImage: "assets/GIFs/draw.gif",
projectUrl: "public/draw.html",
},
{
projectName: "QR Code Generator",
projectImage: "assets/GIFs/qrCode.gif",
projectUrl: "public/QRCode.html",
},
{
projectName: "Word Counter",
projectImage: "assets/GIFs/wordCount.gif",
projectUrl: "public/wordCounter.html",
},
{
projectName: "Tic Tac Toe Game",
projectImage: "assets/GIFs/ticTacToe.gif",
projectUrl: "public/Tic_Tac_Toe.html",
},
{
projectName: "DragNDrop",
projectImage: "assets/GIFs/DragNDrop.gif",
projectUrl: "public/DragNDrop.html",
},
{
projectName: "Typing Speed Tester",
projectImage: "assets/GIFs/typing_speed_test.gif",
projectUrl: "public/typing_speed_test.html",
},
{
projectName: "Quiz App",
projectImage: "assets/GIFs/quizApp.gif",
projectUrl: "public/quizapp.html",
},
{
projectName: "Day Of the Week",
projectImage: "assets/Images/DaysOfWeek.png",
projectUrl: "public/DaysOfWeek.html",
},
{
projectName:"Hangman",
projectImage:"assets/GIFs/hangman.gif",
projectUrl:"public/hangman.html",
},
{
projectName: "Rock Paper Sessior Game",
projectImage: "assets/Images/r-p-s/rps.gif",
projectUrl: "public/Rock-paper-sesssior.html",
},
{
projectName: "Weather App",
projectImage: "assets/GIFs/Weather_app.gif",
projectUrl: "public/Weather_app.html",
},
{
projectName: "Animated Minion Eyes",
projectImage: "assets/GIFs/Minion-Eyes.gif",
projectUrl: "public/Minion-Eyes.html",
},
{
projectName: "Particle JS Project",
projectImage: "assets/GIFs/Particle.gif",
projectUrl: "public/Particle.html",
},
{
projectName: "calendar",
projectImage: "assets/GIFs/cal.gif",
projectUrl: "public/calendar.html",
},
{
projectName: "Text to Voice Generator",
projectImage: "assets/GIFs/textToVoice",
projectUrl: "public/textToVoice.html",
}
];
let projectContainer = document.getElementById("js-projects");
console.log(projectContainer);
window.addEventListener("load", getProjects());
function getProjects() {
let output = "";
projectData.forEach(
(data, item) =>
(output += `
<div class="card my-3 mx-auto col cardStyle">
<a href=${data.projectUrl} class="text-decoration-none" target="_blank">
<img
class="card-img-top"
src=${data.projectImage}
style="height: 207.12px"
alt="Card image cap"
/>
<div class="card-body text-center">
<h5 class="card-title">${data.projectName}</h5>
<!-- <p class="card-text">Some quick example text to build on the card title and make up the bulk of
the
card's content.</p> -->
</div>
</a>
</div>
`)
);
projectContainer.innerHTML = output;
console.log("projectContainer", projectContainer.innerHTML);
}
window.onscroll = function() {myFunction()};
var navbar = document.getElementById("Navbar");
var sticky = navbar.offsetTop;
function myFunction() {
if (window.pageYOffset >= sticky) {
navbar.classList.add("sticky")
} else {
navbar.classList.remove("sticky");
}
}