-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
111 lines (108 loc) · 6.99 KB
/
index.html
File metadata and controls
111 lines (108 loc) · 6.99 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
<!DOCTYPE html>
<html lang="en" data-bs-theme="light">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Web experiments</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
<style>
.experiment-link {
transition: all 0.3s ease;
text-decoration: none;
}
.experiment-link:hover {
transform: translateX(10px);
}
.card {
margin-bottom: 1rem;
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.theme-toggle {
position: fixed;
top: 1rem;
right: 1rem;
z-index: 1000;
}
</style>
</head>
<body>
<button class="btn btn-outline-primary theme-toggle" onclick="toggleTheme()">
<svg id="lightIcon" xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-sun" viewBox="0 0 16 16">
<path d="M8 11a3 3 0 1 1 0-6 3 3 0 0 1 0 6zm0 1a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM8 0a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-1 0v-2A.5.5 0 0 1 8 0zm0 13a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-1 0v-2A.5.5 0 0 1 8 13zm8-5a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1 0-1h2a.5.5 0 0 1 .5.5zM3 8a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1 0-1h2A.5.5 0 0 1 3 8zm10.657-5.657a.5.5 0 0 1 0 .707l-1.414 1.415a.5.5 0 1 1-.707-.708l1.414-1.414a.5.5 0 0 1 .707 0zm-9.193 9.193a.5.5 0 0 1 0 .707L3.05 13.657a.5.5 0 0 1-.707-.707l1.414-1.414a.5.5 0 0 1 .707 0zm9.193 2.121a.5.5 0 0 1-.707 0l-1.414-1.414a.5.5 0 0 1 .707-.707l1.414 1.414a.5.5 0 0 1 0 .707zM4.464 4.465a.5.5 0 0 1-.707 0L2.343 3.05a.5.5 0 1 1 .707-.707l1.414 1.414a.5.5 0 0 1 0 .708z"/>
</svg>
<svg id="darkIcon" xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-moon-stars" viewBox="0 0 16 16" style="display: none;">
<path d="M6 .278a.768.768 0 0 1 .08.858 7.208 7.208 0 0 0-.878 3.46c0 4.021 3.278 7.277 7.318 7.277.527 0 1.04-.055 1.533-.16a.787.787 0 0 1 .81.316.733.733 0 0 1-.031.893A8.349 8.349 0 0 1 8.344 16C3.734 16 0 12.286 0 7.71 0 4.266 2.114 1.312 5.124.06A.752.752 0 0 1 6 .278zM4.858 1.311A7.269 7.269 0 0 0 1.025 7.71c0 4.02 3.279 7.276 7.319 7.276a7.316 7.316 0 0 0 5.205-2.162c-.337.042-.68.063-1.029.063-4.61 0-8.343-3.714-8.343-8.29 0-1.167.242-2.278.681-3.286z"/>
<path d="M10.794 3.148a.217.217 0 0 1 .412 0l.387 1.162c.173.518.579.924 1.097 1.097l1.162.387a.217.217 0 0 1 0 .412l-1.162.387a1.734 1.734 0 0 0-1.097 1.097l-.387 1.162a.217.217 0 0 1-.412 0l-.387-1.162A1.734 1.734 0 0 0 9.31 6.593l-1.162-.387a.217.217 0 0 1 0-.412l1.162-.387a1.734 1.734 0 0 0 1.097-1.097l.387-1.162zM13.863.099a.145.145 0 0 1 .274 0l.258.774c.115.346.386.617.732.732l.774.258a.145.145 0 0 1 0 .274l-.774.258a1.156 1.156 0 0 0-.732.732l-.258.774a.145.145 0 0 1-.274 0l-.258-.774a1.156 1.156 0 0 0-.732-.732l-.774-.258a.145.145 0 0 1 0-.274l.774-.258c.346-.115.617-.386.732-.732L13.863.1z"/>
</svg>
</button>
<div class="container mt-4">
<div class="card">
<div class="card-header bg-primary text-white">
<h2 class="mb-0">Web Experiments</h2>
</div>
<div class="card-body">
<p class="lead">Used to test web snippets or experiment with different web components</p>
<div class="list-group">
<a href="xss/" class="list-group-item list-group-item-action experiment-link">
<div class="d-flex justify-content-between align-items-center">
<h5 class="mb-1">XSS Run panel</h5>
<span class="badge bg-primary rounded-pill">→</span>
</div>
</a>
<a href="fluent-ui/" class="list-group-item list-group-item-action experiment-link">
<div class="d-flex justify-content-between align-items-center">
<h5 class="mb-1">Fluent-ui</h5>
<span class="badge bg-primary rounded-pill">→</span>
</div>
</a>
<a href="voice-to-text/" class="list-group-item list-group-item-action experiment-link">
<div class="d-flex justify-content-between align-items-center">
<h5 class="mb-1">Voice to text</h5>
<span class="badge bg-primary rounded-pill">→</span>
</div>
<small class="text-muted">Using webkitSpeechRecognition</small>
</a>
<a href="light-gallery/" class="list-group-item list-group-item-action experiment-link">
<div class="d-flex justify-content-between align-items-center">
<h5 class="mb-1">LightGalleryJS Demo</h5>
<span class="badge bg-primary rounded-pill">→</span>
</div>
</a>
<a href="beverage/" class="list-group-item list-group-item-action experiment-link">
<div class="d-flex justify-content-between align-items-center">
<h5 class="mb-1">Coffee Drink Builder</h5>
<span class="badge bg-primary rounded-pill">→</span>
</div>
<small class="text-muted">Decorator Pattern Demo</small>
</a>
<a href="idrag/" class="list-group-item list-group-item-action experiment-link">
<div class="d-flex justify-content-between align-items-center">
<h5 class="mb-1">iDrag Demo</h5>
<span class="badge bg-primary rounded-pill">→</span>
</div>
<small class="text-muted">Parent-Child iframe communication with draggable functionality</small>
</a>
</div>
</div>
</div>
</div>
<script>
function toggleTheme() {
const html = document.documentElement;
const isDark = html.getAttribute('data-bs-theme') === 'dark';
const newTheme = isDark ? 'light' : 'dark';
html.setAttribute('data-bs-theme', newTheme);
document.getElementById('lightIcon').style.display = isDark ? 'block' : 'none';
document.getElementById('darkIcon').style.display = isDark ? 'none' : 'block';
localStorage.setItem('theme', newTheme);
}
// Load saved theme preference
const savedTheme = localStorage.getItem('theme');
if (savedTheme) {
document.documentElement.setAttribute('data-bs-theme', savedTheme);
document.getElementById('lightIcon').style.display = savedTheme === 'dark' ? 'block' : 'none';
document.getElementById('darkIcon').style.display = savedTheme === 'dark' ? 'none' : 'block';
}
</script>
</body>
</html>