diff --git a/.gitignore b/.gitignore index 68a6ec9..e04bd29 100644 --- a/.gitignore +++ b/.gitignore @@ -24,3 +24,5 @@ build *.njsproj *.sln *.sw? + +src/bindings.ts diff --git a/package.json b/package.json index ac40299..187d069 100644 --- a/package.json +++ b/package.json @@ -15,10 +15,13 @@ "release": "standard-version" }, "dependencies": { + "@fortawesome/free-brands-svg-icons": "^6.4.0", + "@fortawesome/free-solid-svg-icons": "^6.4.0", "@tauri-apps/api": "^1.4.0", "class-variance-authority": "^0.6.1", "prettier": "^2.8.8", "prettier-plugin-svelte": "^2.10.1", + "svelte-fa": "^3.0.4", "tailwind-merge": "^1.13.2" }, "devDependencies": { @@ -37,6 +40,7 @@ "svelte": "^4.0.0", "svelte-check": "^3.4.3", "svelte-preprocess": "^5.0.3", + "svelte-routing": "^1.10.0", "tailwind-scrollbar": "^3.0.4", "tailwindcss": "^3.3.1", "tslib": "^2.4.1", diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index bbec553..c88133e 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -1,46 +1,46 @@ { - "build": { - "beforeDevCommand": "yarn dev:client", - "beforeBuildCommand": "yarn build:client", - "devPath": "http://localhost:1420", - "distDir": "../build", - "withGlobalTauri": true - }, - "package": { - "productName": "huehuehue", - "version": "0.0.5" - }, - "tauri": { - "allowlist": { - "all": false, - "shell": { - "all": false, - "open": true - } + "build": { + "beforeDevCommand": "yarn dev:client", + "beforeBuildCommand": "yarn build:client", + "devPath": "http://localhost:1420", + "distDir": "../build", + "withGlobalTauri": true }, - "bundle": { - "active": true, - "targets": "all", - "identifier": "com.huehuehue.dev", - "icon": [ - "icons/32x32.png", - "icons/128x128.png", - "icons/128x128@2x.png", - "icons/icon.icns", - "icons/icon.ico" - ] + "package": { + "productName": "huehuehue", + "version": "0.0.5" }, - "security": { - "csp": null - }, - "windows": [ - { - "fullscreen": false, - "resizable": true, - "title": "huehuehue", - "width": 800, - "height": 600 - } - ] - } + "tauri": { + "allowlist": { + "all": false, + "shell": { + "all": false, + "open": true + } + }, + "bundle": { + "active": true, + "targets": "all", + "identifier": "com.huehuehue.dev", + "icon": [ + "icons/32x32.png", + "icons/128x128.png", + "icons/128x128@2x.png", + "icons/icon.icns", + "icons/icon.ico" + ] + }, + "security": { + "csp": null + }, + "windows": [ + { + "fullscreen": false, + "resizable": true, + "title": "huehuehue", + "width": 800, + "height": 600 + } + ] + } } diff --git a/src/.gitignore b/src/.gitignore deleted file mode 100644 index 73ed9e9..0000000 --- a/src/.gitignore +++ /dev/null @@ -1 +0,0 @@ -bindings.ts diff --git a/src/lib/Greet.svelte b/src/lib/Greet.svelte deleted file mode 100644 index 3fcf415..0000000 --- a/src/lib/Greet.svelte +++ /dev/null @@ -1,19 +0,0 @@ - - -
- {#await discoveredBridgesPromise} -

hello world!

-

loading...

- {:then discoveredBridges} - - {:catch error} -

error: {error.message}

- {/await} -
diff --git a/src/lib/components/discovery/BridgesList.svelte b/src/lib/components/discovery/BridgesList.svelte new file mode 100644 index 0000000..82c98e9 --- /dev/null +++ b/src/lib/components/discovery/BridgesList.svelte @@ -0,0 +1,42 @@ + + + diff --git a/src/lib/components/discovery/BridgesListItem.svelte b/src/lib/components/discovery/BridgesListItem.svelte new file mode 100644 index 0000000..d342e12 --- /dev/null +++ b/src/lib/components/discovery/BridgesListItem.svelte @@ -0,0 +1,25 @@ + + +
  • + +
  • diff --git a/src/lib/components/primitives/Button.svelte b/src/lib/components/primitives/Button.svelte new file mode 100644 index 0000000..46115c0 --- /dev/null +++ b/src/lib/components/primitives/Button.svelte @@ -0,0 +1,91 @@ + + + diff --git a/src/lib/components/primitives/Checkbox.svelte b/src/lib/components/primitives/Checkbox.svelte new file mode 100644 index 0000000..cff723c --- /dev/null +++ b/src/lib/components/primitives/Checkbox.svelte @@ -0,0 +1,80 @@ + + +
    + {#if checked} + + {/if} +
    diff --git a/src/lib/components/primitives/Icon.svelte b/src/lib/components/primitives/Icon.svelte new file mode 100644 index 0000000..82df3d9 --- /dev/null +++ b/src/lib/components/primitives/Icon.svelte @@ -0,0 +1,31 @@ + + +{#if icon} + +{/if} diff --git a/src/lib/components/primitives/Input.svelte b/src/lib/components/primitives/Input.svelte new file mode 100644 index 0000000..ef1ed8f --- /dev/null +++ b/src/lib/components/primitives/Input.svelte @@ -0,0 +1,11 @@ + + + diff --git a/src/lib/components/primitives/LoadingIndicator.svelte b/src/lib/components/primitives/LoadingIndicator.svelte new file mode 100644 index 0000000..7b42ac0 --- /dev/null +++ b/src/lib/components/primitives/LoadingIndicator.svelte @@ -0,0 +1,29 @@ + + + + + {#if label} + {label} + {/if} + diff --git a/src/lib/components/primitives/Typeface.svelte b/src/lib/components/primitives/Typeface.svelte new file mode 100644 index 0000000..c1f94cf --- /dev/null +++ b/src/lib/components/primitives/Typeface.svelte @@ -0,0 +1,36 @@ + + +

    + +

    diff --git a/src/lib/components/primitives/types.ts b/src/lib/components/primitives/types.ts new file mode 100644 index 0000000..57914eb --- /dev/null +++ b/src/lib/components/primitives/types.ts @@ -0,0 +1,2 @@ +export type IconSize = `${number}x`; +export type TypefaceSize = 'xxl' | 'xl' | 'lg' | 'md' | 'sm'; diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte new file mode 100644 index 0000000..7a8c11b --- /dev/null +++ b/src/routes/+layout.svelte @@ -0,0 +1,12 @@ + + +
    diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index 3c6762c..278eb5e 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -1,7 +1 @@ - - -

    Gaggi?

    - - +

    main route

    diff --git a/src/routes/discovery/+page.svelte b/src/routes/discovery/+page.svelte new file mode 100644 index 0000000..01f4a62 --- /dev/null +++ b/src/routes/discovery/+page.svelte @@ -0,0 +1,61 @@ + + +
    +
    + Select your Hue Bridge + + {#await bridges} + + {:then bridges} + {#if bridges.length !== 0} + + {:else} +
    +
    + +
    + + { + selectedBridge = bridge; + }} + /> + +
    + {/if} + {:catch error} + {error.message} + {/await} +
    +
    diff --git a/src/styles.css b/src/styles.css new file mode 100644 index 0000000..153f6d3 --- /dev/null +++ b/src/styles.css @@ -0,0 +1,20 @@ +@tailwind base; +@tailwind components; +@tailwind utilities; + +@font-face { + font-family: 'Inter'; + src: url('/Inter.ttf'); + font-feature-settings: 'tnum'; + font-weight: 100 900; +} + +:root { + font-synthesis: none; + text-rendering: optimizeLegibility; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + -webkit-text-size-adjust: 100%; + + font-family: 'Inter'; +} diff --git a/svelte.config.js b/svelte.config.js index 87f3f8d..c8012d2 100644 --- a/svelte.config.js +++ b/svelte.config.js @@ -1,5 +1,5 @@ -import preprocess from 'svelte-preprocess'; import adapter from '@sveltejs/adapter-static'; +import preprocess from 'svelte-preprocess'; const config = { preprocess: [ diff --git a/tailwind.config.cjs b/tailwind.config.cjs index 20d8861..c94b2b4 100644 --- a/tailwind.config.cjs +++ b/tailwind.config.cjs @@ -1,13 +1,19 @@ +/** + * Colors link: https://coolors.co/16141d-1d1a23-2f2d34-f0fbff-542dc1-6f00ff-8666fb-ff63f7 + */ + /** @type {import('tailwindcss').Config}*/ const config = { content: ['./src/**/*.{html,js,svelte,ts}'], theme: { colors: { + deepDark: '#000000', + albino: '#FFFFFF', ink: { 400: '#16141D', - 500: '#1D1A23', - 600: '#2F2D34', + 500: '#211C29', + 600: '#302D3A', }, nebula: { 400: '#542DC1', @@ -18,7 +24,10 @@ const config = { 500: '#FF63F7', }, snow: { + 300: '#B7C4C8', + 400: '#D2DFE3', 500: '#F0FBFF', + 600: '#FCFEFF', }, }, extend: {}, diff --git a/yarn.lock b/yarn.lock index be616d1..1e5bf54 100644 --- a/yarn.lock +++ b/yarn.lock @@ -158,6 +158,25 @@ resolved "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.5.1.tgz" integrity sha512-Z5ba73P98O1KUYCCJTUeVpja9RcGoMdncZ6T49FCUl2lN38JtCJ+3WgIDBv0AuY4WChU5PmtJmOCTlN6FZTFKQ== +"@fortawesome/fontawesome-common-types@6.4.0": + version "6.4.0" + resolved "https://registry.yarnpkg.com/@fortawesome/fontawesome-common-types/-/fontawesome-common-types-6.4.0.tgz#88da2b70d6ca18aaa6ed3687832e11f39e80624b" + integrity sha512-HNii132xfomg5QVZw0HwXXpN22s7VBHQBv9CeOu9tfJnhsWQNd2lmTNi8CSrnw5B+5YOmzu1UoPAyxaXsJ6RgQ== + +"@fortawesome/free-brands-svg-icons@^6.4.0": + version "6.4.0" + resolved "https://registry.yarnpkg.com/@fortawesome/free-brands-svg-icons/-/free-brands-svg-icons-6.4.0.tgz#c785cf5563231eadc5ef5f8cd0274e0b8920433f" + integrity sha512-qvxTCo0FQ5k2N+VCXb/PZQ+QMhqRVM4OORiO6MXdG6bKolIojGU/srQ1ptvKk0JTbRgaJOfL2qMqGvBEZG7Z6g== + dependencies: + "@fortawesome/fontawesome-common-types" "6.4.0" + +"@fortawesome/free-solid-svg-icons@^6.4.0": + version "6.4.0" + resolved "https://registry.yarnpkg.com/@fortawesome/free-solid-svg-icons/-/free-solid-svg-icons-6.4.0.tgz#48c0e790847fa56299e2f26b82b39663b8ad7119" + integrity sha512-kutPeRGWm8V5dltFP1zGjQOEAzaLZj4StdQhWVZnfGFCvAPVvHh8qk5bRrU4KXnRRRNni5tKQI9PBAdI6MP8nQ== + dependencies: + "@fortawesome/fontawesome-common-types" "6.4.0" + "@hutson/parse-repository-url@^3.0.0": version "3.0.2" resolved "https://registry.npmjs.org/@hutson/parse-repository-url/-/parse-repository-url-3.0.2.tgz" @@ -2364,6 +2383,11 @@ svelte-check@^3.4.3: svelte-preprocess "^5.0.3" typescript "^5.0.3" +svelte-fa@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/svelte-fa/-/svelte-fa-3.0.4.tgz#22543b801950fe4a9a801ba8d4769a53d80c0782" + integrity sha512-y04vEuAoV1wwVDItSCzPW7lzT6v1bj/y1p+W1V+NtIMpQ+8hj8MBkx7JFD7JHSnalPU1QiI8BVfguqheEA3nPg== + svelte-hmr@^0.15.2: version "0.15.2" resolved "https://registry.npmjs.org/svelte-hmr/-/svelte-hmr-0.15.2.tgz" @@ -2380,6 +2404,11 @@ svelte-preprocess@^5.0.3: sorcery "^0.11.0" strip-indent "^3.0.0" +svelte-routing@^1.10.0: + version "1.11.0" + resolved "https://registry.yarnpkg.com/svelte-routing/-/svelte-routing-1.11.0.tgz#8ef3e486f63725ba36d14b491e6e0fc8c2392458" + integrity sha512-/JlBAB6KxgM+Xl+4J/vOy4i4uYAJpWWbjh7vtRwsuu0MPl5B+ml+N/jCRkfjRa9ulODcS/G6PL8opyhczmrV8Q== + svelte@^4.0.0: version "4.0.4" resolved "https://registry.npmjs.org/svelte/-/svelte-4.0.4.tgz"