1+ <script lang =" ts" >
2+ import { onMount } from " svelte" ;
3+ import { goto } from " $app/navigation" ;
4+ import { checkAuthStatus , recalculateHourCounts , updateUser , type User } from " $lib/auth" ;
5+ import ShopCard from " ../ShopCard.svelte" ;
6+ import { page } from " $app/state" ;
7+ import Button from " $lib/Button.svelte" ;
8+ import { shopData } from " ../shop" ;
9+
10+ let user: User | null = $state <User | null >(null );
11+
12+ const index = parseInt (page .params .id ! );
13+
14+ onMount (async () => {
15+ user = await checkAuthStatus ();
16+
17+ if (! user ) {
18+ goto (" /" );
19+ return ;
20+ }
21+ });
22+ </script >
23+
24+ <div class =" shop-page" >
25+ <div class =" back-button" >
26+ <Button label ={' ← Back to Shop' } onclick ={() => goto (" /app/shop" )} color =' black' />
27+ </div >
28+ <div class =" item-overview" >
29+ <div class =" flex flex-col items-stretch justify-center" >
30+ <img
31+ src ={shopData [index ].img }
32+ alt ={shopData [index ].name }
33+ class =" rounded-[1.5vh] mb-[1vh] w-[400px] object-cover border-2 border-black no-select"
34+ draggable =" false"
35+ />
36+ </div >
37+ <div class =" item-content" >
38+ <div class =" item-inner" >
39+ <h1 class ="item-name" >{shopData [index ].name }</h1 >
40+ <h2 class ="req-hours" >{shopData [index ].requiredHours } hours</h2 >
41+ <p class ="item-desc" >{shopData [index ].desc }</p >
42+ </div >
43+ <div >
44+ <Button label =" Coming Soon" disabled />
45+ </div >
46+ </div >
47+ </div >
48+ </div >
49+
50+ <style >
51+ .shop-page {
52+ position : relative ;
53+ min-height : 100vh ;
54+ background : #453b61 ;
55+ padding : 57px 50px 200px ;
56+ }
57+
58+ .item-overview {
59+ display : flex ;
60+ align-items : stretch ;
61+
62+ gap : 48px ;
63+
64+ min-height : 600px ;
65+ }
66+
67+ .item-content {
68+ display : flex ;
69+ flex-direction : column ;
70+ justify-content : space-between ;
71+
72+ min-height : 100% ;
73+ }
74+
75+ .item-name {
76+ font-family : " Moga" , sans-serif ;
77+ font-size : 90px ;
78+ color : white ;
79+ letter-spacing : -0.99px ;
80+ margin : 0 ;
81+ line-height : 1 ;
82+ max-width : 750px ;
83+ }
84+
85+ .req-hours {
86+ font-family : " PT Serif" , serif ;
87+ font-size : 40px ;
88+ color : white ;
89+ letter-spacing : -0.99px ;
90+ margin-bottom : 30px ;
91+ line-height : 1 ;
92+ max-width : 750px ;
93+ }
94+
95+ .item-desc {
96+ font-family : " PT Sans" , sans-serif ;
97+ font-size : 24px ;
98+ color : white ;
99+ font-weight : normal ;
100+ letter-spacing : -0.99px ;
101+ margin : 0 ;
102+ line-height : 1 ;
103+ max-width : 750px ;
104+ }
105+
106+ .back-button {
107+ margin-bottom : 30px ;
108+ position : sticky ;
109+ top : 57px ;
110+ z-index : 10 ;
111+ }
112+
113+ </style >
0 commit comments