Skip to content

Commit 07b00f8

Browse files
committed
First Guide
1 parent b8cf272 commit 07b00f8

16 files changed

Lines changed: 224 additions & 48 deletions

File tree

.firebaserc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"projects": {
3+
"default": "hub-by-nikdelvin"
4+
}
5+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# This file was auto-generated by the Firebase CLI
2+
# https://github.com/firebase/firebase-tools
3+
4+
name: Deploy to Firebase Hosting on merge
5+
on:
6+
push:
7+
branches:
8+
- main
9+
jobs:
10+
build_and_deploy:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
- run: npm ci
15+
- run: npm run build
16+
- uses: FirebaseExtended/action-hosting-deploy@v0
17+
with:
18+
repoToken: ${{ secrets.GITHUB_TOKEN }}
19+
firebaseServiceAccount: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_HUB_BY_NIKDELVIN }}
20+
channelId: live
21+
projectId: hub-by-nikdelvin
22+
env:
23+
FIREBASE_CLI_EXPERIMENTS: webframeworks
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# This file was auto-generated by the Firebase CLI
2+
# https://github.com/firebase/firebase-tools
3+
4+
name: Deploy to Firebase Hosting on PR
5+
on: pull_request
6+
permissions:
7+
checks: write
8+
contents: read
9+
pull-requests: write
10+
jobs:
11+
build_and_preview:
12+
if: ${{ github.event.pull_request.head.repo.full_name == github.repository }}
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
- run: npm ci
17+
- run: npm run build
18+
- uses: FirebaseExtended/action-hosting-deploy@v0
19+
with:
20+
repoToken: ${{ secrets.GITHUB_TOKEN }}
21+
firebaseServiceAccount: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_HUB_BY_NIKDELVIN }}
22+
projectId: hub-by-nikdelvin
23+
env:
24+
FIREBASE_CLI_EXPERIMENTS: webframeworks

astro.config.mjs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,7 @@ export default defineConfig({
1313
sidebar: [
1414
{
1515
label: 'Guides',
16-
items: [
17-
// Each item here is one entry in the navigation menu.
18-
{ label: 'Example Guide', slug: 'guides/example' }
19-
]
20-
},
21-
{
22-
label: 'Reference',
23-
autogenerate: { directory: 'reference' }
16+
autogenerate: { directory: 'guides' }
2417
}
2518
],
2619
customCss: ['./src/styles/global.css']

firebase.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"hosting": {
3+
"site": "scripty-app-nikdelvin",
4+
"source": ".",
5+
"ignore": [
6+
"firebase.json",
7+
"**/.*",
8+
"**/node_modules/**"
9+
],
10+
"frameworksBackend": {
11+
"region": "europe-west1"
12+
}
13+
}
14+
}

public/favicon.svg

Lines changed: 7 additions & 1 deletion
Loading

src/components/ASCIIRenderer/Canvas.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ function emptyState(type: string, isMobile: boolean) {
2121

2222
const Canvas: Component = () => {
2323
const isMobile = window.innerWidth < 768
24-
const [type, setType] = createSignal('2d')
24+
const [type, setType] = createSignal('video')
2525
const [fontSize, setFontSize] = createSignal(1)
26-
const [canvas, setCanvas] = createSignal<CanvasState>(emptyState('2d', isMobile))
26+
const [canvas, setCanvas] = createSignal<CanvasState>(emptyState('video', isMobile))
2727

2828
createEffect(() => {
2929
const isScaled = fontSize() > 1

src/components/ASCIIRenderer/style.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@
44
display: flex;
55
margin-top: 0;
66
overflow: hidden;
7+
background-color: #131920;
78
}

src/components/OpenTopoData/style.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@
1414

1515
[type='number']::-webkit-inner-spin-button {
1616
pointer-events: auto;
17-
opacity: 1;
17+
opacity: 0.25;
1818
}

src/components/OpenTopoData/utils.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { type TypedArray, fromBlob } from 'geotiff'
1+
import { type TypedArray, fromUrl } from 'geotiff'
22

33
function generateColorRange(levels: number, grayScale: boolean) {
44
const colors = []
@@ -33,8 +33,7 @@ function transform(a: number, b: number, M: number[], roundToInt = false): [numb
3333
}
3434

3535
export async function prepareMap() {
36-
const blob = await (await fetch('/media/open-topo-data.tif')).blob()
37-
const tiff = await fromBlob(blob)
36+
const tiff = await fromUrl('/media/open-topo-data.tif')
3837
const image = await tiff.getImage()
3938
console.log(image)
4039
const rasters = await image.readRasters()

0 commit comments

Comments
 (0)