Skip to content

Commit abfae75

Browse files
committed
Update workflow file
1 parent 663d916 commit abfae75

File tree

3 files changed

+36
-18
lines changed

3 files changed

+36
-18
lines changed

.github/workflows/deploy.yml renamed to .github/workflows/deploy_pages.yml

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,47 +3,38 @@ on:
33
push:
44
branches:
55
- main
6+
workflow_dispatch:
67
jobs:
78
build_site:
89
runs-on: ubuntu-latest
910
steps:
1011
- name: Checkout
1112
uses: actions/checkout@v4
12-
13-
# If you're using pnpm, add this step then change the commands and cache key below to use `pnpm`
1413
- name: Install pnpm
1514
uses: pnpm/action-setup@v3
1615
with:
1716
version: 8
1817
cache: pnpm
19-
2018
- name: Install dependencies
2119
run: pnpm install
22-
2320
- name: build
2421
env:
25-
BASE_PATH: '/${{ github.event.repository.name }}'
26-
run: |
27-
pnpm run build
28-
22+
BASE_PATH: '/${{ github.event.repository.name }}'
23+
run: pnpm run build
2924
- name: Upload Artifacts
3025
uses: actions/upload-pages-artifact@v3
3126
with:
32-
path: 'build/'
33-
27+
path: 'build/'
3428
deploy:
3529
needs: build_site
3630
runs-on: ubuntu-latest
37-
38-
permissions:
39-
pages: write
40-
id-token: write
41-
4231
environment:
4332
name: github-pages
4433
url: ${{ steps.deployment.outputs.page_url }}
45-
34+
permissions:
35+
pages: write
36+
id-token: write
4637
steps:
47-
- name: Deploy
38+
- name: Deploy to GitHub Pages
4839
id: deployment
4940
uses: actions/deploy-pages@v4

src/lib/components/shared/Image.svelte

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,31 @@
55
66
let {
77
alt,
8+
width,
9+
height,
810
class: className,
911
...restProps
1012
}: {
1113
alt?: string;
14+
width: string;
15+
height: string;
1216
class?: string;
1317
} & HTMLImgAttributes = $props();
1418
1519
let loading: boolean = $state(true);
1620
</script>
1721

1822
<div class="h-full space-y-2 text-center">
19-
<div class="h-full w-full">
23+
<div
24+
class="h-full w-full"
25+
style="{width ? 'width:' + width + 'px;' : ''}{height ? 'height:' + height + 'px;' : ''}"
26+
>
2027
<Skeleton class="h-full w-full {!loading ? 'hidden' : ''}" />
2128
<img
2229
onload={() => (loading = false)}
2330
onerror={() => (loading = false)}
31+
{width}
32+
{height}
2433
{...restProps}
2534
{alt}
2635
class={twMerge(
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<script lang="ts">
2+
import Image from '$lib/components/shared/Image.svelte';
3+
</script>
4+
5+
<div class="flex flex-col space-y-4">
6+
<p class="text-2xl font-bold text-foreground">Draw 2D</p>
7+
<p></p>
8+
<div class="flex items-stretch space-x-4">
9+
<div class="flex-[2]">
10+
<Image height="300" src="/" alt="Preview of the Draw 2D program" />
11+
</div>
12+
<p class="flex-[3]">
13+
This is one of the first programs that I made on my calculator, and it sort of served as a
14+
stepping stone towards greater programs. It's very basic, and allows you to draw pixels
15+
individually, adjust brush size, move the cursor, change the color.
16+
</p>
17+
</div>
18+
</div>

0 commit comments

Comments
 (0)