Skip to content

Commit 0113194

Browse files
committed
layout refactoring
1 parent 9d82c5b commit 0113194

11 files changed

Lines changed: 226 additions & 123 deletions

File tree

GEMINI.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Only use tailwindcss v4 which is already installed and svelte.
2+
Do not make decisions that are not based on modern web design standards. Keep typography clean and pretty.
3+
Do not change the textual content of the site unless told otherwise.
4+
Keep the UI elements pretty and nice to look at. Make sure navigation is fun and intuitive, and that it does not strain the viewer's eyes.
5+
Do not make absolute statements about the user or their experience.

package.json

Lines changed: 26 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,28 @@
11
{
2-
"name": "kylee-interactive-resume",
3-
"private": true,
4-
"version": "0.0.1",
5-
"type": "module",
6-
"scripts": {
7-
"dev": "vite dev",
8-
"build": "vite build",
9-
"preview": "vite preview",
10-
"prepare": "svelte-kit sync || echo ''",
11-
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
12-
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch"
13-
},
14-
"devDependencies": {
15-
"@sveltejs/adapter-static": "^3.0.8",
16-
"@sveltejs/kit": "^2.16.0",
17-
"@sveltejs/vite-plugin-svelte": "^5.0.0",
18-
"@tailwindcss/typography": "^0.5.16",
19-
"@tailwindcss/vite": "^4.0.0",
20-
"@types/node": "^24.0.12",
21-
"svelte": "^5.0.0",
22-
"svelte-check": "^4.0.0",
23-
"tailwindcss": "^4.0.0",
24-
"typescript": "^5.0.0",
25-
"vite": "^6.2.6"
26-
},
27-
"dependencies": {
28-
"@catppuccin/tailwindcss": "^1.0.0-beta.1"
29-
}
2+
"name": "kylee-interactive-resume",
3+
"private": true,
4+
"version": "0.0.1",
5+
"type": "module",
6+
"scripts": {
7+
"dev": "vite dev",
8+
"build": "vite build",
9+
"preview": "vite preview",
10+
"prepare": "svelte-kit sync || echo ''",
11+
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
12+
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch"
13+
},
14+
"devDependencies": {
15+
"@sveltejs/adapter-static": "^3.0.8",
16+
"@sveltejs/kit": "^2.16.0",
17+
"@sveltejs/vite-plugin-svelte": "^5.0.0",
18+
"@tailwindcss/typography": "^0.5.16",
19+
"@tailwindcss/vite": "^4.0.0",
20+
"@types/node": "^24.0.12",
21+
"svelte": "^5.0.0",
22+
"svelte-check": "^4.0.0",
23+
"tailwindcss": "^4.0.0",
24+
"typescript": "^5.0.0",
25+
"@catppuccin/tailwindcss": "^1.0.0-beta.1",
26+
"vite": "^6.2.6"
27+
}
3028
}

src/app.css

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@import url('https://fonts.googleapis.com/css2?family=Old+Standard+TT&display=swap');
1+
@import url("https://fonts.googleapis.com/css2?family=Old+Standard+TT&display=swap");
22

33
* {
44
box-sizing: border-box;
@@ -25,6 +25,6 @@ html {
2525

2626
/* Ensure main content area scrolls independently */
2727
main {
28-
overflow-y: auto;
29-
-webkit-overflow-scrolling: touch; /* For smooth scrolling on iOS */
28+
overflow-y: auto;
29+
-webkit-overflow-scrolling: touch; /* For smooth scrolling on iOS */
3030
}

src/app.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
<meta charset="utf-8" />
55
<link rel="icon" href="%sveltekit.assets%/favicon.svg" />
66
<meta name="viewport" content="width=device-width, initial-scale=1" />
7+
<link href="/src/app.css" rel="stylesheet" />
78
%sveltekit.head%
89
</head>
910
<body data-sveltekit-preload-data="hover" class="bg-ctp-base text-ctp-text">

src/lib/components/Header.svelte

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<script>
2+
import ThemeSwitch from "./ThemeSwitch.svelte";
3+
import LangToggle from "./LangToggle.svelte";
4+
</script>
5+
6+
<header class="fixed top-0 left-0 right-0 z-50 bg-ctp-base p-4 flex justify-between items-center shadow-lg" dir="ltr">
7+
<a href="/" aria-label="Homepage">
8+
<img src="/favicon.svg" alt="Logo" class="h-8 w-8">
9+
</a>
10+
<div class="flex items-center gap-4">
11+
<ThemeSwitch />
12+
<LangToggle />
13+
</div>
14+
</header>

src/lib/components/Journal.svelte

Lines changed: 112 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,121 @@
11
<script>
2-
import { t } from "$lib/stores/language.js";
3-
import ThemeSwitch from "./ThemeSwitch.svelte";
2+
import { t } from '$lib/stores/language.js';
3+
import { onMount } from 'svelte';
44
5-
export let quests = [
6-
{ href: "#about", text: "nav.about" },
7-
{ href: "#skills", text: "nav.skills" },
8-
{ href: "#experience", text: "nav.experience" },
9-
{ href: "#projects", text: "nav.projects" },
10-
{ href: "#education", text: "nav.education" },
11-
];
5+
export let quests = [
6+
{ href: '#about', text: 'nav.about', icon: 'M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z', style: '' },
7+
{ href: '#skills', text: 'nav.skills', icon: 'M5 13.18v4L12 21l7-3.82v-4L12 17l-7-3.82zM12 3L1 9l11 6 9-4.91V17h2V9L12 3z', style: '' },
8+
{ href: '#experience', text: 'nav.experience', icon: 'M20 6h-4V4c0-1.11-.89-2-2-2h-4c-1.11 0-2 .89-2 2v2H4c-1.11 0-1.99.89-1.99 2L2 19c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V8c0-1.11-.89-2-2-2zm-6 0h-4V4h4v2z', style: '' },
9+
{ href: '#projects', text: 'nav.projects', icon: 'M4 6H2v14c0 1.1.9 2 2 2h14v-2H4V6zm16-4H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-1 9h-4v4h-2v-4H9V9h4V5h2v4h4v2z', style: '' },
10+
{ href: '#education', text: 'nav.education', icon: 'M5 13.18v4L12 21l7-3.82v-4L12 17l-7-3.82zM12 3L1 9l11 6 9-4.91V17h2V9L12 3z', style: '' }
11+
];
1212
13-
let selectedQuest = quests[0].href;
13+
let selectedQuest = quests[0].href;
14+
/**
15+
* @type {IntersectionObserver}
16+
*/
17+
let observer;
1418
15-
/**
16-
* @param {string} href
17-
*/
18-
function selectQuest(href) {
19-
selectedQuest = href;
20-
}
19+
onMount(() => {
20+
quests = quests.map(q => ({
21+
...q,
22+
style: `transform: rotate(${(Math.random() - 0.5) * 5}deg); margin-left: ${Math.random() * 20}px;`
23+
}));
24+
25+
const sections = document.querySelectorAll('section[id]');
26+
observer = new IntersectionObserver(
27+
(entries) => {
28+
entries.forEach((entry) => {
29+
if (entry.isIntersecting) {
30+
selectedQuest = `#${entry.target.id}`;
31+
}
32+
});
33+
},
34+
{ rootMargin: '-50% 0px -50% 0px' }
35+
);
36+
37+
sections.forEach((section) => {
38+
observer.observe(section);
39+
});
40+
41+
return () => {
42+
sections.forEach((section) => {
43+
observer.unobserve(section);
44+
});
45+
};
46+
});
47+
48+
/**
49+
* @param {HTMLAnchorElement} node
50+
*/
51+
function smoothScroll(node) {
52+
/**
53+
* @param {MouseEvent} event
54+
*/
55+
function handleClick(event) {
56+
event.preventDefault();
57+
const href = node.href;
58+
const id = href.substring(href.indexOf('#'));
59+
const target = document.querySelector(id);
60+
if (target) {
61+
target.scrollIntoView({ behavior: 'smooth' });
62+
}
63+
}
64+
65+
node.addEventListener('click', handleClick);
66+
67+
return {
68+
destroy() {
69+
node.removeEventListener('click', handleClick);
70+
}
71+
};
72+
}
2173
</script>
2274

2375
<aside
24-
class="bg-ctp-latte border-2 border-ctp-mocha rounded-lg p-6 shadow-xl m-5 w-96 flex-shrink-0 overflow-y-auto max-h-[calc(100vh-40px)] sticky top-5 font-serif text-ctp-text dark:bg-ctp-crust dark:border-ctp-mocha dark:text-ctp-text md:w-auto md:m-2.5"
76+
class="bg-ctp-crust border-2 border-ctp-surface0 rounded-lg p-6 shadow-xl m-5 sticky top-24 h-[calc(100vh-12rem)] overflow-y-auto font-serif text-ctp-text"
2577
>
26-
<div class="flex justify-between items-center mb-4">
27-
<h1 class="text-3xl font-bold text-ctp-text drop-shadow-md">
28-
{$t("name")}
29-
</h1>
30-
<ThemeSwitch />
31-
</div>
32-
<div class="text-center mb-6 border-b border-dashed border-ctp-mocha pb-3">
33-
<h2 class="text-2xl font-bold text-ctp-text drop-shadow-md">
34-
{$t("journal.title")}
35-
</h2>
36-
</div>
37-
<ul class="list-none p-0 m-0">
38-
{#each quests as quest, i}
39-
<li
40-
class="mb-3 p-3 bg-ctp-base/30 rounded-md transition-colors hover:bg-ctp-base/50"
41-
class:completed={selectedQuest === quest.href}
42-
>
43-
<a
44-
href={quest.href}
45-
on:click={() => selectQuest(quest.href)}
46-
class="flex items-center no-underline text-ctp-text text-xl"
47-
>
48-
<span
49-
class="w-5 h-5 border-2 rounded-full mr-3 bg-transparent transition-all"
50-
class:border-ctp-green={selectedQuest === quest.href}
51-
class:bg-ctp-green={selectedQuest === quest.href}
52-
class:border-ctp-mocha={selectedQuest !== quest.href}
53-
></span>
54-
<span
55-
class="flex-grow"
56-
class:line-through={selectedQuest === quest.href}
57-
class:text-ctp-subtext0={selectedQuest === quest.href}
58-
>{$t(quest.text)}</span
59-
>
60-
</a>
61-
</li>
62-
{/each}
63-
</ul>
78+
<div class="text-center mb-6">
79+
<h1 class="text-4xl font-bold text-ctp-text drop-shadow-md font-fantasy">{$t('name')}</h1>
80+
<h2 class="text-2xl text-ctp-subtext0 font-fantasy">{$t('journal.title')}</h2>
81+
</div>
82+
83+
<div class="relative py-4">
84+
<div class="absolute top-0 left-1/2 -translate-x-1/2 w-full h-px bg-ctp-surface2"></div>
85+
<svg width="100%" height="20" class="absolute top-0 left-0 right-0">
86+
<path d="M0 10 Q 5 0, 10 10 T 20 10 T 30 10 T 40 10 T 50 10 T 60 10 T 70 10 T 80 10 T 90 10 T 100 10" stroke="var(--ctp-surface2)" stroke-width="2" fill="none" />
87+
</svg>
88+
</div>
89+
90+
<ul class="list-none p-0 m-0 space-y-4">
91+
{#each quests as quest}
92+
<li style={quest.style}>
93+
<a
94+
href={quest.href}
95+
use:smoothScroll
96+
class="flex items-center no-underline text-ctp-text text-lg p-3 rounded-lg transition-all duration-300"
97+
class:bg-ctp-surface0={selectedQuest === quest.href}
98+
class:text-ctp-mauve={selectedQuest === quest.href}
99+
class:hover:bg-ctp-surface1={selectedQuest !== quest.href}
100+
>
101+
<svg class="w-6 h-6 mr-4 fill-current" viewBox="0 0 24 24">
102+
<path d={quest.icon}></path>
103+
</svg>
104+
<span class="flex-grow font-semibold">{$t(quest.text)}</span>
105+
<div class="w-3 h-3 rounded-full border-2 transition-all"
106+
class:border-ctp-green={selectedQuest === quest.href}
107+
class:bg-ctp-green={selectedQuest === quest.href}
108+
class:border-ctp-surface2={selectedQuest !== quest.href}>
109+
</div>
110+
</a>
111+
</li>
112+
{/each}
113+
</ul>
114+
115+
<div class="relative py-4 mt-4">
116+
<div class="absolute bottom-0 left-1/2 -translate-x-1/2 w-full h-px bg-ctp-surface2"></div>
117+
<svg width="100%" height="20" class="absolute bottom-0 left-0 right-0">
118+
<path d="M0 10 Q 5 20, 10 10 T 20 10 T 30 10 T 40 10 T 50 10 T 60 10 T 70 10 T 80 10 T 90 10 T 100 10" stroke="var(--ctp-surface2)" stroke-width="2" fill="none" />
119+
</svg>
120+
</div>
64121
</aside>

src/lib/components/LangToggle.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
}
66
</script>
77

8-
<div class="absolute top-4 right-4 flex items-center gap-4" dir="ltr">
8+
<div class="flex items-center gap-4" dir="ltr">
99
<button
1010
on:click={toggleLanguage}
1111
class="text-sm font-bold text-ctp-subtext0 transform transition-transform duration-200 hover:scale-110 active:scale-95"

src/lib/components/ThemeSwitch.svelte

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<div dir="ltr">
1010
<button on:click={toggleTheme} aria-label="Toggle theme"
1111
><div class="tdnn" class:day={$theme === "light"}>
12-
<div class="moon" class:sun={$theme === "dark"}></div>
12+
<div class="moon" class:sun={$theme === "light"}></div>
1313
</div>
1414
</button>
1515
</div>
@@ -28,15 +28,14 @@
2828
--bgColor--night: #423966;
2929
--toggleBtn-bgColor--night: var(--bgColor--night);
3030
--mooncolor: #d9fbff;
31-
--bgColor--day: #9ee3fb;
31+
--bgColor--day: #fab387;
3232
--toggleBtn-bgColor--day: var(--bgColor--day);
3333
}
3434
3535
.tdnn {
3636
margin: 0 auto;
3737
/*change size of toggle with font-size*/
38-
font-size: 30%;
39-
margin-top: 10em;
38+
font-size: 15%;
4039
position: relative;
4140
height: var(--toggleHeight);
4241
width: var(--toggleWidth);
@@ -68,6 +67,10 @@
6867
rgba(255, 255, 255, 0.1) -4em 7em 0 -4.5em,
6968
rgba(255, 255, 255, 0.1) -1em 10em 0 -4.5em;
7069
}
70+
71+
.day {
72+
background: #ffbf71;
73+
}
7174
.sun {
7275
top: 4.5em;
7376
left: 18em;

src/routes/+layout.svelte

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,30 @@
44
import { language } from "$lib/stores/language.js";
55
import Journal from "$lib/components/Journal.svelte";
66
import Footer from "$lib/components/Footer.svelte";
7+
import Header from "$lib/components/Header.svelte";
78
89
theme.init();
910
language.init();
1011
</script>
1112

12-
<div class="bg-ctp-base text-ctp-text transition-colors duration-300 {$language === 'he' ? 'lang-he' : 'lang-en'} flex min-h-screen" dir={$language === "he" ? "rtl" : "ltr"}>
13-
<Journal />
14-
<div class="flex-grow flex flex-col container mx-auto px-4">
15-
<main class="prose lg:prose-xl max-w-none flex-grow py-8">
16-
<slot />
17-
</main>
18-
<Footer />
19-
</div>
13+
<div
14+
class="bg-ctp-base text-ctp-text transition-colors duration-300 {$language ===
15+
'he'
16+
? 'lang-he'
17+
: 'lang-en'} min-h-screen flex flex-col"
18+
dir={$language === "he" ? "rtl" : "ltr"}
19+
>
20+
<Header />
21+
<div class="flex-grow grid grid-cols-1 md:grid-cols-[1fr_3fr] gap-8 px-4">
22+
<!-- Sidebar -->
23+
<aside class="md:sticky top-24 h-full">
24+
<Journal />
25+
</aside>
26+
27+
<!-- Main Content -->
28+
<main class="prose lg:prose-xl max-w-none flex-grow py-8 overflow-y-auto">
29+
<slot />
30+
<Footer />
31+
</main>
32+
</div>
2033
</div>

src/routes/+page.svelte

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,23 @@
88
</script>
99

1010
<Hero />
11-
<About />
11+
12+
<section id="about" class="py-8">
13+
<About />
14+
</section>
1215
<div class="my-8 border-t border-ctp-surface1"></div>
13-
<Skills />
16+
<section id="skills" class="py-8">
17+
<Skills />
18+
</section>
1419
<div class="my-8 border-t border-ctp-surface1"></div>
15-
<Experience />
20+
<section id="experience" class="py-8">
21+
<Experience />
22+
</section>
1623
<div class="my-8 border-t border-ctp-surface1"></div>
17-
<Projects />
24+
<section id="projects" class="py-8">
25+
<Projects />
26+
</section>
1827
<div class="my-8 border-t border-ctp-surface1"></div>
19-
<Education />
28+
<section id="education" class="py-8">
29+
<Education />
30+
</section>

0 commit comments

Comments
 (0)