-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
523 lines (471 loc) · 17 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
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
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Harsh Official</title><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
<link href="https://fonts.googleapis.com/css2?family=Lato:wght@400;700&family=Merriweather:wght@400;700&display=swap" rel="stylesheet">
<style>
/* Style to give space at the top for the fixed navbar */
body {
padding-top: 70px;
font-family: 'Lato', sans-serif;
margin: 0;
padding: 0;
height: 100vh;
}
.navbar {
background-color: rgba(255,255,255,0.5) !important;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
backdrop-filter: blur(5px); /* Add blur effect */
}
.navbar-toggler {
background-color: white !important;
}
.gradient-text {
position: relative;
z-index: 1;
font-size: 1em;
padding: 20px;
background: linear-gradient(160deg, #800080, #DA70D6, #FF69B4, #FFD700);
overflow: hidden;
}
.gradient-text::before, .gradient-text::after {
content: '';
position: absolute;
border-radius: 50%;
background-color: rgba(255, 255, 255, 0.5);
animation: move 5s infinite linear;
}
.gradient-text::before {
width: 100px;
height: 100px;
top: 10%;
left: 20%;
}
.gradient-text::after {
width: 60px;
height: 60px;
top: 50%;
left: 70%;
}
@keyframes move {
0% { transform: translate(0, 0); }
100% { transform: translate(20px, 20px); }
}
}
.share-button {
text-align: center;
}
.shareBtn {
text-align: center;
position: fixed;
bottom: 10%;
right: 1%;
transform: translate(-50%, -50%);
z-index: 9999;
background-color: #ffd700;
color: black;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
border: 0px;
border-radius: 8px;
padding: 5px 10px;
}
.navbar-brand img {
height: 10px;
width: 10px;
margin-right: 2px;
}
.shareBox {
display: none;
position: absolute;
bottom: 23%;
border-radius: 3px;
position: fixed;
right: 10%;
background-color: #fff;
border: 1px solid #ccc;
padding: 10px;
z-index: 9999;
}
.shareBox a {
display: block;
margin-bottom: 10px;
}
.shareBox img {
width: 30px;
height: 30px;
margin-right: 10px;
}
.quiz-container {
max-width: 600px;
margin: 0 2%;
padding: 20px;
background-color: white;
border-radius: 10px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}
#toc {
position: fixed;
top: 0;
margin-top: 16%;
left: -250px;
width: 200px;
padding: 10px;
border-right: 1px solid #ccc;
height: 100%;
overflow-y: auto;
transition: left 0.3s ease;
z-index: 10000;
border-top-right-radius: 10px;
border-bottom-right-radius: 10px;
background-color: rgba(255,255,255,0.5) !important;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
backdrop-filter: blur(5px); /* Add blur effect */
}
#toc ul {
list-style-type: none;
padding: 0;
}
#toc li {
margin: 10px 0;
}
#toc a {
text-decoration: none;
color: #333;
}
#toc a:hover {
text-decoration: underline;
}
.toc-level-2 {
padding-left: 5px;
}
.toc-level-3 {
padding-left: 10px;
}
.toc-level-4 {
padding-left: 15px;
}
.toc-level-5 {
padding-left: 20px;
}
.toc-level-6 {
padding-left: 25px;
}
#toc-button {
position: fixed;
top: 15%;
right: 0;
padding: 10px 19px;
background-color: #2799ff;
color: white;
border: none;
border-top-left-radius: 20px;
border-bottom-left-radius: 20px;
cursor: pointer;
z-index: 1000;
box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.2);
}
#toc-button .blinking-dot {
width: 8px;
height: 8px;
background-color: red;
border-radius: 50%;
position: absolute;
top: 10px;
right: 10px;
animation: blink 1s infinite;
}
@keyframes blink {
0%, 100% { opacity: 1; }
50% { opacity: 0; }
}
.question {
font-size: 18px;
margin-bottom: 10px;
}
.options {
display: flex;
flex-direction: column;
}
.option {
margin-bottom: 10px;
padding: 10px 20px;
border-radius: 5px;
cursor: pointer;
}
.btn {
padding: 10px 20px;
background-color: #007bff;
color: #ffffff;
border: none;
border-radius: 5px;
cursor: pointer;
}
.btn:hover {
background-color: #0056b3;
}
.points {
font-size: 16px;
margin-top: 20px;
}
.selected {
background-color: #e0f0ff; /* light blue color */
}
.navbar-brand {
position: relative;
margin-right: 21%;
display: inline-block;
padding-bottom: 5px; /* Space for the bars */
color: black !important;
}
.navbar-brand::after {
content: '';
position: absolute;
bottom: 0;
left: 0;
width: 100%;
height: 5px;
background: linear-gradient(90deg, #4285f4 25%, #ea4335 25%, #ea4335 50%, #FBBC05 50%, #FBBC05 75%, #34A853 75%);
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
border-radius: 20px;
}
.footer {
background-color: #ffd700;
color: black;
padding: 20px 0;
text-align: center;
position: relative;
bottom: 0;
width: 100%;
}
.footer p {
margin: 0;
}
.footer a {
color: #ffd700;
text-decoration: none;
}
.footer a:hover {
text-decoration: underline;
}
</style>
</head>
<body>
<button id="toc-button"><i class="fas fa-list-ul"></i><div class="blinking-dot"></div></button>
<nav class="navbar navbar-expand-lg navbar-light bg-light fixed-top">
<img width="25px" src="Harsh_Class_10_CBSE_logo-min-removebg-preview.png" alt="Harsh Official Logo">
<a class="navbar-brand" href="https://harshna044.github.io/harshofficial/"><b>Harsh Official</b></a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav ml-auto">
<li class="nav-item active">
<a class="nav-link" href="#">Home <span class="sr-only">(current)</span></a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">About</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Services</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Contact</a>
</li>
</ul>
</div>
</nav><br><br><br>
<div class="gradient-text">
<div class="container">
<nav id="toc"><b><p>Table of Content</p><hr></b></nav><main>
<h1 style="text-align: left;">Welcome to my official website!</h1>
<br>
<p>This website is created by Harsh. Share this website with your friends by clicking on Share button. For more updates Stay tuned !</p>
</div>
</div>
<div class="share-button">
<button class="shareBtn">Share</button><button style="bottom: 18% ! important; right: 2%;" class="shareBtn" onclick="printPage()">Print</button>
<div class="shareBox" id="shareBox">
<a href="https://www.facebook.com/sharer/sharer.php?u=" target="_blank"><img src="https://upload.wikimedia.org/wikipedia/commons/thumb/5/51/Facebook_f_logo_%282019%29.svg/1200px-Facebook_f_logo_%282019%29.svg.png" alt="Facebook"></a>
<a href="https://twitter.com/intent/tweet?url=" target="_blank"><img src="https://cdn-icons-png.flaticon.com/512/23/23931.png" alt="Twitter"></a>
<a href="https://www.linkedin.com/shareArticle?url=" target="_blank"><img src="https://upload.wikimedia.org/wikipedia/commons/thumb/c/ca/LinkedIn_logo_initials.png/768px-LinkedIn_logo_initials.png" alt="LinkedIn"></a>
<a href="whatsapp://send?text=" target="_blank"><img src="https://upload.wikimedia.org/wikipedia/commons/thumb/6/6b/WhatsApp.svg/1200px-WhatsApp.svg.png" alt="WhatsApp"></a>
<a href="https://www.instagram.com/?url=" target="_blank"><img src="https://upload.wikimedia.org/wikipedia/commons/thumb/a/a5/Instagram_icon.png/1024px-Instagram_icon.png" alt="Instagram"></a>
<!-- Add more social media share icons as needed -->
</div>
</div>
<!-- Bootstrap JS -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
<script>
document.querySelector('.shareBtn').addEventListener('click', function() {
var shareBox = document.getElementById('shareBox');
if (shareBox.style.display === 'block') {
shareBox.style.display = 'none';
} else {
shareBox.style.display = 'block';
}
});
// Get current URL
var url = window.location.href;
// Update social media share links with current URL
document.querySelectorAll('.shareBox a').forEach(function(link) {
var socialMediaURL = link.getAttribute('href');
link.setAttribute('href', socialMediaURL + encodeURIComponent(url));
});
</script><br><br>
<div class="quiz-container">
<button class="btn start-btn" onclick="startQuiz()">Start</button>
<div class="question" id="question"></div>
<div class="options" id="options"></div>
<button class="btn prev-btn" onclick="prevQuestion()" style="display: none;">Previous</button>
<button class="btn next-btn" onclick="nextQuestion()" style="display: none;">Next</button>
<button class="btn submit-btn" onclick="submitQuiz()" style="display: none;">Submit</button>
<div class="points" id="points" style="display: none;"></div>
</div>
</main>
<script>
const questions = [
{
question: "What is the capital of France?",
options: ["Paris", "London", "Berlin", "Madrid"],
correctAnswer: "Paris"
},
{
question: "Which planet is known as the Red Planet?",
options: ["Earth", "Mars", "Venus", "Jupiter"],
correctAnswer: "Mars"
},
// Add more questions here...
];
let currentQuestionIndex = 0;
let userPoints = 0;
let userAnswers = [];
function startQuiz() {
const startButton = document.querySelector(".start-btn");
startButton.style.display = "none";
const prevButton = document.querySelector(".prev-btn");
const nextButton = document.querySelector(".next-btn");
const submitButton = document.querySelector(".submit-btn");
prevButton.style.display = "inline-block";
nextButton.style.display = "inline-block";
submitButton.style.display = "inline-block";
displayQuestion();
}
function displayQuestion() {
const questionElement = document.getElementById("question");
const optionsElement = document.getElementById("options");
const currentQuestion = questions[currentQuestionIndex];
questionElement.textContent = currentQuestion.question;
optionsElement.innerHTML = "";
currentQuestion.options.forEach((option, index) => {
const optionElement = document.createElement("div");
optionElement.classList.add("option");
optionElement.textContent = option;
optionElement.onclick = () => checkAnswer(index, optionElement);
optionsElement.appendChild(optionElement);
});
userAnswers[currentQuestionIndex] !== undefined && optionsElement.children[userAnswers[currentQuestionIndex]].classList.add("selected");
}
function checkAnswer(selectedIndex, optionElement) {
const currentQuestion = questions[currentQuestionIndex];
if (currentQuestion.options[selectedIndex] === currentQuestion.correctAnswer) {
if (!optionElement.classList.contains("selected")) {
userPoints++;
}
}
optionElement.classList.toggle("selected");
userAnswers[currentQuestionIndex] = selectedIndex;
disableOptions();
nextQuestion();
}
function disableOptions() {
const optionElements = document.querySelectorAll(".option");
optionElements.forEach(option => {
option.onclick = null;
option.style.pointerEvents = "none";
});
}
function prevQuestion() {
if (currentQuestionIndex > 0) {
currentQuestionIndex--;
displayQuestion();
}
}
function nextQuestion() {
if (currentQuestionIndex < questions.length - 1) {
currentQuestionIndex++;
displayQuestion();
} else if (currentQuestionIndex === questions.length - 1) {
}
}
function submitQuiz() {
showPoints();
disableOptions();
hideButtons();
}
function hideButtons() {
const prevButton = document.querySelector(".prev-btn");
const nextButton = document.querySelector(".next-btn");
const submitButton = document.querySelector(".submit-btn");
prevButton.style.display = "none";
nextButton.style.display = "none";
submitButton.style.display = "none";
}
function showPoints() {
const totalQuestions = questions.length;
const pointsElement = document.getElementById("points");
pointsElement.textContent = `Your score: ${userPoints} / ${totalQuestions}`;
pointsElement.style.display = "block";
}
</script><script>
// JavaScript to print the current page
function printPage() {
window.print();
}
</script>
<script>
document.addEventListener('DOMContentLoaded', () => {
const toc = document.getElementById('toc');
const tocButton = document.getElementById('toc-button');
const headings = document.querySelectorAll('main h1, main h2, main h3, main h4, main h5, main h6');
const tocList = document.createElement('ul');
const headingCounters = [0, 0, 0, 0, 0, 0]; // Array to keep track of the numbering
headings.forEach(heading => {
const listItem = document.createElement('li');
const link = document.createElement('a');
const id = heading.textContent.toLowerCase().replace(/\s+/g, '-');
const level = parseInt(heading.tagName.charAt(1), 10); // Get the heading level (1-6)
// Reset lower level counters
for (let i = level; i < headingCounters.length; i++) {
headingCounters[i] = 0;
}
// Increment current level counter
headingCounters[level - 1]++;
// Generate the numbering string
const numbering = headingCounters.slice(0, level).join('.') + ' ';
heading.id = id;
link.href = `#${id}`;
link.textContent = numbering + heading.textContent;
listItem.classList.add(`toc-level-${level}`);
listItem.appendChild(link);
tocList.appendChild(listItem);
});
toc.appendChild(tocList);
tocButton.addEventListener('click', () => {
if (toc.style.left === '0px') {
toc.style.left = '-250px';
} else {
toc.style.left = '0px';
}
});
});
</script><br><br>
<div class="footer">
<p>Copyright © Harsh Official</p>
</div>
</body>
</html>