Skip to content

Commit adc626b

Browse files
Merge pull request steam-bell-92#1044 from Alvi24-hub/main
Feature: Add web-app specific guidelines to WEB_APP_GUIDE.md
2 parents 2850d43 + 911a5fe commit adc626b

1 file changed

Lines changed: 69 additions & 1 deletion

File tree

WEB_APP_GUIDE.md

Lines changed: 69 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,76 @@ Then open `http://localhost:8000` in your browser.
6666
- Works on mobile, tablet, and desktop
6767
- No console errors
6868

69+
## 🎯 Modal Requirements
70+
71+
For modals to work correctly in the web app, the following IDs are required:
72+
73+
| ID | Purpose |
74+
|----|---------|
75+
| `projectModal` | Main modal container |
76+
| `modalBody` | Container for project content |
77+
| `modalClose` | Button to close modal |
78+
79+
**Example HTML structure:**
80+
81+
```html
82+
<div class="modal" id="projectModal">
83+
<div class="modal-content">
84+
<div class="modal-header">
85+
<button class="modal-close" id="modalClose">&times;</button>
86+
</div>
87+
<div id="modalBody"></div>
88+
</div>
89+
</div>
90+
```
91+
92+
## 📦 Adding a Project Card
93+
94+
To add a new project card to the homepage, add this HTML inside `projectsTemplate`:
95+
96+
```html
97+
<div class="project-card" data-category="games" data-project="your-project-name" data-tags="tag1,tag2,tag3">
98+
<img class="card-banner" src="assets/banners/your-project.webp" alt="Project Name" loading="lazy">
99+
<div class="card-actions">
100+
<button class="btn-play">Try It</button>
101+
</div>
102+
<h3>Project Name</h3>
103+
<p>Brief description of your project</p>
104+
</div>
105+
```
106+
107+
**Required attributes:**
108+
109+
- `data-category`: `games`, `math`, or `utilities`
110+
- `data-project`: Unique project identifier
111+
- `data-tags`: Search keywords (comma separated)
112+
113+
## ✅ Web PR Testing Checklist
114+
115+
Before submitting a web-related PR, test the following:
116+
117+
- Project modal opens when clicking "Try It"
118+
- Theme toggle switches between dark/light mode
119+
- Search bar filters projects correctly
120+
- No console errors (`F12` → Console)
121+
- Mobile view works (320px width)
122+
- Keyboard navigation (Tab, Enter, Escape)
123+
- Project closes properly with ✕ button and Escape key
124+
125+
## 🚫 What NOT to Do
126+
127+
Avoid these common mistakes:
128+
129+
| Mistake | Why It's Bad |
130+
|---------|--------------|
131+
| Duplicate element IDs | Breaks JavaScript functionality |
132+
| Opening `index.html` directly | Use `python -m http.server 8000` |
133+
| Forgetting to register in `projects.js` | Project won't load |
134+
| Hardcoding colors | Use CSS variables instead |
135+
| Breaking template structure | Causes project cards to disappear |
136+
69137
## Notes
70138

71139
- Use the worker for any long-running Python execution.
72140
- Stop execution by terminating the worker and creating a fresh one.
73-
- Keep changes small and consistent with the existing UI.
141+
- Keep changes small and consistent with the existing UI.

0 commit comments

Comments
 (0)