Skip to content

Commit 4a3da36

Browse files
committed
init
1 parent 0375af3 commit 4a3da36

23 files changed

Lines changed: 5009 additions & 1 deletion

.github/workflows/deploy.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Deploy to GitHub Pages
2+
3+
on:
4+
push:
5+
branches: [main]
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
10+
pages: write
11+
id-token: write
12+
13+
concurrency:
14+
group: pages
15+
cancel-in-progress: true
16+
17+
jobs:
18+
build:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v4
22+
23+
- uses: actions/setup-node@v4
24+
with:
25+
node-version: 22
26+
cache: npm
27+
28+
- name: Install dependencies
29+
run: npm ci
30+
31+
- name: Build
32+
run: npm run build
33+
34+
- uses: actions/upload-pages-artifact@v3
35+
with:
36+
path: dist
37+
38+
deploy:
39+
needs: build
40+
runs-on: ubuntu-latest
41+
environment:
42+
name: github-pages
43+
url: ${{ steps.deployment.outputs.page_url }}
44+
steps:
45+
- id: deployment
46+
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
node_modules/
2+
dist/
3+
.claude/
4+
.DS_Store

.idea/.gitignore

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

.idea/modules.xml

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

.idea/portfolio-react.iml

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

README.md

Lines changed: 101 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,101 @@
1-
# personal-portfolio
1+
# Adam Gasiorek — Portfolio
2+
3+
An interactive terminal-style portfolio. The background is a 3D model rendered
4+
in real time as ASCII art (three.js + `AsciiEffect`), and the foreground is a
5+
fake shell — type `help` to explore. It includes an interactive world map of
6+
visited countries.
7+
8+
**Live:** deployed to GitHub Pages via GitHub Actions on every push to `main`.
9+
10+
## Tech stack
11+
12+
| What | Why |
13+
| --- | --- |
14+
| [React 19](https://react.dev) | The standard UI library; the app is a single-page app with purely client-side state. |
15+
| [Vite](https://vite.dev) | Fast dev server and a zero-config static build — exactly what GitHub Pages needs. |
16+
| [TypeScript](https://www.typescriptlang.org) (strict) | Type safety across the three.js imperative code and React components. |
17+
| [Tailwind CSS](https://tailwindcss.com) | All styling is utility classes; no component CSS files to maintain. |
18+
| [three.js](https://threejs.org) | Loads the STL model and renders it through `AsciiEffect` into a live ASCII table. |
19+
20+
> This project started as a Deno Fresh (Preact islands) app. It was rewritten
21+
> as a plain React + Vite SPA because the site has no server-side logic at
22+
> all — everything happens in the browser — and a static bundle is the
23+
> simplest thing that can be hosted on GitHub Pages for free.
24+
25+
## Project structure
26+
27+
```
28+
├── index.html # Single HTML entry point
29+
├── public/ # Static assets copied verbatim to the build
30+
│ ├── favicon.svg
31+
│ ├── models/model.stl # Default 3D model shown on load
32+
│ └── world.svg # World map used by the `world` command
33+
├── src/
34+
│ ├── main.tsx # React bootstrap
35+
│ ├── App.tsx # Composition + terminal command processor
36+
│ ├── index.css # Tailwind entry + global styles
37+
│ ├── components/
38+
│ │ ├── AsciiBackground.tsx # three.js scene, ASCII effect, imperative API
39+
│ │ ├── Terminal.tsx # Fake shell (prompt, output, input)
40+
│ │ └── WorldPanel.tsx # Visited-countries map with pan/zoom
41+
│ └── data/
42+
│ └── visitedCountries.ts # Country lists + continent mapping
43+
└── .github/workflows/deploy.yml # Build & deploy to GitHub Pages
44+
```
45+
46+
### How it works
47+
48+
- **`AsciiBackground`** owns the whole three.js world (scene, camera, STL
49+
loader, point light, `AsciiEffect`). React state would be too slow (and
50+
irrelevant) for a 60 fps render loop, so the entire scene lives inside a
51+
single `useEffect` and never touches React state. The model spins slowly,
52+
the light orbits on mobile, and the scene is draggable via `OrbitControls`.
53+
- **`App`** is the only stateful coordinator: it parses terminal commands and
54+
updates the terminal output and the world panel visibility.
55+
- **`Terminal`** is purely presentational — it renders the prompt/output and
56+
reports submitted commands upward. URLs in output become clickable links.
57+
- **`WorldPanel`** fetches `world.svg`, highlights visited countries by ISO
58+
code (with a few selector overrides for countries the SVG names
59+
differently), and implements pan/zoom by mutating the SVG `viewBox` — no map
60+
library needed. The wheel listener is attached natively because React
61+
registers `wheel` as passive, which would break `preventDefault()`.
62+
63+
## Development
64+
65+
Requires Node.js 20+.
66+
67+
```bash
68+
npm install
69+
npm run dev # dev server with HMR
70+
npm run build # type-check + production build into dist/
71+
npm run preview # serve the production build locally
72+
```
73+
74+
## Deployment (GitHub Pages)
75+
76+
Deployment is fully automated by
77+
[`.github/workflows/deploy.yml`](.github/workflows/deploy.yml): every push to
78+
`main` builds the site and publishes `dist/` with the official
79+
`actions/deploy-pages` action.
80+
81+
One-time setup: in the repository go to **Settings → Pages** and set
82+
**Source** to **GitHub Actions**.
83+
84+
Two details make the build GitHub Pages-friendly:
85+
86+
1. **Relative base path**`base: "./"` in [`vite.config.ts`](vite.config.ts)
87+
makes all asset URLs relative, so the same build works at
88+
`https://<user>.github.io/<repo>/` (a sub-path) as well as at a custom
89+
domain root. No hardcoded repository name anywhere.
90+
2. **Runtime asset URLs** — files loaded at runtime (`model.stl`,
91+
`world.svg`) are resolved through `import.meta.env.BASE_URL` instead of
92+
absolute `/` paths for the same reason.
93+
94+
## Terminal commands
95+
96+
| Command | Description |
97+
| --- | --- |
98+
| `help` | list all commands |
99+
| `world` | open the visited-countries map |
100+
| `socials` | show social links |
101+
| `clear` | clear terminal output |

index.html

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<meta
6+
name="viewport"
7+
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"
8+
/>
9+
<meta
10+
name="description"
11+
content="Adam Gasiorek — creative developer. Interactive terminal portfolio with a real-time ASCII-rendered 3D model."
12+
/>
13+
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
14+
<title>Adam Gasiorek</title>
15+
</head>
16+
<body>
17+
<div id="root"></div>
18+
<script type="module" src="/src/main.tsx"></script>
19+
</body>
20+
</html>

0 commit comments

Comments
 (0)