Skip to content

Commit 1286913

Browse files
Copilotdorkmo
andcommitted
Add preview directory documentation and .gitignore
Co-authored-by: dorkmo <[email protected]>
1 parent f270f39 commit 1286913

File tree

2 files changed

+84
-0
lines changed

2 files changed

+84
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Node modules (if testing locally)
2+
node_modules/
3+
package.json
4+
package-lock.json
5+
6+
# Temporary files
7+
*.tmp
8+
*.log
9+
10+
# Keep the generated screenshot
11+
!web-controller-preview.png
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# Web Controller Preview Assets
2+
3+
This directory contains assets for generating preview screenshots of the LifeTrac v25 web controller interface.
4+
5+
## Files
6+
7+
### camera-placeholder.svg
8+
An SVG placeholder image that simulates a camera feed view. Used in the standalone HTML to provide a realistic preview without requiring an actual camera connection.
9+
10+
### standalone.html
11+
A self-contained HTML page that includes:
12+
- Complete web controller interface styling (embedded CSS)
13+
- Joystick initialization code (embedded JavaScript)
14+
- No Flask backend dependencies
15+
- Uses the camera placeholder image
16+
17+
This page is used by the GitHub Actions workflow to generate screenshots automatically.
18+
19+
### web-controller-preview.png
20+
Auto-generated screenshot of the web controller interface showing:
21+
- Header with status indicators
22+
- Camera feed area with placeholder
23+
- Left joystick (Tank Steering - green)
24+
- Right joystick (Hydraulics - orange)
25+
- Emergency stop button
26+
- Keyboard shortcuts reference
27+
28+
## Usage
29+
30+
### Manual Screenshot Generation
31+
32+
To generate a screenshot locally:
33+
34+
1. Install Playwright:
35+
```bash
36+
npm init -y
37+
npm install --save-dev @playwright/test
38+
npx playwright install --with-deps chromium
39+
```
40+
41+
2. Start a local HTTP server:
42+
```bash
43+
cd preview
44+
python3 -m http.server 8080
45+
```
46+
47+
3. Run the screenshot script:
48+
```bash
49+
node screenshot.js
50+
```
51+
52+
### Automated Screenshot Generation
53+
54+
The GitHub Actions workflow (`.github/workflows/generate-web-controller-preview.yml`) automatically:
55+
- Triggers on changes to web controller files
56+
- Generates a fresh screenshot
57+
- Uploads it as an artifact
58+
- Commits it back to the repository
59+
60+
You can also manually trigger the workflow from the GitHub Actions tab.
61+
62+
## Customization
63+
64+
To customize the preview appearance:
65+
1. Edit `standalone.html` to change the UI layout or styling
66+
2. Edit `camera-placeholder.svg` to change the placeholder image
67+
3. Run the screenshot generation process to create a new preview
68+
69+
## Integration
70+
71+
The preview image is referenced in:
72+
- `LifeTrac-v25/README.md` - Main documentation
73+
- GitHub repository preview for the web controller feature

0 commit comments

Comments
 (0)