|
1 | | -# visual-assets |
| 1 | +# Visual Assets |
2 | 2 |
|
3 | | -Original format-ready visual assets for everyone |
| 3 | +Original format-ready visual assets for everyone. |
| 4 | + |
| 5 | +## Adding Assets |
| 6 | + |
| 7 | +**Important:** All assets must be placed inside the `assets/` directory only. |
| 8 | + |
| 9 | +### Directory Structure |
| 10 | + |
| 11 | +Place your assets in the appropriate subdirectory: |
| 12 | + |
| 13 | +- **Icons**: `assets/icons/` - Small icon files (typically SVG) |
| 14 | +- **Logos**: `assets/logos/` - Logo files (typically SVG) |
| 15 | +- **Images**: `assets/images/` - Image files (PNG, JPG, WebP, etc.) |
| 16 | + |
| 17 | +### Supported File Formats |
| 18 | + |
| 19 | +The following formats are supported: |
| 20 | + |
| 21 | +- **SVG** (recommended for icons and logos) - Vector format, scalable without quality loss |
| 22 | +- **PNG** - Raster format with transparency support |
| 23 | +- **JPG/JPEG** - Raster format, smaller file size, no transparency |
| 24 | +- **WebP** - Modern raster format with excellent compression |
| 25 | + |
| 26 | +### Format Conversion |
| 27 | + |
| 28 | +All assets can be converted between supported formats directly in the browser using the asset gallery interface. The conversion is performed client-side using the browser's Canvas API. |
| 29 | + |
| 30 | +**Conversion Matrix:** |
| 31 | + |
| 32 | +| From → To | PNG | JPG | WebP | SVG | |
| 33 | +|-----------|-----|-----|------|-----| |
| 34 | +| **SVG** | ✅ | ✅ | ✅ | ✅ (original) | |
| 35 | +| **PNG** | ✅ (original) | ✅ | ✅ | ⚠️ (embedded) | |
| 36 | +| **JPG** | ✅ | ✅ (original) | ✅ | ⚠️ (embedded) | |
| 37 | +| **WebP** | ✅ | ✅ | ✅ (original) | ⚠️ (embedded) | |
| 38 | + |
| 39 | +**Notes:** |
| 40 | + |
| 41 | +- ✅ **Full conversion** - Maintains quality and dimensions |
| 42 | +- ⚠️ **Embedded conversion** - Raster images embedded in SVG (not true vector conversion) |
| 43 | +- SVG to raster conversions maintain quality at the original size |
| 44 | +- Raster to raster conversions preserve image dimensions |
| 45 | +- Use the copy/download buttons in the asset gallery to access different formats |
| 46 | +- Conversions are performed on-demand in your browser (no server processing) |
| 47 | + |
| 48 | +### Example |
| 49 | + |
| 50 | +To add a new icon: |
| 51 | + |
| 52 | +1. Place your file in `assets/icons/your-icon-name.svg` |
| 53 | +2. Commit and push to the repository |
| 54 | +3. The system will automatically update `assets.json` (see below) |
| 55 | + |
| 56 | +## Automatic Asset Registration |
| 57 | + |
| 58 | +**`assets.json` is updated programmatically** - you should not edit it manually. |
| 59 | + |
| 60 | +When you add, modify, or remove files in the `assets/` directory: |
| 61 | + |
| 62 | +1. A GitHub Action workflow automatically scans the filesystem |
| 63 | +2. Extracts metadata (name, type, tags, size) from your files |
| 64 | +3. Generates or updates `assets.json` automatically |
| 65 | +4. Commits the changes back to the repository |
| 66 | + |
| 67 | +The system automatically: |
| 68 | + |
| 69 | +- Extracts tags from filenames (e.g., `aws-black-orange-icon.svg` → tags: `["aws", "black", "orange", "icon"]`) |
| 70 | +- Determines asset type from directory (`icons/` → `icon`, `logos/` → `logo`) |
| 71 | +- Extracts size information from SVG files (viewBox or width/height attributes) |
| 72 | +- Generates descriptions based on filename and metadata |
| 73 | + |
| 74 | +## Direct Asset URLs |
| 75 | + |
| 76 | +Assets are automatically made available at shorter, direct URLs: |
| 77 | + |
| 78 | +- Icons: `https://assets.awsug.nz/icons/filename.svg` |
| 79 | +- Logos: `https://assets.awsug.nz/logos/filename.svg` |
| 80 | +- Images: `https://assets.awsug.nz/images/filename.png` |
| 81 | + |
| 82 | +For example: |
| 83 | + |
| 84 | +- `assets/icons/aws-black-orange.svg` → `https://assets.awsug.nz/icons/aws-black-orange.svg` |
| 85 | +- `assets/logos/datacom-primary-blue.svg` → `https://assets.awsug.nz/logos/datacom-primary-blue.svg` |
| 86 | + |
| 87 | +**Full URL format:** All assets can be accessed using the full URL path: |
| 88 | + |
| 89 | +- `https://assets.awsug.nz/icons/aws-black-orange.svg` |
| 90 | +- `https://assets.awsug.nz/logos/datacom-primary-blue.svg` |
| 91 | +- `https://assets.awsug.nz/images/your-image.png` |
| 92 | + |
| 93 | +These URLs are created automatically during deployment - no manual configuration needed. |
| 94 | + |
| 95 | +## Usage |
| 96 | + |
| 97 | +### Direct Image Links |
| 98 | + |
| 99 | +You can link directly to any asset using its direct URL: |
| 100 | + |
| 101 | +**Icons:** |
| 102 | + |
| 103 | +- `https://assets.awsug.nz/icons/aws-black-orange.svg` |
| 104 | +- `https://assets.awsug.nz/icons/aws-blue-orange.svg` |
| 105 | + |
| 106 | +**Logos:** |
| 107 | + |
| 108 | +- `https://assets.awsug.nz/logos/aws-black-orange-sphere.svg` |
| 109 | +- `https://assets.awsug.nz/logos/datacom-primary-blue.svg` |
| 110 | + |
| 111 | +**Images:** |
| 112 | + |
| 113 | +- `https://assets.awsug.nz/images/your-image.png` |
| 114 | + |
| 115 | +### In HTML |
| 116 | + |
| 117 | +Embed an image directly: |
| 118 | + |
| 119 | +```html |
| 120 | +<img src="https://assets.awsug.nz/icons/aws-black-orange.svg" alt="AWS Icon"> |
| 121 | +``` |
| 122 | + |
| 123 | +Link to an image (opens in new tab): |
| 124 | + |
| 125 | +```html |
| 126 | +<a href="https://assets.awsug.nz/icons/aws-black-orange.svg" target="_blank"> |
| 127 | + View AWS Icon |
| 128 | +</a> |
| 129 | +``` |
| 130 | + |
| 131 | +### In Markdown |
| 132 | + |
| 133 | +Display an image: |
| 134 | + |
| 135 | +```markdown |
| 136 | + |
| 137 | +``` |
| 138 | + |
| 139 | +Link to an image: |
| 140 | + |
| 141 | +```markdown |
| 142 | +[View AWS Icon](https://assets.awsug.nz/icons/aws-black-orange.svg) |
| 143 | +``` |
| 144 | + |
| 145 | +### In CSS |
| 146 | + |
| 147 | +Use as background image: |
| 148 | + |
| 149 | +```css |
| 150 | +background-image: url('https://assets.awsug.nz/logos/datacom-primary-blue.svg'); |
| 151 | +``` |
| 152 | + |
| 153 | +### In React/JSX |
| 154 | + |
| 155 | +```jsx |
| 156 | +<img src="https://assets.awsug.nz/icons/aws-black-orange.svg" alt="AWS Icon" /> |
| 157 | +``` |
| 158 | + |
| 159 | +### Download Links |
| 160 | + |
| 161 | +You can also use these URLs as download links: |
| 162 | + |
| 163 | +```html |
| 164 | +<a href="https://assets.awsug.nz/icons/aws-black-orange.svg" download> |
| 165 | + Download AWS Icon |
| 166 | +</a> |
| 167 | +``` |
| 168 | + |
| 169 | +## License |
| 170 | + |
| 171 | +Use responsibly and according to their respective licenses. |
0 commit comments