You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
612 lines
19 KiB
612 lines
19 KiB
<!DOCTYPE html> |
|
<html lang="en"> |
|
<head> |
|
<meta charset="UTF-8"> |
|
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
|
<title>System Design Game - Select Difficulty</title> |
|
<style> |
|
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@300;400;500;700&display=swap'); |
|
|
|
/* === CSS VARIABLES === */ |
|
:root { |
|
/* Colors */ |
|
--color-bg-body: #161b22; |
|
--color-bg-dark: #121212; |
|
--color-bg-sidebar: #111; |
|
--color-bg-component: #1e1e1e; |
|
--color-bg-hover: #2a2a2a; |
|
--color-bg-accent: #005f87; |
|
--color-bg-tab-active: #1a3d2a; |
|
--color-border: #444; |
|
--color-border-accent: #00ff88; |
|
--color-border-panel: #30363d; |
|
--color-text-primary: #ccc; |
|
--color-text-muted: #888; |
|
--color-text-accent: #00ff88; |
|
--color-text-white: #fff; |
|
--color-text-dark: #333; |
|
--color-button: #238636; |
|
--color-button-disabled: #555; |
|
--color-connection: #333; |
|
--color-connection-selected: #007bff; |
|
--color-tooltip-bg: #333; |
|
--color-tooltip-text: #fff; |
|
|
|
/* Sizes */ |
|
--radius-small: 4px; |
|
--radius-medium: 6px; |
|
--radius-large: 8px; |
|
--font-family-mono: 'JetBrains Mono', monospace; |
|
--font-family-code: 'Fira Code', monospace; |
|
--component-padding: 8px; |
|
--component-gap: 12px; |
|
|
|
/* Difficulty-specific colors using existing palette */ |
|
--color-easy: var(--color-text-accent); |
|
--color-medium: #d29922; |
|
--color-hard: #f85149; |
|
} |
|
|
|
/* === RESET === */ |
|
* { |
|
box-sizing: border-box; |
|
} |
|
|
|
body { |
|
margin: 0; |
|
font-family: var(--font-family-mono); |
|
background-color: var(--color-bg-body); |
|
color: var(--color-text-primary); |
|
min-height: 100vh; |
|
background: |
|
radial-gradient(circle at 30% 50%, rgba(0, 255, 136, 0.1), transparent 50%), |
|
radial-gradient(circle at 70% 80%, rgba(255, 107, 53, 0.1), transparent 50%), |
|
var(--color-bg-body); |
|
} |
|
|
|
/* === HEADER === */ |
|
.header { |
|
width: 100%; |
|
background: transparent; |
|
padding: 12px 24px; |
|
border-bottom: 1px solid var(--color-border); |
|
display: flex; |
|
align-items: center; |
|
justify-content: space-between; |
|
} |
|
|
|
.header-text { |
|
font-size: 24px; |
|
margin: 0; |
|
color: var(--color-text-accent); |
|
font-weight: bold; |
|
} |
|
|
|
.back-button { |
|
display: inline-flex; |
|
align-items: center; |
|
gap: 8px; |
|
padding: 8px 14px; |
|
background: transparent; |
|
color: var(--color-text-primary); |
|
text-decoration: none; |
|
border: 1px solid var(--color-border); |
|
border-radius: var(--radius-medium); |
|
font-weight: 500; |
|
font-family: var(--font-family-mono); |
|
font-size: 12px; |
|
transition: all 0.2s ease; |
|
} |
|
|
|
.back-button:hover { |
|
background-color: var(--color-bg-hover); |
|
border-color: var(--color-border-accent); |
|
} |
|
|
|
/* === MAIN CONTENT === */ |
|
.main-container { |
|
max-width: 1200px; |
|
margin: 0 auto; |
|
padding: 60px 24px; |
|
} |
|
|
|
.title-section { |
|
text-align: center; |
|
margin-bottom: 60px; |
|
} |
|
|
|
.main-title { |
|
font-size: 48px; |
|
font-weight: 700; |
|
margin: 0 0 20px 0; |
|
background: linear-gradient(135deg, var(--color-text-accent), var(--color-connection-selected)); |
|
-webkit-background-clip: text; |
|
-webkit-text-fill-color: transparent; |
|
background-clip: text; |
|
} |
|
|
|
.subtitle { |
|
font-size: 18px; |
|
color: var(--color-text-muted); |
|
max-width: 600px; |
|
margin: 0 auto; |
|
line-height: 1.6; |
|
} |
|
|
|
/* === DIFFICULTY CARDS === */ |
|
.difficulty-grid { |
|
display: grid; |
|
grid-template-columns: repeat(3, 1fr); |
|
gap: 20px; |
|
max-width: 1000px; |
|
margin: 0 auto; |
|
} |
|
|
|
.difficulty-card { |
|
background: var(--color-bg-component); |
|
border: 2px solid var(--color-border); |
|
border-radius: var(--radius-large); |
|
padding: 24px; |
|
cursor: pointer; |
|
transition: all 0.3s ease; |
|
position: relative; |
|
overflow: hidden; |
|
} |
|
|
|
.difficulty-card::before { |
|
content: ''; |
|
position: absolute; |
|
top: 0; |
|
left: 0; |
|
right: 0; |
|
bottom: 0; |
|
background: linear-gradient(135deg, transparent, rgba(255, 255, 255, 0.05)); |
|
opacity: 0; |
|
transition: opacity 0.3s ease; |
|
} |
|
|
|
.difficulty-card:hover { |
|
transform: translateY(-5px); |
|
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3); |
|
background-color: var(--color-bg-hover); |
|
} |
|
|
|
.difficulty-card:hover::before { |
|
opacity: 1; |
|
} |
|
|
|
.difficulty-card.easy { |
|
border-color: var(--color-easy); |
|
} |
|
|
|
.difficulty-card.easy:hover { |
|
border-color: var(--color-easy); |
|
box-shadow: 0 10px 30px rgba(0, 255, 136, 0.3); |
|
} |
|
|
|
.difficulty-card.medium { |
|
border-color: var(--color-medium); |
|
} |
|
|
|
.difficulty-card.medium:hover { |
|
border-color: var(--color-medium); |
|
box-shadow: 0 10px 30px rgba(210, 153, 34, 0.3); |
|
} |
|
|
|
.difficulty-card.hard { |
|
border-color: var(--color-hard); |
|
} |
|
|
|
.difficulty-card.hard:hover { |
|
border-color: var(--color-hard); |
|
box-shadow: 0 10px 30px rgba(248, 81, 73, 0.3); |
|
} |
|
|
|
.difficulty-header { |
|
display: flex; |
|
align-items: center; |
|
gap: 15px; |
|
margin-bottom: 20px; |
|
} |
|
|
|
.difficulty-icon { |
|
width: 50px; |
|
height: 50px; |
|
border-radius: var(--radius-medium); |
|
display: flex; |
|
align-items: center; |
|
justify-content: center; |
|
font-size: 24px; |
|
font-weight: bold; |
|
background: var(--color-bg-dark); |
|
border: 1px solid var(--color-border-panel); |
|
} |
|
|
|
.difficulty-card.easy .difficulty-icon { |
|
color: var(--color-easy); |
|
border-color: var(--color-easy); |
|
} |
|
|
|
.difficulty-card.medium .difficulty-icon { |
|
color: var(--color-medium); |
|
border-color: var(--color-medium); |
|
} |
|
|
|
.difficulty-card.hard .difficulty-icon { |
|
color: var(--color-hard); |
|
border-color: var(--color-hard); |
|
} |
|
|
|
.difficulty-title { |
|
font-size: 28px; |
|
font-weight: 700; |
|
margin: 0; |
|
color: var(--color-text-white); |
|
} |
|
|
|
.difficulty-description { |
|
font-size: 16px; |
|
color: var(--color-text-muted); |
|
margin-bottom: 25px; |
|
line-height: 1.5; |
|
} |
|
|
|
.difficulty-features { |
|
list-style: none; |
|
padding: 0; |
|
margin: 0 0 25px 0; |
|
} |
|
|
|
.difficulty-features li { |
|
display: flex; |
|
align-items: center; |
|
gap: 10px; |
|
margin-bottom: 12px; |
|
font-size: 14px; |
|
color: var(--color-text-primary); |
|
} |
|
|
|
.difficulty-features li::before { |
|
content: '✓'; |
|
font-weight: bold; |
|
width: 16px; |
|
height: 16px; |
|
display: flex; |
|
align-items: center; |
|
justify-content: center; |
|
border-radius: 50%; |
|
font-size: 12px; |
|
background: var(--color-bg-dark); |
|
border: 1px solid var(--color-border); |
|
} |
|
|
|
.difficulty-card.easy .difficulty-features li::before { |
|
color: var(--color-easy); |
|
border-color: var(--color-easy); |
|
} |
|
|
|
.difficulty-card.medium .difficulty-features li::before { |
|
color: var(--color-medium); |
|
border-color: var(--color-medium); |
|
} |
|
|
|
.difficulty-card.hard .difficulty-features li::before { |
|
color: var(--color-hard); |
|
border-color: var(--color-hard); |
|
} |
|
|
|
.difficulty-stats { |
|
background: var(--color-bg-dark); |
|
border: 1px solid var(--color-border-panel); |
|
border-radius: var(--radius-medium); |
|
padding: 16px; |
|
margin-bottom: 25px; |
|
} |
|
|
|
.stats-grid { |
|
display: grid; |
|
grid-template-columns: 1fr 1fr; |
|
gap: 12px; |
|
} |
|
|
|
.stat-item { |
|
text-align: center; |
|
} |
|
|
|
.stat-label { |
|
font-size: 12px; |
|
color: var(--color-text-muted); |
|
margin-bottom: 5px; |
|
text-transform: uppercase; |
|
letter-spacing: 0.5px; |
|
} |
|
|
|
.stat-value { |
|
font-size: 18px; |
|
font-weight: 700; |
|
color: var(--color-text-white); |
|
} |
|
|
|
.select-button { |
|
width: 100%; |
|
padding: 15px; |
|
border: none; |
|
border-radius: var(--radius-medium); |
|
font-size: 16px; |
|
font-weight: 600; |
|
font-family: var(--font-family-mono); |
|
cursor: pointer; |
|
transition: all 0.3s ease; |
|
text-transform: uppercase; |
|
letter-spacing: 0.5px; |
|
background: var(--color-button); |
|
color: var(--color-text-white); |
|
} |
|
|
|
.select-button:hover { |
|
background: var(--color-bg-accent); |
|
transform: translateY(-2px); |
|
} |
|
|
|
.select-button:disabled { |
|
background: var(--color-button-disabled); |
|
cursor: not-allowed; |
|
transform: none; |
|
} |
|
|
|
.difficulty-card.easy .select-button { |
|
border: 1px solid var(--color-easy); |
|
} |
|
|
|
.difficulty-card.easy .select-button:hover { |
|
border-color: var(--color-easy); |
|
box-shadow: 0 0 10px rgba(0, 255, 136, 0.3); |
|
} |
|
|
|
.difficulty-card.medium .select-button { |
|
border: 1px solid var(--color-medium); |
|
} |
|
|
|
.difficulty-card.medium .select-button:hover { |
|
border-color: var(--color-medium); |
|
box-shadow: 0 0 10px rgba(210, 153, 34, 0.3); |
|
} |
|
|
|
.difficulty-card.hard .select-button { |
|
border: 1px solid var(--color-hard); |
|
} |
|
|
|
.difficulty-card.hard .select-button:hover { |
|
border-color: var(--color-hard); |
|
box-shadow: 0 0 10px rgba(248, 81, 73, 0.3); |
|
} |
|
|
|
/* === RESPONSIVE === */ |
|
@media (max-width: 1024px) { |
|
.difficulty-grid { |
|
grid-template-columns: 1fr; |
|
gap: 20px; |
|
} |
|
} |
|
|
|
@media (max-width: 768px) { |
|
.main-title { |
|
font-size: 36px; |
|
} |
|
|
|
.difficulty-card { |
|
padding: 20px; |
|
} |
|
|
|
.main-container { |
|
padding: 40px 16px; |
|
} |
|
} |
|
|
|
/* === ANIMATIONS === */ |
|
@keyframes fadeInUp { |
|
from { |
|
opacity: 0; |
|
transform: translateY(30px); |
|
} |
|
to { |
|
opacity: 1; |
|
transform: translateY(0); |
|
} |
|
} |
|
|
|
.difficulty-card { |
|
animation: fadeInUp 0.6s ease forwards; |
|
} |
|
|
|
.difficulty-card:nth-child(1) { |
|
animation-delay: 0.1s; |
|
} |
|
|
|
.difficulty-card:nth-child(2) { |
|
animation-delay: 0.2s; |
|
} |
|
|
|
.difficulty-card:nth-child(3) { |
|
animation-delay: 0.3s; |
|
} |
|
</style> |
|
</head> |
|
<body> |
|
<div class="header"> |
|
<h1 class="header-text">System Design Game</h1> |
|
</div> |
|
|
|
<div class="main-container"> |
|
<div class="title-section"> |
|
<h1 class="main-title">Select Difficulty</h1> |
|
<p class="subtitle"> |
|
Choose your challenge level. Each difficulty offers unique constraints and learning opportunities |
|
to help you master system design at your own pace. |
|
</p> |
|
</div> |
|
|
|
<div class="difficulty-grid"> |
|
<!-- Easy Difficulty --> |
|
<div class="difficulty-card easy" onclick="selectDifficulty('easy')"> |
|
<div class="difficulty-header"> |
|
<div class="difficulty-icon">🌱</div> |
|
<h2 class="difficulty-title">Easy</h2> |
|
</div> |
|
|
|
<p class="difficulty-description"> |
|
Perfect for beginners. Learn the fundamentals with guided tutorials and forgiving constraints. |
|
</p> |
|
|
|
<ul class="difficulty-features"> |
|
<li>Extended time limits</li> |
|
<li>Helpful hints and tips</li> |
|
<li>Relaxed performance requirements</li> |
|
<li>Step-by-step guidance</li> |
|
<li>Basic component set</li> |
|
</ul> |
|
|
|
<div class="difficulty-stats"> |
|
<div class="stats-grid"> |
|
<div class="stat-item"> |
|
<div class="stat-label">Time Limit</div> |
|
<div class="stat-value">45 min</div> |
|
</div> |
|
<div class="stat-item"> |
|
<div class="stat-label">Max RPS</div> |
|
<div class="stat-value">1K</div> |
|
</div> |
|
<div class="stat-item"> |
|
<div class="stat-label">Budget</div> |
|
<div class="stat-value">$500</div> |
|
</div> |
|
<div class="stat-item"> |
|
<div class="stat-label">Availability</div> |
|
<div class="stat-value">99%</div> |
|
</div> |
|
</div> |
|
</div> |
|
|
|
<button class="select-button">Start Easy Mode</button> |
|
</div> |
|
|
|
<!-- Medium Difficulty --> |
|
<div class="difficulty-card medium" onclick="selectDifficulty('medium')"> |
|
<div class="difficulty-header"> |
|
<div class="difficulty-icon">⚡</div> |
|
<h2 class="difficulty-title">Medium</h2> |
|
</div> |
|
|
|
<p class="difficulty-description"> |
|
Balanced challenge for intermediate learners. Real-world constraints with moderate complexity. |
|
</p> |
|
|
|
<ul class="difficulty-features"> |
|
<li>Standard time constraints</li> |
|
<li>Realistic performance targets</li> |
|
<li>Full component library</li> |
|
<li>Trade-off decisions required</li> |
|
<li>Cost optimization needed</li> |
|
</ul> |
|
|
|
<div class="difficulty-stats"> |
|
<div class="stats-grid"> |
|
<div class="stat-item"> |
|
<div class="stat-label">Time Limit</div> |
|
<div class="stat-value">30 min</div> |
|
</div> |
|
<div class="stat-item"> |
|
<div class="stat-label">Max RPS</div> |
|
<div class="stat-value">10K</div> |
|
</div> |
|
<div class="stat-item"> |
|
<div class="stat-label">Budget</div> |
|
<div class="stat-value">$2K</div> |
|
</div> |
|
<div class="stat-item"> |
|
<div class="stat-label">Availability</div> |
|
<div class="stat-value">99.9%</div> |
|
</div> |
|
</div> |
|
</div> |
|
|
|
<button class="select-button">Start Medium Mode</button> |
|
</div> |
|
|
|
<!-- Hard Difficulty --> |
|
<div class="difficulty-card hard" onclick="selectDifficulty('hard')"> |
|
<div class="difficulty-header"> |
|
<div class="difficulty-icon">🔥</div> |
|
<h2 class="difficulty-title">Hard</h2> |
|
</div> |
|
|
|
<p class="difficulty-description"> |
|
Expert-level challenges. Tight constraints and complex requirements that mirror real FAANG interviews. |
|
</p> |
|
|
|
<ul class="difficulty-features"> |
|
<li>Strict time pressure</li> |
|
<li>High-scale requirements</li> |
|
<li>Complex failure scenarios</li> |
|
<li>Advanced optimization needed</li> |
|
<li>Multiple constraint conflicts</li> |
|
</ul> |
|
|
|
<div class="difficulty-stats"> |
|
<div class="stats-grid"> |
|
<div class="stat-item"> |
|
<div class="stat-label">Time Limit</div> |
|
<div class="stat-value">20 min</div> |
|
</div> |
|
<div class="stat-item"> |
|
<div class="stat-label">Max RPS</div> |
|
<div class="stat-value">100K</div> |
|
</div> |
|
<div class="stat-item"> |
|
<div class="stat-label">Budget</div> |
|
<div class="stat-value">$5K</div> |
|
</div> |
|
<div class="stat-item"> |
|
<div class="stat-label">Availability</div> |
|
<div class="stat-value">99.99%</div> |
|
</div> |
|
</div> |
|
</div> |
|
|
|
<button class="select-button">Start Hard Mode</button> |
|
</div> |
|
</div> |
|
</div> |
|
|
|
<script> |
|
function selectDifficulty(difficulty) { |
|
// Add loading state to the selected button |
|
const selectedCard = document.querySelector(`.difficulty-card.${difficulty}`); |
|
const button = selectedCard.querySelector('.select-button'); |
|
const originalText = button.textContent; |
|
|
|
button.textContent = 'Loading...'; |
|
button.disabled = true; |
|
|
|
// Simulate loading and redirect |
|
setTimeout(() => { |
|
// In a real app, you'd pass the difficulty as a parameter |
|
window.location.href = `/game?difficulty=${difficulty}`; |
|
}, 1000); |
|
} |
|
|
|
// Add keyboard navigation |
|
document.addEventListener('keydown', function(e) { |
|
if (e.key === '1') { |
|
selectDifficulty('easy'); |
|
} else if (e.key === '2') { |
|
selectDifficulty('medium'); |
|
} else if (e.key === '3') { |
|
selectDifficulty('hard'); |
|
} else if (e.key === 'Escape') { |
|
window.location.href = '/game-modes'; |
|
} |
|
}); |
|
</script> |
|
</body> |
|
</html>
|
|
|