Skip to content

Commit b45efbe

Browse files
Merge pull request #3 from ZaneThePython/copilot/improve-file-structure-css-seo
Restructure repo: modularize JS, add build system, improve accessibility and SEO
2 parents 3b04758 + 7a4996c commit b45efbe

29 files changed

Lines changed: 11787 additions & 1681 deletions

.github/workflows/ci.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ main, copilot/** ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
lint-test-build:
11+
runs-on: ubuntu-latest
12+
13+
strategy:
14+
matrix:
15+
node-version: [18.x, 20.x]
16+
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v4
20+
21+
- name: Setup Node.js ${{ matrix.node-version }}
22+
uses: actions/setup-node@v4
23+
with:
24+
node-version: ${{ matrix.node-version }}
25+
cache: 'npm'
26+
27+
- name: Install dependencies
28+
run: npm ci
29+
30+
- name: Run ESLint
31+
run: npm run lint
32+
33+
- name: Check formatting
34+
run: npm run format:check
35+
36+
- name: Run tests
37+
run: npm run test:run
38+
39+
- name: Build project
40+
run: npm run build
41+
42+
- name: Upload build artifacts
43+
if: matrix.node-version == '20.x'
44+
uses: actions/upload-artifact@v4
45+
with:
46+
name: build-artifacts
47+
path: dist/
48+
retention-days: 7

.gitignore

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Dependencies
2+
node_modules/
3+
4+
# Build outputs
5+
dist/
6+
build/
7+
8+
# Logs
9+
*.log
10+
npm-debug.log*
11+
12+
# OS files
13+
.DS_Store
14+
Thumbs.db
15+
16+
# Editor directories
17+
.vscode/
18+
.idea/
19+
20+
# Temporary files
21+
*.tmp
22+
.cache/
23+
24+
# Environment files
25+
.env
26+
.env.local

.prettierignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
node_modules
2+
dist
3+
build
4+
.git
5+
*.min.js
6+
*.min.css

.prettierrc.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"semi": true,
3+
"trailingComma": "es5",
4+
"singleQuote": true,
5+
"printWidth": 100,
6+
"tabWidth": 2,
7+
"useTabs": false,
8+
"arrowParens": "always"
9+
}

CONTRIBUTING.md

Lines changed: 179 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,179 @@
1+
# Contributing to ZanePersonal
2+
3+
Thank you for your interest in contributing to this project! While this is primarily a personal website, contributions are welcome.
4+
5+
## Commit Message Format
6+
7+
This project follows the [Conventional Commits](https://www.conventionalcommits.org/) specification for commit messages.
8+
9+
### Format
10+
11+
```
12+
<type>(<scope>): <subject>
13+
14+
<body>
15+
16+
<footer>
17+
```
18+
19+
### Types
20+
21+
- **feat**: A new feature
22+
- **fix**: A bug fix
23+
- **docs**: Documentation changes
24+
- **style**: Code style changes (formatting, missing semi-colons, etc.)
25+
- **refactor**: Code refactoring without changing functionality
26+
- **perf**: Performance improvements
27+
- **test**: Adding or updating tests
28+
- **build**: Changes to build system or dependencies
29+
- **ci**: Changes to CI configuration
30+
- **chore**: Other changes that don't modify src or test files
31+
32+
### Examples
33+
34+
```
35+
feat(effects): add new particle collision detection
36+
37+
fix(animations): resolve timing issue with typewriter effect
38+
39+
docs(readme): update installation instructions
40+
41+
style(css): apply consistent naming convention
42+
43+
refactor(modules): extract sound utilities to separate module
44+
45+
perf(effects): optimize particle rendering loop
46+
47+
test(interactions): add unit tests for ripple effect
48+
49+
build(vite): update build configuration for better tree-shaking
50+
51+
ci(github-actions): add accessibility testing workflow
52+
```
53+
54+
## Development Workflow
55+
56+
1. **Fork the repository** (if you're an external contributor)
57+
58+
2. **Clone your fork**
59+
```bash
60+
git clone https://github.com/YOUR_USERNAME/ZanePersonal.git
61+
cd ZanePersonal
62+
```
63+
64+
3. **Install dependencies**
65+
```bash
66+
npm install
67+
```
68+
69+
4. **Create a feature branch**
70+
```bash
71+
git checkout -b feat/your-feature-name
72+
```
73+
74+
5. **Make your changes**
75+
- Write clean, readable code
76+
- Follow existing code style
77+
- Add comments where necessary
78+
- Update documentation if needed
79+
80+
6. **Run quality checks**
81+
```bash
82+
npm run lint # Check for linting errors
83+
npm run format # Format code with Prettier
84+
npm run build # Ensure project builds successfully
85+
```
86+
87+
7. **Commit your changes**
88+
```bash
89+
git add .
90+
git commit -m "feat(scope): your descriptive message"
91+
```
92+
93+
8. **Push to your fork**
94+
```bash
95+
git push origin feat/your-feature-name
96+
```
97+
98+
9. **Create a Pull Request**
99+
- Provide a clear description of changes
100+
- Reference any related issues
101+
- Ensure CI checks pass
102+
103+
## Code Style Guidelines
104+
105+
### JavaScript
106+
107+
- Use ES6+ features
108+
- Prefer `const` over `let`, avoid `var`
109+
- Use arrow functions for callbacks
110+
- Keep functions small and focused
111+
- Add JSDoc comments for complex functions
112+
- Follow the existing modular structure
113+
114+
### CSS
115+
116+
- Use CSS custom properties (variables) defined in `:root`
117+
- Follow BEM-like naming conventions where appropriate
118+
- Group related properties together
119+
- Use meaningful class names
120+
- Avoid overly specific selectors
121+
122+
### HTML
123+
124+
- Use semantic HTML5 elements
125+
- Include proper ARIA labels for accessibility
126+
- Ensure all images have alt text
127+
- Maintain proper heading hierarchy
128+
129+
## Testing
130+
131+
While this project doesn't currently have automated tests, please ensure:
132+
- All features work in modern browsers (Chrome, Firefox, Safari, Edge)
133+
- Responsive design works on mobile, tablet, and desktop
134+
- No console errors or warnings
135+
- Accessibility features work with keyboard navigation
136+
137+
## Performance Considerations
138+
139+
- Keep total bundle size under 150KB (compressed)
140+
- Optimize images before adding them
141+
- Minimize use of heavy libraries
142+
- Test animations on lower-end devices
143+
- Use lazy loading where appropriate
144+
145+
## Accessibility Standards
146+
147+
- Maintain WCAG 2.1 Level AA compliance
148+
- Test with screen readers
149+
- Ensure keyboard navigation works
150+
- Provide sufficient color contrast
151+
- Include focus indicators on interactive elements
152+
153+
## Pull Request Checklist
154+
155+
Before submitting a PR, ensure:
156+
157+
- [ ] Code follows the project's style guidelines
158+
- [ ] All linting checks pass (`npm run lint`)
159+
- [ ] Code is properly formatted (`npm run format`)
160+
- [ ] Project builds successfully (`npm run build`)
161+
- [ ] Changes are tested in multiple browsers
162+
- [ ] Documentation is updated if needed
163+
- [ ] Commit messages follow conventional commits format
164+
- [ ] PR description clearly explains the changes
165+
166+
## Questions or Issues?
167+
168+
Feel free to:
169+
- Open an issue for bugs or feature requests
170+
- Start a discussion for questions
171+
- Email [contact@zane.org](mailto:contact@zane.org)
172+
173+
## License
174+
175+
By contributing, you agree that your contributions will be licensed under the MIT License.
176+
177+
---
178+
179+
Thank you for contributing! 🎉

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 ZaneDev
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)