prototype 1

This commit is contained in:
2026-01-06 00:21:02 -08:00
parent 1f8fd99d25
commit 6f59fa26bd
6 changed files with 707 additions and 40 deletions

View File

@@ -1,45 +1,320 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Clock Engagement</title>
<link rel="icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><rect width=%22100%22 height=%22100%22 rx=%2220%22 fill=%22%23111%22/><text x=%2250%22 y=%2265%22 font-family=%22monospace%22 font-size=%2245%22 font-weight=%22900%22 text-anchor=%22middle%22 fill=%22%23fff%22>CRT</text></svg>">
<script src="{{ url_for('static', filename='js/clocks/clock.js') }}"></script>
<script src="{{ url_for('static', filename='js/operation.js') }}" defer></script>
<link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}">
<style>
body {
background-color: #F3E5F5; /* Very pale light purple */
margin: 0;
height: 100vh;
display: flex;
justify-content: center;
align-items: center;
:root {
--box-size: 300px;
}
@media (max-width: 600px) {
:root {
--box-size: 220px;
}
#infoPanel {
top: 20px;
right: 20px;
left: 20px;
width: auto !important; /* Override fixed width */
}
#controls {
right: 20px;
bottom: 20px;
}
#leftControls {
left: 20px;
bottom: 20px;
}
#flushButton, #clockSelect {
padding: 10px 16px;
font-size: 0.9rem;
}
}
body {
background-color: #F3E5F5;
/* Very pale light purple */
margin: 0;
width: 100%;
height: 100%;
position: fixed; /* Lock viewport on mobile */
overflow: hidden;
/* Prevent body scroll */
touch-action: none; /* Disable browser handling of gestures */
overscroll-behavior: none; /* Prevent pull-to-refresh effects */
}
#boxContainer {
display: flex;
flex-direction: row;
align-items: center;
/* Position the container's right edge at the center of the screen */
position: absolute;
right: 50%;
top: 50%;
/* Shift right by half the box width (so the last box is centered) */
/* Shift up by 50% to vertically center */
/* Added --scroll-offset for swipe functionality */
transform: translate(calc(var(--box-size) / 2 + var(--scroll-offset, 0px)), -50%);
/* Ensure boxes don't wrap */
flex-wrap: nowrap;
/* Variable for overlaps */
--card-overlap: -240px;
/* Better cursor to indicate interactivity */
cursor: grab;
transition: transform 0.1s linear;
/* Smooth drag */
}
#boxContainer:active {
cursor: grabbing;
}
.box {
width: 300px;
height: 300px;
border: 2px solid black;
width: var(--box-size);
height: var(--box-size);
border: 1px solid #333;
border-radius: 15px;
background-color: #000000;
display: flex;
justify-content: center;
align-items: center;
flex-shrink: 0;
/* Don't shrink the boxes */
/* Overlap logic: pulled to the left to overlap with previous sibling */
margin-left: var(--card-overlap);
/* Lighter shadow to prevent darkness accumulation when stacked */
box-shadow: -2px 0 5px rgba(0, 0, 0, 0.1);
position: relative;
transition: transform 0.3s ease, margin-left 0.3s ease, margin-right 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease, margin-top 0.3s ease;
background-color: white;
/* Default background, will be overridden */
/* Initial state for creation animation */
opacity: 0;
transform: translateY(100px);
}
/* Class to trigger entry animation */
.box.entered {
opacity: 1;
transform: translateY(0);
}
/* The first box shouldn't have a negative margin */
.box:first-child {
margin-left: 0;
box-shadow: none;
/* First card doesn't need a left shadow on anything */
}
/* Hover effect */
.box.entered:hover {
transform: translateY(-320px);
/* Move up clearly */
margin-left: 0px;
/* Expand to show full card */
margin-right: 20px;
/* Push next cards away */
z-index: 100000 !important;
/* Bring to front */
/* Stronger shadow to indicate lifting */
box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}
/*
Invisible pseudo-element to extend the hit area downwards during hover.
This prevents the 'flickering' issue where the card moves up away from the mouse cursor.
*/
.box::after {
content: '';
position: absolute;
top: 100%;
/* Anchor to the bottom of the card */
left: 0;
width: 100%;
height: 350px;
/* Covers the 320px movement + buffer */
display: none;
/* Hidden by default */
}
.box:hover::after {
display: block;
/* Show only on hover to maintain the capture */
}
#infoPanel {
position: fixed;
right: 40px;
top: 40px;
width: 250px;
background-color: rgba(255, 255, 255, 0.95);
padding: 20px;
border-radius: 12px;
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
z-index: 1000;
opacity: 0;
transition: opacity 0.3s ease;
pointer-events: none;
/* Let clicks pass through */
}
#infoPanel.visible {
opacity: 1;
}
#infoPanel h2 {
margin-top: 0;
color: #333;
font-size: 1.2rem;
border-bottom: 2px solid #eee;
padding-bottom: 10px;
margin-bottom: 15px;
}
.info-row {
margin-bottom: 10px;
display: flex;
align-items: center;
}
.info-label {
font-weight: bold;
color: #666;
width: 60px;
font-size: 0.9rem;
}
.info-value {
color: #111;
font-family: monospace;
font-size: 1rem;
}
#colorPreview {
width: 20px;
height: 20px;
border: 1px solid #ccc;
border-radius: 4px;
margin-right: 8px;
display: inline-block;
}
#controls {
position: fixed;
right: 40px;
bottom: 40px;
z-index: 1000;
}
#clockSelect {
padding: 12px 16px;
font-size: 1rem;
border-radius: 25px;
border: none;
background-color: rgba(255, 255, 255, 0.95);
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
cursor: pointer;
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
color: #333;
outline: none;
transition: transform 0.2s ease, box-shadow 0.2s ease;
appearance: none;
/* Remove default arrow in some browsers for custom styling if needed, but keeping default is safer */
-webkit-appearance: none;
padding-right: 40px;
background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23333%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
background-repeat: no-repeat;
background-position: right 15px top 50%;
background-size: 10px auto;
}
#clockSelect:hover {
transform: translateY(-2px);
box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}
#leftControls {
position: fixed;
left: 40px;
bottom: 40px;
z-index: 1000;
}
#flushButton {
padding: 12px 24px;
font-size: 1rem;
border-radius: 25px;
border: none;
background-color: rgba(255, 255, 255, 0.95);
box-shadow: 0 4px 15px rgba(0,0,0,0.15);
cursor: pointer;
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
color: #d32f2f; /* Red color for destructive action */
font-weight: bold;
outline: none;
transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}
#flushButton:hover {
transform: translateY(-2px);
box-shadow: 0 6px 20px rgba(0,0,0,0.2);
background-color: #ffebee;
}
</style>
</head>
<body>
<div class="box" id="colorBox">
<!-- Content can go here -->
</div>
<script>
function updateColor() {
fetch('/color')
.then(response => response.json())
.then(data => {
document.getElementById('colorBox').style.backgroundColor = data.color;
})
.catch(error => console.error('Error fetching color:', error));
}
// Update every 100 milliseconds
setInterval(updateColor, 811);
</script>
<body>
<div id="boxContainer">
<!-- Boxes will be added here -->
</div>
<div id="leftControls">
<button id="flushButton">Flush All</button>
</div>
<div id="controls">
<select id="clockSelect">
<option value="linear_crt">Linear CRT</option>
<option value="modified_crt">Modified CRT</option>
<option value="linear_cosine_crt">Linear Cosine CRT</option>
<option value="modified_cosine_crt">Modified Cosine CRT</option>
</select>
</div>
<div id="infoPanel">
<h2>Card Details</h2>
<div class="info-row">
<span class="info-label">Time:</span>
<span class="info-value" id="infoTime">--:--:--</span>
</div>
<div class="info-row">
<span class="info-label">RGB:</span>
<div id="colorPreview"></div>
<span class="info-value" id="infoRGB"></span>
</div>
<div class="info-row">
<span class="info-label">Clock:</span>
<span class="info-value" id="infoClock">--</span>
</div>
</div>
</body>
</html>