# Frontend Structure This folder contains the modular frontend components for Screenshot Studio. ## Directory Structure ``` static/ ├── css/ │ └── styles.css # Main stylesheet with all UI components ├── js/ │ ├── navigation.js # Navigation, tabs, and UI controls │ ├── text-to-image.js # Text to Image tool functionality │ ├── html-to-image.js # HTML to Image tool functionality │ └── utils.js # Shared utility functions └── README.md # This file ``` ## File Descriptions ### CSS - **styles.css**: Contains all styles including: - Layout (sidebar, main content) - Components (buttons, forms, cards) - Utilities (loading, alerts, grids) - Responsive design ### JavaScript Modules #### navigation.js - Tool switching between Text to Image and HTML to Image - Advanced settings toggle - Reset to defaults functionality - HTML tab switching (paste/upload) - File upload handler #### text-to-image.js - Handles text input processing - Collects all settings (output, advanced) - Makes API call to `/generate` endpoint - Error handling and loading states #### html-to-image.js - Handles HTML input (paste or upload) - Makes API call to `/generate-html` endpoint - Error handling and loading states #### utils.js - `displayResults()`: Renders screenshot grid - Shared utility functions - Can be extended with more helpers ## Customization Guide ### Adding a New Tool 1. **Add navigation item** in `templates/index.html`: ```html
``` 2. **Add tool section** in `templates/index.html`: ```html