Skip to content

Commit 9a1682a

Browse files
committed
polish projects page
1 parent 1b54dfb commit 9a1682a

File tree

7 files changed

+111
-93
lines changed

7 files changed

+111
-93
lines changed

lark-ui/src/lib/Button.svelte

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
<script lang="ts">
2+
const { label, disabled, icon = undefined }: {
3+
label: string;
4+
disabled: boolean;
5+
icon?: string;
6+
} = $props();
7+
</script>
8+
9+
<button class="submit-button" disabled={disabled}>
10+
<p>{label}</p>
11+
{#if icon}
12+
<img src="/icons/{icon}.svg" alt="icon" />
13+
{/if}
14+
</button>
15+
16+
<style>
17+
.submit-button {
18+
position: relative;
19+
font-family: "Moga", sans-serif;
20+
font-size: 48px;
21+
color: white;
22+
23+
background: #F24B4B;
24+
padding: 0 24px;
25+
26+
display: flex;
27+
align-items: center;
28+
justify-content: center;
29+
gap: 16px;
30+
31+
cursor: pointer;
32+
transition: background 0.2s;
33+
34+
height: 60px;
35+
}
36+
37+
.submit-button p {
38+
letter-spacing: -0.5px;
39+
line-height: 60px;
40+
text-align: center;
41+
42+
margin: 0;
43+
44+
translate: 0 3px;
45+
}
46+
47+
.submit-button:not(:disabled):hover {
48+
background: #f07575;
49+
}
50+
51+
.submit-button:disabled:hover {
52+
background: #b0b0b0;
53+
}
54+
55+
.submit-button:disabled {
56+
cursor: not-allowed;
57+
}
58+
</style>

lark-ui/src/lib/auth.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,10 @@ export type Project = {
4949
userId: string;
5050
projectTitle: string;
5151
projectType: 'personal_website' | 'platformer_game' | 'wildcard';
52-
projectDescription: string;
52+
description: string;
5353
createdAt: Date;
5454
updatedAt: Date;
55+
nowHackatimeHours: number | null;
5556
};
5657

5758
export async function createProject(data: {

lark-ui/src/routes/app/projects/+page.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
href={'/app/projects/' + project.projectId}
5050
/>
5151
{#if !user?.onboardComplete}
52-
<img alt="this is your project!" src="/your_project.png" style="width: 140px; margin-top: 0px" />
52+
<img alt="this is your project!" src="/handdrawn_text/your_project.png" style="width: 140px; margin-top: 0px" />
5353
{/if}
5454
</div>
5555
{/each}

lark-ui/src/routes/app/projects/[id]/+page.svelte

Lines changed: 44 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import { goto } from '$app/navigation';
66
import { getProject } from '$lib/auth';
77
import type { Project } from '$lib/auth';
8+
import Button from '$lib/Button.svelte';
89
910
let project = $state<Project | null>(null);
1011
let loading = $state(true);
@@ -51,31 +52,29 @@
5152
{:else if error}
5253
<div class="error">Error: {error}</div>
5354
{:else if project}
54-
<div class="project-content">
55+
<div class="project-overview">
5556
<div class="project-card-preview">
5657
<img src="/card-blah.svg" alt={project.projectTitle} />
5758
</div>
5859

59-
<div class="project-details">
60-
<h1 class="project-title">{project.projectTitle}</h1>
61-
62-
<p class="project-time">time spent: 2 hours</p>
63-
64-
<p class="project-description">
65-
{project.projectDescription}
66-
</p>
67-
68-
<div class="submit-section">
69-
<button class="submit-button" disabled={locked}>
70-
SUBMIT →
71-
{#if locked}
72-
<div class="lock-indicator">
73-
<img src="/lock-circle.svg" alt="Locked" class="lock-circle" />
74-
<img src="/lock-icon.svg" alt="Locked" class="lock-icon" />
75-
</div>
60+
<div class="project-content">
61+
<div class="project-details">
62+
<div class="project-heading">
63+
<h1 class="project-title">{project.projectTitle}</h1>
64+
{#if project.nowHackatimeHours}
65+
<h2 class="project-time">2 hours</h2>
7666
{/if}
77-
</button>
67+
</div>
68+
69+
<p class="project-description">
70+
{project.description}
71+
</p>
7872
</div>
73+
74+
<div class="submit-section">
75+
<Button label="LINK HACKATIME" disabled={false} icon="link" />
76+
<img alt="required!" src="/handdrawn_text/required.png" style="width: 140px;" />
77+
</div>
7978
</div>
8079
</div>
8180
{/if}
@@ -122,7 +121,7 @@
122121
color: #f24b4b;
123122
}
124123
125-
.project-content {
124+
.project-overview {
126125
display: flex;
127126
gap: 47px;
128127
}
@@ -138,27 +137,40 @@
138137
height: 100%;
139138
}
140139
140+
.project-content {
141+
display: flex;
142+
flex-direction: column;
143+
justify-content: space-between;
144+
}
145+
141146
.project-details {
142147
flex: 1;
143-
padding-top: 33px;
148+
}
149+
150+
.project-heading {
151+
display: flex;
152+
flex-direction: row;
153+
align-items: baseline;
154+
gap: 8px;
144155
}
145156
146157
.project-title {
147158
font-family: 'Moga', sans-serif;
148159
font-size: 90px;
149160
color: white;
150161
letter-spacing: -0.99px;
151-
margin: 0 0 10px 0;
152-
line-height: 1.5;
162+
margin: 0;
163+
line-height: 1;
153164
}
154165
155166
.project-time {
156-
font-family: 'PT Serif', serif;
157-
font-size: 32px;
167+
font-family: 'Moga', serif;
168+
font-size: 40px;
158169
color: white;
159170
letter-spacing: -0.352px;
160-
margin: 0 0 16px 0;
161-
line-height: 1.5;
171+
margin: 0;
172+
line-height: 1;
173+
padding-bottom: 2px;
162174
}
163175
164176
.project-description {
@@ -173,62 +185,15 @@
173185
174186
.submit-section {
175187
position: relative;
176-
}
177-
178-
.submit-button {
179-
position: relative;
180-
font-family: 'Moga', sans-serif;
181-
font-size: 48px;
182-
color: white;
183-
background: #9a9a9a;
184-
border: none;
185-
padding: 0;
186-
width: 227px;
187-
height: 67px;
188+
188189
display: flex;
189-
align-items: center;
190-
justify-content: center;
191-
letter-spacing: -0.528px;
192-
line-height: 1.5;
193-
cursor: pointer;
194-
transition: background 0.2s;
195-
}
196-
197-
.submit-button:not(:disabled):hover {
198-
background: #b0b0b0;
199-
}
200-
201-
.submit-button:disabled {
202-
cursor: not-allowed;
203-
}
204-
205-
.lock-indicator {
206-
position: absolute;
207-
top: -12px;
208-
right: -12px;
209-
width: 48px;
210-
height: 48px;
211-
z-index: 1;
212-
}
213-
214-
.lock-circle {
215-
position: absolute;
216-
inset: 0;
217-
width: 100%;
218-
height: 100%;
219-
}
220-
221-
.lock-icon {
222-
position: absolute;
223-
top: 50%;
224-
left: 50%;
225-
transform: translate(-50%, -50%);
226-
width: 24px;
227-
height: 24px;
190+
flex-direction: row;
191+
align-items: end;
192+
gap: 4px;
228193
}
229194
230195
@media (max-width: 1024px) {
231-
.project-content {
196+
.project-overview {
232197
flex-direction: column;
233198
}
234199
@@ -261,12 +226,6 @@
261226
.project-description {
262227
font-size: 14px;
263228
}
264-
265-
.submit-button {
266-
font-size: 36px;
267-
width: 180px;
268-
height: 56px;
269-
}
270229
}
271230
272231
@media (max-width: 480px) {
@@ -277,11 +236,5 @@
277236
.project-time {
278237
font-size: 20px;
279238
}
280-
281-
.submit-button {
282-
font-size: 28px;
283-
width: 150px;
284-
height: 48px;
285-
}
286239
}
287240
</style>
Lines changed: 3 additions & 0 deletions
Loading
File renamed without changes.

lark-ui/static/icons/link.svg

Lines changed: 3 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)