Skip to content
Open
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
241 changes: 241 additions & 0 deletions WhackABug/unitybtw/css/main.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,241 @@
/* css/main.css */

/* Basic Reset */
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}

body {
background: var(--color-bg-base);
color: var(--color-text-primary);
font-family: var(--font-sans);
min-height: 100vh;
display: flex;
justify-content: center;
align-items: center;
overflow: hidden;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}

/* Typography */
.highlight {
color: var(--color-highlight);
}

.header {
text-align: center;
margin-bottom: var(--spacing-lg);
}

.header__title {
font-size: 2rem;
font-weight: 700;
letter-spacing: -0.03em;
margin-bottom: var(--spacing-sm);
}

.header__subtitle {
color: var(--color-text-secondary);
font-size: 0.95rem;
}

/* Layout */
.app-container {
display: flex;
flex-direction: column;
align-items: center;
padding: var(--spacing-md);
width: 100%;
max-width: 500px;
}

.game-board {
display: flex;
flex-direction: column;
align-items: center;
gap: var(--spacing-lg);
width: 100%;
}

/* Clean Panels */
.glass-panel {
background: var(--color-bg-panel);
border: 1px solid var(--color-border-panel);
border-radius: var(--border-radius-md);
/* Removed all blur and glassmorphism. Flat, clean look instead. */
}

/* Stats */
.stats-panel {
display: flex;
justify-content: space-between;
width: 100%;
padding: var(--spacing-md) var(--spacing-lg);
}

.stat {
display: flex;
flex-direction: column;
align-items: flex-start;
}

.stat__label {
font-size: 0.75rem;
font-weight: 500;
color: var(--color-text-secondary);
text-transform: uppercase;
letter-spacing: 0.05em;
margin-bottom: 4px;
}

.stat__value {
font-family: var(--font-mono);
font-size: 1.5rem;
font-weight: 600;
color: var(--color-text-primary);
}

/* Grid & Holes */
.grid {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: var(--grid-gap);
padding: var(--spacing-lg);
}

.hole {
width: var(--hole-size);
height: var(--hole-size);
background: var(--color-hole-bg);
border: 1px solid var(--color-hole-border);
border-radius: var(--border-radius-sm); /* Square with slightly rounded corners */
box-shadow: inset 0 4px 10px var(--color-hole-shadow);
position: relative;
overflow: hidden;
cursor: pointer;
}

/* Focus rings for accessibility */
.hole:focus-visible {
outline: 2px solid var(--color-highlight);
outline-offset: 2px;
}

/* The Bug (Pure CSS Art - Clean Vector Style) */
.bug {
width: 60%;
height: 60%;
background: var(--color-bug);
border-radius: 4px;
position: absolute;
bottom: -100%;
left: 20%;
transition: bottom 0.15s cubic-bezier(0.2, 0, 0, 1);
pointer-events: none; /* Clicking passes through to the hole */
}

/* Flat Bug details */
.bug::before, .bug::after {
content: '';
position: absolute;
width: 12px;
height: 12px;
background: #ffffff;
border-radius: 50%;
top: 20%;
}

.bug::before { left: 15%; }
.bug::after { right: 15%; }

/* Animation States */
.hole--active .bug {
bottom: 10%;
}

.hole--whacked .bug {
background: var(--color-text-secondary);
transform: scaleY(0.1);
transform-origin: bottom;
transition: transform 0.05s ease-out, background 0.05s;
}

/* Buttons */
.btn {
font-family: var(--font-sans);
font-weight: 500;
font-size: 0.95rem;
padding: 10px 24px;
border-radius: var(--border-radius-sm);
cursor: pointer;
transition: background 0.15s ease, color 0.15s ease;
border: 1px solid transparent;
}

.btn:focus-visible {
outline: 2px solid var(--color-highlight);
outline-offset: 2px;
}

.btn--primary {
background: var(--color-btn-primary);
color: var(--color-btn-primary-text);
width: 100%;
}

.btn--primary:hover {
background: var(--color-btn-primary-hover);
}

.btn--secondary {
background: var(--color-btn-secondary);
color: var(--color-text-primary);
border: 1px solid var(--color-btn-secondary-border);
}

.btn--secondary:hover {
background: var(--color-btn-secondary-hover);
}

/* Modal */
.modal {
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%) scale(0.95);
padding: var(--spacing-lg);
text-align: center;
border: 1px solid var(--color-border-panel);
border-radius: var(--border-radius-md);
background: var(--color-bg-panel);
color: var(--color-text-primary);
opacity: 0;
pointer-events: none;
transition: opacity 0.2s ease, transform 0.2s ease;
box-shadow: 0 20px 40px rgba(0,0,0,0.5);
}

.modal[open] {
opacity: 1;
transform: translate(-50%, -50%) scale(1);
pointer-events: all;
}

.modal::backdrop {
background: rgba(0, 0, 0, 0.7);
}

.modal__title {
font-size: 1.5rem;
font-weight: 600;
margin-bottom: var(--spacing-sm);
}

.modal__text {
font-size: 1rem;
color: var(--color-text-secondary);
margin-bottom: var(--spacing-lg);
}
48 changes: 48 additions & 0 deletions WhackABug/unitybtw/css/variables.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/* css/variables.css */
:root {
/* Minimalist Professional Dark Theme (Vercel/GitHub inspired) */
--color-bg-base: #0a0a0a;
--color-bg-panel: #111111;
--color-border-panel: #333333;

--color-text-primary: #ededed;
--color-text-secondary: #a1a1aa;

--color-highlight: #0070f3; /* Clean tech blue */
--color-bug: #e00000; /* High contrast red for bugs */

--color-hole-bg: #1a1a1a;
--color-hole-border: #222222;
--color-hole-shadow: #000000;

/* Buttons */
--color-btn-primary: #ededed;
--color-btn-primary-hover: #ffffff;
--color-btn-primary-text: #0a0a0a;

--color-btn-secondary: #111111;
--color-btn-secondary-border: #333333;
--color-btn-secondary-hover: #222222;

/* Typography */
--font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
--font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

/* Spacing & Sizes */
--spacing-sm: 8px;
--spacing-md: 16px;
--spacing-lg: 32px;
--border-radius-sm: 6px;
--border-radius-md: 12px;

/* Grid & Game sizes */
--grid-gap: 24px;
--hole-size: 100px;
}

@media (max-width: 600px) {
:root {
--hole-size: 80px;
--grid-gap: 16px;
}
}
80 changes: 80 additions & 0 deletions WhackABug/unitybtw/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Whack-A-Bug | Developer Edition</title>
<link rel="stylesheet" href="css/variables.css">
<link rel="stylesheet" href="css/main.css">
<!-- Google Fonts for a modern monospaced and sans-serif look -->
<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=Fira+Code:wght@400;600&family=Inter:wght@400;600;800&display=swap" rel="stylesheet">
</head>
<body>
<div class="app-container">
<header class="header">
<h1 class="header__title">WHACK-A-<span class="highlight">BUG</span></h1>
<p class="header__subtitle">Smash the bugs before they reach production!</p>
</header>

<main class="game-board">
<div class="stats-panel glass-panel">
<div class="stat">
<span class="stat__label">SCORE</span>
<span class="stat__value" id="score">0</span>
</div>
<div class="stat">
<span class="stat__label">TIME</span>
<span class="stat__value" id="time">30</span>
</div>
</div>

<div class="grid glass-panel" id="grid">
<!-- 9 Holes generated dynamically or statically -->
<div class="hole" data-index="0">
<div class="bug"></div>
</div>
<div class="hole" data-index="1">
<div class="bug"></div>
</div>
<div class="hole" data-index="2">
<div class="bug"></div>
</div>
<div class="hole" data-index="3">
<div class="bug"></div>
</div>
<div class="hole" data-index="4">
<div class="bug"></div>
</div>
<div class="hole" data-index="5">
<div class="bug"></div>
</div>
<div class="hole" data-index="6">
<div class="bug"></div>
</div>
<div class="hole" data-index="7">
<div class="bug"></div>
</div>
<div class="hole" data-index="8">
<div class="bug"></div>
</div>
</div>

<div class="controls">
<button class="btn btn--primary" id="start-btn">START DEBUGGING</button>
</div>
</main>

<!-- Game Over Modal -->
<dialog class="modal glass-panel" id="game-over-modal">
<h2 class="modal__title">Sprint Ended!</h2>
<p class="modal__text">You squashed <span id="final-score" class="highlight">0</span> bugs.</p>
<button class="btn btn--secondary" id="restart-btn">Play Again</button>
</dialog>
</div>

<!-- JavaScript Modules -->
<script type="module" src="js/app.js"></script>
</body>
</html>
Loading