You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
*`data-translate-alt="key"`: Updates the **alt** attribute (essential for images and accessibility).
20
-
*`data-translate-html="key"`: Updates **innerHTML** (supported, currently unused).
21
-
***SEO/Metadata:** The system dynamically updates the page `<title>`, `<meta name="description">`, and Open Graph (`og:title`, `og:description`) tags on language change.
22
-
***Performance:** Translations are loaded **asynchronously** (`async/await`) using the native `fetch` API.
15
+
-**Logic:** Language priority is checked in this order: **Local Storage (key: 'language') → Browser Language → Fallback to English**.
16
+
-**Data Structure:** Translations are stored in flat JSON files within the `/locales/` directory (e.g., `en.json`, `role`).
17
+
-**HTML Attributes:** Elements are updated using custom `data-translate` attributes:
-`data-translate-alt="key"`: Updates the **alt** attribute (essential for images and accessibility).
20
+
-`data-translate-html="key"`: Updates **innerHTML** (supported, currently unused).
21
+
-**SEO/Metadata:** The system dynamically updates the page `<title>`, `<meta name="description">`, and Open Graph (`og:title`, `og:description`) tags on language change.
22
+
-**Performance:** Translations are loaded **asynchronously** (`async/await`) using the native `fetch` API.
23
23
24
24
### Custom Dropdown (`js/custom-select.js`)
25
25
26
26
This file implements the styled dropdown menu for language selection.
27
27
28
-
***UI Implementation:** Uses vanilla JavaScript to handle dropdown toggle and visual state management (`.open`, `.selected` classes).
29
-
***Integration:** It integrates with the translation system by calling **`setLanguage(lang)`** from `translations.js` upon selection.
30
-
***Language Names:** Display names (e.g., 'English', 'Español') are hardcoded in the `languageNames` object within this file.
28
+
-**UI Implementation:** Uses vanilla JavaScript to handle dropdown toggle and visual state management (`.open`, `.selected` classes).
29
+
-**Integration:** It integrates with the translation system by calling **`setLanguage(lang)`** from `translations.js` upon selection.
30
+
-**Language Names:** Display names (e.g., 'English', 'Español') are hardcoded in the `languageNames` object within this file.
31
31
32
32
### CSS Architecture (`css/style.css`)
33
33
34
34
The CSS follows a well-organized structure with clear separation of concerns.
35
35
36
-
***Color Scheme:** Uses **CSS Variables** defined in `:root` (e.g., `--clr-navy`, `--clr-linkedin`) for easy theme consistency.
37
-
***Icon Styling Pattern:** Icons (SVGs) use CSS filters for color manipulation across different states:
38
-
* White icon on dark background: `filter: brightness(0) invert(1)`
39
-
* Dark icon on light background: `filter: brightness(0) invert(0)`
40
-
***Visual Pattern:** Elements like the language selector implement a "Glassmorphism" effect using `rgba()` combined with `backdrop-filter: blur(10px)`.
41
-
***Responsiveness:** Mobile-first approach using Bootstrap utility classes and media queries for specific adjustments below 992px and 576px.
36
+
-**Color Scheme:** Uses **CSS Variables** defined in `:root` (e.g., `--clr-navy`, `--clr-linkedin`) for easy theme consistency.
37
+
-**Icon Styling Pattern:** Icons (SVGs) use CSS filters for color manipulation across different states:
38
+
- White icon on dark background: `filter: brightness(0) invert(1)`
39
+
- Dark icon on light background: `filter: brightness(0) invert(0)`
40
+
-**Visual Pattern:** Elements like the language selector implement a "Glassmorphism" effect using `rgba()` combined with `backdrop-filter: blur(10px)`.
41
+
-**Responsiveness:** Mobile-first approach using Bootstrap utility classes and media queries for specific adjustments below 992px and 576px.
42
42
43
43
---
44
44
45
45
## Conventions & Development Workflow
46
46
47
47
### Development Setup
48
48
49
-
| Task | Detail |
50
-
| :--- | :--- |
51
-
|**Cross-Platform**| Developed and maintained across **Linux, Windows, and macOS**. |
52
-
|**Dependencies**| Requires **Node.js/NPM** to run development tooling (Jest). The core site is dependency-free. |
53
-
|**Local Testing**| The project is static: open `index.html` in the browser or use a simple HTTP server. |
54
-
|**Deployment**| Git push to the main branch auto-deploys via GitHub Pages. |
0 commit comments