Skip to content

Commit 38af97b

Browse files
code
1 parent 456b912 commit 38af97b

29 files changed

+1599
-234
lines changed

README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# fresh project
22

3+
### Setup
4+
5+
Make a config.
6+
7+
```
8+
cp .env.example .env
9+
```
10+
311
### Usage
412

513
Start the project:
@@ -9,3 +17,21 @@ deno task start
917
```
1018

1119
This will watch the project directory and restart as necessary.
20+
21+
### Testing
22+
23+
```
24+
deno test -A
25+
```
26+
27+
This will launch the puppeteer tests.
28+
29+
### Secrets for GitHub Actions
30+
31+
Use this command to get the secret contents
32+
33+
```
34+
base64 -i .env.github | pbcopy
35+
```
36+
37+
secret name should be `ENV_GITHUB_ACTIONS`

components/Button.tsx

Lines changed: 0 additions & 12 deletions
This file was deleted.

components/Footer.jsx

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
import BrandGithub from "$icons/brand-github.tsx"
2+
import { isSushiOpenPhrase } from "@/utils/mod.js"
3+
4+
export default function Footer({ children, active, hits = 0 }) {
5+
const menus = [
6+
{
7+
title: "Pages",
8+
children: [
9+
{ name: "Home", href: "/" },
10+
{ name: "Menu", href: "/menu" },
11+
// { name: "Order", href: "/order" },
12+
],
13+
},
14+
{
15+
title: "Community",
16+
children: [
17+
// { name: "GitHub", href: "https://github.com/hyprtxt" },
18+
{ name: "Facebook", href: "https://www.facebook.com/SushiJExpress/" },
19+
],
20+
},
21+
]
22+
23+
return (
24+
<div class="bg-white flex flex-col md:flex-row w-full max-w-screen-lg gap-8 md:gap-16 px-8 py-8 text-sm mb-5">
25+
<div class="flex-1">
26+
<div
27+
class="flex items-center gap-1"
28+
vocab="https://schema.org/"
29+
typeof="Restaurant"
30+
>
31+
<div
32+
class="font-bold text-2xl"
33+
property="name"
34+
>
35+
Sushi <span class="text-red">J</span> Express
36+
</div>
37+
</div>
38+
<div>
39+
<a href="https://goo.gl/maps/V5GUNWqMwZ6JSoa98">
40+
Location & Directions
41+
</a>
42+
</div>
43+
<div property="telephone">
44+
<a href="tel:+19287759323">(928) 775-9323</a>
45+
{" "}
46+
</div>
47+
<div>
48+
{isSushiOpenPhrase()}
49+
</div>
50+
</div>
51+
52+
{menus.map((item) => (
53+
<div class="mb-4" key={item.title}>
54+
<div class="font-bold">{item.title}</div>
55+
<ul class="mt-2">
56+
{item.children.map((child) => (
57+
<li class="mt-2" key={child.name}>
58+
<a
59+
href={child.href}
60+
class={child.href === active ? " font-bold" : ""}
61+
>
62+
{child.name}
63+
</a>
64+
</li>
65+
))}
66+
</ul>
67+
</div>
68+
))}
69+
70+
<div class="space-y-2">
71+
<div class="text-xs">
72+
Copyright © Sushi J Express<br />
73+
<a href="https://hyprtxt.dev">Coded in Prescott Valley</a>.
74+
</div>
75+
<a
76+
href="https://github.com/Hyprtxt/sushij.express"
77+
class="inline-block hover:text-black"
78+
aria-label="Github Icon"
79+
>
80+
<BrandGithub />
81+
</a>
82+
{hits > 0 ? <p>Hits: {hits}</p> : <></>}
83+
</div>
84+
{children}
85+
</div>
86+
)
87+
}

components/Header.jsx

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// import HyprtxtIcon from "@/components/HyprtxtIcon.jsx"
2+
3+
export default function Header({ active }) {
4+
const menus = [
5+
{ name: "Home", href: "/" },
6+
{ name: "Menu", href: "/menu" },
7+
{ name: "Order", href: "/order" },
8+
]
9+
10+
return (
11+
<header class="bg-white w-full max-w-screen-lg py-6 px-8 flex flex-col md:flex-row gap-4">
12+
<div class="flex items-center flex-1">
13+
{/* <HyprtxtIcon /> */}
14+
<div class="text-2xl ml-1 font-bold">
15+
Sushi <span class="text-red">J</span> Express
16+
</div>
17+
</div>
18+
<ul class="flex items-center gap-6">
19+
{menus.map((menu) => (
20+
<li>
21+
<a
22+
href={menu.href}
23+
class={"text-gray-500 hover:text-gray-700 py-1 border-gray-500" +
24+
(menu.href === active ? " font-bold" : "")}
25+
>
26+
{menu.name}
27+
</a>
28+
</li>
29+
))}
30+
</ul>
31+
</header>
32+
)
33+
}

components/Hero.jsx

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// import IconChevronRight from "$icons/chevron-right.tsx"
2+
import { asset } from "$fresh/runtime.ts"
3+
4+
export default function Hero(props) {
5+
console.log(props)
6+
const { data } = props
7+
const { title, description } = data
8+
9+
return (
10+
<div
11+
class="w-full flex px-8 h-96 justify-center items-center flex-col gap-8 bg-cover bg-center bg-no-repeat bg-gray-100 rounded-xl text-white"
12+
style={`background-image:linear-gradient(rgba(11,7,13, 0.3),rgba(11,7,13, 0.6)), url(${
13+
asset("/deno_city.jpg")
14+
});`}
15+
>
16+
<div class="space-y-4 text-center">
17+
<h1 class="text-4xl inline-block font-bold">{title}</h1>
18+
<p class="text-xl max-w-lg text-blue-100">
19+
{description}
20+
</p>
21+
</div>
22+
</div>
23+
)
24+
}

components/HyprtxtIcon.jsx

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
const HyprtxtIcon = () => (
2+
<svg
3+
class={`h-8 w-8 text-gray-500`}
4+
width="240"
5+
height="240"
6+
viewBox="0 0 240 240"
7+
fill="none"
8+
xmlns="http://www.w3.org/2000/svg"
9+
>
10+
<g id="main_group"></g>
11+
<circle
12+
stroke="#000000"
13+
id="circle1"
14+
stroke-width="0px"
15+
cy="120px"
16+
fill="#271f3f"
17+
r="120px"
18+
cx="120px"
19+
transform=""
20+
visibility="visible"
21+
>
22+
</circle>
23+
<polygon
24+
points="38.225418,113.270493 74.350418,94.895477 74.600418,78.395493 20.850418,106.020477 20.225418,119.770493 73.850418,147.270477 74.225418,130.895493 "
25+
stroke="none"
26+
id="polygon1"
27+
stroke-width="3px"
28+
fill="#59a188"
29+
transform=""
30+
>
31+
</polygon>
32+
<polygon
33+
points="144,62.5 158.5,65 93,179.5 78.5,178 "
34+
stroke="none"
35+
id="polygon2"
36+
stroke-width="3px"
37+
fill="#59a188"
38+
transform=""
39+
>
40+
</polygon>
41+
<polygon
42+
points="182.725418,108.770493 218.850418,90.395477 219.100418,73.895493 165.350418,101.520477 164.725418,115.270493 218.350418,142.770477 218.725418,126.395493 "
43+
stroke="none"
44+
stroke-width="3px"
45+
id="polygon3"
46+
fill="#3ba388"
47+
transform="rotate(180 192.912918 110.832985)"
48+
>
49+
</polygon>
50+
</svg>
51+
)
52+
export default HyprtxtIcon

components/Layout.jsx

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
import Header from "@/components/Header.jsx"
2+
import Footer from "@/components/Footer.jsx"
3+
import { tw } from "twind"
4+
import { DENO_ENV } from "@/utils/config.js"
5+
import { globalStyles } from "@/utils/style.js"
6+
import { Head } from "$fresh/runtime.ts"
7+
8+
const SchemaORG = () => {
9+
const Schema = {
10+
"@context": "https://schema.org",
11+
"@type": "Restaurant",
12+
"address": {
13+
"@type": "PostalAddress",
14+
"addressLocality": "Prescott Valley",
15+
"addressRegion": "AZ",
16+
"postalCode": "86314",
17+
"streetAddress": "7840 E. St, AZ-69",
18+
},
19+
"name": "Sushi J Express",
20+
"openingHours": [
21+
"Tu-Sa 11:00-14:30",
22+
"Tu-Sa 16:30-19:00",
23+
],
24+
"priceRange": "$$",
25+
"servesCuisine": [
26+
"Sushi",
27+
"Japanese",
28+
],
29+
"telephone": "(928) 775-9323",
30+
"url": "https://sushij.express/",
31+
}
32+
return (
33+
<script
34+
type="application/ld+json"
35+
dangerouslySetInnerHTML={{ __html: JSON.stringify(Schema, null, 2) }}
36+
>
37+
</script>
38+
)
39+
}
40+
41+
const Layout = ({ children, data = {} }) => (
42+
<>
43+
<Head>
44+
<SchemaORG />
45+
</Head>
46+
<div class={tw`${globalStyles}`}></div>
47+
<section class={tw`flex justify-center header-wrapper`}>
48+
<Header active={data.route} />
49+
</section>
50+
{children}
51+
<section class={tw`flex justify-center`}>
52+
<Footer hits={data?.data?.hits} />
53+
</section>
54+
{DENO_ENV === "development"
55+
? (
56+
<section class="max-w-screen-lg mx-auto py-8 px(8) space-y-4 bg-white">
57+
<pre>{JSON.stringify(data, null, 2 )}</pre>
58+
</section>
59+
)
60+
: <></>}
61+
</>
62+
)
63+
64+
export default Layout

0 commit comments

Comments
 (0)