Fix: Remove duplicate event listeners and CSS @media rules
This commit is contained in:
parent
a6284b0933
commit
6950c4d788
1 changed files with 1 additions and 58 deletions
|
|
@ -140,13 +140,6 @@
|
||||||
.info-card { padding: 0.75rem !important; }
|
.info-card { padding: 0.75rem !important; }
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ── Mobile-first responsive tweaks ── */
|
|
||||||
@media (max-width: 640px) {
|
|
||||||
.stat-desc { display: none; }
|
|
||||||
.stat-card { padding: 0.5rem !important; }
|
|
||||||
.info-card { padding: 0.75rem !important; }
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ── Sticky Sidebar (Desktop ≥1024px) ── */
|
/* ── Sticky Sidebar (Desktop ≥1024px) ── */
|
||||||
@media (min-width: 1024px) {
|
@media (min-width: 1024px) {
|
||||||
.app-layout {
|
.app-layout {
|
||||||
|
|
@ -179,11 +172,6 @@
|
||||||
.anim-header, .anim-section, .anim-stat { animation: none !important; }
|
.anim-header, .anim-section, .anim-stat { animation: none !important; }
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ── Reduced Motion ── */
|
|
||||||
@media (prefers-reduced-motion: reduce) {
|
|
||||||
.anim-header, .anim-section, .anim-stat { animation: none !important; }
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ── Progress Bar ── */
|
/* ── Progress Bar ── */
|
||||||
.progress-track {
|
.progress-track {
|
||||||
height: 4px;
|
height: 4px;
|
||||||
|
|
@ -209,7 +197,7 @@
|
||||||
<div class="flex-1"></div>
|
<div class="flex-1"></div>
|
||||||
<div class="text-center">
|
<div class="text-center">
|
||||||
<h1 class="title-text font-bold tracking-tight" style="color: var(--c-text); text-shadow: 0 0 40px rgba(74,124,255,0.3);">
|
<h1 class="title-text font-bold tracking-tight" style="color: var(--c-text); text-shadow: 0 0 40px rgba(74,124,255,0.3);">
|
||||||
Sortier-Algorithmen <span style="font-size: 0.45em; font-weight: 400; opacity: 0.5; vertical-align: middle;">v0.2.3</span>
|
Sortier-Algorithmen <span style="font-size: 0.45em; font-weight: 400; opacity: 0.5; vertical-align: middle;">v0.2.5</span>
|
||||||
</h1>
|
</h1>
|
||||||
<p class="text-muted text-sm mt-0.5">Interaktive Visualisierung mit schrittweiser Animation</p>
|
<p class="text-muted text-sm mt-0.5">Interaktive Visualisierung mit schrittweiser Animation</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -2751,14 +2739,12 @@ function doReset() {
|
||||||
// Combined Play/Pause button
|
// Combined Play/Pause button
|
||||||
$btnPlayPause.addEventListener('click', function() {
|
$btnPlayPause.addEventListener('click', function() {
|
||||||
if (isRunning && !isPaused) {
|
if (isRunning && !isPaused) {
|
||||||
// Currently playing → pause
|
|
||||||
stopTimer();
|
stopTimer();
|
||||||
isPaused = true;
|
isPaused = true;
|
||||||
updateButtonStates();
|
updateButtonStates();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!isRunning) {
|
if (!isRunning) {
|
||||||
// Not started → start; skip generateArray() if Reset already prepared a fresh array
|
|
||||||
if (!arrayFresh) { generateArray(); }
|
if (!arrayFresh) { generateArray(); }
|
||||||
arrayFresh = false;
|
arrayFresh = false;
|
||||||
renderCurrent();
|
renderCurrent();
|
||||||
|
|
@ -2775,27 +2761,6 @@ $btnPlayPause.addEventListener('click', function() {
|
||||||
scheduleNext();
|
scheduleNext();
|
||||||
});
|
});
|
||||||
|
|
||||||
// Step forward
|
|
||||||
$btnStep.addEventListener('click', function() {
|
|
||||||
if (!isRunning) {
|
|
||||||
if (!arrayFresh) { generateArray(); }
|
|
||||||
arrayFresh = false;
|
|
||||||
renderCurrent();
|
|
||||||
steps = buildSteps($algoSelect.value);
|
|
||||||
stepIndex = 0;
|
|
||||||
startTime = 0;
|
|
||||||
elapsedMs = 0;
|
|
||||||
setStats(0, 0, 0, 0);
|
|
||||||
$statTime.textContent = '0 ms';
|
|
||||||
isRunning = true;
|
|
||||||
isPaused = true;
|
|
||||||
}
|
|
||||||
isRunning = true;
|
|
||||||
isPaused = false;
|
|
||||||
updateButtonStates();
|
|
||||||
scheduleNext();
|
|
||||||
});
|
|
||||||
|
|
||||||
// Step forward
|
// Step forward
|
||||||
$btnStep.addEventListener('click', function() {
|
$btnStep.addEventListener('click', function() {
|
||||||
if (!isRunning) {
|
if (!isRunning) {
|
||||||
|
|
@ -2870,28 +2835,6 @@ $presetSelect.addEventListener('change', function() {
|
||||||
writeUrlState();
|
writeUrlState();
|
||||||
});
|
});
|
||||||
|
|
||||||
$sizeSlider.addEventListener('input', function() {
|
|
||||||
updateSizeLabel();
|
|
||||||
if (!isRunning) doReset();
|
|
||||||
writeUrlState();
|
|
||||||
});
|
|
||||||
|
|
||||||
$algoSelect.addEventListener('change', function() {
|
|
||||||
updateThreadSlider();
|
|
||||||
if (!isRunning) doReset();
|
|
||||||
writeUrlState();
|
|
||||||
});
|
|
||||||
|
|
||||||
$threadSlider.addEventListener('input', function() {
|
|
||||||
$threadVal.textContent = $threadSlider.value;
|
|
||||||
if (isRunning && !isPaused) scheduleNext();
|
|
||||||
});
|
|
||||||
|
|
||||||
$presetSelect.addEventListener('change', function() {
|
|
||||||
if (!isRunning) doReset();
|
|
||||||
writeUrlState();
|
|
||||||
});
|
|
||||||
|
|
||||||
$customArray.addEventListener('change', function() {
|
$customArray.addEventListener('change', function() {
|
||||||
if (!isRunning) doReset();
|
if (!isRunning) doReset();
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue