diff --git a/src/app.sass b/src/app.sass
index c34cf68..f894451 100644
--- a/src/app.sass
+++ b/src/app.sass
@@ -89,8 +89,8 @@ main
height: 1em
.rules
- max-width: 900px
- opacity: 0.9
+ font-size: 0.9em
+ max-width: 800px
.btn-div
display: flex
@@ -118,9 +118,6 @@ main
font-family: 'Teko', sans-serif
font-size: 2em
color: colors.$accent
- margin-bottom: -24px
-
- // Larger gap between letters
letter-spacing: 0.3em
.status
@@ -129,30 +126,9 @@ main
&.error
color: colors.$cross
-.overlay
- position: fixed
- inset: 0
-
- background-color: rgba(0, 0, 0, 0.5)
-
+.timer-line
+ // Two items, left and right
display: flex
- justify-content: center
- align-items: center
-
- z-index: 1000
- backdrop-filter: blur(5px)
-
- h2, p
- user-select: none
- margin: 0
-
- > div
- background-color: colors.$background
- padding: 2rem
- border-radius: 8px
-
- display: flex
- flex-direction: column
- gap: 1rem
-
- max-width: 400px
+ justify-content: space-between
+ gap: 10px
+ margin-bottom: -12px
diff --git a/src/aqua.sass b/src/aqua.sass
new file mode 100644
index 0000000..6c55197
--- /dev/null
+++ b/src/aqua.sass
@@ -0,0 +1,148 @@
+@use "colors"
+
+$font: Quicksand, Inter, LXGW Wenkai, Microsoft YaHei, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Avenir, Helvetica, Arial, sans-serif
+$c-main: #b3c6ff
+$c-sub: rgba(0, 0, 0, 0.77)
+$c-good: #b3ffb9
+$c-darker: #646cff
+$c-bg: #242424
+$c-error: #ff6b6b
+$c-shadow: rgba(0, 0, 0, 0.1)
+
+$ov-light: rgba(white, 0.04)
+$ov-lighter: rgba(white, 0.08)
+$ov-dark: rgba(black, 0.1)
+$ov-darker: rgba(black, 0.18)
+
+$nav-height: 4rem
+$w-mobile: 560px
+$w-max: 900px
+
+$grad-special: linear-gradient(90deg, #ffee94, #ffb798, #ffa3e5, #ebff94)
+
+$border-radius: 12px
+$gap: 20px
+
+$transition: all 0.25s
+
+.card
+ display: flex
+ flex-direction: column
+
+ border-radius: $border-radius
+ padding: 12px 16px
+ background: $ov-light
+
+blockquote
+ $c1: rgba(255, 149, 149, 0.05)
+ $c2: rgba(255, 152, 152, 0.12)
+ background: repeating-linear-gradient(45deg, $c1, $c1 10px, $c2 10px, $c2 20px)
+ padding: 10px 20px 10px 20px
+ margin: 16px 0
+ border-left: solid #ff7c7c 3px
+ border-radius: $border-radius
+
+input, textarea
+ border-radius: $border-radius
+ border: 1px solid transparent
+ padding: 0.6em 1.2em
+ font-size: 1em
+ font-weight: 500
+ font-family: inherit
+ background-color: $ov-lighter
+ transition: $transition
+ box-sizing: border-box
+ resize: vertical
+ &:focus, &:focus-visible
+ border: 1px solid $c-main
+ outline: none
+ &.error
+ border: 1px solid $c-error
+
+select
+ border-radius: $border-radius
+ border: 1px solid transparent
+ padding: 0.6em 1.2em
+ font-size: 1em
+ font-weight: 500
+ font-family: inherit
+ background-color: $ov-lighter
+ transition: $transition
+ box-sizing: border-box
+
+input[type="checkbox"]
+ width: 1.2em
+ height: 1.2em
+ margin: 0
+ padding: 0
+ border: 1px solid $c-main
+ background-color: $ov-lighter
+ appearance: none
+ cursor: pointer
+ flex-shrink: 0
+
+ &:checked
+ background-color: $c-main
+ border-color: $c-main
+
+label
+ cursor: pointer
+
+.overlay
+ position: fixed
+ inset: 0
+
+ background-color: rgba(0, 0, 0, 0.5)
+
+ display: flex
+ justify-content: center
+ align-items: center
+
+ z-index: 1000
+ backdrop-filter: blur(5px)
+
+ h2, p
+ user-select: none
+ margin: 0
+
+ > div
+ background-color: colors.$background
+ padding: 2rem
+ border-radius: 8px
+
+ display: flex
+ flex-direction: column
+ gap: 1rem
+
+ min-width: 300px
+ max-width: 400px
+
+.actions
+ display: flex
+ flex-direction: column
+ gap: 16px
+
+ button
+ width: 100%
+
+.loading.overlay
+ font-size: 28rem
+
+ :global(.icon)
+ opacity: 0.5
+
+ > span
+ position: absolute
+ inset: 0
+ display: flex
+ justify-content: center
+ align-items: center
+ background: transparent
+
+ letter-spacing: 20px
+ margin-left: 20px
+
+ font-size: 1.5rem
+
+.error
+ color: $c-error
\ No newline at end of file
diff --git a/src/lib/PuzzleInfo.svelte b/src/lib/PuzzleInfo.svelte
new file mode 100644
index 0000000..aea9725
--- /dev/null
+++ b/src/lib/PuzzleInfo.svelte
@@ -0,0 +1,28 @@
+
+
+
+
+ {puzzleData?.name}
+ by {puzzleData?.author}
+
+
+ {puzzleData?.description}
+
+
+
+
\ No newline at end of file
diff --git a/src/lib/Upload.svelte b/src/lib/Upload.svelte
new file mode 100644
index 0000000..5cce9a6
--- /dev/null
+++ b/src/lib/Upload.svelte
@@ -0,0 +1,58 @@
+
+
+{#if data}
+
+
+ {#if !id}
+
Upload Puzzle
+
+ {#if error}
+
{error}
+ {:else}
+
Upload your puzzle to the server
+ {/if}
+
+
+
+
+
+ {:else}
+
Uploaded 🥳
+
Your puzzle has been uploaded to the server
+
+
You can share it by the following link:
+
{url}
+
Thank you for your creation!
+
+ {/if}
+
+
+{/if}
diff --git a/src/main.ts b/src/main.ts
index c1e2e93..87ab958 100644
--- a/src/main.ts
+++ b/src/main.ts
@@ -1,5 +1,6 @@
import { mount } from 'svelte'
import './app.sass'
+import './aqua.sass'
import './puzzle.sass'
import './fonts/caveat.sass'
import Launcher from './Launcher.svelte'
diff --git a/src/utils.ts b/src/utils.ts
index e2b721f..3b550c9 100644
--- a/src/utils.ts
+++ b/src/utils.ts
@@ -3,6 +3,8 @@ export type i8s = Int8Array
export interface Checkpoint { rows: number, cols: number,
hStates: i8s, vStates: i8s, hColors: i8s, vColors: i8s, numbers: i8s, nMask: i8s, colors: string[] }
+export interface MetaCheckpoint extends Checkpoint { name: string, author: string, description: string, date?: string }
+
export const cfg = {
cellW: 20,
lineW: 4,
@@ -75,7 +77,10 @@ export const Backend = {
if (!r.ok) throw new Error(`Failed to get puzzle: ${r.status}`)
return r.text()
}).then(JsonTy.parse),
- post: (data: Checkpoint) => fetch(`${cfg.backend}/`, { method: "post", body: JsonTy.stringify(data) }),
+ post: (data: MetaCheckpoint) => fetch(`${cfg.backend}/`, { method: "post", body: JsonTy.stringify(data) }).then(r => {
+ if (!r.ok) throw new Error(`Failed to post puzzle: ${r.status}`)
+ return r.text()
+ }).then(JsonTy.parse),
}
export const Misc = {