Skip to content

Commit 53b71f3

Browse files
Bikram GoleBikram Gole
authored andcommitted
Fix contact typo and add theme e2e coverage
1 parent 1f80adc commit 53b71f3

8 files changed

Lines changed: 126 additions & 7 deletions

File tree

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node_modules/
2+
test-results/
3+
playwright-report/

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ I conceived this project to create a personal website that authentically represe
2020
My website incorporates a variety of interactive and engaging features: ✨
2121

2222
- **Multi-Page Navigation:** Seamless navigation across `Home`, `About`, and `Contact` sections.
23-
- **Dynamic Theme Engine:** A robust theme system offering multiple visual styles, including 'Liquid Glass' and 'Chaos' modes, with theme persistence across page transitions.
23+
- **Dynamic Theme Engine:** A robust theme system offering multiple visual styles, including `Liquid Glass` and `Black Flag Uprising`, with theme persistence across page transitions.
2424
- **Interactive Mini Terminal:** A functional command-line interface for enhanced user engagement.
2525
- **Persona Quiz Game:** An integrated game designed to interactively explore user personas.
2626
- **Live GitHub Repository Cards:** Displays real-time project information fetched from `github.com/DevXtechnic` via the GitHub API.
@@ -52,8 +52,8 @@ To set up and run my project on your local machine, follow these steps 👇:
5252

5353
1. **Clone the repository:**
5454
```bash
55-
git clone https://github.com/DevXtechnic/bikram-site.git
56-
cd bikram-site
55+
git clone https://github.com/DevXtechnic/DevXtechnic.github.io.git
56+
cd DevXtechnic.github.io
5757
```
5858
2. **Serve the files:**
5959
You can use a simple Python HTTP server 🐍:
@@ -66,7 +66,7 @@ To set up and run my project on your local machine, follow these steps 👇:
6666
## Developer Notes
6767

6868
- I included a `.nojekyll` file to ensure GitHub Pages serves files directly, bypassing Jekyll processing.
69-
- I manage theme state using `localStorage` to maintain your selected themes across sessions.
69+
- I manage theme state with URL `theme` parameters and `localStorage`, with explicit URL themes taking precedence.
7070
- I intentionally included over-engineered elements for demonstrative and exploratory purposes, reflecting my commitment to creative and technical experimentation. No regrets!
7171

7272
## Contributing

contact.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ <h3 class="contact-title">
133133
</h3>
134134
<p>Bikramgole.genius@keemail.me</p>
135135
</a>
136-
<a class="contact-item tilt" href="mailto:Develope.genius@gmail.com">
136+
<a class="contact-item tilt" href="mailto:Developer.genius@gmail.com">
137137
<h3 class="contact-title">
138138
<span class="contact-logo" aria-hidden="true">
139139
<svg class="mono-icon" viewBox="0 0 24 24" role="img" focusable="false">
@@ -142,7 +142,7 @@ <h3 class="contact-title">
142142
</span>
143143
Backup Email
144144
</h3>
145-
<p>Develope.genius@gmail.com</p>
145+
<p>Developer.genius@gmail.com</p>
146146
</a>
147147
<a class="contact-item tilt" href="https://github.com/DevXtechnic" target="_blank" rel="noopener noreferrer">
148148
<h3 class="contact-title">

package-lock.json

Lines changed: 75 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"scripts": {
3+
"test:e2e": "playwright test"
4+
},
5+
"devDependencies": {
6+
"@playwright/test": "^1.54.0"
7+
}
8+
}

playwright.config.mjs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { defineConfig } from "@playwright/test";
2+
3+
export default defineConfig({
4+
testDir: "./tests",
5+
webServer: {
6+
command: "python -m http.server 4173",
7+
url: "http://127.0.0.1:4173",
8+
reuseExistingServer: !process.env.CI,
9+
},
10+
use: {
11+
baseURL: "http://127.0.0.1:4173",
12+
},
13+
});

script.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -721,7 +721,7 @@ const personaQuizQuestions = [
721721
{ question: "In Black Flag theme, the hero gun appears on which side of title?", options: ["Left", "Right", "Both sides", "It is hidden"], answer: 0 },
722722
{ question: "Which mode label replaced the old Libertarian theme?", options: ["Paper Link", "Neo Blue", "Black Flag Uprising", "Blood Moon"], answer: 2 },
723723
{ question: "What vibe best matches this site?", options: ["Corporate dashboard", "Chaotic fun", "News portal", "Minimal blog"], answer: 1 },
724-
{ question: "Which email is marked as Primary in Contact?", options: ["Develope.genius@gmail.com", "Bikramgole.genius@keemail.me", "neo@matrix.com", "devx@proton.me"], answer: 1 },
724+
{ question: "Which email is marked as Primary in Contact?", options: ["Developer.genius@gmail.com", "Bikramgole.genius@keemail.me", "neo@matrix.com", "devx@proton.me"], answer: 1 },
725725
{ question: "What does the quiz do when current pool runs out?", options: ["Auto-download more", "Stops and asks reset/refresh", "Repeats previous 10", "Crashes intentionally"], answer: 1 },
726726
{ question: "Which page describes Identity Snapshot?", options: ["Home", "Contact", "About", "All pages"], answer: 2 },
727727
{ question: "Which section title includes the word Console?", options: ["Mission Console", "Open Channel", "Identity Snapshot", "Live GitHub"], answer: 0 },

tests/theme-precedence.spec.mjs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import { expect, test } from "@playwright/test";
2+
3+
const THEME_STORAGE_KEY = "neoThemeVariant.v1";
4+
5+
test("URL theme overrides stored theme and persists across navigation", async ({ page }) => {
6+
await page.goto("/index.html");
7+
await page.evaluate((key) => {
8+
window.localStorage.setItem(key, "paper");
9+
}, THEME_STORAGE_KEY);
10+
11+
await page.goto("/index.html?theme=blackflag");
12+
13+
await expect(page.locator("html")).toHaveAttribute("data-theme", "blackflag");
14+
await expect.poll(() => page.evaluate((key) => window.localStorage.getItem(key), THEME_STORAGE_KEY)).toBe("blackflag");
15+
16+
await page.getByRole("link", { name: "About" }).first().click();
17+
18+
await expect(page.locator("html")).toHaveAttribute("data-theme", "blackflag");
19+
await expect(page).toHaveURL(/about\.html\?theme=blackflag$/);
20+
});

0 commit comments

Comments
 (0)