Skip to content
Closed
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
47 changes: 35 additions & 12 deletions projects/stopwatch/index.html
Original file line number Diff line number Diff line change
@@ -1,18 +1,41 @@
<!doctype html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Stopwatch | Vanilla Verse</title>
<link rel="stylesheet" href="styles.css" />
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Stopwatch</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<header><h1>Stopwatch</h1></header>
<main id="app">
<!-- TODO: Implement stopwatch with Start, Pause, Reset, and Lap -->
<!-- TODO: Display hh:mm:ss.ms with requestAnimationFrame or setInterval -->
<!-- TODO: List laps with timestamps -->
</main>
<script defer src="main.js"></script>
<div class="container">
<h1>⏱️ Stopwatch</h1>

<div class="display" id="display" role="timer" aria-live="off" aria-atomic="true">
00:00.000
</div>

<div class="controls">
<button id="startPauseBtn" aria-label="Start stopwatch">
Start
</button>
<button id="lapBtn" disabled aria-label="Record lap time">
Lap
</button>
<button id="resetBtn" disabled aria-label="Reset stopwatch">
Reset
</button>
</div>

<div id="lapsSection" style="display: none;">
<div class="laps-header">Lap Times</div>
<div class="laps-container" id="lapsContainer" role="list"></div>
</div>

<div class="keyboard-hint">
<kbd>Space</kbd> Start/Pause • <kbd>L</kbd> Lap • <kbd>R</kbd> Reset
</div>
</div>

<script src="main.js"></script>
</body>
</html>
7 changes: 1 addition & 6 deletions projects/stopwatch/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,4 @@
* Implementation notes:
* - Use performance.now() for precise deltas
* - requestAnimationFrame for smooth display updates
*/

document.addEventListener('DOMContentLoaded', () => {
console.log('Stopwatch app ready');
// TODO: Wire up buttons and timing loop
});
*/
242 changes: 242 additions & 0 deletions projects/stopwatch/styles.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,244 @@
<<<<<<< unit
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}

body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
min-height: 100vh;
display: flex;
align-items: center;
justify-content: center;
padding: 20px;
}

.container {
background: rgba(255, 255, 255, 0.95);
border-radius: 24px;
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
padding: 40px;
max-width: 500px;
width: 100%;
}

h1 {
text-align: center;
color: #333;
font-size: 28px;
margin-bottom: 30px;
font-weight: 600;
}

.display {
background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
color: #fff;
font-size: 56px;
font-weight: 300;
text-align: center;
padding: 40px 20px;
border-radius: 16px;
margin-bottom: 30px;
font-variant-numeric: tabular-nums;
letter-spacing: 2px;
box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.2);
}

.controls {
display: flex;
gap: 12px;
margin-bottom: 30px;
justify-content: center;
}

button {
flex: 1;
padding: 16px 24px;
font-size: 16px;
font-weight: 600;
border: none;
border-radius: 12px;
cursor: pointer;
transition: all 0.2s ease;
text-transform: uppercase;
letter-spacing: 0.5px;
position: relative;
overflow: hidden;
}

button:focus {
outline: 3px solid rgba(102, 126, 234, 0.5);
outline-offset: 2px;
}

button:active {
transform: translateY(1px);
}

button:disabled {
opacity: 0.5;
cursor: not-allowed;
}

#startPauseBtn {
background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
color: white;
}

#startPauseBtn:hover:not(:disabled) {
box-shadow: 0 8px 20px rgba(56, 239, 125, 0.4);
transform: translateY(-2px);
}

#startPauseBtn.paused {
background: linear-gradient(135deg, #ee0979 0%, #ff6a00 100%);
}

#startPauseBtn.paused:hover:not(:disabled) {
box-shadow: 0 8px 20px rgba(238, 9, 121, 0.4);
}

#lapBtn {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
}

#lapBtn:hover:not(:disabled) {
box-shadow: 0 8px 20px rgba(118, 75, 162, 0.4);
transform: translateY(-2px);
}

#resetBtn {
background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
color: white;
}

#resetBtn:hover:not(:disabled) {
box-shadow: 0 8px 20px rgba(245, 87, 108, 0.4);
transform: translateY(-2px);
}

.laps-container {
max-height: 300px;
overflow-y: auto;
margin-top: 20px;
}

.laps-container::-webkit-scrollbar {
width: 8px;
}

.laps-container::-webkit-scrollbar-track {
background: #f1f1f1;
border-radius: 10px;
}

.laps-container::-webkit-scrollbar-thumb {
background: #888;
border-radius: 10px;
}

.laps-container::-webkit-scrollbar-thumb:hover {
background: #555;
}

.laps-header {
font-weight: 600;
color: #333;
margin-bottom: 12px;
font-size: 18px;
}

.lap-item {
display: flex;
justify-content: space-between;
align-items: center;
padding: 14px 16px;
background: #f8f9fa;
margin-bottom: 8px;
border-radius: 10px;
border-left: 4px solid #667eea;
transition: all 0.2s ease;
}

.lap-item:hover {
background: #e9ecef;
transform: translateX(4px);
}

.lap-number {
font-weight: 600;
color: #667eea;
font-size: 16px;
}

.lap-times {
display: flex;
gap: 20px;
align-items: center;
}

.lap-time {
font-variant-numeric: tabular-nums;
color: #333;
font-size: 15px;
}

.lap-delta {
font-variant-numeric: tabular-nums;
color: #666;
font-size: 14px;
font-style: italic;
}

.keyboard-hint {
text-align: center;
color: #666;
font-size: 13px;
margin-top: 20px;
padding-top: 20px;
border-top: 1px solid #e0e0e0;
}

.keyboard-hint kbd {
background: #f5f5f5;
padding: 3px 8px;
border-radius: 4px;
border: 1px solid #ccc;
font-family: monospace;
font-size: 12px;
}

@media (max-width: 500px) {
.container {
padding: 24px;
}

.display {
font-size: 42px;
padding: 30px 15px;
}

button {
padding: 14px 18px;
font-size: 14px;
}

.controls {
flex-wrap: wrap;
}

button {
flex-basis: calc(50% - 6px);
}

#resetBtn {
flex-basis: 100%;
}
}
=======
/* TODO: Style stopwatch display and controls */
:root {
--bg: #0b1220;
Expand All @@ -15,3 +256,4 @@ body {
place-items: center;
}
#app { width: min(92vw, 600px); }
>>>>>>> main
56 changes: 44 additions & 12 deletions projects/unit-converter/index.html
Original file line number Diff line number Diff line change
@@ -1,18 +1,50 @@
<!doctype html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Unit Converter | Vanilla Verse</title>
<link rel="stylesheet" href="styles.css" />
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Unit Converter</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="styles.css">
</head>
<body>
<header><h1>Unit Converter</h1></header>
<main id="app">
<!-- TODO: Select category (Length, Temperature, Weight) -->
<!-- TODO: Inputs: from-value, from-unit, to-unit; show converted result live -->
<!-- TODO: Add helpful hints and rounding options -->
</main>
<script defer src="main.js"></script>
<div class="container">
<div class="header">
<h1>Unit Converter</h1>
<button class="theme-toggle" id="themeToggle">🌙</button>
</div>

<div class="category-selector">
<button class="category-btn active" data-category="length">Length</button>
<button class="category-btn" data-category="temperature">Temperature</button>
<button class="category-btn" data-category="weight">Weight</button>
</div>

<div class="converter-box">
<div class="input-group">
<label>From</label>
<div class="input-wrapper">
<input type="number" id="input1" placeholder="Enter value" step="any">
<select id="unit1"></select>
</div>
</div>

<div class="swap-container">
<button class="swap-btn" id="swapBtn">⇅</button>
</div>

<div class="input-group">
<label>To</label>
<div class="input-wrapper">
<input type="number" id="input2" placeholder="Result" step="any">
<select id="unit2"></select>
</div>
</div>
</div>
</div>

<script src="main.js"></script>
</body>
</html>
Loading
Loading