Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
213 changes: 213 additions & 0 deletions demos/interactive_demo.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,213 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Galaxy Stars - GridWise Visualization</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}

body {
font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
background: #0a0a0f;
overflow: hidden;
width: 100vw;
height: 100vh;
}

#canvas {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
cursor: crosshair;
}

#controls {
position: absolute;
top: 20px;
right: 20px;
background: rgba(20, 20, 25, 0.9);
backdrop-filter: blur(20px);
padding: 15px 20px;
border-radius: 12px;
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
z-index: 10;
display: flex;
flex-direction: column;
gap: 10px;
min-width: 180px;
}

.control-group {
display: flex;
flex-direction: column;
gap: 8px;
}

label {
color: #888;
font-size: 11px;
font-weight: 500;
text-transform: uppercase;
letter-spacing: 0.5px;
}

input[type="range"] {
width: 100%;
height: 4px;
border-radius: 2px;
background: #2a2a30;
outline: none;
-webkit-appearance: none;
appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
-webkit-appearance: none;
appearance: none;
width: 14px;
height: 14px;
border-radius: 50%;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
cursor: pointer;
box-shadow: 0 2px 6px rgba(102, 126, 234, 0.5);
}

input[type="range"]::-moz-range-thumb {
width: 14px;
height: 14px;
border-radius: 50%;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
cursor: pointer;
border: none;
box-shadow: 0 2px 6px rgba(102, 126, 234, 0.5);
}

#starCount {
color: #fff;
font-size: 13px;
font-weight: 600;
text-align: center;
}

.button-group {
display: flex;
flex-direction: column;
gap: 12px;
margin-top: 8px;
}

button {
padding: 10px 20px;
font-size: 14px;
font-weight: 600;
border: none;
border-radius: 4px;
cursor: pointer;
background: transparent;
color: white;
position: relative;
animation: textGlow 3s ease-in-out infinite;
}

button:nth-child(1) {
animation-delay: 0s;
}

button:nth-child(2) {
animation-delay: 1s;
}

button:nth-child(3) {
animation-delay: 2s;
}

@keyframes textGlow {
0%, 100% {
text-shadow:
0 0 5px rgba(255, 255, 255, 0.3),
0 0 10px rgba(255, 255, 255, 0.2);
}
50% {
text-shadow:
0 0 10px rgba(255, 255, 255, 0.6),
0 0 20px rgba(255, 255, 255, 0.4),
0 0 30px rgba(255, 255, 255, 0.2);
}
}

button:hover {
animation: textGlowFast 1.5s ease-in-out infinite;
}

@keyframes textGlowFast {
0%, 100% {
text-shadow:
0 0 8px rgba(255, 255, 255, 0.5),
0 0 15px rgba(255, 255, 255, 0.3);
}
50% {
text-shadow:
0 0 15px rgba(255, 255, 255, 0.8),
0 0 30px rgba(255, 255, 255, 0.5),
0 0 45px rgba(255, 255, 255, 0.3);
}
}

button:active {
transform: scale(0.95);
}

.info-text {
color: #555;
font-size: 10px;
text-align: center;
margin-top: 5px;
}

#errorDisplay {
display: none;
position: absolute;
bottom: 20px;
left: 50%;
transform: translateX(-50%);
background: rgba(180, 30, 30, 0.92);
color: #fff;
font-size: 13px;
font-weight: 600;
padding: 10px 20px;
border-radius: 8px;
z-index: 20;
pointer-events: none;
box-shadow: 0 4px 16px rgba(0,0,0,0.5);
}
</style>
</head>
<body>
<canvas id="canvas"></canvas>
<div id="errorDisplay"></div>

<div id="controls">
<div class="control-group">
<label>Particles</label>
<input type="range" id="starSlider" min="1000" max="100000" step="1000" value="10000">
<div id="starCount">10K</div>
</div>

<div class="button-group">
<button id="sortBtn">Sort</button>
<button id="scanBtn">Scan</button>
<button id="reduceBtn">Reduce</button>
</div>

<div class="info-text">Click: attract • Shift: repel</div>
</div>

<script type="module" src="interactive_demo.mjs"></script>
</body>
</html>
Loading