Skip to content

Commit d845702

Browse files
committed
Refactor code to remove unused scratchpad functionality and animations.js references across multiple problem pages. Implement shared scratchpad setup for improved consistency and maintainability.
1 parent bf3b15d commit d845702

22 files changed

Lines changed: 1086 additions & 2142 deletions

README.md

Lines changed: 39 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,55 @@
11
# Math Problems
22

3-
Access the page here: https://jspann21.github.io/Math_Problems/
3+
**Live site:** https://jspann21.github.io/Math_Problems/
44

5-
I created this site so that my daughter doesn't have to watch 30-second ads or pay a subscription to practice math
6-
problems. My plan is to expand the quantity and types of problems over time.
5+
I created this site so that my daughter doesn't have to watch 30-second ads or pay a subscription to practice math problems. My plan is to expand the quantity and types of problems over time.
76

8-
A JavaScript-based project that generates math problems with interactive options and a built-in scratchpad for drawing
9-
and annotating solutions. The project uses HTML, CSS, and vanilla JavaScript to display problems, handle user
10-
interactions, and provide a fun, dynamic learning experience.
7+
Ad-free math practice pages built with static HTML/CSS/JavaScript, deployed on GitHub Pages.
118

12-
## Features
9+
## Usage
1310

14-
- Interactive math problems with multiple-choice options
15-
- Scratchpad for handwritten notes and drawings
16-
- Undo, redo, and clear functions in the scratchpad
17-
- Animated stars for correct answers
18-
- Responsive design and touch support for mobile devices
11+
Visit the live site and pick a topic from the homepage. Each problem page shows a question with multiple-choice answers. Use **Previous** and **Next** to move between problems. Open the **scratchpad** to work out solutions on a drawing canvas (undo, redo, clear). Use the **Home** button to return to the topic list.
1912

20-
## Usage
13+
## Problem Types
2114

22-
1. Open the index.html file in your browser.
23-
2. The first math problem will display with multiple-choice options.
24-
3. Use the scratchpad on the side to work out your solutions:
25-
* Click on the Toggle Scratchpad button to open it.
26-
* Use your mouse or touch to draw on the canvas.
27-
* Use the Undo, Redo, and Clear buttons to manage your drawing.
28-
4. Select an answer option to check if your answer is correct. Animated stars will appear for correct answers.
29-
5. Navigate between problems using the provided navigation buttons.
15+
- **Customary Units of Length:** Using 3 One or Two Digit Numbers, Units Up to 100, Appropriate Metric Unit of Length
16+
- **Word Problems:** Length Word Problems
17+
- **Basic Operations:** Addition & Subtraction (0–20), Flashcards: Add & Subtract (0–20)
18+
- **Time:** Telling Time Problems, Read Clock Time (Minute Tick Marks)
3019

31-
## Project Structure
20+
## Current Stack
3221

33-
* index.html — Main entry point of the application.
34-
* script.js — Contains the logic for math problems, event handlers, and the scratchpad.
35-
* styles.css — Styles for the application layout and elements.
36-
* README.md — Project documentation file.
22+
- Static HTML pages for each problem type
23+
- Shared ES modules for animations, scratchpad, and utilities
24+
- Data-driven homepage catalog (`site-catalog.js` + `index.js`)
25+
- Single global stylesheet (`styles.css`) with reusable design tokens
3726

38-
## Contributing
27+
## Local Development
3928

40-
Contributions are welcome. To contribute:
29+
Use any static file server from the repo root:
4130

42-
1. Fork the repository.
43-
2. Create a new branch for your feature or bugfix.
44-
3. Commit your changes with clear commit messages.
45-
4. Open a pull request for review.
31+
```bash
32+
python -m http.server 8000
33+
```
4634

47-
## License
35+
Then open `http://localhost:8000`.
4836

49-
This project is open source and available under the MIT License.
37+
## Project Structure
5038

39+
- `index.html`: homepage shell
40+
- `index.js`: renders topic cards from catalog data
41+
- `site-catalog.js`: single source of truth for homepage links/topics
42+
- `shared.js`: shared scratchpad + utility functions
43+
- `animations.js`: reusable correct/wrong answer feedback
44+
- `*.html` + matching `*.js`: individual problem pages and logic
45+
- `styles.css`: global and page-specific styling
46+
47+
## Add A New Page
48+
49+
1. Create `your-topic.html` and `your-topic.js`.
50+
2. Reuse existing page structure and include module scripts.
51+
3. Import shared helpers in your script:
52+
- `setupScratchpad()` for scratchpad controls
53+
- `shuffleArray()` and other shared utilities as needed
54+
4. Add your page link to `site-catalog.js` in the correct topic section.
55+
5. Commit and push to `main` for GitHub Pages deployment.

addition-subtraction-0-20-flashcards.html

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,8 @@ <h1>⚡ Flashcards: Add & Subtract (0-20)</h1>
4343
<div class="problem-type">
4444
Addition & Subtraction (0-20) Flashcards
4545
</div>
46-
<!-- Stars container might not be relevant here, but kept for consistency -->
46+
<!-- Kept for consistency if celebration animations are added later -->
4747
<div class="stars" id="stars-container"></div>
48-
<!-- animations.js included for potential future use or consistency -->
49-
<script src="animations.js" type="module" defer></script>
5048
<script src="addition-subtraction-0-20-flashcards.js" type="module" defer></script>
5149
</body>
52-
</html>
50+
</html>

addition-subtraction-0-20.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ <h1>🔢 Addition & Subtraction (0-20)</h1>
3939
Addition & Subtraction (0-20) Problems
4040
</div>
4141
<div class="stars" id="stars-container"></div>
42-
<script src="animations.js" type="module" defer></script>
4342
<script src="addition-subtraction-0-20.js" type="module" defer></script>
4443
</body>
45-
</html>
44+
</html>

0 commit comments

Comments
 (0)