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
Binary file added public/BulletMath.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
202 changes: 202 additions & 0 deletions src/app/game/bullet-math/page.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,202 @@
.container {
display: flex;
flex-direction: column;
align-items: center;
gap: 16px;
padding: 24px;
}

.controls {
display: flex;
gap: 12px;
justify-content: center;
flex-wrap: wrap;
}

.statusBar {
display: flex;
gap: 24px;
font-weight: bold;
margin-top: 10px;
}

.equationBox {
font-size: 36px;
font-weight: 700;
padding: 20px 32px;
border-radius: 12px;
border: 2px solid #ddd;
min-width: 360px;
display: flex;
justify-content: center;
align-items: center;
gap: 12px;
}
Comment on lines +23 to +34

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick (assertive)

Responsive min-width could still overflow on very narrow devices.

You already adjust under 400px; consider using min(360px, 100%) to avoid any overflow without the media query dependency.

-.equationBox {
+.equationBox {
   font-size: 36px;
@@
-  min-width: 360px;
+  min-width: min(360px, 100%);

Also applies to: 143-159

🤖 Prompt for AI Agents
In src/app/game/bullet-math/page.module.css around lines 23 to 34 (and similarly
apply the same change to lines 143-159), the fixed min-width: 360px can still
cause horizontal overflow on very narrow screens; replace the hard min-width
with a responsive constraint like min-width: min(360px, 100%) (or use width:
min(360px, 100%)) so the element never exceeds the viewport width while
preserving the intended minimum on larger screens.


/* .buttons {
display: flex;
gap: 16px;
margin-top: 10px;
} */

.btn {
padding: 12px 20px;
border: none;
border-radius: 10px;
cursor: pointer;
font-weight: 700;
font-size: 18px;
}

.true { background: #16a34a; color: white; }
.false { background: #dc2626; color: white; }
.neutral { background: #334155; color: white; }

Comment on lines +51 to +54

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick (assertive)

Unused variants?

If .true/.false aren’t used, drop them to reduce CSS surface. Keep only what’s referenced in JSX.

🤖 Prompt for AI Agents
In src/app/game/bullet-math/page.module.css around lines 51 to 54, the CSS
defines .true and .false classes that may be unused; remove those class rules if
they are not referenced in any JSX/TSX to reduce CSS surface, or alternatively
verify and rename/replace them with the actual class names used in components
(or convert to a single reusable utility class) and update the JSX to reference
the kept class; ensure you run a quick grep/IDE search for ".true" and ".false"
usages before deleting to avoid breaking references.

.radioGroup {
display: flex;
gap: 8px;
align-items: center;
}

.input {
font-size: 28px;
font-weight: 600;
text-align: center;
padding: 10px 16px;
margin-left: 12px;
width: 120px;
border: 2px solid #aaa;
border-radius: 10px;
outline: none;
transition: border-color 0.2s, box-shadow 0.2s, color 0.2s;
}

.input:focus {
border-color: #2563eb;
box-shadow: 0 0 6px rgba(37, 99, 235, 0.5);
}

.wrong {
color: #dc2626;
border-color: #dc2626;
}

.menuButton {
margin-top: 12px;
background: linear-gradient(135deg, #3b82f6, #2563eb);
color: white;
border: none;
padding: 12px 24px;
font-size: 1.1rem;
font-weight: bold;
border-radius: 10px;
cursor: pointer;
transition: all 0.3s ease;
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}
Comment on lines +84 to +96

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick (assertive)

Micro-optimization: limit transitioned properties.

Avoid transition: all to reduce layout work; scope to the properties you animate.

 .menuButton {
   ...
-  transition: all 0.3s ease;
+  transition: transform 0.2s ease, background 0.2s ease;
   box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
.menuButton {
margin-top: 12px;
background: linear-gradient(135deg, #3b82f6, #2563eb);
color: white;
border: none;
padding: 12px 24px;
font-size: 1.1rem;
font-weight: bold;
border-radius: 10px;
cursor: pointer;
transition: all 0.3s ease;
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}
.menuButton {
margin-top: 12px;
background: linear-gradient(135deg, #3b82f6, #2563eb);
color: white;
border: none;
padding: 12px 24px;
font-size: 1.1rem;
font-weight: bold;
border-radius: 10px;
cursor: pointer;
transition: transform 0.2s ease, background 0.2s ease;
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}
🤖 Prompt for AI Agents
In src/app/game/bullet-math/page.module.css around lines 84 to 96, the rule uses
"transition: all 0.3s ease" which is broad and causes extra layout work; replace
it with targeted transitions for only the properties you animate (for example:
background-color, transform, box-shadow, color) and keep the same duration and
easing so the visual effect is preserved while reducing repaint/reflow cost.


.menuButton:hover {
background: linear-gradient(135deg, #2563eb, #1e40af);
transform: translateY(-2px);
}

.overlay {
position: fixed;
top: 0; left: 0;
width: 100%; height: 100%;
background: rgba(0,0,0,0.7);
display: flex; align-items: center; justify-content: center;
z-index: 1000;
}

.completionMessage {
background: white;
padding: 30px;
border-radius: 16px;
text-align: center;
max-width: 400px;
width: 90%;
box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

Comment on lines +103 to +121

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick (assertive)

Modal styles are solid; consider motion-reduction for hover animations.

Respect users who prefer reduced motion by disabling hover transforms.

 @media (max-width: 400px) {
   .equationBox {
@@
   }
 }
+
+@media (prefers-reduced-motion: reduce) {
+  .menuButton:hover,
+  .resetButton:hover {
+    transform: none;
+  }
+}

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In src/app/game/bullet-math/page.module.css around lines 103-121, add a
prefers-reduced-motion rule so users who prefer reduced motion won't see
hover/animation transforms: create an @media (prefers-reduced-motion: reduce)
block that sets transition: none; animation: none; and transform: none on
.overlay and .completionMessage (and any related hover/focus selectors used
elsewhere), so hover transforms and animations are disabled for those users.

.finalStats {
margin: 20px 0;
font-size: 1.2rem;
}

.resetButton {
background: linear-gradient(135deg, #22c55e, #16a34a);
color: white;
border: none;
padding: 12px 24px;
font-size: 1rem;
font-weight: bold;
border-radius: 10px;
cursor: pointer;
margin-bottom: 12px;
}

.resetButton:hover {
background: linear-gradient(135deg, #16a34a, #15803d);
}

@media (max-width: 400px) {
.equationBox {
min-width: auto;
font-size: 24px;
padding: 12px 16px;
}

.input {
width: 80px;
font-size: 20px;
}

.btn {
font-size: 16px;
padding: 10px 14px;
}
}

.hintBox {
margin-top: 20px;
padding: 16px;
border: 2px dashed #f59e0b;
border-radius: 12px;
background: #fffbea;
font-size: 16px;
max-width: 500px;
text-align: left;
line-height: 1.6;
}

.hintBox h3 {
margin-bottom: 10px;
color: #b45309;
}

.hintBox pre {
background: #fef3c7;
padding: 8px 12px;
border-radius: 8px;
font-family: monospace;
font-size: 14px;
overflow-x: auto;
}

.btn:focus-visible, .menuButton:focus-visible, .resetButton:focus-visible { outline: 3px solid #f59e0b; outline-offset: 2px; }

.infoBox {
margin-top: 30px;
padding: 20px;
border-radius: 12px;
background: #f9fafb;
text-align: left;
line-height: 1.6;
font-size: 15px;
}

.infoBox h2 {
margin-top: 20px;
color: #1e40af;
}
Loading