-
Notifications
You must be signed in to change notification settings - Fork 44
Expand file tree
/
Copy pathindex.html
More file actions
806 lines (694 loc) · 27.2 KB
/
index.html
File metadata and controls
806 lines (694 loc) · 27.2 KB
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
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Hacktoberfest CSS Playground</title>
<link rel="stylesheet" href="style.css" />
<link rel="stylesheet" href="css/variables.css" />
<link rel="stylesheet" href="navstyle.css" />
<link rel="stylesheet" href="dark.css" />
</head>
<body>
<!-- Main Navigation -->
<nav class="navbar" role="navigation" aria-label="Main navigation">
<div class="container">
<div class="navbar-inner">
<div class="navbar-brand"></div>
<div class="mysite">APS_X</div>
<!-- Mobile menu toggle -->
<input type="checkbox" id="nav_toggle" class="nav_toggle" aria-hidden="true">
<label for="nav_toggle" class="nav_icon" aria-label="Toggle navigation menu">
<span class="hamburger-line"></span>
<span class="hamburger-line"></span>
<span class="hamburger-line"></span>
</label>
<!-- Navigation links -->
<ul class="nav_links" role="list">
<li><a href="#hero" class="nav-link active">Home</a></li>
<li><a href="#components" class="nav-link">Components</a></li>
<li><a href="#showcase" class="nav-link">Showcase</a></li>
<li><a href="components/form.html" class="nav-link">Contact</a></li>
<li><a href="components/gallery.html" class="nav-link">Gallery</a></li>
<li><a href="login.html" class="nav-link btn-outline">Login</a></li>
</ul>
</div>
</div>
</nav>
<!-- Hero Section Start -->
<section class="hero">
<div class="hero__content">
<div class="hero__text">
<h1>Empowering Ideas with Innovation</h1>
<p>
Join our community to explore and contribute to exciting open-source projects.
</p>
<a href="Register.html" class="hero__cta">Get Started</a>
</div>
<div class="hero__image">
<img src="https://www.google.com/url?sa=i&url=https%3A%2F%2Fblog.clipart.com%2Fwhy-teaching-coding-to-middle-and-highschool-students%2F&psig=AOvVaw3sjmfzVsWPQNQFujqiqyNE&ust=1761687426294000&source=images&cd=vfe&opi=89978449&ved=0CBUQjRxqFwoTCOj5kLmrxZADFQAAAAAdAAAAABAE" alt="Innovation illustration">
</div>
</div>
</section>
<!-- Hero Section End -->
<header class="fade-in">
<h1 class="fade-in">🎉 Hacktoberfest CSS Playground 🎉</h1>
<p class="typewriter-text">
Explore awesome components built with HTML & CSS!
</p>
</header>
<main class="fade-in">
<section class="fade-in">
<h2 class="fade-in">Sample Component</h2>
<iframe src="components/sample-card.html" frameborder="0"></iframe>
</section>
<section class="price-table fade-in">
<iframe src="components/pricing.html" frameborder="0"></iframe>
</section>
<div class="btn_container">
<a href="#modal"><button class="btn fade-in">APS_X</button></a>
</div>
</div>
</div>
<!-- Hero Section -->
<header id="hero" class="hero-section">
<div class="container">
<div class="hero-content">
<div class="hero-badge">
<span class="badge-icon">�</span>
<span class="badge-text">Hacktoberfest 2025</span>
</div>
<h1 class="hero-title">
CSS Playground
<span class="title-highlight">for Developers</span>
</h1>
<p class="hero-description typewriter-text">
Discover modern, responsive components built with semantic HTML & CSS.
Perfect for learning, contributing, and building amazing web experiences.
</p>
<div class="hero-actions">
<a href="#components" class="btn btn-primary btn-lg">
<span>Explore Components</span>
<span class="btn-icon">→</span>
</a>
<a href="https://github.com/FSOC-OSS/Fsoc-level-easy" class="btn btn-outline btn-lg" target="_blank" rel="noopener">
<span class="btn-icon">⭐</span>
<span>Star on GitHub</span>
</a>
</div>
</div>
<div class="hero-visual">
<div class="hero-card-stack">
<div class="hero-card card-1">
<div class="card-content">
<div class="card-icon">🎨</div>
<h3>Modern Design</h3>
</div>
</div>
<div class="hero-card card-2">
<div class="card-content">
<div class="card-icon">📱</div>
<h3>Responsive</h3>
</div>
</div>
<div class="hero-card card-3">
<div class="card-content">
<div class="card-icon">⚡</div>
<h3>Fast & Clean</h3>
</div>
</div>
</div>
</div>
</div>
</header>
<!-- Main Content -->
<main id="main-content">
<!-- Statistics Section -->
<section class="stats-section">
<div class="container">
<div class="stats-grid">
<div class="stat-card">
<div class="stat-number">20+</div>
<div class="stat-label">Components</div>
</div>
<div class="stat-card">
<div class="stat-number">5</div>
<div class="stat-label">Themes</div>
</div>
<div class="stat-card">
<div class="stat-number">100%</div>
<div class="stat-label">Responsive</div>
</div>
<div class="stat-card">
<div class="stat-number">Open</div>
<div class="stat-label">Source</div>
</div>
</div>
</div>
</section>
<!-- Components Showcase Section -->
<section id="components" class="components-section">
<div class="container">
<div class="section-header">
<h2 class="section-title">Featured Components</h2>
<p class="section-description">
Explore our collection of modern, reusable components designed with accessibility and performance in mind.
</p>
</div>
<!-- Form Component -->
<article class="component-showcase">
<div class="component-header">
<h3 class="component-title">Contact Forms</h3>
<span class="component-badge">Forms</span>
</div>
<div class="component-preview">
<iframe src="components/form.html"
title="Contact form component demo"
loading="lazy"
class="component-iframe"
style="height: 500px;"></iframe>
</div>
<div class="component-footer">
<p class="component-description">Accessible forms with validation and modern styling.</p>
<a href="components/form.html" class="btn btn-sm btn-outline" target="_blank">
View Full Demo
</a>
</div>
</article>
<!-- Interactive Elements -->
<article class="component-showcase">
<div class="component-header">
<h3 class="component-title">Interactive Elements</h3>
<span class="component-badge">Animation</span>
</div>
<div class="component-preview">
<div class="interactive-demo">
<div class="flip-card">
<div class="flip-card-inner">
<div class="flip-card-front">
<div class="card-icon">🎃</div>
<h4>Hacktoberfest</h4>
<p>A month long celebration</p>
</div>
<div class="flip-card-back">
<div class="card-icon">🚀</div>
<h4>Join Us!</h4>
<p>Build the future together</p>
</div>
</div>
</div>
</div>
</div>
<div class="component-footer">
<p class="component-description">Hover and click interactions with smooth animations.</p>
<a href="#modal" class="btn btn-sm btn-outline">
Try Interactive
</a>
</div>
</article>
</div>
</div>
</section>
<!-- Interactive Modal -->
<div class="modal-overlay" id="modal" role="dialog" aria-labelledby="modal-title" aria-hidden="true">
<div class="modal-container">
<div class="modal-header">
<h3 id="modal-title" class="modal-title">🎉 Welcome to Hacktoberfest!</h3>
<a href="#" class="modal-close" aria-label="Close modal">×</a>
</div>
<div class="modal-body">
<p class="modal-content">
Thanks for exploring our components! This is an example of a modern, accessible modal dialog.
</p>
<div class="typewriter-demo">
<p class="typewriter-text">Keep contributing to open source! 🚀</p>
</div>
</div>
<div class="modal-footer">
<a href="#" class="btn btn-primary">Get Started</a>
<a href="#" class="btn btn-outline">Learn More</a>
</div>
</div>
</div>
<!-- Feature Highlights Section -->
<section id="showcase" class="features-section">
<div class="container">
<div class="section-header">
<h2 class="section-title">Why Choose Our Components?</h2>
<p class="section-description">Built with modern web standards and best practices.</p>
</div>
<div class="features-grid">
<div class="feature-card">
<div class="feature-icon">
<span>♿</span>
</div>
<h3 class="feature-title">Accessible</h3>
<p class="feature-description">
Built with ARIA labels, semantic HTML, and keyboard navigation support.
</p>
</div>
<div class="feature-card">
<div class="feature-icon">
<span>📱</span>
</div>
<h3 class="feature-title">Responsive</h3>
<p class="feature-description">
Perfectly optimized for all screen sizes from mobile to desktop.
</p>
</div>
<div class="feature-card">
<div class="feature-icon">
<span>🎨</span>
</div>
<h3 class="feature-title">Customizable</h3>
<p class="feature-description">
Multiple themes and easy-to-modify CSS custom properties.
</p>
</div>
<div class="feature-card">
<div class="feature-icon">
<span>⚡</span>
</div>
<h3 class="feature-title">Performance</h3>
<p class="feature-description">
Lightweight, optimized CSS with smooth animations and transitions.
</p>
</div>
<div class="feature-card">
<div class="feature-icon">
<span>🔧</span>
</div>
<h3 class="feature-title">Modern CSS</h3>
<p class="feature-description">
Uses CSS Grid, Flexbox, custom properties, and modern techniques.
</p>
</div>
<div class="feature-card">
<div class="feature-icon">
<span>🎯</span>
</div>
<h3 class="feature-title">Purpose-Built</h3>
<p class="feature-description">
Each component solves real-world problems with clean, maintainable code.
</p>
</div>
</div>
</div>
</section>
<!-- Call to Action Section -->
<section class="cta-section">
<div class="container">
<div class="cta-content">
<h2 class="cta-title">Ready to Contribute?</h2>
<p class="cta-description">
Join the Hacktoberfest community and help us build amazing open source components!
</p>
<div class="cta-actions">
<a href="https://hacktoberfest.com/" class="btn btn-primary btn-lg" target="_blank" rel="noopener">
<span>Join Hacktoberfest</span>
<span class="btn-icon">🎃</span>
</a>
<a href="https://github.com/FSOC-OSS/Fsoc-level-easy" class="btn btn-outline btn-lg" target="_blank" rel="noopener">
<span class="btn-icon">📚</span>
<span>View Documentation</span>
</a>
</div>
</div>
</div>
</section>
</main>
<!-- Footer -->
<footer class="footer">
<div class="container">
<div class="footer-content">
<!-- Footer Main -->
<div class="footer-main">
<div class="footer-brand">
<div class="footer-logo">
<span class="brand-icon">🚀</span>
<span class="brand-text">APS_X</span>
</div>
<p class="footer-description">
Building modern, accessible web components for the open source community.
Join us in making the web better, one component at a time.
</p>
<div class="footer-social">
<a href="https://github.com/FSOC-OSS/Fsoc-level-easy"
class="social-link"
aria-label="GitHub Repository"
target="_blank"
rel="noopener">
<span class="social-icon">📱</span>
GitHub
</a>
<a href="#"
class="social-link"
aria-label="Twitter Profile"
target="_blank"
rel="noopener">
<span class="social-icon">🐦</span>
Twitter
</a>
<a href="#"
class="social-link"
aria-label="LinkedIn Profile"
target="_blank"
rel="noopener">
<span class="social-icon">💼</span>
LinkedIn
</a>
</div>
</div>
<div class="footer-links">
<div class="footer-column">
<h4 class="footer-heading">Components</h4>
<ul class="footer-list">
<li><a href="components/form.html" class="footer-link">Forms</a></li>
<li><a href="components/sample-card.html" class="footer-link">Cards</a></li>
<li><a href="components/pricing.html" class="footer-link">Pricing</a></li>
<li><a href="components/gallery.html" class="footer-link">Gallery</a></li>
<li><a href="components/loader.html" class="footer-link">Loaders</a></li>
</ul>
</div>
<div class="footer-column">
<h4 class="footer-heading">Resources</h4>
<ul class="footer-list">
<li><a href="#" class="footer-link">Documentation</a></li>
<li><a href="#" class="footer-link">Examples</a></li>
<li><a href="#" class="footer-link">Tutorials</a></li>
<li><a href="#" class="footer-link">Best Practices</a></li>
<li><a href="#" class="footer-link">Guidelines</a></li>
</ul>
</div>
<div class="footer-column">
<h4 class="footer-heading">Community</h4>
<ul class="footer-list">
<li><a href="https://hacktoberfest.com/" class="footer-link" target="_blank" rel="noopener">Hacktoberfest</a></li>
<li><a href="#" class="footer-link">Contributors</a></li>
<li><a href="#" class="footer-link">Issues</a></li>
<li><a href="#" class="footer-link">Discussions</a></li>
<li><a href="#" class="footer-link">Roadmap</a></li>
</ul>
</div>
<div class="footer-column">
<h4 class="footer-heading">Support</h4>
<ul class="footer-list">
<li><a href="components/form.html" class="footer-link">Contact Us</a></li>
<li><a href="#" class="footer-link">Help Center</a></li>
<li><a href="#" class="footer-link">Report Bug</a></li>
<li><a href="#" class="footer-link">Feature Request</a></li>
<li><a href="mailto:support@example.com" class="footer-link">Email Support</a></li>
</ul>
</div>
</div>
</div>
<!-- Footer Bottom -->
<div class="footer-bottom">
<div class="footer-bottom-content">
<div class="footer-copyright">
<p>© 2025 APS_X. Made with ❤️ for <a href="https://hacktoberfest.com/" target="_blank" rel="noopener" class="hacktoberfest-link">Hacktoberfest</a></p>
</div>
<div class="footer-meta">
<a href="#" class="footer-meta-link">Privacy Policy</a>
<span class="footer-divider">•</span>
<a href="#" class="footer-meta-link">Terms of Service</a>
<span class="footer-divider">•</span>
<a href="#" class="footer-meta-link">Code of Conduct</a>
</div>
</div>
</div>
</div>
</div>
</footer>
<script>
// Enhanced Theme Management
class ThemeManager {
constructor() {
this.init();
}
init() {
this.setupThemeToggle();
this.setupPaletteControls();
this.setupNavigation();
this.setupAnimations();
this.loadSavedPreferences();
}
setupThemeToggle() {
const themeToggle = document.getElementById('theme-toggle');
themeToggle.addEventListener('click', () => {
const isDark = document.body.classList.contains('dark-theme');
if (isDark) {
document.body.classList.remove('dark-theme');
document.body.removeAttribute('data-theme');
localStorage.setItem('theme', 'light');
} else {
document.body.classList.add('dark-theme');
document.body.setAttribute('data-theme', 'dark');
localStorage.setItem('theme', 'dark');
}
// Animate the transition
document.body.style.transition = 'all 0.3s ease';
setTimeout(() => {
document.body.style.transition = '';
}, 300);
});
}
setupPaletteControls() {
const paletteButtons = document.querySelectorAll('.palette-btn');
const paletteNames = ['palette-ocean', 'palette-forest', 'palette-lavender', 'palette-sunset', 'palette-dark'];
const clearPalettes = () => {
paletteNames.forEach(palette => {
document.body.classList.remove(palette);
});
};
paletteButtons.forEach(button => {
button.addEventListener('click', () => {
const palette = button.dataset.palette;
// Clear all palettes first
clearPalettes();
// Apply new palette
if (palette) {
document.body.classList.add(palette);
localStorage.setItem('palette', palette);
}
// Update active state
paletteButtons.forEach(btn => {
btn.classList.toggle('active', btn === button);
});
// Special handling for dark palette
if (palette === 'palette-dark') {
document.body.classList.add('dark-theme');
document.body.setAttribute('data-theme', 'dark');
localStorage.setItem('theme', 'dark');
}
});
});
}
setupNavigation() {
// Smooth scrolling for navigation links
const navLinks = document.querySelectorAll('.nav-link[href^="#"]');
navLinks.forEach(link => {
link.addEventListener('click', (e) => {
e.preventDefault();
const targetId = link.getAttribute('href');
const targetElement = document.querySelector(targetId);
if (targetElement) {
targetElement.scrollIntoView({
behavior: 'smooth',
block: 'start'
});
// Close mobile menu if open
const navToggle = document.getElementById('nav_toggle');
if (navToggle) {
navToggle.checked = false;
}
// Update active nav link
navLinks.forEach(nl => nl.classList.remove('active'));
link.classList.add('active');
}
});
});
// Auto-close mobile menu when clicking outside
document.addEventListener('click', (e) => {
const navbar = document.querySelector('.navbar');
const navToggle = document.getElementById('nav_toggle');
if (navToggle && navToggle.checked && !navbar.contains(e.target)) {
navToggle.checked = false;
}
});
}
setupAnimations() {
// Intersection Observer for fade-in animations
const observerOptions = {
threshold: 0.1,
rootMargin: '0px 0px -50px 0px'
};
const observer = new IntersectionObserver((entries) => {
entries.forEach(entry => {
if (entry.isIntersecting) {
entry.target.classList.add('fade-in');
observer.unobserve(entry.target);
}
});
}, observerOptions);
// Observe elements for animation
const animatedElements = document.querySelectorAll('.component-showcase, .feature-card, .stat-card');
animatedElements.forEach(el => {
observer.observe(el);
});
// Parallax effect for hero cards
const heroCards = document.querySelectorAll('.hero-card');
let ticking = false;
const updateParallax = () => {
const scrolled = window.pageYOffset;
const rate = scrolled * -0.5;
heroCards.forEach((card, index) => {
const yPos = -(rate * (index + 1) * 0.1);
card.style.transform = `translateY(${yPos}px)`;
});
ticking = false;
};
const requestTick = () => {
if (!ticking) {
requestAnimationFrame(updateParallax);
ticking = true;
}
};
window.addEventListener('scroll', requestTick, { passive: true });
}
loadSavedPreferences() {
// Load saved theme
const savedTheme = localStorage.getItem('theme');
if (savedTheme === 'dark') {
document.body.classList.add('dark-theme');
document.body.setAttribute('data-theme', 'dark');
}
// Load saved palette
const savedPalette = localStorage.getItem('palette');
if (savedPalette) {
document.body.classList.add(savedPalette);
const activeButton = document.querySelector(`[data-palette="${savedPalette}"]`);
if (activeButton) {
activeButton.classList.add('active');
}
}
}
}
// Modal functionality
class ModalManager {
constructor() {
this.setupModals();
}
setupModals() {
// Close modal when clicking outside
document.addEventListener('click', (e) => {
if (e.target.classList.contains('modal-overlay')) {
this.closeModal(e.target);
}
});
// Close modal with Escape key
document.addEventListener('keydown', (e) => {
if (e.key === 'Escape') {
const openModal = document.querySelector('.modal-overlay:target');
if (openModal) {
this.closeModal(openModal);
}
}
});
// Close button functionality
const closeButtons = document.querySelectorAll('.modal-close');
closeButtons.forEach(button => {
button.addEventListener('click', (e) => {
e.preventDefault();
const modal = button.closest('.modal-overlay');
this.closeModal(modal);
});
});
}
closeModal(modal) {
if (modal) {
window.location.hash = '';
}
}
}
// Performance optimizations
const optimizeImages = () => {
const iframes = document.querySelectorAll('iframe[loading="lazy"]');
const imageObserver = new IntersectionObserver((entries) => {
entries.forEach(entry => {
if (entry.isIntersecting) {
const iframe = entry.target;
// Iframe is now visible, it will load automatically due to loading="lazy"
imageObserver.unobserve(iframe);
}
});
});
iframes.forEach(iframe => {
imageObserver.observe(iframe);
});
};
// Initialize everything when DOM is loaded
document.addEventListener('DOMContentLoaded', () => {
new ThemeManager();
new ModalManager();
optimizeImages();
// Add smooth loading animation
document.body.classList.add('loaded');
// Enhanced button interactions
const buttons = document.querySelectorAll('.btn');
buttons.forEach(button => {
button.addEventListener('mouseenter', function() {
this.style.transform = 'translateY(-2px)';
});
button.addEventListener('mouseleave', function() {
this.style.transform = 'translateY(0)';
});
});
});
// Add loading state
document.body.style.opacity = '0';
window.addEventListener('load', () => {
document.body.style.transition = 'opacity 0.3s ease';
document.body.style.opacity = '1';
});
</script>
<!-- Code injected by live-server -->
<script>
// <![CDATA[ <-- For SVG support
if ('WebSocket' in window) {
(function () {
function refreshCSS() {
var sheets = [].slice.call(document.getElementsByTagName("link"));
var head = document.getElementsByTagName("head")[0];
for (var i = 0; i < sheets.length; ++i) {
var elem = sheets[i];
var parent = elem.parentElement || head;
parent.removeChild(elem);
var rel = elem.rel;
if (elem.href && typeof rel != "string" || rel.length == 0 || rel.toLowerCase() == "stylesheet") {
var url = elem.href.replace(/(&|\?)_cacheOverride=\d+/, '');
elem.href = url + (url.indexOf('?') >= 0 ? '&' : '?') + '_cacheOverride=' + (new Date().valueOf());
}
parent.appendChild(elem);
}
}
var protocol = window.location.protocol === 'http:' ? 'ws://' : 'wss://';
var address = protocol + window.location.host + window.location.pathname + '/ws';
var socket = new WebSocket(address);
socket.onmessage = function (msg) {
if (msg.data == 'reload') window.location.reload();
else if (msg.data == 'refreshcss') refreshCSS();
};
if (sessionStorage && !sessionStorage.getItem('IsThisFirstTime_Log_From_LiveServer')) {
console.log('Live reload enabled.');
sessionStorage.setItem('IsThisFirstTime_Log_From_LiveServer', true);
}
})();
}
else {
console.error('Upgrade your browser. This Browser is NOT supported WebSocket for Live-Reloading.');
}
// ]]>
</script>
</body>
</html>