forked from denoland/merch
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
32 changed files
with
606 additions
and
208 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
SHOPIFY_SHOP=xxx.myshopify.com | ||
SHOPIFY_ACCESS_TOKEN=xxxxxx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
.DS_Store | ||
.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
{ | ||
"deno.enable": true | ||
"deno.enable": true, | ||
"deno.lint": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,23 @@ | ||
# fresh project | ||
# Deno Merch | ||
|
||
### Usage | ||
The Deno shop! Built with [Deno](https://deno.land/) and | ||
[Fresh](https://fresh.deno.dev/), powered by [Shopify](https://www.shopify.com). | ||
|
||
Set up Shopify credentials in the `.env`. | ||
## Screen Shot | ||
|
||
Start the project: | ||
![Screen Shot](./static/screen_shot.png) | ||
|
||
``` | ||
deno task start | ||
``` | ||
## Develop locally | ||
|
||
- Clone the repository | ||
- Set up Shopify credentials in the `.env`, follows `.env.example`. | ||
- Start the project in local mode: | ||
```bash | ||
deno task start | ||
``` | ||
|
||
## Deploy to global | ||
|
||
Sign in to [dash.deno.com](https://dash.deno.com), create a new project, and then link to your clone version of the repository. Please ensure add shopify secret before link: | ||
|
||
![Screen Shot 2](./static/screen_shot_2.png) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/** @jsx h */ | ||
import { h } from "preact"; | ||
import { tw } from "@twind"; | ||
import Cart from "../islands/Cart.tsx"; | ||
|
||
export function Header() { | ||
return ( | ||
<header | ||
class={tw`h-[110px] sm:!h-[144px] w-full bg-cover bg-no-repeat relative`} | ||
style={{ | ||
backgroundImage: "url(/header_bg.svg)", | ||
}} | ||
> | ||
<div class={`rainfall ${tw`w-full h-full absolute opacity-30`}`} /> | ||
<nav | ||
class={tw | ||
`w-11/12 h-24 max-w-5xl mx-auto flex items-center justify-between relative`} | ||
> | ||
<a href="/"> | ||
<img | ||
src="/logo.svg" | ||
alt="Deno Logo" | ||
class={tw`h-14 w-14`} | ||
/> | ||
</a> | ||
<h1> | ||
<img | ||
src="/text_logo.svg" | ||
alt="Deno Merch" | ||
class={tw`h-6`} | ||
/> | ||
</h1> | ||
<Cart /> | ||
</nav> | ||
</header> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/** @jsx h */ | ||
import { h } from "preact"; | ||
|
||
export default function IconCart({ size = 16 }: { size?: number }) { | ||
return ( | ||
<svg | ||
width={Math.round((15 / 16) * size)} | ||
height={size} | ||
viewBox="0 0 15 16" | ||
fill="none" | ||
xmlns="http://www.w3.org/2000/svg" | ||
> | ||
<mask id="path-1-inside-1_1601_8161" fill="white"> | ||
<rect | ||
x="0.919922" | ||
y="3.9663" | ||
width="14.08" | ||
height="12.0337" | ||
rx="1" | ||
/> | ||
</mask> | ||
<rect | ||
x="0.919922" | ||
y="3.9663" | ||
width="14.08" | ||
height="12.0337" | ||
rx="1" | ||
stroke="currentColor" | ||
stroke-width="3.2" | ||
mask="url(#path-1-inside-1_1601_8161)" | ||
/> | ||
<path | ||
fill-rule="evenodd" | ||
clip-rule="evenodd" | ||
d="M11.5599 7.60279V3.6C11.5599 1.61177 9.94809 -3.8147e-06 7.95986 -3.8147e-06C5.97164 -3.8147e-06 4.35986 1.61177 4.35986 3.59999V7.60279H5.95986V3.59999C5.95986 2.49543 6.85529 1.6 7.95986 1.6C9.06443 1.6 9.95986 2.49543 9.95986 3.6V7.60279H11.5599Z" | ||
fill="currentColor" | ||
/> | ||
</svg> | ||
); | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
#!/usr/bin/env -S deno run -A --watch=static/,routes/ | ||
|
||
import dev from "$fresh/dev.ts"; | ||
import "$std/dotenv/load.ts"; | ||
|
||
await dev(import.meta.url, "./main.ts"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,15 +2,16 @@ | |
"imports": { | ||
"@/": "./", | ||
"@twind": "./utils/twind.ts", | ||
"@twind/aspect-ratio": "https://esm.sh/@twind/[email protected]", | ||
|
||
"$fresh/": "https://deno.land/x/[email protected].0/", | ||
"$fresh/": "https://deno.land/x/[email protected].1/", | ||
"preact": "https://esm.sh/[email protected]", | ||
"preact/": "https://esm.sh/[email protected]/", | ||
"preact-render-to-string": "https://esm.sh/[email protected]?deps=preact@10.8.1", | ||
"preact-render-to-string": "https://esm.sh/[email protected]?external=preact", | ||
|
||
"twind": "https://esm.sh/[email protected]", | ||
"twind/": "https://esm.sh/[email protected]/", | ||
"$std/": "https://deno.land/std@0.140.0/", | ||
"swr": "https://esm.sh/[email protected]?alias=react:preact/compat&deps=preact@10.8.1" | ||
"$std/": "https://deno.land/std@0.149.0/", | ||
"swr": "https://esm.sh/[email protected]?alias=react:preact/compat&external=preact/compat" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.