diff --git a/.eslintignore b/.eslintignore
new file mode 100644
index 0000000..3897265
--- /dev/null
+++ b/.eslintignore
@@ -0,0 +1,13 @@
+.DS_Store
+node_modules
+/build
+/.svelte-kit
+/package
+.env
+.env.*
+!.env.example
+
+# Ignore files for PNPM, NPM and YARN
+pnpm-lock.yaml
+package-lock.json
+yarn.lock
diff --git a/.eslintrc.cjs b/.eslintrc.cjs
new file mode 100644
index 0000000..ebc1958
--- /dev/null
+++ b/.eslintrc.cjs
@@ -0,0 +1,30 @@
+module.exports = {
+ root: true,
+ extends: [
+ 'eslint:recommended',
+ 'plugin:@typescript-eslint/recommended',
+ 'plugin:svelte/recommended',
+ 'prettier'
+ ],
+ parser: '@typescript-eslint/parser',
+ plugins: ['@typescript-eslint'],
+ parserOptions: {
+ sourceType: 'module',
+ ecmaVersion: 2020,
+ extraFileExtensions: ['.svelte']
+ },
+ env: {
+ browser: true,
+ es2017: true,
+ node: true
+ },
+ overrides: [
+ {
+ files: ['*.svelte'],
+ parser: 'svelte-eslint-parser',
+ parserOptions: {
+ parser: '@typescript-eslint/parser'
+ }
+ }
+ ]
+};
diff --git a/.forgejo/workflows/build.yaml b/.forgejo/workflows/build.yaml
deleted file mode 100644
index f6899f2..0000000
--- a/.forgejo/workflows/build.yaml
+++ /dev/null
@@ -1,132 +0,0 @@
-on:
- push:
- branches:
- - main
- pull_request:
-
-jobs:
- check-changes:
- runs-on: docker
- outputs:
- all_changed_and_modified_files_count: ${{ steps.changed-files.outputs.all_changed_and_modified_files_count }}
- steps:
- - name: Checkout code
- uses: actions/checkout@v4
-
- - name: Get changed files count
- id: changed-files
- uses: tj-actions/changed-files@v45
- with:
- files_ignore: 'doc/**,README.md,Dockerfile,.*'
- files_ignore_separator: ','
- - name: Print changed files count
- run: >
- echo "Changed files count: ${{
- steps.changed-files.outputs.all_changed_and_modified_files_count }}"
-
- build:
- needs: check-changes
- runs-on: docker
- container:
- image: ghcr.io/catthehacker/ubuntu:js-22.04
- if: ${{ needs.check-changes.outputs.all_changed_and_modified_files_count >= 1 }}
- permissions:
- contents: write
-
- steps:
- - uses: actions/checkout@v4
- with:
- submodules: recursive
- - uses: actions/setup-node@v4
- with:
- token: ${{ secrets.GH_TOKEN }}
- node-version: lts/*
- cache: yarn
- cache-dependency-path: '**/yarn.lock'
- - uses: actions/cache@v4
- with:
- path: |
- ~/.cache/pip
- ~/node_modules
- ~/.cache/ms-playwright
- key: ${{ runner.os }}-pio-playwright-${{ hashFiles('**/yarn.lock') }}
- - name: Get current date
- id: dateAndTime
- run: echo "dateAndTime=$(date +'%Y-%m-%d-%H:%M')" >> $GITHUB_OUTPUT
- - name: Install mklittlefs
- run: >
- git clone https://github.com/earlephilhower/mklittlefs.git /tmp/mklittlefs &&
- cd /tmp/mklittlefs &&
- git submodule update --init &&
- make dist
- - name: Install yarn
- run: yarn && yarn postinstall
- - name: Run linter
- run: yarn lint
- - name: Run vitest tests
- run: yarn vitest run
- - name: Install Playwright Browsers
- if: steps.cache.outputs.cache-hit != 'true'
- run: npx playwright install --with-deps
- - name: Run Playwright tests
- run: npx playwright test
- - name: Build WebUI
- run: yarn build
-
- # The following steps only run on push to main
- - name: Get current block
- if: github.event_name == 'push' && github.ref == 'refs/heads/main'
- id: getBlockHeight
- run: echo "blockHeight=$(curl -s https://mempool.space/api/blocks/tip/height)" >> $GITHUB_OUTPUT
-
- - name: Write block height to file
- env:
- BLOCK_HEIGHT: ${{ steps.getBlockHeight.outputs.blockHeight }}
- run: mkdir -p output && echo "$BLOCK_HEIGHT" > output/version.txt
- - name: gzip build for LittleFS
- run: find dist -type f ! -name ".*" -exec sh -c 'mkdir -p "build_gz/$(dirname "${1#dist/}")" && gzip -k "$1" -c > "build_gz/${1#dist/}".gz' _ {} \;
- - name: Write git rev to file
- run: echo "$GITHUB_SHA" > build_gz/fs_hash.txt && echo "$GITHUB_SHA" > output/commit.txt
- - name: Check GZipped directory size
- run: |
- # Set the threshold size in bytes
- THRESHOLD=410000
-
- # Calculate the total size of files in the directory
- DIRECTORY_SIZE=$(du -b -s build_gz | awk '{print $1}')
-
- # Fail the workflow if the size exceeds the threshold
- if [ "$DIRECTORY_SIZE" -gt "$THRESHOLD" ]; then
- echo "Directory size exceeds the threshold of $THRESHOLD bytes"
- exit 1
- else
- echo "Directory size is within the threshold $DIRECTORY_SIZE"
- fi
- - name: Create tarball
- if: github.event_name == 'push' && github.ref == 'refs/heads/main'
- run: tar czf webui.tgz --strip-components=1 dist
- - name: Build LittleFS
- run: |
- set -e
- /tmp/mklittlefs/mklittlefs -c build_gz -s 410000 output/littlefs.bin
- - name: Upload artifacts
- if: github.event_name == 'push' && github.ref == 'refs/heads/main'
- uses: https://code.forgejo.org/forgejo/upload-artifact@v4
- with:
- path: |
- webui.tgz
- output/littlefs.bin
- - name: Create release
- if: github.event_name == 'push' && github.ref == 'refs/heads/main'
- uses: https://code.forgejo.org/actions/forgejo-release@v2.6.0
- with:
- url: 'https://git.btclock.dev/'
- repo: '${{ github.repository }}'
- direction: upload
- tag: ${{ steps.getBlockHeight.outputs.blockHeight }}
- sha: '${{ github.sha }}'
- release-dir: output
- token: ${{ secrets.TOKEN }}
- override: false
- verbose: false
- release-notes-assistant: false
diff --git a/.github/dependabot.yml b/.github/dependabot.yml
deleted file mode 100644
index c44914e..0000000
--- a/.github/dependabot.yml
+++ /dev/null
@@ -1,15 +0,0 @@
-# To get started with Dependabot version updates, you'll need to specify which
-# package ecosystems to update and where the package manifests are located.
-# Please see the documentation for all configuration options:
-# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
-
-version: 2
-updates:
- - package-ecosystem: 'npm' # See documentation for possible values
- directory: '/' # Location of package manifests
- schedule:
- interval: 'daily'
- versioning-strategy: 'increase-if-necessary'
- ignore:
- - dependency-name: '*'
- update-types: ['version-update:semver-major']
diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml
index 310777b..13e2b2a 100644
--- a/.github/workflows/workflow.yml
+++ b/.github/workflows/workflow.yml
@@ -3,51 +3,30 @@ name: BTClock WebUI CI
on: [push]
env:
- PUBLIC_BASE_URL: ''
+ PUBLIC_BASE_URL: ""
jobs:
- check-changes:
- runs-on: ubuntu-latest
- outputs:
- all_changed_and_modified_files_count: ${{ steps.changed-files.outputs.all_changed_and_modified_files_count }}
- steps:
- - name: Checkout code
- uses: actions/checkout@v4
-
- - name: Get changed files count
- id: changed-files
- uses: tj-actions/changed-files@v45
- with:
- files_ignore: 'doc/**,README.md,Dockerfile,.*'
- files_ignore_separator: ','
- - name: Print changed files count
- run: >
- echo "Changed files count: ${{
- steps.changed-files.outputs.all_changed_and_modified_files_count }}"
-
build:
- needs: check-changes
runs-on: ubuntu-latest
- if: ${{ needs.check-changes.outputs.all_changed_and_modified_files_count >= 1 }}
permissions:
contents: write
steps:
- - uses: actions/checkout@v4
+ - uses: actions/checkout@v3
with:
submodules: recursive
- - uses: actions/setup-node@v4
+ - uses: actions/setup-node@v3
with:
node-version: lts/*
cache: yarn
cache-dependency-path: '**/yarn.lock'
- - uses: actions/cache@v4
+ - uses: actions/cache@v3
with:
path: |
~/.cache/pip
~/node_modules
key: ${{ runner.os }}-pio
- - uses: actions/setup-python@v5
+ - uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Get current date
@@ -61,76 +40,30 @@ jobs:
make dist
- name: Install yarn
run: yarn && yarn postinstall
- - name: Run linter
- run: yarn lint
- - name: Run vitest tests
- run: yarn vitest run
- - name: Install Playwright Browsers
- run: npx playwright install --with-deps
- - name: Run Playwright tests
- run: npx playwright test
- name: Build WebUI
run: yarn build
- name: Get current block
id: getBlockHeight
run: echo "blockHeight=$(curl -s https://mempool.space/api/blocks/tip/height)" >> $GITHUB_OUTPUT
- - name: Write block height to file
- env:
- BLOCK_HEIGHT: ${{ steps.getBlockHeight.outputs.blockHeight }}
- run: mkdir -p output && echo "$BLOCK_HEIGHT" > output/version.txt
- name: gzip build for LittleFS
run: find dist -type f ! -name ".*" -exec sh -c 'mkdir -p "build_gz/$(dirname "${1#dist/}")" && gzip -k "$1" -c > "build_gz/${1#dist/}".gz' _ {} \;
- - name: Write git rev to file
- run: echo "$GITHUB_SHA" > build_gz/fs_hash.txt && echo "$GITHUB_SHA" > output/commit.txt
- - name: Check GZipped directory size
- run: |
- # Set the threshold size in bytes
- THRESHOLD=409600
-
- # Calculate the total size of files in the directory
- DIRECTORY_SIZE=$(du -b -s build_gz | awk '{print $1}')
-
- # Fail the workflow if the size exceeds the threshold
- if [ "$DIRECTORY_SIZE" -gt "$THRESHOLD" ]; then
- echo "Directory size exceeds the threshold of $THRESHOLD bytes"
- exit 1
- else
- echo "Directory size is within the threshold $DIRECTORY_SIZE"
- fi
- name: Create tarball
run: tar czf webui.tgz --strip-components=1 dist
- name: Build LittleFS
- run: |
- set -e
- /tmp/mklittlefs/mklittlefs -c build_gz -s 409600 output/littlefs.bin
+ run: /tmp/mklittlefs/mklittlefs -c build_gz -s 409600 littlefs.bin
- name: Upload artifacts
- uses: actions/upload-artifact@v4
+ uses: actions/upload-artifact@v3
with:
path: |
webui.tgz
- output/littlefs.bin
+ littlefs.bin
- name: Create release
- if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: ncipollo/release-action@v1
with:
tag: ${{ steps.getBlockHeight.outputs.blockHeight }}
commit: main
name: release-${{ steps.getBlockHeight.outputs.blockHeight }}
- artifacts: 'output/littlefs.bin,webui.tgz'
+ artifacts: "littlefs.bin,webui.tgz"
allowUpdates: true
removeArtifacts: true
- makeLatest: true
- - name: Pushes littlefs.bin to web flasher
- if: github.event_name == 'push' && github.ref == 'refs/heads/main'
- id: push_directory
- uses: cpina/github-action-push-to-another-repository@main
- env:
- SSH_DEPLOY_KEY: ${{ secrets.SSH_DEPLOY_KEY }}
- with:
- source-directory: output/
- target-directory: webui/
- destination-github-username: 'btclock'
- destination-repository-name: 'web-flasher'
- target-branch: main
- user-name: ${{github.actor}}
- user-email: ${{github.actor}}@users.noreply.github.com
+ makeLatest: true
\ No newline at end of file
diff --git a/.gitignore b/.gitignore
index 441fdc9..5a5ed98 100644
--- a/.gitignore
+++ b/.gitignore
@@ -12,4 +12,3 @@ dist
vite.config.js.timestamp-*
vite.config.ts.timestamp-*
yarn-error.log
-test-results/
\ No newline at end of file
diff --git a/.prettierignore b/.prettierignore
index 96ca2e4..297772e 100644
--- a/.prettierignore
+++ b/.prettierignore
@@ -8,7 +8,7 @@ node_modules
!.env.example
dist/
build_gz
-dist/**
+
# Ignore files for PNPM, NPM and YARN
pnpm-lock.yaml
diff --git a/.vscode/settings.json b/.vscode/settings.json
index 2fcadf2..c0772af 100644
--- a/.vscode/settings.json
+++ b/.vscode/settings.json
@@ -1,5 +1,6 @@
{
- "i18n-ally.localesPaths": ["src/lib/locales"],
- "i18n-ally.keystyle": "nested",
- "i18n-ally.sourceLanguage": "en"
-}
+ "i18n-ally.localesPaths": [
+ "src/lib/locales"
+ ],
+ "i18n-ally.keystyle": "nested"
+}
\ No newline at end of file
diff --git a/README.md b/README.md
index 7913f27..5c91169 100644
--- a/README.md
+++ b/README.md
@@ -1,46 +1,38 @@
-# BTClock WebUI
+# create-svelte
-[](https://git.btclock.dev/btclock/webui/releases/latest)
-[](https://git.btclock.dev/btclock/webui/actions?workflow=build.yaml&actor=0&status=0)
+Everything you need to build a Svelte project, powered by [`create-svelte`](https://github.com/sveltejs/kit/tree/master/packages/create-svelte).
-The web user-interface for the BTClock, based on Svelte-kit. It uses Bootstrap for the lay-out.
+## Creating a project
-
-
+If you're seeing this, you've probably already done this step. Congrats!
+
+```bash
+# create a new project in the current directory
+npm create svelte@latest
+
+# create a new project in my-app
+npm create svelte@latest my-app
+```
## Developing
-After installed dependencies with `yarn`, start a development server:
+Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server:
```bash
-yarn dev
+npm run dev
# or start the server and open the app in a new browser tab
-yarn dev -- --open
+npm run dev -- --open
```
## Building
-To create a production version of the WebUI:
+To create a production version of your app:
```bash
-yarn build
+npm run build
```
-Make sure the postinstall script is ran, because otherwise the filenames are to long for the LittleFS filesystem.
+You can preview the production build with `npm run preview`.
-## Deploying
-
-To upload the firmware to the BTClock, you need to GZIP all the files. You can use the python script `gzip_build.py` for that:
-
-```bash
-python3 gzip_build.py
-```
-
-Then you can make a `LittleFS.bin` with mklittlefs:
-
-```bash
-mklittlefs -c build_gz -s 409600 littlefs.bin
-```
-
-You can preview the production build with `yarn preview`.
+> To deploy your app, you may need to install an [adapter](https://kit.svelte.dev/docs/adapters) for your target environment.
diff --git a/doc/LICENSE.txt b/doc/LICENSE.txt
deleted file mode 100644
index d645695..0000000
--- a/doc/LICENSE.txt
+++ /dev/null
@@ -1,202 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
diff --git a/doc/screenshot-dark.webp b/doc/screenshot-dark.webp
deleted file mode 100644
index 64f26d2..0000000
Binary files a/doc/screenshot-dark.webp and /dev/null differ
diff --git a/doc/screenshot-light.webp b/doc/screenshot-light.webp
deleted file mode 100644
index d5fad73..0000000
Binary files a/doc/screenshot-light.webp and /dev/null differ
diff --git a/eslint.config.js b/eslint.config.js
deleted file mode 100644
index 62dbd03..0000000
--- a/eslint.config.js
+++ /dev/null
@@ -1,33 +0,0 @@
-import js from '@eslint/js';
-import ts from 'typescript-eslint';
-import svelte from 'eslint-plugin-svelte';
-import prettier from 'eslint-config-prettier';
-import globals from 'globals';
-
-/** @type {import('eslint').Linter.Config[]} */
-export default [
- js.configs.recommended,
- ...ts.configs.recommended,
- ...svelte.configs['flat/recommended'],
- prettier,
- ...svelte.configs['flat/prettier'],
- {
- languageOptions: {
- globals: {
- ...globals.browser,
- ...globals.node
- }
- }
- },
- {
- files: ['**/*.svelte'],
- languageOptions: {
- parserOptions: {
- parser: ts.parser
- }
- }
- },
- {
- ignores: ['build/', '.svelte-kit/', 'dist/']
- }
-];
diff --git a/extra/icons/flash.svg b/extra/icons/flash.svg
deleted file mode 100644
index 23ca832..0000000
--- a/extra/icons/flash.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/extra/icons/lightning-bolt.svg b/extra/icons/lightning-bolt.svg
deleted file mode 100644
index 78cb2c5..0000000
--- a/extra/icons/lightning-bolt.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/extra/icons/pickaxe.svg b/extra/icons/pickaxe.svg
deleted file mode 100644
index 2c85559..0000000
--- a/extra/icons/pickaxe.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/extra/icons/rocket.svg b/extra/icons/rocket.svg
deleted file mode 100644
index cf9b58f..0000000
--- a/extra/icons/rocket.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/package.json b/package.json
index 8596a5c..744d61e 100644
--- a/package.json
+++ b/package.json
@@ -5,69 +5,42 @@
"scripts": {
"dev": "vite dev",
"build": "vite build",
- "build:test": "vite build --config vite.config.test.ts",
"preview": "vite preview",
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
"lint": "prettier --check . && eslint .",
"format": "prettier --write .",
- "postinstall": "patch-package",
- "test": "prettier --write . && eslint . && npm run test:integration && npm run test:unit",
- "test:integration": "playwright test",
- "test:screenshots": "playwright test -c playwright.screenshot.config.ts",
- "doc:update-screenshots": "playwright test -c playwright.doc-screenshot.config.ts",
- "test:unit": "vitest"
+ "postinstall": "patch-package"
},
"devDependencies": {
"@rollup/plugin-json": "^6.0.1",
- "@sveltejs/adapter-auto": "^3.0.0",
- "@sveltejs/adapter-static": "^3.0.0",
- "@sveltejs/kit": "^2.0.0",
- "@sveltejs/vite-plugin-svelte": "^3.0.1",
- "@testing-library/svelte": "^5.2.1",
+ "@sveltejs/adapter-auto": "^2.0.0",
+ "@sveltejs/adapter-static": "^2.0.3",
+ "@sveltejs/kit": "^1.27.4",
"@types/swagger-ui": "^3.52.4",
- "@typescript-eslint/eslint-plugin": "^8.7.0",
- "@typescript-eslint/parser": "^8.7.0",
- "@vitest/ui": "^2.0.5",
- "eslint": "^9.11.0",
- "eslint-config-prettier": "^9.1.0",
- "eslint-plugin-svelte": "^2.36.0",
- "jsdom": "^25.0.0",
- "prettier": "^3.3.3",
- "prettier-plugin-svelte": "^3.2.6",
- "rollup-plugin-visualizer": "^5.12.0",
- "sass": "^1.79.3",
- "sharp": "^0.33.5",
- "svelte": "^4.2.19",
- "svelte-check": "^4.0.2",
- "svelte-preprocess": "^6.0.2",
- "tslib": "^2.7.0",
- "typescript": "^5.5.4",
- "typescript-eslint": "^8.7.0",
- "vite": "^5.4.7",
- "vitest": "^2.1.1"
+ "@typescript-eslint/eslint-plugin": "^6.0.0",
+ "@typescript-eslint/parser": "^6.0.0",
+ "eslint": "^8.28.0",
+ "eslint-config-prettier": "^9.0.0",
+ "eslint-plugin-svelte": "^2.30.0",
+ "prettier": "^3.0.0",
+ "prettier-plugin-svelte": "^3.0.0",
+ "sass": "^1.69.5",
+ "svelte": "^4.0.5",
+ "svelte-check": "^3.6.0",
+ "tslib": "^2.4.1",
+ "typescript": "^5.0.0",
+ "vite": "^4.4.2"
},
"type": "module",
"dependencies": {
- "@fontsource/antonio": "^5.1.0",
- "@fontsource/oswald": "^5.1.0",
- "@fontsource/ubuntu": "^5.1.0",
- "@noble/secp256k1": "^2.1.0",
- "@playwright/test": "^1.46.0",
- "@popperjs/core": "^2.11.8",
- "@sveltestrap/sveltestrap": "^6.2.7",
- "@testing-library/jest-dom": "^6.5.0",
- "bootstrap": "^5.3.3",
- "bootstrap-icons": "^1.11.3",
- "msgpack-es": "^0.0.5",
- "nostr-tools": "^2.7.1",
+ "@fontsource/antonio": "^5.0.17",
+ "@fontsource/oswald": "^5.0.17",
+ "@fontsource/ubuntu": "^5.0.8",
+ "bootstrap": "^5.3.2",
"patch-package": "^8.0.0",
- "svelte-bootstrap-icons": "^3.1.1",
- "svelte-i18n": "^4.0.0"
- },
- "resolutions": {
- "es5-ext": ">=0.10.64",
- "ws": ">=8.18.0",
- "micromatch": ">=4.0.8"
+ "svelte-i18n": "^4.0.0",
+ "sveltestrap": "^5.11.2",
+ "swagger-ui": "^5.10.0"
}
}
diff --git a/patches/@sveltejs+kit+2.16.0+001+initial.patch b/patches/@sveltejs+kit+1.27.6.patch
similarity index 66%
rename from patches/@sveltejs+kit+2.16.0+001+initial.patch
rename to patches/@sveltejs+kit+1.27.6.patch
index 7fb98b1..a008413 100644
--- a/patches/@sveltejs+kit+2.16.0+001+initial.patch
+++ b/patches/@sveltejs+kit+1.27.6.patch
@@ -1,17 +1,17 @@
diff --git a/node_modules/@sveltejs/kit/src/exports/vite/index.js b/node_modules/@sveltejs/kit/src/exports/vite/index.js
-index ddbe746..1d926a4 100644
+index a7a886d..d3433b5 100644
--- a/node_modules/@sveltejs/kit/src/exports/vite/index.js
+++ b/node_modules/@sveltejs/kit/src/exports/vite/index.js
-@@ -658,9 +658,9 @@ async function kit({ svelte_config }) {
+@@ -561,9 +561,9 @@ function kit({ svelte_config }) {
+ input,
output: {
- format: inline ? 'iife' : 'esm',
- name: `__sveltekit_${version_hash}.app`,
+ format: 'esm',
- entryFileNames: ssr ? '[name].js' : `${prefix}/[name].[hash].${ext}`,
-- chunkFileNames: ssr ? 'chunks/[name].js' : `${prefix}/chunks/[hash].${ext}`,
+- chunkFileNames: ssr ? 'chunks/[name].js' : `${prefix}/chunks/[name].[hash].${ext}`,
- assetFileNames: `${prefix}/assets/[name].[hash][extname]`,
+ entryFileNames: ssr ? '[name].js' : `${prefix}/[hash].${ext}`,
-+ chunkFileNames: ssr ? 'chunks/[name].js' : `${prefix}/c[hash].${ext}`,
-+ assetFileNames: `${prefix}/a[hash][extname]`,
++ chunkFileNames: ssr ? 'chunks/[name].js' : `${prefix}/chunks/[hash].${ext}`,
++ assetFileNames: `${prefix}/assets/[hash][extname]`,
hoistTransitiveImports: false,
- sourcemapIgnoreList,
- manualChunks: split ? undefined : () => 'bundle',
+ sourcemapIgnoreList
+ },
diff --git a/playwright.config.ts b/playwright.config.ts
deleted file mode 100644
index 461f3c2..0000000
--- a/playwright.config.ts
+++ /dev/null
@@ -1,17 +0,0 @@
-import type { PlaywrightTestConfig } from '@playwright/test';
-
-const config: PlaywrightTestConfig = {
- use: {
- locale: 'en-GB',
- timezoneId: 'Europe/Amsterdam'
- },
- webServer: {
- command: 'npm run build:test && npm run preview',
- port: 4173
- },
- reporter: process.env.CI ? 'github' : 'list',
- testDir: 'tests/playwright',
- testMatch: /(.+\.)?(test|spec)\.[jt]s/
-};
-
-export default config;
diff --git a/playwright.doc-screenshot.config.ts b/playwright.doc-screenshot.config.ts
deleted file mode 100644
index f052338..0000000
--- a/playwright.doc-screenshot.config.ts
+++ /dev/null
@@ -1,27 +0,0 @@
-import { defineConfig } from '@playwright/test';
-
-export default defineConfig({
- use: {
- locale: 'en-GB',
- timezoneId: 'Europe/Amsterdam'
- },
- webServer: {
- command: 'yarn build && yarn preview',
- port: 4173
- },
- testDir: './tests/doc-screenshots',
- outputDir: './test-results/screenshots',
- projects: [
- {
- name: 'Light Mode',
- use: {
- viewport: { width: 1440, height: 900 },
- colorScheme: 'light'
- }
- },
- {
- name: 'Dark Mode',
- use: { viewport: { width: 1440, height: 900 }, colorScheme: 'dark' }
- }
- ]
-});
diff --git a/playwright.screenshot.config.ts b/playwright.screenshot.config.ts
deleted file mode 100644
index f4272ff..0000000
--- a/playwright.screenshot.config.ts
+++ /dev/null
@@ -1,67 +0,0 @@
-import { defineConfig, devices } from '@playwright/test';
-
-export default defineConfig({
- reporter: 'html',
- use: {
- locale: 'en-GB',
- timezoneId: 'Europe/Amsterdam'
- },
- webServer: {
- command: 'npm run build && npm run preview',
- port: 4173
- },
- testDir: './tests/screenshots',
- outputDir: './test-results/screenshots',
- projects: [
- {
- name: 'MacBook Air 13 inch',
- use: {
- viewport: { width: 1440, height: 900 }
- }
- },
- {
- name: 'iPhone 14 Pro',
- use: { ...devices['iPhone 14 Pro'] }
- },
- {
- name: 'iPhone 15 Pro Landscape',
- use: { ...devices['iPhone 15 Pro Landscape'] }
- },
- {
- name: 'MacBook Pro 14 inch',
- use: {
- viewport: { width: 1512, height: 982 }
- }
- },
- {
- name: 'MacBook Pro 14 inch NL locale',
- use: {
- viewport: { width: 1512, height: 982 },
- locale: 'nl'
- }
- },
- {
- name: 'MacBook Pro 14 inch nl-NL locale',
- use: {
- viewport: { width: 1512, height: 982 },
- locale: 'nl-NL'
- }
- },
- {
- name: 'MacBook Pro 14 inch Firefox HiDPI',
- use: { ...devices['Desktop Firefox HiDPI'], viewport: { width: 1512, height: 982 } }
- },
- {
- name: 'MacBook Pro 14 inch Safari',
- use: { ...devices['Desktop Safari'], viewport: { width: 1512, height: 982 } }
- },
- {
- name: 'MacBook Pro 14 inch Safari Dark Mode',
- use: {
- ...devices['Desktop Safari'],
- viewport: { width: 1512, height: 982 },
- colorScheme: 'dark'
- }
- }
- ]
-});
diff --git a/renovate.json b/renovate.json
deleted file mode 100644
index 7dca1ca..0000000
--- a/renovate.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "$schema": "https://docs.renovatebot.com/renovate-schema.json",
- "extends": ["config:recommended"],
- "packageRules": [
- {
- "matchUpdateTypes": ["major"],
- "enabled": false,
- "matchPackageNames": ["*"]
- }
- ],
- "npm": {
- "rangeStrategy": "update-lockfile"
- }
-}
diff --git a/src/hooks.server.ts b/src/hooks.server.ts
index 1f9b93e..2c6aa97 100644
--- a/src/hooks.server.ts
+++ b/src/hooks.server.ts
@@ -1,10 +1,10 @@
-import type { Handle } from '@sveltejs/kit';
-import { locale } from 'svelte-i18n';
+import type { Handle } from '@sveltejs/kit'
+import { locale } from 'svelte-i18n'
export const handle: Handle = async ({ event, resolve }) => {
- const lang = event.request.headers.get('accept-language')?.split(',')[0];
+ const lang = event.request.headers.get('accept-language')?.split(',')[0]
if (lang) {
- locale.set(lang);
+ locale.set(lang)
}
- return resolve(event);
-};
+ return resolve(event)
+}
\ No newline at end of file
diff --git a/src/icons/PickaxeIcon.svelte b/src/icons/PickaxeIcon.svelte
deleted file mode 100644
index 6d35c68..0000000
--- a/src/icons/PickaxeIcon.svelte
+++ /dev/null
@@ -1,5 +0,0 @@
-
diff --git a/src/icons/RocketIcon.svelte b/src/icons/RocketIcon.svelte
deleted file mode 100644
index 1317fd7..0000000
--- a/src/icons/RocketIcon.svelte
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-rocket-launch
diff --git a/src/icons/ZapIcon.svelte b/src/icons/ZapIcon.svelte
deleted file mode 100644
index 59a5c5c..0000000
--- a/src/icons/ZapIcon.svelte
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-flash
diff --git a/src/lib/components/ColorSchemeSwitcher.svelte b/src/lib/components/ColorSchemeSwitcher.svelte
deleted file mode 100644
index 9d7e32a..0000000
--- a/src/lib/components/ColorSchemeSwitcher.svelte
+++ /dev/null
@@ -1,53 +0,0 @@
-
-
-
-
- {theme === 'auto' ? '🌗' : theme === 'dark' ? '🌙' : '☀️'}
-
-
- setTheme('light')}
- >☀️ Light
- setTheme('dark')}>🌙 Dark
- setTheme('auto')}>🌗 Auto
-
-
diff --git a/src/lib/components/Placeholder.svelte b/src/lib/components/Placeholder.svelte
deleted file mode 100644
index 3eecfdc..0000000
--- a/src/lib/components/Placeholder.svelte
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
- {valueToCheck ? value : ''}
-
diff --git a/src/lib/components/SettingsInput.svelte b/src/lib/components/SettingsInput.svelte
deleted file mode 100644
index 01738e6..0000000
--- a/src/lib/components/SettingsInput.svelte
+++ /dev/null
@@ -1,65 +0,0 @@
-
-
-
- {label}
-
-
-
- {#if suffix}
- {suffix}
- {/if}
-
-
- {#if helpText}
- {helpText}
- {/if}
-
-
diff --git a/src/lib/components/SettingsSelect.svelte b/src/lib/components/SettingsSelect.svelte
deleted file mode 100644
index ef34fec..0000000
--- a/src/lib/components/SettingsSelect.svelte
+++ /dev/null
@@ -1,34 +0,0 @@
-
-
-
- {label}
-
-
- {#each options as [key, val]}
- {key}
- {/each}
-
- {#if helpText}
- {helpText}
- {/if}
-
-
diff --git a/src/lib/components/SettingsSwitch.svelte b/src/lib/components/SettingsSwitch.svelte
deleted file mode 100644
index 27a3156..0000000
--- a/src/lib/components/SettingsSwitch.svelte
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
-
-
diff --git a/src/lib/components/ToggleHeader.svelte b/src/lib/components/ToggleHeader.svelte
deleted file mode 100644
index acc8d3b..0000000
--- a/src/lib/components/ToggleHeader.svelte
+++ /dev/null
@@ -1,28 +0,0 @@
-
-
-
- (isOpen = !isOpen)}
- tabindex="0"
- on:keypress={() => (isOpen = !isOpen)}
- >
- {#if isOpen}
-
- {:else}
-
- {/if}
- {header}
-
-
-
-
-
diff --git a/src/lib/components/index.ts b/src/lib/components/index.ts
deleted file mode 100644
index b026c1c..0000000
--- a/src/lib/components/index.ts
+++ /dev/null
@@ -1,6 +0,0 @@
-export { default as SettingsSwitch } from './SettingsSwitch.svelte';
-export { default as SettingsInput } from './SettingsInput.svelte';
-export { default as SettingsSelect } from './SettingsSelect.svelte';
-export { default as ToggleHeader } from './ToggleHeader.svelte';
-export { default as ColorSchemeSwitcher } from './ColorSchemeSwitcher.svelte';
-export { default as Placeholder } from './Placeholder.svelte';
diff --git a/src/lib/components/settings/DataSourceSettings.svelte b/src/lib/components/settings/DataSourceSettings.svelte
deleted file mode 100644
index 5891573..0000000
--- a/src/lib/components/settings/DataSourceSettings.svelte
+++ /dev/null
@@ -1,142 +0,0 @@
-
-
-
-
-
-
- Data Source
-
-
-
-
-
-
-
-
- {#if $settings.nostrRelay}
-
-
-
- {/if}
-
-
-
-
-
-
-
-
- {#if $settings.dataSource === DataSourceType.THIRD_PARTY_SOURCE}
-
-
-
- HTTPS
-
-
- {/if}
-
- {#if $settings.dataSource === DataSourceType.NOSTR_SOURCE}
-
- checkValidNostrPubkey('nostrPubKey')}
- onInput={() => checkValidNostrPubkey('nostrPubKey')}
- />
- {/if}
-
- {#if $settings.dataSource === DataSourceType.CUSTOM_SOURCE}
-
-
- {/if}
-
-
diff --git a/src/lib/components/settings/DisplaySettings.svelte b/src/lib/components/settings/DisplaySettings.svelte
deleted file mode 100644
index 0edaad0..0000000
--- a/src/lib/components/settings/DisplaySettings.svelte
+++ /dev/null
@@ -1,206 +0,0 @@
-
-
-
-
-
-
-
-
- ($settings.timePerScreen = Number(e.target.value))}
- type="number"
- min={1}
- step={1}
- required={true}
- suffix={$_('time.minutes')}
- size={$uiSettings.inputSize}
- />
-
-
-
-
-
-
- {#if $settings.hasFrontlight && !$settings.flDisable}
-
-
-
- {/if}
-
- {#if !$settings.flDisable && $settings.hasLightLevel}
-
- {/if}
-
-
-
-
-
-
-
-
- {#if $settings.hasFrontlight}
-
- {/if}
-
- {#if $settings.hasFrontlight && !$settings.flDisable}
-
-
-
-
- {#if $settings.hasLightLevel}
-
- {/if}
- {/if}
-
-
-
diff --git a/src/lib/components/settings/ExtraFeaturesSettings.svelte b/src/lib/components/settings/ExtraFeaturesSettings.svelte
deleted file mode 100644
index 95cc470..0000000
--- a/src/lib/components/settings/ExtraFeaturesSettings.svelte
+++ /dev/null
@@ -1,321 +0,0 @@
-
-
-
-
-
-
- {#if $settings.dnd.timeBasedEnabled}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {/if}
-
-
- {#if 'bitaxeEnabled' in $settings}
-
-
- BitAxe
-
- {#if $settings.bitaxeEnabled}
-
-
- {$_('test', { default: 'Test' })}
-
-
- {/if}
-
-
- {/if}
-
-
- {#if 'miningPoolStats' in $settings}
-
-
- Mining Pool stats
-
- {#if $settings.miningPoolStats}
-
- {#if $settings.miningPoolName === 'local_public_pool'}
-
-
- {$_('test', { default: 'Test' })}
-
-
- {/if}
-
- {/if}
-
-
- {/if}
-
-
- {#if 'nostrZapNotify' in $settings}
-
-
- Nostr
-
-
- {#if $settings.nostrZapNotify}
-
-
- {#if $settings.hasFrontlight && !$settings.flDisable}
-
- {/if}
-
-
-
-
- checkValidNostrPubkey('nostrZapPubkey')}
- onInput={() => checkValidNostrPubkey('nostrZapPubkey')}
- />
- {/if}
-
-
- {/if}
-
-
diff --git a/src/lib/components/settings/ScreenSpecificSettings.svelte b/src/lib/components/settings/ScreenSpecificSettings.svelte
deleted file mode 100644
index bae67df..0000000
--- a/src/lib/components/settings/ScreenSpecificSettings.svelte
+++ /dev/null
@@ -1,126 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {#if !$settings.actCurrencies}
-
- {/if}
-
-
- {$_('section.settings.screens')}
- {#if $settings.screens}
- {#each $settings.screens as s}
-
- {/each}
- {/if}
-
- {#if $settings.actCurrencies && $settings.dataSource == DataSourceType.BTCLOCK_SOURCE}
-
- {$_('section.settings.currencies')}
- {$_('restartRequired')}
- {#if $settings.availableCurrencies}
- {#each $settings.availableCurrencies as c}
-
-
-
- {c}
-
-
- {/each}
- {/if}
-
- {/if}
-
-
diff --git a/src/lib/components/settings/SystemSettings.svelte b/src/lib/components/settings/SystemSettings.svelte
deleted file mode 100644
index f774c8f..0000000
--- a/src/lib/components/settings/SystemSettings.svelte
+++ /dev/null
@@ -1,98 +0,0 @@
-
-
-
-
- ($settings.tzString = value)}
- size={$uiSettings.inputSize}
- />
-
- {#if $settings.httpAuthEnabled}
-
-
- (showPassword = !showPassword)}
- color={showPassword ? 'success' : 'danger'}
- >
- {#if !showPassword} {:else} {/if}
-
-
- {/if}
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/lib/components/settings/TimezoneSelector.svelte b/src/lib/components/settings/TimezoneSelector.svelte
deleted file mode 100644
index f76ddd6..0000000
--- a/src/lib/components/settings/TimezoneSelector.svelte
+++ /dev/null
@@ -1,56 +0,0 @@
-
-
-
-
- {$_('section.settings.timezoneOffset')}
-
-
-
-
- {#each timezones as tz}
-
- {tz}
-
- {/each}
-
-
- {$_('auto-detect')}
-
-
- {$_('section.settings.tzOffsetHelpText')}
-
-
diff --git a/src/lib/components/settings/index.ts b/src/lib/components/settings/index.ts
deleted file mode 100644
index 6ddfa7c..0000000
--- a/src/lib/components/settings/index.ts
+++ /dev/null
@@ -1,5 +0,0 @@
-export { default as ScreenSpecificSettings } from './ScreenSpecificSettings.svelte';
-export { default as DisplaySettings } from './DisplaySettings.svelte';
-export { default as DataSourceSettings } from './DataSourceSettings.svelte';
-export { default as ExtraFeaturesSettings } from './ExtraFeaturesSettings.svelte';
-export { default as SystemSettings } from './SystemSettings.svelte';
diff --git a/src/lib/config.ts b/src/lib/config.ts
deleted file mode 100644
index 55130ff..0000000
--- a/src/lib/config.ts
+++ /dev/null
@@ -1,5 +0,0 @@
-import * as publicEnv from '$env/static/public';
-
-export const PUBLIC_BASE_URL: string = Object.hasOwn(publicEnv, 'PUBLIC_BASE_URL')
- ? publicEnv.PUBLIC_BASE_URL
- : '';
diff --git a/src/lib/i18n/index.ts b/src/lib/i18n/index.ts
index fa817a7..7f85386 100644
--- a/src/lib/i18n/index.ts
+++ b/src/lib/i18n/index.ts
@@ -1,30 +1,13 @@
-import { browser } from '$app/environment';
-import { init, register } from 'svelte-i18n';
+import { browser } from '$app/environment'
+import { init, register } from 'svelte-i18n'
-const defaultLocale = 'en';
+const defaultLocale = 'en'
-register('en', () => import('../locales/en.json'));
-register('nl', () => import('../locales/nl.json'));
-register('es', () => import('../locales/es.json'));
-register('de', () => import('../locales/de.json'));
-
-const getInitialLocale = () => {
- if (!browser) return defaultLocale;
-
- // Check localStorage first
- const storedLocale = localStorage.getItem('locale');
- if (storedLocale) return storedLocale;
-
- // Get browser locale and normalize it
- const browserLocale = window.navigator.language;
- const normalizedLocale = browserLocale.split('-')[0].toLowerCase();
-
- // Check if we support this locale
- const supportedLocales = ['en', 'nl', 'es', 'de'];
- return supportedLocales.includes(normalizedLocale) ? normalizedLocale : defaultLocale;
-};
+register('en', () => import('../locales/en.json'))
+register('nl', () => import('../locales/nl.json'))
+register('es', () => import('../locales/es.json'))
init({
fallbackLocale: defaultLocale,
- initialLocale: getInitialLocale()
-});
+ initialLocale: browser ? window.navigator.language : defaultLocale,
+})
\ No newline at end of file
diff --git a/src/lib/index.ts b/src/lib/index.ts
index 981d545..856f2b6 100644
--- a/src/lib/index.ts
+++ b/src/lib/index.ts
@@ -1,81 +1 @@
-import * as nip19 from 'nostr-tools/nip19';
-import { Relay } from 'nostr-tools';
-
-/**
- * Validates if the given npub is a valid Nostr Public Key.
- * @param npub - The npub (Nostr Public Key) to validate.
- * @returns A boolean indicating if the npub is valid.
- */
-const isValidNpub = (npub: string): boolean => {
- try {
- // Decode the npub using NIP-19
- const { type, data } = nip19.decode(npub);
- // Check if the type is 'npub' and the data length is 32 bytes
- return type === 'npub' && data.length === 64;
- } catch {
- // If any error is thrown, the npub is not valid
- return false;
- }
-};
-
-/**
- * Validates if the given URL is a valid Nostr relay.
- * @param url - The URL of the Nostr relay to validate.
- * @returns A Promise indicating if the URL is a valid Nostr relay.
- */
-const isValidNostrRelay = async (url: string): Promise => {
- try {
- const relay: Relay = await Relay.connect(url);
-
- // If the relay is successfully connected, it's a valid Nostr relay
- if (relay.connected) {
- // Close the connection to clean up
- relay.close();
- return true;
- }
-
- return false;
- } catch {
- // If any error is thrown, the URL is not a valid Nostr relay
- return false;
- }
-};
-
-/**
- * Validates if the given parameter is a valid hex public key.
- * @param pubkey - The public key to validate.
- * @returns A boolean indicating if the public key is valid.
- */
-const isValidHexPubKey = (pubkey: string): boolean => {
- return /^[0-9a-f]{64}$/i.test(pubkey);
-};
-
-/**
- * Checks if a parameter is a valid pubkey or npub and converts npub to pubkey.
- * @param input - The input string to check and convert.
- * @returns The pubkey if valid, otherwise null.
- */
-
-const getPubKey = (input: string): string | null => {
- try {
- // If input is a valid hex public key
- if (isValidHexPubKey(input)) {
- return input;
- }
-
- // Try to decode the input as npub
- const { type, data } = nip19.decode(input);
-
- // Check if the decoded type is 'npub' and the data length is 64 characters (32 bytes in hex)
- if (type === 'npub' && data.length === 64) {
- return data;
- }
-
- return null;
- } catch {
- // If any error is thrown, the input is not valid
- return null;
- }
-};
-
-export { isValidNpub, isValidNostrRelay, isValidHexPubKey, getPubKey };
+// place files you want to import through the `$lib` alias in this folder.
diff --git a/src/lib/locales/de.json b/src/lib/locales/de.json
deleted file mode 100644
index 6671619..0000000
--- a/src/lib/locales/de.json
+++ /dev/null
@@ -1,153 +0,0 @@
-{
- "section": {
- "settings": {
- "title": "Einstellungen",
- "textColor": "Textfarbe",
- "backgroundColor": "Hintergrundfarbe",
- "ledPowerOnTest": "LED-Einschalttest",
- "ledFlashOnBlock": "LED blinkt bei neuem Block",
- "timePerScreen": "Zeit pro Bildschirm",
- "ledBrightness": "LED-Helligkeit",
- "flMaxBrightness": "Displaybeleuchtung Helligkeit",
- "timezoneOffset": "Zeitzonenoffset",
- "timeBetweenPriceUpdates": "Zeit zwischen Preisaktualisierungen",
- "fullRefreshEvery": "Vollständige Aktualisierung alle",
- "mempoolnstance": "Mempool Instance",
- "hostnamePrefix": "Hostnamen-Präfix",
- "StealFocusOnNewBlock": "Steal focus on new block",
- "useBigCharsMcap": "Verwende große Zeichen für die Marktkapitalisierung",
- "useBlkCountdown": "Blocks Countdown zur Halbierung",
- "useSatsSymbol": "Sats-Symbol verwenden",
- "suffixPrice": "Suffix-Preisformat",
- "disableLeds": "Alle LED-Effekte deaktivieren",
- "otaUpdates": "OTA updates",
- "enableMdns": "mDNS",
- "fetchEuroPrice": "€-Preis abrufen",
- "shortAmountsWarning": "Geringe Beträge können die Lebensdauer der Displays verkürzen",
- "tzOffsetHelpText": "Ein Neustart ist erforderlich, um den TZ-Offset anzuwenden.",
- "screens": "Bildschirme",
- "wifiTxPowerText": "In den meisten Fällen muss dies nicht eingestellt werden.",
- "wifiTxPower": "WiFi-TX-Leistung",
- "settingsSaved": "Einstellungen gespeichert",
- "errorSavingSettings": "Fehler beim Speichern der Einstellungen",
- "ownDataSource": "BTClock-Datenquelle",
- "flAlwaysOn": "Displaybeleuchtung immer an",
- "flEffectDelay": "Displaybeleuchtungeffekt Geschwindigkeit",
- "flFlashOnUpd": "Displaybeleuchting bei neuem Block",
- "mempoolInstanceHelpText": "Nur wirksam, wenn die BTClock-Datenquelle deaktiviert ist. \nZur Anwendung ist ein Neustart erforderlich.",
- "luxLightToggle": "Automatisches Umschalten des Frontlichts bei Lux",
- "wpTimeout": "WiFi-Konfigurationsportal timeout",
- "useNostr": "Nostr-Datenquelle verwenden",
- "flDisable": "Displaybeleuchtung deaktivieren",
- "httpAuthUser": "WebUI-Benutzername",
- "httpAuthPass": "WebUI-Passwort",
- "httpAuthText": "Schützt nur die WebUI mit einem Passwort, nicht API-Aufrufe.",
- "currencies": "Währungen",
- "mowMode": "Mow suffixmodus",
- "suffixShareDot": "Kompakte Suffix-Notation",
- "section": {
- "displaysAndLed": "Anzeigen und LEDs",
- "screenSettings": "Infospezifisch",
- "dataSource": "Datenquelle",
- "extraFeatures": "Zusätzliche Funktionen",
- "system": "System"
- },
- "ledFlashOnZap": "LED blinkt bei Nostr Zap",
- "flFlashOnZap": "Displaybeleuchting bei Nostr Zap",
- "showAll": "Alle anzeigen",
- "hideAll": "Alles ausblenden",
- "flOffWhenDark": "Displaybeleuchtung aus, wenn es dunkel ist",
- "luxLightToggleText": "Zum Deaktivieren auf 0 setzen",
- "verticalDesc": "Vrtikale Bildschirmbeschreibung",
- "enableDebugLog": "Debug-Protokoll aktivieren",
- "bitaxeEnabled": "BitAxe-Integration aktivieren",
- "miningPoolStats": "Mining-Pool-Statistiken Integration Aktivieren",
- "nostrZapNotify": "Nostr Zap-Benachrichtigungen aktivieren",
- "thirdPartySource": "mempool.space/coincap.io Verwenden",
- "dataSource": {
- "nostr": "Nostr-Verlag",
- "custom": "Benutzerdefinierter dataquelle"
- },
- "fontName": "Schriftart",
- "timeBasedDnd": "Aktivieren Sie den Zeitplan „Bitte nicht stören“.",
- "dndStartHour": "Startstunde",
- "dndStartMinute": "Startminute",
- "dndEndHour": "Endstunde",
- "dndEndMinute": "Schlussminute",
- "screenRestoreZap": "Vorherigen Bildschirmzustand nach Zap wieder herstellen (Verwendet {setting} Einstellung)"
- },
- "control": {
- "systemInfo": "Systeminfo",
- "version": "Version",
- "buildTime": "Build time",
- "ledColor": "LED-Farbe",
- "turnOff": "Ausschalten",
- "setColor": "Farbe festlegen",
- "showText": "Text anzeigen",
- "text": "Text",
- "title": "Kontrolle",
- "hostname": "Hostname",
- "frontlight": "Displaybeleuchtung",
- "turnOn": "Einschalten",
- "flashFrontlight": "Blinken",
- "fwCommitMismatch": "Die Firmware -Version unterscheidet sich von der WebUI -Version, dies kann zu Problemen führen."
- },
- "status": {
- "title": "Status",
- "screenCycle": "Bildschirmzyklus",
- "memoryFree": "Speicher frei",
- "wsPriceConnection": "WS-Preisverbindung",
- "wsMempoolConnection": "WS {instance}-Verbindung",
- "fetchEuroNote": "If you use \"Fetch € price\" the WS Price connection will show ❌ since it uses another data source.",
- "uptime": "Betriebszeit",
- "wifiSignalStrength": "WiFi-Signalstärke",
- "wsDataConnection": "BTClock-Datenquelle verbindung",
- "lightSensor": "Lichtsensor",
- "nostrConnection": "Nostr Relay-Verbindung",
- "doNotDisturb": "Bitte nicht stören",
- "timeBasedDnd": "Zeitbasierter Zeitplan"
- },
- "firmwareUpdater": {
- "fileUploadSuccess": "Datei erfolgreich hochgeladen, Gerät neu gestartet. WebUI in {countdown} Sekunden neu geladen",
- "fileUploadFailed": "Das Hochladen der Datei ist fehlgeschlagen. \nStellen Sie sicher, dass Sie die richtige Datei ausgewählt haben, und versuchen Sie es erneut.",
- "uploading": "Hochladen",
- "firmwareUpdateText": "Wenn Sie die Firmware-Upload-Funktion verwenden, stellen Sie sicher, dass Sie die richtigen Dateien verwenden. \nDas Hochladen der falschen Dateien kann dazu führen, dass das Gerät nicht mehr funktioniert. \nWenn es schief geht, können Sie die Firmware wiederherstellen, indem Sie das vollständige Image hochladen, nachdem Sie das Gerät in den BOOT-Modus versetzt haben.",
- "swUpToDate": "Du hast die neueste Version.",
- "swUpdateAvailable": "Eine neuere Version ist verfügbar!",
- "latestVersion": "Letzte Version",
- "releaseDate": "Veröffentlichungsdatum",
- "viewRelease": "Veröffentlichung anzeigen",
- "autoUpdate": "Update installieren (experimentell)",
- "autoUpdateInProgress": "Automatische Aktualisierung läuft, bitte warten..."
- }
- },
- "colors": {
- "black": "Schwarz",
- "white": "Weiss"
- },
- "time": {
- "minutes": "Minuten",
- "seconds": "Sekunden"
- },
- "restartRequired": "Neustart erforderlich",
- "button": {
- "save": "Speichern",
- "reset": "Zurücksetzen",
- "restart": "Neustart",
- "forceFullRefresh": "Vollständige Aktualisierung erzwingen"
- },
- "timer": {
- "running": "läuft",
- "stopped": "gestoppt"
- },
- "sections": {
- "control": {
- "keepSameColor": "Gleiche Farbe beibehalten"
- }
- },
- "rssiBar": {
- "tooltip": "Werte > -67 dBm gelten als gut. > -30 dBm ist erstaunlich"
- },
- "warning": "Achtung",
- "auto-detect": "Automatische Erkennung"
-}
diff --git a/src/lib/locales/en.json b/src/lib/locales/en.json
index 40476d8..d634291 100644
--- a/src/lib/locales/en.json
+++ b/src/lib/locales/en.json
@@ -1,172 +1,71 @@
{
- "section": {
- "settings": {
- "title": "Settings",
- "textColor": "Text color",
- "backgroundColor": "Background color",
- "ledPowerOnTest": "LED power-on test",
- "ledFlashOnBlock": "LED flash on new block",
- "timePerScreen": "Time per screen",
- "ledBrightness": "LED brightness",
- "timezoneOffset": "Timezone offset",
- "timeBetweenPriceUpdates": "Time between price updates",
- "fullRefreshEvery": "Full refresh every",
- "mempoolnstance": "Mempool Instance",
- "hostnamePrefix": "Hostname prefix",
- "StealFocusOnNewBlock": "Steal focus on new block",
- "useBigCharsMcap": "Use big characters for market cap",
- "useBlkCountdown": "Blocks countdown for halving",
- "useSatsSymbol": "Use sats symbol",
- "suffixPrice": "Suffix price format",
- "disableLeds": "Disable all LEDs effects",
- "otaUpdates": "OTA updates",
- "enableMdns": "mDNS",
- "fetchEuroPrice": "Fetch € price",
- "shortAmountsWarning": "Short amounts might shorten lifespan of the displays",
- "tzOffsetHelpText": "A restart is required to apply TZ offset.",
- "screens": "Screens",
- "wifiTxPowerText": "In most cases this does not need to be set.",
- "wifiTxPower": "WiFi TX power",
- "settingsSaved": "Settings saved",
- "errorSavingSettings": "Error saving settings",
- "ownDataSource": "BTClock data source",
- "flMaxBrightness": "Frontlight brightness",
- "flAlwaysOn": "Frontlight always on",
- "flEffectDelay": "Frontlight effect speed",
- "flFlashOnUpd": "Frontlight flash on new block",
- "mempoolInstanceHelpText": "Only effective when BTClock data-source is disabled. A restart is required to apply.",
- "luxLightToggle": "Auto toggle frontlight at lux",
- "wpTimeout": "WiFi-config portal timeout",
- "nostrPubKey": "Nostr source pubkey",
- "nostrZapKey": "Nostr zap pubkey",
- "nostrRelay": "Nostr Relay",
- "nostrZapNotify": "Enable Nostr Zap Notifications",
- "useNostr": "Use Nostr data source",
- "bitaxeHostname": "BitAxe hostname or IP",
- "bitaxeEnabled": "Enable BitAxe-integration",
- "miningPoolStats": "Enable Mining Pool Stats integration",
- "miningPoolName": "Mining Pool",
- "miningPoolUser": "Mining Pool username or api key",
- "nostrZapPubkey": "Nostr Zap pubkey",
- "invalidNostrPubkey": "Invalid Nostr pubkey, note that your pubkey does NOT start with npub.",
- "convertingValidNpub": "Converting valid npub to pubkey",
- "flDisable": "Disable frontlight",
- "httpAuthEnabled": "Require authentication for WebUI",
- "httpAuthUser": "WebUI Username",
- "httpAuthPass": "WebUI Password",
- "httpAuthText": "Only password-protects WebUI, not API-calls.",
- "currencies": "Currencies",
- "customSource": "Use custom data source endpoint",
- "useNostrTooltip": "Very experimental and unstable. Nostr data source is not required for Nostr Zap notifications.",
- "mowMode": "Mow Suffix Mode",
- "suffixShareDot": "Suffix compact notation",
- "section": {
- "displaysAndLed": "Displays and LEDs",
- "screenSettings": "Screen specific",
- "dataSource": "Data source",
- "extraFeatures": "Extra features",
- "system": "System"
- },
- "ledFlashOnZap": "LED flash on Nostr Zap",
- "flFlashOnZap": "Frontlight flash on Nostr Zap",
- "showAll": "Show all",
- "hideAll": "Hide all",
- "flOffWhenDark": "Frontlight off when dark",
- "luxLightToggleText": "Set to 0 to disable",
- "verticalDesc": "Use vertical screen description",
- "enableDebugLog": "Enable Debug-log",
- "dataSource": {
- "label": "Data Source",
- "btclock": "BTClock Data Source",
- "thirdParty": "mempool.space/Kraken",
- "nostr": "Nostr publisher",
- "custom": "Custom Endpoint"
- },
- "thirdPartySource": "Use mempool.space/coincap.io",
- "ceDisableSSL": "Disable SSL",
- "ceEndpoint": "Endpoint hostname",
- "fontName": "Font",
- "timeBasedDnd": "Enable Do Not Disturb time schedule",
- "dndStartHour": "Start hour",
- "dndStartMinute": "Start minute",
- "dndEndHour": "End hour",
- "dndEndMinute": "End minute",
- "screenRestoreZap": "Restore previous screen state after zap (Uses {setting} setting)"
- },
- "control": {
- "systemInfo": "System info",
- "version": "Version",
- "buildTime": "Build time",
- "ledColor": "LED color",
- "turnOff": "Turn off",
- "setColor": "Set color",
- "showText": "Show text",
- "text": "Text",
- "title": "Control",
- "hostname": "Hostname",
- "frontlight": "Frontlight",
- "turnOn": "Turn on",
- "flashFrontlight": "Flash",
- "firmwareUpdate": "Firmware update",
- "fwCommit": "Firmware commit",
- "fwCommitMismatch": "The firmware version is different from the WebUI version, this might cause problems. "
- },
- "status": {
- "title": "Status",
- "screenCycle": "Screen cycle",
- "memoryFree": "Memory free",
- "wsPriceConnection": "WS Price connection",
- "wsMempoolConnection": "WS {instance} connection",
- "fetchEuroNote": "If you use \"Fetch € price\" the WS Price connection will show ❌ since it uses another data source.",
- "uptime": "Uptime",
- "wifiSignalStrength": "WiFi Signal strength",
- "wsDataConnection": "BTClock data-source connection",
- "lightSensor": "Light sensor",
- "nostrConnection": "Nostr Relay connection",
- "doNotDisturb": "Do not disturb",
- "timeBasedDnd": "Time-based schedule"
- },
- "firmwareUpdater": {
- "fileUploadFailed": "File upload failed. Make sure you have selected the correct file and try again.",
- "fileUploadSuccess": "File uploaded successfully, restarting device and reloading WebUI in {countdown} seconds",
- "uploading": "Uploading",
- "firmwareUpdateText": "When you use the firmware upload functionality, make sure you use the correct files. Uploading the wrong files can result in a non-working device. If it goes wrong, you can restore firmware by uploading the full image after setting the device in BOOT-mode.",
- "swUpdateAvailable": "A newer version is available!",
- "swUpToDate": "You are up to date.",
- "latestVersion": "Latest Version",
- "releaseDate": "Release Date",
- "viewRelease": "View Release",
- "autoUpdate": "Install update (experimental)",
- "autoUpdateInProgress": "Auto-update in progress, please wait..."
- }
- },
- "colors": {
- "black": "Black",
- "white": "White"
- },
- "time": {
- "minutes": "minutes",
- "seconds": "seconds"
- },
- "restartRequired": "restart required",
- "button": {
- "save": "Save",
- "reset": "Reset",
- "restart": "Restart",
- "forceFullRefresh": "Force full refresh"
- },
- "timer": {
- "running": "running",
- "stopped": "stopped"
- },
- "sections": {
- "control": {
- "keepSameColor": "Keep same color"
- }
- },
- "rssiBar": {
- "tooltip": "Values > -67 dBm are considered good. > -30 dBm is amazing"
- },
- "warning": "Warning",
- "auto-detect": "Auto-detect"
+ "section": {
+ "settings": {
+ "title": "Settings",
+ "textColor": "Text color",
+ "backgroundColor": "Background color",
+ "ledPowerOnTest": "LED power-on test",
+ "ledFlashOnBlock": "LED flash on new block",
+ "timePerScreen": "Time per screen",
+ "ledBrightness": "LED brightness",
+ "timezoneOffset": "Timezone offset",
+ "timeBetweenPriceUpdates": "Time between price updates",
+ "fullRefreshEvery": "Full refresh every",
+ "mempoolnstance": "Mempool Instance",
+ "hostnamePrefix": "Hostname prefix",
+ "StealFocusOnNewBlock": "Steal focus on new block",
+ "useBigCharsMcap": "Use big characters for market cap",
+ "otaUpdates": "OTA updates",
+ "enableMdns": "mDNS",
+ "fetchEuroPrice": "Fetch € price",
+ "shortAmountsWarning": "Short amounts might shorten lifespan.",
+ "tzOffsetHelpText": "A restart is required to apply TZ offset.",
+ "screens": "Screens"
+ },
+ "control": {
+ "systemInfo": "System info",
+ "version": "Version",
+ "buildTime": "Build time",
+ "ledColor": "LED color",
+ "turnOff": "Turn off",
+ "setColor": "Set color",
+ "showText": "Show text",
+ "text": "Text",
+ "title": "Control",
+ "hostname": "Hostname"
+ },
+ "status": {
+ "title": "Status",
+ "screenCycle": "Screen cycle",
+ "memoryFree": "Memory free",
+ "wsPriceConnection": "WS Price connection",
+ "wsMempoolConnection": "WS Mempool.space connection",
+ "fetchEuroNote": "If you use \"Fetch € price\" the WS Price connection will show ❌ since it uses another data source.",
+ "uptime": "Uptime"
+ }
+ },
+ "colors": {
+ "black": "Black",
+ "white": "White"
+ },
+ "time": {
+ "minutes": "minutes",
+ "seconds": "seconds"
+ },
+ "restartRequired": "restart required",
+ "button": {
+ "save": "Save",
+ "reset": "Reset",
+ "restart": "Restart",
+ "forceFullRefresh": "Force full refresh"
+ },
+ "timer": {
+ "running": "running",
+ "stopped": "stopped"
+ },
+ "sections": {
+ "control": {
+ "keepSameColor": "Keep same color"
+ }
+ }
}
diff --git a/src/lib/locales/es.json b/src/lib/locales/es.json
index e9edba5..c3958ae 100644
--- a/src/lib/locales/es.json
+++ b/src/lib/locales/es.json
@@ -1,152 +1,71 @@
{
- "section": {
- "settings": {
- "title": "Configuración",
- "textColor": "Color de texto",
- "backgroundColor": "Color de fondo",
- "ledBrightness": "Brillo LED",
- "screens": "Pantallas",
- "shortAmountsWarning": "Pequeñas cantidades pueden acortar la vida útil de los displays",
- "fullRefreshEvery": "Actualización completa cada",
- "timePerScreen": "Tiempo por pantalla",
- "tzOffsetHelpText": "Es necesario reiniciar para aplicar la compensación.",
- "timezoneOffset": "Compensación de zona horaria",
- "StealFocusOnNewBlock": "Presta atención al nuevo bloque",
- "ledFlashOnBlock": "El LED parpadea con un bloque nuevo",
- "useBigCharsMcap": "Utilice caracteres grandes para la market cap",
- "useBlkCountdown": "Cuenta regresiva en bloques",
- "useSatsSymbol": "Usar símbolo sats",
- "fetchEuroPrice": "Obtener precio en €",
- "timeBetweenPriceUpdates": "Tiempo entre actualizaciones de precios",
- "ledPowerOnTest": "Prueba de encendido del LED",
- "enableMdns": "mDNS",
- "hostnamePrefix": "Prefijo de nombre de host",
- "mempoolnstance": "Instancia de Mempool",
- "suffixPrice": "Precio con sufijos",
- "disableLeds": "Desactivar efectos de LED",
- "otaUpdates": "Actualización por aire",
- "wifiTxPowerText": "En la mayoría de los casos no es necesario configurar esto.",
- "settingsSaved": "Configuración guardada",
- "errorSavingSettings": "Error al guardar la configuración",
- "ownDataSource": "fuente de datos BTClock",
- "flMaxBrightness": "Brillo de luz de la pantalla",
- "flAlwaysOn": "Luz de la pantalla siempre encendida",
- "flEffectDelay": "Velocidad del efecto de luz de la pantalla",
- "flFlashOnUpd": "Luz de la pantalla parpadea con un nuevo bloque",
- "mempoolInstanceHelpText": "Solo es efectivo cuando la fuente de datos BTClock está deshabilitada. \nEs necesario reiniciar para aplicar.",
- "luxLightToggle": "Cambio automático de luz frontal en lux",
- "wpTimeout": "Portal de configuración WiFi timeout",
- "useNostr": "Utilice la fuente de datos Nostr",
- "flDisable": "Desactivar luz de la pantalla",
- "httpAuthUser": "Nombre de usuario WebUI",
- "httpAuthPass": "Contraseña WebUI",
- "httpAuthText": "Solo la WebUI está protegida con contraseña, no las llamadas API.",
- "currencies": "Monedas",
- "mowMode": "Modo de sufijo Mow",
- "suffixShareDot": "Notación compacta de sufijo",
- "section": {
- "displaysAndLed": "Pantallas y LED",
- "screenSettings": "Específico de la pantalla",
- "dataSource": "Fuente de datos",
- "extraFeatures": "Funciones adicionales",
- "system": "Sistema"
- },
- "ledFlashOnZap": "LED parpadeante con Nostr Zap",
- "flFlashOnZap": "Flash de luz frontal con Nostr Zap",
- "showAll": "Mostrar todo",
- "hideAll": "Ocultar todo",
- "flOffWhenDark": "Luz de la pantalla cuando está oscuro",
- "luxLightToggleText": "Establecer en 0 para desactivar",
- "verticalDesc": "Descripción de pantalla vertical",
- "enableDebugLog": "Habilitar registro de depuración",
- "bitaxeEnabled": "Habilitar la integración de BitAxe",
- "miningPoolStats": "Habilitar la integración de estadísticas del grupo minero",
- "nostrZapNotify": "Habilitar notificaciones de Nostr Zap",
- "thirdPartySource": "Utilice mempool.space/coincap.io",
- "dataSource": {
- "nostr": "editorial nostr",
- "custom": "Punto final personalizado"
- },
- "fontName": "Fuente",
- "timeBasedDnd": "Habilitar el horario de No molestar",
- "dndStartHour": "Hora de inicio",
- "dndStartMinute": "Minuto de inicio",
- "dndEndHour": "Hora final",
- "dndEndMinute": "Minuto final",
- "screenRestoreZap": "Restaurar el estado de pantalla anterior después de Zap (Usa la configuración {setting})"
- },
- "control": {
- "turnOff": "Apagar",
- "setColor": "Establecer el color",
- "version": "Versión",
- "ledColor": "color del LED",
- "systemInfo": "Info del sistema",
- "showText": "Mostrar texto",
- "text": "Texto",
- "title": "Control",
- "buildTime": "Tiempo de compilación",
- "hostname": "Nombre del host",
- "turnOn": "Encender",
- "frontlight": "Luz de la pantalla",
- "flashFrontlight": "Luz intermitente",
- "fwCommitMismatch": "La versión de firmware es diferente de la versión WebUI, esto podría causar problemas."
- },
- "status": {
- "memoryFree": "Memoria RAM libre",
- "wsPriceConnection": "Conexión WebSocket Precio",
- "wsMempoolConnection": "Conexión WebSocket {instance}",
- "screenCycle": "Ciclo de pantalla",
- "uptime": "Tiempo de funcionamiento",
- "fetchEuroNote": "Si utiliza \"Obtener precio en €\", la conexión de Precio WS mostrará ❌ ya que utiliza otra fuente de datos.",
- "title": "Estado",
- "wifiSignalStrength": "Fuerza de la señal WiFi",
- "wsDataConnection": "Conexión de fuente de datos BTClock",
- "lightSensor": "Sensor de luz",
- "nostrConnection": "Conexión de relé Nostr",
- "doNotDisturb": "No molestar",
- "timeBasedDnd": "Horario basado en el tiempo"
- },
- "firmwareUpdater": {
- "fileUploadSuccess": "Archivo cargado exitosamente, reiniciando el dispositivo. Recargando WebUI en {countdown} segundos",
- "fileUploadFailed": "Error al cargar el archivo. \nAsegúrese de haber seleccionado el archivo correcto e inténtelo nuevamente.",
- "uploading": "Subiendo",
- "firmwareUpdateText": "Cuando utilice la función de carga de firmware, asegúrese de utilizar los archivos correctos. \nCargar archivos incorrectos puede provocar que el dispositivo no funcione. \nSi sale mal, puede restaurar el firmware cargando la imagen completa después de configurar el dispositivo en modo BOOT.",
- "swUpToDate": "Tienes la ultima version.",
- "swUpdateAvailable": "¡Una nueva versión está disponible!",
- "latestVersion": "Ultima versión",
- "releaseDate": "Fecha de lanzamiento",
- "viewRelease": "Ver lanzamiento",
- "autoUpdate": "Instalar actualización (experimental)",
- "autoUpdateInProgress": "Actualización automática en progreso, espere..."
- }
- },
- "button": {
- "save": "Guardar",
- "reset": "Restaurar",
- "restart": "Reiniciar",
- "forceFullRefresh": "Forzar refresco"
- },
- "colors": {
- "black": "Negro",
- "white": "Blanco"
- },
- "restartRequired": "reinicio requerido",
- "time": {
- "minutes": "minutos",
- "seconds": "segundos"
- },
- "timer": {
- "running": "funcionando",
- "stopped": "detenido"
- },
- "sections": {
- "control": {
- "keepSameColor": "Mantén el mismo color"
- }
- },
- "rssiBar": {
- "tooltip": "Se consideran buenos valores > -67 dBm. > -30 dBm es increíble"
- },
- "warning": "Aviso",
- "auto-detect": "Detección automática"
+ "section": {
+ "settings": {
+ "title": "Configuración",
+ "textColor": "Color de texto",
+ "backgroundColor": "Color de fondo",
+ "ledBrightness": "Brillo LED",
+ "screens": "Pantallas",
+ "shortAmountsWarning": "Cantidades pequeñas pueden acortar la vida útil.",
+ "fullRefreshEvery": "Actualización completa cada",
+ "timePerScreen": "Tiempo por pantalla",
+ "tzOffsetHelpText": "Es necesario reiniciar para aplicar la compensación.",
+ "timezoneOffset": "Compensación de zona horaria",
+ "StealFocusOnNewBlock": "Presta atención al nuevo bloque",
+ "ledFlashOnBlock": "El LED parpadea con un bloque nuevo",
+ "useBigCharsMcap": "Utilice caracteres grandes para la market cap",
+ "fetchEuroPrice": "Obtener precio en €",
+ "timeBetweenPriceUpdates": "Tiempo entre actualizaciones de precios",
+ "ledPowerOnTest": "Prueba de encendido del LED",
+ "enableMdns": "mDNS",
+ "hostnamePrefix": "Prefijo de nombre de host",
+ "mempoolnstance": "Instancia de Mempool",
+ "otaUpdates": "Actualización por aire"
+ },
+ "control": {
+ "turnOff": "Apagar",
+ "setColor": "Establecer el color",
+ "version": "Versión",
+ "ledColor": "color del LED",
+ "systemInfo": "Info del sistema",
+ "showText": "Poner texto",
+ "text": "Texto",
+ "title": "Control",
+ "buildTime": "Tiempo de construcción",
+ "hostname": "Nombre de host"
+ },
+ "status": {
+ "memoryFree": "Memoria RAM libre",
+ "wsPriceConnection": "Conexión WebSocket Precio",
+ "wsMempoolConnection": "Conexión WebSocket Mempool.space",
+ "screenCycle": "Rotacion de pantalla",
+ "uptime": "Tiempo de funcionamiento",
+ "fetchEuroNote": "Si utiliza \"Obtener precio en €\", la conexión de Precio WS mostrará ❌ ya que utiliza otra fuente de datos.",
+ "title": "Estado"
+ }
+ },
+ "button": {
+ "save": "Guardar",
+ "reset": "Restaurar",
+ "restart": "Reiniciar",
+ "forceFullRefresh": "Forzar refresco"
+ },
+ "colors": {
+ "black": "Negro",
+ "white": "Blanco"
+ },
+ "restartRequired": "reinicio requerido",
+ "time": {
+ "minutes": "minutos",
+ "seconds": "segundos"
+ },
+ "timer": {
+ "running": "funcionando",
+ "stopped": "detenido"
+ },
+ "sections": {
+ "control": {
+ "keepSameColor": "Mantén el mismo color"
+ }
+ }
}
diff --git a/src/lib/locales/nl.json b/src/lib/locales/nl.json
index 8b6bd64..24c2396 100644
--- a/src/lib/locales/nl.json
+++ b/src/lib/locales/nl.json
@@ -1,143 +1,70 @@
{
- "section": {
- "settings": {
- "title": "Instellingen",
- "textColor": "Tekstkleur",
- "backgroundColor": "Achtergrondkleur",
- "timeBetweenPriceUpdates": "Tijd tussen prijs updates",
- "timezoneOffset": "Tijdzone afwijking",
- "ledBrightness": "LED helderheid",
- "timePerScreen": "Tijd per scherm",
- "fullRefreshEvery": "Volledig verversen elke",
- "shortAmountsWarning": "Lage waardes verkorten mogelijk levensduur schermen",
- "tzOffsetHelpText": "Herstart nodig voor toepassen afwijking.",
- "enableMdns": "mDNS",
- "ledPowerOnTest": "LED test bij aanzetten",
- "StealFocusOnNewBlock": "Pak aandacht bij nieuw blok",
- "ledFlashOnBlock": "Knipper led bij nieuw blok",
- "useBigCharsMcap": "Gebruik grote tekens bij market cap",
- "useBlkCountdown": "Blocks aftellen voor halving",
- "useSatsSymbol": "Gebruik sats symbol",
- "fetchEuroPrice": "Toon € prijs",
- "screens": "Schermen",
- "hostnamePrefix": "Hostnaam voorvoegsel",
- "mempoolnstance": "Mempool instantie",
- "suffixPrice": "Achtervoegsel prijs formaat",
- "disableLeds": "Alle LEDs effecten uit",
- "otaUpdates": "OTA updates",
- "wifiTxPower": "WiFi TX power",
- "wifiTxPowerText": "Meestal hoeft dit niet aangepast te worden.",
- "settingsSaved": "Instellingen opgeslagen",
- "errorSavingSettings": "Fout bij opslaan instellingen",
- "ownDataSource": "BTClock-gegevensbron gebruiken",
- "flMaxBrightness": "Displaylicht helderheid",
- "flAlwaysOn": "Displaylicht altijd aan",
- "flEffectDelay": "Displaylicht effect snelheid",
- "flFlashOnUpd": "Knipper displaylicht bij nieuw blok",
- "mempoolInstanceHelpText": "Alleen effectief als de BTClock-gegevensbron is uitgeschakeld. \nOm toe te passen is een herstart nodig.",
- "luxLightToggle": "Schakelen displaylicht op lux",
- "wpTimeout": "WiFi-config-portal timeout",
- "useNostr": "Gebruik Nostr-gegevensbron",
- "flDisable": "Schakel Displaylicht uit",
- "httpAuthUser": "WebUI-gebruikersnaam",
- "httpAuthPass": "WebUI-wachtwoord",
- "httpAuthText": "Beveiligd enkel WebUI, niet de API.",
- "currencies": "Valuta's",
- "mowMode": "Mow achtervoegsel",
- "suffixShareDot": "Achtervoegsel compacte notatie",
- "section": {
- "displaysAndLed": "Displays en LED's",
- "screenSettings": "Schermspecifiek",
- "dataSource": "Gegevensbron",
- "extraFeatures": "Extra functies",
- "system": "Systeem"
- },
- "ledFlashOnZap": "Knipper LED bij Nostr Zap",
- "flFlashOnZap": "Knipper displaylicht bij Nostr Zap",
- "showAll": "Toon alles",
- "hideAll": "Alles verbergen",
- "flOffWhenDark": "Displaylicht uit als het donker is",
- "luxLightToggleText": "Stel in op 0 om uit te schakelen",
- "verticalDesc": "Verticale schermbeschrijving",
- "fontName": "Lettertype",
- "timeBasedDnd": "Schakel het tijdschema Niet storen in",
- "dndStartHour": "Begin uur",
- "dndStartMinute": "Beginminuut",
- "dndEndHour": "Eind uur",
- "dndEndMinute": "Einde minuut",
- "screenRestoreZap": "Herstel vorige schermstatus na zap (Gebruikt {setting} instelling)"
- },
- "control": {
- "systemInfo": "Systeeminformatie",
- "version": "Versie",
- "buildTime": "Bouwtijd",
- "setColor": "Kleur instellen",
- "turnOff": "Uitzetten",
- "ledColor": "LED kleur",
- "showText": "Toon tekst",
- "text": "Tekst",
- "title": "Besturing",
- "frontlight": "Displaylicht",
- "turnOn": "Aanzetten",
- "flashFrontlight": "Knipper",
- "fwCommitMismatch": "De firmwareversie verschilt van de WebUI -versie, dit kan problemen veroorzaken."
- },
- "status": {
- "title": "Status",
- "memoryFree": "Geheugen vrij",
- "screenCycle": "Scherm cyclus",
- "wsPriceConnection": "WS Prijs verbinding",
- "wsMempoolConnection": "WS {instance} verbinding",
- "fetchEuroNote": "Wanneer je \"Toon € prijs\" aanzet, zal de prijsverbinding als ❌ verbroken getoond worden vanwege het gebruik van een andere bron.",
- "uptime": "Uptime",
- "wifiSignalStrength": "WiFi signaalsterkte",
- "wsDataConnection": "BTClock-gegevensbron verbinding",
- "lightSensor": "Licht sensor",
- "nostrConnection": "Nostr Relay-verbinding",
- "doNotDisturb": "Niet storen",
- "timeBasedDnd": "Op tijd gebaseerd schema"
- },
- "firmwareUpdater": {
- "fileUploadSuccess": "Bestand geüpload, apparaat herstart. WebUI opnieuw geladen over {countdown} seconden",
- "fileUploadFailed": "Bestandsupload mislukt. \nZorg ervoor dat het juiste bestand is geselecteerd en probeer het opnieuw.",
- "uploading": "Uploaden",
- "firmwareUpdateText": "Zorg bij het gebruiken van de firmware upload dat de juiste bestanden gebruikt worden. \nHet uploaden van de verkeerde bestanden kan resulteren in een niet-werkend apparaat. \nAls het misgaat, kunt u de firmware herstellen door de volledige afbeelding te uploaden nadat u het apparaat in de BOOT-modus hebt gezet.",
- "swUpToDate": "Je hebt de nieuwste versie.",
- "swUpdateAvailable": "Een nieuwere versie is beschikbaar!",
- "latestVersion": "Laatste versie",
- "releaseDate": "Datum van publicatie",
- "viewRelease": "Bekijk publicatie",
- "autoUpdate": "Update installeren (experimenteel)",
- "autoUpdateInProgress": "Automatische update wordt uitgevoerd. Even geduld a.u.b...."
- }
- },
- "colors": {
- "black": "Zwart",
- "white": "Wit"
- },
- "time": {
- "minutes": "minuten",
- "seconds": "seconden"
- },
- "restartRequired": "herstart nodig",
- "button": {
- "save": "Opslaan",
- "reset": "Herstel",
- "restart": "Herstart",
- "forceFullRefresh": "Forceer scherm verversen"
- },
- "timer": {
- "running": "actief",
- "stopped": "gestopt"
- },
- "sections": {
- "control": {
- "keepSameColor": "Behoud zelfde kleur"
- }
- },
- "rssiBar": {
- "tooltip": "Waarden > -67 dBm zijn goed. > -30 dBm is verbazingwekkend"
- },
- "warning": "Waarschuwing",
- "auto-detect": "Automatische detectie"
+ "section": {
+ "settings": {
+ "title": "Instellingen",
+ "textColor": "Tekstkleur",
+ "backgroundColor": "Achtergrondkleur",
+ "timeBetweenPriceUpdates": "Tijd tussen prijs updates",
+ "timezoneOffset": "Tijdzone afwijking",
+ "ledBrightness": "LED helderheid",
+ "timePerScreen": "Tijd per scherm",
+ "fullRefreshEvery": "Volledig verversen elke",
+ "shortAmountsWarning": "Lage waardes verkorten levensduur",
+ "tzOffsetHelpText": "Herstart nodig voor toepassen afwijking.",
+ "enableMdns": "mDNS",
+ "ledPowerOnTest": "LED test bij aanzetten",
+ "StealFocusOnNewBlock": "Pak aandacht bij nieuw blok",
+ "ledFlashOnBlock": "Knipper led bij nieuw blok",
+ "useBigCharsMcap": "Gebruik grote tekens bij market cap",
+ "fetchEuroPrice": "Toon € prijs",
+ "screens": "Schermen",
+ "hostnamePrefix": "Hostnaam voorvoegsel",
+ "mempoolnstance": "Mempool instantie",
+ "otaUpdates": "OTA updates"
+ },
+ "control": {
+ "systemInfo": "Systeeminformatie",
+ "version": "Versie",
+ "buildTime": "Bouwtijd",
+ "setColor": "Kleur instellen",
+ "turnOff": "Uitzetten",
+ "ledColor": "LED kleur",
+ "showText": "Toon tekst",
+ "text": "Tekst",
+ "title": "Besturing"
+ },
+ "status": {
+ "title": "Status",
+ "memoryFree": "Geheugen vrij",
+ "screenCycle": "Scherm cyclus",
+ "wsPriceConnection": "WS Prijs verbinding",
+ "wsMempoolConnection": "WS Mempool.space verbinding",
+ "fetchEuroNote": "Wanneer je \"Toon € prijs\" aanzet, zal de prijsverbinding als ❌ verbroken getoond worden vanwege het gebruik van een andere bron.",
+ "uptime": "Uptime"
+ }
+ },
+ "colors": {
+ "black": "Zwart",
+ "white": "Wit"
+ },
+ "time": {
+ "minutes": "minuten",
+ "seconds": "seconden"
+ },
+ "restartRequired": "herstart nodig",
+ "button": {
+ "save": "Opslaan",
+ "reset": "Herstel",
+ "restart": "Herstart",
+ "forceFullRefresh": "Forceer scherm verversen"
+ },
+ "timer": {
+ "running": "actief",
+ "stopped": "gestopt"
+ },
+ "sections": {
+ "control": {
+ "keepSameColor": "Behoud zelfde kleur"
+ }
+ }
}
diff --git a/src/lib/screen.ts b/src/lib/screen.ts
deleted file mode 100644
index 293d5e7..0000000
--- a/src/lib/screen.ts
+++ /dev/null
@@ -1,18 +0,0 @@
-import { writable } from 'svelte/store';
-
-// Check if window is available
-let initialWidth: number = 0;
-if (typeof window !== 'undefined') {
- initialWidth = window.innerWidth;
-}
-
-// Create a writable store to track screen size
-export const screenSize = writable(initialWidth);
-
-// Function to update the screen size
-export const updateScreenSize = (): void => {
- // Check if window is available before setting the screen size
- if (typeof window !== 'undefined') {
- screenSize.set(window.innerWidth);
- }
-};
diff --git a/src/lib/style/app.scss b/src/lib/style/app.scss
index dd3d50a..85cf732 100644
--- a/src/lib/style/app.scss
+++ b/src/lib/style/app.scss
@@ -1,352 +1,188 @@
-@use '@fontsource/ubuntu/scss/mixins' as Ubuntu;
-@use '@fontsource/antonio/scss/mixins' as Antonio;
-
-@import '../node_modules/bootstrap/scss/functions';
+@import "../node_modules/bootstrap/scss/functions";
+@import "../node_modules/bootstrap/scss/variables";
+@import "../node_modules/bootstrap/scss/variables-dark";
//@import "@fontsource/antonio/latin-400.css";
+@import "@fontsource/ubuntu/latin-400.css";
+@import "@fontsource/oswald/latin-400.css";
-@include Ubuntu.faces(
- $subsets: latin,
- $weights: 400,
- $formats: 'woff2',
- $directory: '@fontsource/ubuntu/files'
-);
-
-@include Antonio.faces(
- $subsets: latin,
- $weights: 400,
- $formats: 'woff2',
- $directory: '@fontsource/antonio/files'
-);
-
-@import './satsymbol';
-
-$color-mode-type: data;
-$font-family-base: 'Ubuntu';
+$form-range-track-bg: #fff;
+$color-mode-type: media-query;
+$font-family-base: "Ubuntu";
$font-size-base: 0.9rem;
-$input-font-size-sm: $font-size-base * 0.875;
+//$font-size-sm: $font-size-base * .875 !default;
+//$form-label-font-size: $font-size-base * .575 !default;
+//$input-btn-font-size-sm: 0.4rem;
+//$form-label-font-size: 0.4rem;
+$input-font-size-sm: $font-size-base * .875;
-@import '../node_modules/bootstrap/scss/variables';
-@import '../node_modules/bootstrap/scss/variables-dark';
// $border-radius: .675rem;
-@import '../node_modules/bootstrap/scss/mixins';
-@import '../node_modules/bootstrap/scss/maps';
-@import '../node_modules/bootstrap/scss/utilities';
+@import "../node_modules/bootstrap/scss/mixins";
+@import "../node_modules/bootstrap/scss/maps";
+@import "../node_modules/bootstrap/scss/utilities";
-@import '../node_modules/bootstrap/scss/root';
-@import '../node_modules/bootstrap/scss/reboot';
-@import '../node_modules/bootstrap/scss/type';
-@import '../node_modules/bootstrap/scss/containers';
-@import '../node_modules/bootstrap/scss/grid';
-@import '../node_modules/bootstrap/scss/forms';
-@import '../node_modules/bootstrap/scss/buttons';
-@import '../node_modules/bootstrap/scss/button-group';
-//@import '../node_modules/bootstrap/scss/pagination';
+@import "../node_modules/bootstrap/scss/root";
+@import "../node_modules/bootstrap/scss/reboot";
+@import "../node_modules/bootstrap/scss/type";
+@import "../node_modules/bootstrap/scss/containers";
+@import "../node_modules/bootstrap/scss/grid";
+@import "../node_modules/bootstrap/scss/forms";
+@import "../node_modules/bootstrap/scss/buttons";
+@import "../node_modules/bootstrap/scss/button-group";
+@import "../node_modules/bootstrap/scss/pagination";
-@import '../node_modules/bootstrap/scss/dropdown';
+@import "../node_modules/bootstrap/scss/dropdown";
-@import '../node_modules/bootstrap/scss/navbar';
-@import '../node_modules/bootstrap/scss/nav';
-@import '../node_modules/bootstrap/scss/card';
-@import '../node_modules/bootstrap/scss/progress';
-@import '../node_modules/bootstrap/scss/tooltip';
-@import '../node_modules/bootstrap/scss/toasts';
-@import '../node_modules/bootstrap/scss/alert';
-@import '../node_modules/bootstrap/scss/placeholders';
-@import '../node_modules/bootstrap/scss/spinners';
+@import "../node_modules/bootstrap/scss/navbar";
+@import "../node_modules/bootstrap/scss/nav";
+@import "../node_modules/bootstrap/scss/card";
+@import "../node_modules/bootstrap/scss/progress";
-@import '../node_modules/bootstrap/scss/helpers';
-@import '../node_modules/bootstrap/scss/utilities/api';
+@import "../node_modules/bootstrap/scss/helpers";
+@import "../node_modules/bootstrap/scss/utilities/api";
-/* Default state (xs) - sticky */
-.sticky-xs-top {
- position: sticky;
- top: 0;
- z-index: 1020;
+@include media-breakpoint-down(xl) {
+ html {
+ font-size: 85%;
+ }
+
+ button.btn,
+ input[type="button"].btn,
+ input[type="submit"].btn,
+ input[type="reset"].btn {
+ @include button-size($btn-padding-y-sm, $btn-padding-x-sm, $font-size-sm, $btn-border-radius-sm);
+ }
}
-@media (max-width: 576px) {
- main {
- margin-top: 25px;
- }
+@include media-breakpoint-down(lg) {
+ html {
+ font-size: 75%;
+ }
}
-/* Remove sticky behavior for larger screens */
-@media (min-width: 576px) {
- .sticky-xs-top {
- position: relative;
- }
-}
-
-@include color-mode(dark) {
- .navbar {
- --bs-navbar-color: $light;
- background-color: $dark;
- }
-}
-
-@include color-mode(light) {
- .navbar {
- --bs-navbar-color: $dark;
- background-color: $light;
- }
-}
nav {
- margin-bottom: 15px;
+ margin-bottom: 15px;
}
-#btclock-wrapper {
- margin: 0 auto;
+.splitText div:first-child::after {
+ display: block;
+ content: '';
+ margin-top: 0px;
+ border-bottom: 2px solid;
+ margin-bottom: 3px;
}
-.btn-group-sm .btn {
- font-size: 0.8rem;
- // text-overflow: ellipsis;
- // white-space: nowrap;
- // overflow: hidden;
- // width: 4rem;
+#btcclock-wrapper {
+ margin: 0 auto;
}
-.btn-group-sm {
- display: flex !important;
- flex-wrap: wrap !important;
- gap: 0.25rem !important;
+.btclock {
+ border: 1px solid darkgray;
+ background: #000;
+ border-radius: 5px;
+ padding: 10px;
+ max-width: 700px;
+ margin: 0 auto;
+ display: flex;
+ flex-direction: row;
+ flex-wrap: nowrap;
+ justify-content: space-between;
+ align-items: center;
+ align-content: stretch;
+ font-family: 'Oswald', sans-serif;
+
+ >div {
+ padding: 5px;
+ }
+
+ .digit,
+ .splitText,
+ .mediumText {
+ border: 2px solid gold;
+ border-radius: 8px;
+
+ @include media-breakpoint-up(sm) {
+ min-width: 10px;
+ }
+
+ @include media-breakpoint-up(xxl) {
+ min-width: 70px;
+ }
+
+ text-align: center;
+ color: #fff;
+ }
}
-/* Remove the border radius override that Bootstrap applies */
-.btn-group-sm > .btn {
- border-radius: 0.25rem !important;
- margin: 0 !important;
- position: relative !important;
+.darkMode .btclock>div {
+ color: #fff;
+ border-color: #fff;
+}
+
+.lightMode .btclock>div {
+ background: #fff;
+}
+
+.lightMode .btclock>div {
+ color: #000;
+}
+
+.darkMode .btclock>div {
+ background: #000;
+}
+
+.splitText {
+ @include media-breakpoint-up(sm) {
+ font-size: 1.0rem;
+ padding-top: 8px !important;
+ padding-bottom: 9px !important;
+ }
+ @include media-breakpoint-up(xxl) {
+ font-size: 1.8rem;
+ padding-top: 19px !important;
+ padding-bottom: 20px !important;
+ }
+
+ text-align: center;
+}
+
+.mediumText {
+ font-size: 3rem;
+ padding-left: 5px;
+ padding-right: 5px;
+ padding-top: 20px !important;
+ padding-bottom: 20px !important;
+}
+
+.digit {
+ font-size: 5rem;
+ @include media-breakpoint-up(sm) {
+ font-size: 2.5rem;
+ }
+ @include media-breakpoint-up(xxl) {
+ font-size: 5rem;
+ }
+ padding-left: 10px;
+ padding-right: 10px;
+}
+
+.digit-blank {
+ content: "abc";
}
#customText {
- text-transform: uppercase;
+ text-transform: uppercase;
}
-
-.btclock-wrapper {
- .btclock {
- background: #000;
- display: flex;
- font-size: calc(2vw + 2vh);
- font-family: 'Antonio', sans-serif;
- font-weight: 400;
- padding: 10px;
- gap: 10px;
-
- .digit,
- .splitText,
- .mediumText {
- border: 2px solid gold;
- border-radius: 8px;
- display: flex;
- align-items: center;
- justify-content: center;
- text-align: center;
- padding: 10px 10px 15px 10px;
- width: calc(12vw + 12vh); /* Set a dynamic width based on viewport */
- aspect-ratio: 1 / 1.5; /* Maintain a 1:1 aspect ratio */
-
- hr {
- width: 75%; /* Line width relative to digit square */
- border: 0;
- border-top: 2px solid #fff;
- margin: 0; /* Remove default margin */
- padding: 0;
- opacity: 1;
- }
- }
-
- .digit.sats {
- padding-top: 35px;
- }
-
- .mediumText {
- font-size: calc(1.25vw + 1.25vh);
- }
-
- .splitText {
- flex-direction: column; /* Stack the text and line vertically */
- align-items: center;
- justify-content: space-around; /* Distribute items with space between */
- padding: 5px;
- }
-
- &.verticalDesc > .splitText:first-child {
- .textcontainer {
- transform: rotate(-90deg);
- }
- }
-
- .splitText .textcontainer :first-child::after {
- display: block;
- content: '';
- margin-top: 0px;
- border-bottom: 2px solid;
- // margin-bottom: 3px;
- }
-
- .splitText {
- font-size: calc(0.3vw + 1vh);
-
- .top-text,
- .bottom-text {
- margin: 0;
- line-height: 1;
- }
-
- .top-text {
- margin-bottom: -45px;
- }
-
- .bottom-text {
- margin-top: -45px;
- }
- }
-
- .digit-blank {
- content: 'abc';
- }
-
- .digit.icon {
- content: 'abc';
-
- svg {
- width: 100%;
- }
- }
- }
-
- .digit.sats {
- font-family: 'Satoshi Symbol', sans-serif;
- content: 'a';
- }
-
- @media (max-width: 576px) {
- .btclock {
- font-size: calc(2vw + 2vh); /* Adjust for small screens if necessary */
-
- .digit,
- .splitText,
- .mediumText {
- padding: 5px;
- }
-
- .splitText {
- font-size: calc(1.2vw + 1.2vh);
-
- .top-text,
- .bottom-text {
- margin: 0;
- line-height: 1;
- }
-
- .top-text {
- margin-bottom: -10px;
- }
-
- .bottom-text {
- margin-top: -10px;
- }
- }
- }
- }
-}
-
-.darkMode .btclock > div {
- color: #fff;
- border-color: #fff;
-}
-
-.darkMode .btclock > div {
- background: #000;
- color: #fff;
-}
-
-.lightMode .btclock {
- & > div {
- background: #fff;
- color: #000;
- }
-
- .splitText hr {
- border-top: 2px solid #000;
- }
-}
-
-.lightMode .btclock > div {
- color: #000;
-}
-
.system_info {
- padding: 0;
+ padding: 0;
- li {
- list-style: none;
- }
+ li {
+ list-style: none;
+ }
}
.card-title {
- margin-bottom: 0;
-}
-
-.navbar-brand {
- font-style: italic;
- font-weight: 600;
-}
-
-.firmwareUploadStatusAlert,
-#firmwareUploadProgress {
- @extend .my-2;
-}
-
-.sats {
- font-family: 'Satoshi Symbol';
-}
-
-.currencyCode {
- width: 20%;
- text-align: center;
- display: inline-block;
-}
-
-input[type='number'] {
- text-align: right;
-}
-
-.lightMode .bitaxelogo {
- filter: brightness(0) saturate(100%);
-}
-
-.connection-lost-overlay {
- position: absolute;
- top: 0;
- left: 0;
- width: 100%;
- height: 100%;
- background-color: rgba(0, 0, 0, 0.75);
- z-index: 1050;
- display: flex;
- justify-content: center;
- align-items: center;
-
- .overlay-content {
- background-color: rgba(255, 255, 255, 0.75);
-
- padding: 0.5rem;
- border-radius: 0.5rem;
- text-align: center;
-
- i {
- font-size: 1rem;
- color: $danger;
- margin-bottom: 1rem;
- }
-
- h4 {
- margin-bottom: 0.5rem;
- }
- }
-}
+ margin-bottom: 0;
+}
\ No newline at end of file
diff --git a/src/lib/style/satsymbol.scss b/src/lib/style/satsymbol.scss
deleted file mode 100644
index 9b7eefd..0000000
--- a/src/lib/style/satsymbol.scss
+++ /dev/null
@@ -1,7 +0,0 @@
-@font-face {
- font-family: 'Satoshi Symbol';
- src: url('/fonts/Satoshi_Symbol.woff2') format('woff2');
- font-weight: normal;
- font-style: normal;
- font-display: swap;
-}
diff --git a/src/lib/types/dataSource.ts b/src/lib/types/dataSource.ts
deleted file mode 100644
index ffadd46..0000000
--- a/src/lib/types/dataSource.ts
+++ /dev/null
@@ -1,6 +0,0 @@
-export enum DataSourceType {
- BTCLOCK_SOURCE = 0,
- THIRD_PARTY_SOURCE = 1,
- NOSTR_SOURCE = 2,
- CUSTOM_SOURCE = 3
-}
diff --git a/src/lib/uiSettings.ts b/src/lib/uiSettings.ts
deleted file mode 100644
index 3d30b18..0000000
--- a/src/lib/uiSettings.ts
+++ /dev/null
@@ -1,7 +0,0 @@
-import { writable } from 'svelte/store';
-
-export const uiSettings = writable({
- inputSize: 'sm',
- selectClass: '',
- btnSize: 'lg'
-});
diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte
index 0f1cc8a..b7f1a34 100644
--- a/src/routes/+layout.svelte
+++ b/src/routes/+layout.svelte
@@ -1,23 +1,21 @@
-
- ₿TClock
-
-
- {$_('section.control.title', { default: 'Control' })}
-
-
- {$_('section.status.title', { default: 'Status' })}
-
-
- {$_('section.settings.title', { default: 'Settings' })}
-
-
-
-
-
-
+
+ ₿TClock
+
Home
-
- Convert
-
API
- {#if !$isLoading}
-
- {getFlagEmoji($currentLocale)}
- {languageNames[$currentLocale] || 'English'}
-
- {#each $locales as locale}
- {getFlagEmoji(locale)} {languageNames[locale]}
- {/each}
-
-
- {/if}
-
+
+ {getFlagEmoji($locale)} {getLanguageName($locale)}
+
+ {#each $locales as locale}
+ {getFlagEmoji(locale)} {getLanguageName(locale)}
+ {/each}
+
+
-
-
-
+
diff --git a/src/routes/+layout.ts b/src/routes/+layout.ts
index 3c7d853..a9bc794 100644
--- a/src/routes/+layout.ts
+++ b/src/routes/+layout.ts
@@ -1,24 +1,20 @@
-import '$lib/style/app.scss';
+import "$lib/style/app.scss";
-import { browser } from '$app/environment';
-import '$lib/i18n'; // Import to initialize. Important :)
-import { locale, waitLocale } from 'svelte-i18n';
-import type { LayoutLoad } from './$types';
+
+import { browser } from '$app/environment'
+import '$lib/i18n' // Import to initialize. Important :)
+import { locale, waitLocale } from 'svelte-i18n'
+import type { LayoutLoad } from './$types'
export const load: LayoutLoad = async () => {
- if (browser) {
- if (localStorage.getItem('locale')) {
- locale.set(localStorage.getItem('locale'));
- } else {
- // Normalize the browser locale
- const browserLocale = window.navigator.language.split('-')[0].toLowerCase();
- const supportedLocales = ['en', 'nl', 'es', 'de'];
- locale.set(supportedLocales.includes(browserLocale) ? browserLocale : 'en');
- }
+ if (browser && localStorage.getItem('locale')) {
+ locale.set(localStorage.getItem('locale'));
+ } else if (browser) {
+ locale.set(window.navigator.language)
}
- await waitLocale();
-};
+ await waitLocale();
+}
export const prerender = true;
export const ssr = false;
-export const csr = true;
+export const csr = true;
\ No newline at end of file
diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte
index 5971a12..28b617b 100644
--- a/src/routes/+page.svelte
+++ b/src/routes/+page.svelte
@@ -1,221 +1,71 @@
- BTClock
+ ₿TClock
-
-
-
-
-
-
+
+
+
+
-
-
- (toastIsOpen = false)}
- >
-
- {toastBody}
-
-
-
-
diff --git a/src/routes/Control.spec.ts b/src/routes/Control.spec.ts
deleted file mode 100644
index 763e9a3..0000000
--- a/src/routes/Control.spec.ts
+++ /dev/null
@@ -1,30 +0,0 @@
-import { writable } from 'svelte/store';
-import Control from './Control.svelte';
-import { render } from '@testing-library/svelte';
-import { describe, test, expect, beforeEach } from 'vitest';
-import { addMessages, init, locale } from 'svelte-i18n';
-
-import '$lib/i18n/index.ts';
-import en from '$lib/locales/en.json';
-addMessages('en', en);
-
-describe('Control Component', () => {
- beforeEach(() => {
- init({
- fallbackLocale: 'en',
- initialLocale: 'en'
- });
- locale.set('en');
- });
-
- test('should render the component', () => {
- const host = document.createElement('div');
- document.body.appendChild(host);
- const instance = render(Control, {
- target: host,
- props: { status: writable([]), settings: writable([]) }
- });
- expect(instance).toBeTruthy();
- expect(host.innerHTML).toContain('Control');
- });
-});
diff --git a/src/routes/Control.svelte b/src/routes/Control.svelte
index c4e96c1..23b13c3 100644
--- a/src/routes/Control.svelte
+++ b/src/routes/Control.svelte
@@ -1,254 +1,134 @@
-
-
+
+
{$_('section.control.title', { default: 'Control' })}
- {#if !$settings.disableLeds}
- LEDs
-
-
- {/if}
- {#if $settings.hasFrontlight && !$settings.flDisable}
- {$_('section.control.frontlight')}
-
-
- {$_('section.control.turnOff')}
-
- {$_('section.control.turnOn')}
-
- {$_('section.control.flashFrontlight')}
+ LEDs
+
- {$_('button.forceFullRefresh')}
-
-
- {#if $settings.otaEnabled}
-
- {$_('section.control.firmwareUpdate')}
-
- {/if}
+
+ { $_('section.control.systemInfo') }
+
+ { $_('section.control.version') }: {$settings.gitRev}
+ { $_('section.control.buildTime') }: {new Date(($settings.lastBuildTime * 1000)).toLocaleString()}
+ IP: {$settings.ip}
+ { $_('section.control.hostname') }: {$settings.hostname}
+
+ { $_('button.restart') }
+ { $_('button.forceFullRefresh') }
diff --git a/src/lib/i18n/en.json b/src/routes/Control.ts
similarity index 100%
rename from src/lib/i18n/en.json
rename to src/routes/Control.ts
diff --git a/src/routes/FirmwareUpdater.svelte b/src/routes/FirmwareUpdater.svelte
deleted file mode 100644
index 06f4d0e..0000000
--- a/src/routes/FirmwareUpdater.svelte
+++ /dev/null
@@ -1,281 +0,0 @@
-
-
-{#if latestVersion && latestVersion != 'error'}
-
- {$_('section.firmwareUpdater.latestVersion')}: {latestVersion} - {$_(
- 'section.firmwareUpdater.releaseDate'
- )}: {releaseDate} -
- {$_('section.firmwareUpdater.viewRelease')}
- {#if isNewerVersionAvailable}
- {#if !$status.isOTAUpdating}
- {$_('section.firmwareUpdater.swUpdateAvailable')} -
- {$_('section.firmwareUpdater.autoUpdate')} .
- {:else}
- {$_('section.firmwareUpdater.autoUpdateInProgress')}
- {/if}
- {:else}
- {$_('section.firmwareUpdater.swUpToDate')}
- {/if}
-
-{:else if latestVersion == 'error'}
- Error loading version, try again later.
-{:else}
- Loading...
-{/if}
-{#if !$status.isOTAUpdating}
-
- {#if firmwareUploadProgress > 0}
- {$_('section.firmwareUpdater.uploading')}... {firmwareUploadProgress}%
- {/if}
- {#if firmwareUploadSuccess}
- {$_('section.firmwareUpdater.fileUploadSuccess', { values: { countdown: $countdown } })}
-
- {/if}
-
- {#if firmwareUploadError}
- {$_('section.firmwareUpdater.fileUploadFailed')}
- {/if}
- ⚠️ {$_('warning')} : {$_('section.firmwareUpdater.firmwareUpdateText')}
-{/if}
diff --git a/src/routes/Rendered.svelte b/src/routes/Rendered.svelte
index e4a1783..0003cbf 100644
--- a/src/routes/Rendered.svelte
+++ b/src/routes/Rendered.svelte
@@ -1,114 +1,25 @@
-
-
- {#each status.data as char}
- {#if isSplitText(char)}
-
-
- {#if char.split('/').length}
- {char.split('/')[0]}
- {char.split('/')[1]}
- {/if}
-
-
-
- {:else if char.startsWith('mdi')}
-
- {#if char.endsWith('rocket')}
-
- {/if}
- {#if char.endsWith('pickaxe')}
-
- {/if}
- {#if char.endsWith('bolt')}
-
- {/if}
- {#if char.endsWith('bitaxe')}
-
- {/if}
- {#if char.endsWith('miningpool')}
-
Mining Pool Logo
- {/if}
-
- {:else if char === 'STS'}
-
S
- {:else if char.length >= 3}
-
{char}
- {:else if char.length === 0 || char === ' '}
-
- {:else}
-
{getCurrencySymbol(char)}
- {/if}
- {/each}
-
-
-
-
+
+
+ {#each status.data as char}
+ {#if isSplitText(char)}
+
+ {#each char.split("/") as part}
+
{part}
+ {/each}
+
+ {:else if char.length === 0 || char === " "}
+
+ {:else}
+
{char}
+ {/if}
+ {/each}
+
+
\ No newline at end of file
diff --git a/src/routes/Settings.spec.ts b/src/routes/Settings.spec.ts
deleted file mode 100644
index 4e1fb07..0000000
--- a/src/routes/Settings.spec.ts
+++ /dev/null
@@ -1,32 +0,0 @@
-import { writable } from 'svelte/store';
-import Settings from './Settings.svelte';
-import { render } from '@testing-library/svelte';
-import { describe, test, expect, beforeEach } from 'vitest';
-import { addMessages, init, locale } from 'svelte-i18n';
-
-import '$lib/i18n/index.ts';
-import en from '$lib/locales/en.json';
-addMessages('en', en);
-
-describe('Settings Component', () => {
- beforeEach(() => {
- init({
- fallbackLocale: 'en',
- initialLocale: 'en'
- });
- locale.set('en');
- });
-
- test('should render the component', () => {
- locale.set('en');
-
- const host = document.createElement('div');
- document.body.appendChild(host);
- const instance = render(Settings, {
- target: host,
- props: { settings: writable([]) }
- });
- expect(instance).toBeTruthy();
- expect(host.innerHTML).toContain('Settings');
- });
-});
diff --git a/src/routes/Settings.svelte b/src/routes/Settings.svelte
index 16de960..994548a 100644
--- a/src/routes/Settings.svelte
+++ b/src/routes/Settings.svelte
@@ -1,162 +1,209 @@
-
-
+
+
-
-
- {$_('section.settings.showAll')}
- |
- {$_('section.settings.hideAll')}
-
-
- {$_('section.settings.title')}
+ {$_('section.settings.title', { default: 'Settings' })}
- {#if $settings.isLoaded === false}
-
- {:else}
-
- {/if}
+
+ { $_('section.settings.screens') }
+ {#if $settings.screens}
+ {#each $settings.screens as s}
+
+
+
+ {/each}
+ {/if}
+
+ { $_('button.reset') }
+ { $_('button.save') }
+
diff --git a/src/routes/Status.spec.ts b/src/routes/Status.spec.ts
deleted file mode 100644
index 820e2eb..0000000
--- a/src/routes/Status.spec.ts
+++ /dev/null
@@ -1,30 +0,0 @@
-import { writable } from 'svelte/store';
-import Status from './Status.svelte';
-import { render } from '@testing-library/svelte';
-import { describe, test, expect, beforeEach } from 'vitest';
-import { locale, init, addMessages } from 'svelte-i18n';
-
-import '$lib/i18n/index.ts';
-import en from '$lib/locales/en.json';
-addMessages('en', en);
-
-describe('Status Component', () => {
- beforeEach(() => {
- init({
- fallbackLocale: 'en',
- initialLocale: 'en'
- });
- locale.set('en');
- });
-
- test('should render the component', () => {
- const host = document.createElement('div');
- document.body.appendChild(host);
- const instance = render(Status, {
- target: host,
- props: { status: writable([]), settings: writable([]) }
- });
- expect(instance).toBeTruthy();
- expect(host.innerHTML).toContain('Status');
- });
-});
diff --git a/src/routes/Status.svelte b/src/routes/Status.svelte
index a659af0..3195ad8 100644
--- a/src/routes/Status.svelte
+++ b/src/routes/Status.svelte
@@ -1,319 +1,131 @@
-
-
+
+
{$_('section.status.title', { default: 'Status' })}
- {#if $settings.isLoaded === false}
-
- {:else}
- {#if $settings.screens}
-
- {#each buttonChunks as chunk}
-
- {#each chunk as s}
- {s.name}
- {/each}
-
- {/each}
-
-
-
- {#each $settings.screens as s}
- {s.name}
- {/each}
-
-
- {#if $settings.actCurrencies && ($settings.dataSource == DataSourceType.BTCLOCK_SOURCE || $settings.dataSource == DataSourceType.CUSTOM_SOURCE)}
-
-
- {#each $settings.actCurrencies as c}
- {c}
- {/each}
-
-
- {/if}
-
- {#if $status.data}
-
- {#if $status.isUpdating === false && ($status.isFake ?? false) === false}
-
-
-
-
Lost connection
-
Trying to reconnect...
-
-
- {/if}
-
-
- {$_('section.status.screenCycle')}:
- {#if $status.timerRunning}⏵ {$_('timer.running')}{:else}⏸ {$_(
- 'timer.stopped'
- )}{/if}
-
- {$_('section.status.doNotDisturb')}:
-
- {#if $status.dnd?.active}⏵ {$_('on')}{:else}⏸ {$_('off')}{/if}
-
- {#if $status.dnd?.timeBasedEnabled}
- {$_('section.status.timeBasedDnd')} ( {$settings.dnd
- .startHour}:{$settings.dnd.startMinute.toString().padStart(2, '0')} - {$settings
- .dnd.endHour}:{$settings.dnd.endMinute.toString().padStart(2, '0')} )
- {/if}
-
- {/if}
- {/if}
-
- {#if !$settings.disableLeds}
-
- {#if $status.leds}
- {#each $status.leds as led}
-
-
-
- {/each}
- {/if}
-
-
- {/if}
- {memoryFreePercent}%
-
-
{$_('section.status.memoryFree')}
-
- {Math.round($status.espFreeHeap / 1024)} / {Math.round($status.espHeapSize / 1024)} KiB
-
-
-
- {#if $settings.hasLightLevel}
- {$_('section.status.lightSensor')}: {Number(Math.round($status.lightLevel))} lux
-
- {/if}
-
- {$_('rssiBar.tooltip')}
-
-
-
{$_('section.status.wifiSignalStrength')}
-
- {$status.rssi} dBm
-
-
-
- {$_('section.status.uptime')}: {toUptimestring($status.espUptime)}
-
-
- {#if $settings.dataSource == DataSourceType.NOSTR_SOURCE || $settings.nostrZapNotify}
- {$_('section.status.nostrConnection')}:
-
- {#if $status.connectionStatus && $status.connectionStatus.nostr}
- ✅
- {:else}
- ❌
- {/if}
-
- {/if}
- {#if $settings.dataSource != DataSourceType.NOSTR_SOURCE}
- {#if $settings.dataSource == DataSourceType.THIRD_PARTY_SOURCE}
- {$_('section.status.wsPriceConnection')}:
-
- {#if $status.connectionStatus && $status.connectionStatus.price}
- ✅
- {:else}
- ❌
- {/if}
-
- -
- {$_('section.status.wsMempoolConnection', {
- values: { instance: $settings.mempoolInstance }
- })}:
-
- {#if $status.connectionStatus && $status.connectionStatus.blocks}
- ✅
- {:else}
- ❌
- {/if}
-
- {:else}
- {$_('section.status.wsDataConnection')}:
-
- {#if $status.connectionStatus && $status.connectionStatus.V2}
- ✅
- {:else}
- ❌
- {/if}
-
- {/if}
- {/if}
- {#if $settings.fetchEurPrice}
- {$_('section.status.fetchEuroNote')}
- {/if}
-
- {/if}
-
-
+ {#if $settings.screens}
+
+
+ {#each $settings.screens as s}
+ {s.name}
+ {/each}
+
+
+
+ {#if $status.data}
+
+ { $_('section.status.screenCycle') }: {#if $status.timerRunning}⏵ { $_('timer.running') }{:else}⏸ { $_('timer.stopped') }{/if}
+ {/if}
+ {/if}
+
+
+ {#if $status.leds}
+ {#each $status.leds as led}
+
+
+
+ {/each}
+ {/if}
+
+
+ { memoryFreePercent }%
+
+
{ $_('section.status.memoryFree') }
+
{ Math.round($status.espFreeHeap / 1024) } / { Math.round($status.espHeapSize / 1024) } KiB
+
+
+ { $_('section.status.uptime') }: {toUptimeString($status.espUptime)}
+
+
+ { $_('section.status.wsPriceConnection') }:
+
+ {#if $status.connectionStatus && $status.connectionStatus.price}
+ ✅
+ {:else}
+ ❌
+ {/if}
+
+ -
+ { $_('section.status.wsMempoolConnection') }:
+
+ {#if $status.connectionStatus && $status.connectionStatus.blocks}
+ ✅
+ {:else}
+ ❌
+ {/if}
+
+ {#if $settings.fetchEurPrice}
+ { $_('section.status.fetchEuroNote') }
+ {/if}
+
+
+
+
-
-
diff --git a/src/routes/api/+page.svelte b/src/routes/api/+page.svelte
index 4b87374..cb11cd6 100644
--- a/src/routes/api/+page.svelte
+++ b/src/routes/api/+page.svelte
@@ -1,57 +1,64 @@
API playground
+
-
+
+
diff --git a/src/routes/convert/+page.svelte b/src/routes/convert/+page.svelte
deleted file mode 100644
index a1e9951..0000000
--- a/src/routes/convert/+page.svelte
+++ /dev/null
@@ -1,143 +0,0 @@
-
-
-
-
-
-
- BTC
- updateValues('BTC', e.target.value)}
- />
-
-
- s
- updateValues('sats', e.target.value)}
- />
-
- {#each Object.entries(exchangeRates) as [cur]}
-
- {cur}
- updateValues(cur, e.target.value)}
- />
-
- {/each}
-
-
-
diff --git a/static/bitaxe.webp b/static/bitaxe.webp
deleted file mode 100644
index 3c907c1..0000000
Binary files a/static/bitaxe.webp and /dev/null differ
diff --git a/static/fonts/Satoshi_Symbol.woff2 b/static/fonts/Satoshi_Symbol.woff2
deleted file mode 100644
index f565227..0000000
Binary files a/static/fonts/Satoshi_Symbol.woff2 and /dev/null differ
diff --git a/static/swagger.json b/static/swagger.json
index 04efa57..a1ef68a 100644
--- a/static/swagger.json
+++ b/static/swagger.json
@@ -1,457 +1,480 @@
{
- "openapi": "3.0.3",
- "info": {
- "title": "BTClock API",
- "version": "3.0",
- "description": "BTClock V3 API"
- },
- "servers": [
- {
- "url": "/api/"
- }
- ],
- "paths": {
- "/status": {
- "get": {
- "tags": ["system"],
- "summary": "Get current status",
- "responses": {
- "200": {
- "description": "successful operation"
- }
- }
- }
- },
- "/system_status": {
- "get": {
- "tags": ["system"],
- "summary": "Get system status",
- "responses": {
- "200": {
- "description": "successful operation"
- }
- }
- }
- },
- "/settings": {
- "get": {
- "tags": ["system"],
- "summary": "Get current settings",
- "responses": {
- "200": {
- "description": "successful operation",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ArrayOfLeds"
- }
- }
- }
- }
- }
- },
- "post": {
- "tags": ["system"],
- "summary": "Save current settings",
- "requestBody": {
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Settings"
- }
- }
- }
- },
- "responses": {
- "200": {
- "description": "successful operation"
- }
- }
- },
- "patch": {
- "tags": ["system"],
- "summary": "Save current settings",
- "requestBody": {
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Settings"
- }
- }
- }
- },
- "responses": {
- "200": {
- "description": "successful operation"
- }
- }
- }
- },
- "/action/pause": {
- "get": {
- "tags": ["timer"],
- "summary": "Pause screen rotation",
- "responses": {
- "200": {
- "description": "successful operation"
- }
- }
- }
- },
- "/action/timer_restart": {
- "get": {
- "tags": ["timer"],
- "summary": "Restart screen rotation",
- "responses": {
- "200": {
- "description": "successful operation"
- }
- }
- }
- },
- "/show/screen/{id}": {
- "get": {
- "tags": ["screens"],
- "summary": "Set screen to show",
- "parameters": [
- {
- "in": "path",
- "name": "id",
- "schema": {
- "type": "integer",
- "default": 1
- },
- "required": true,
- "description": "ID of screen to show"
- }
- ],
- "responses": {
- "200": {
- "description": "successful operation"
- }
- }
- }
- },
- "/show/text/{text}": {
- "get": {
- "tags": ["screens"],
- "summary": "Set text to show",
- "parameters": [
- {
- "in": "path",
- "name": "text",
- "schema": {
- "type": "string",
- "default": "text"
- },
- "required": true,
- "description": "Text to show"
- }
- ],
- "responses": {
- "200": {
- "description": "successful operation"
- }
- }
- }
- },
- "/show/custom": {
- "post": {
- "tags": ["screens"],
- "summary": "Set text to show (advanced)",
- "requestBody": {
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/CustomText"
- }
- }
- }
- },
- "responses": {
- "200": {
- "description": "successful operation"
- }
- }
- }
- },
- "/full_refresh": {
- "get": {
- "tags": ["system"],
- "summary": "Force full refresh of all displays",
- "responses": {
- "200": {
- "description": "successful operation"
- }
- }
- }
- },
- "/lights": {
- "get": {
- "tags": ["lights"],
- "summary": "Get LEDs status",
- "responses": {
- "200": {
- "description": "successful operation",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ArrayOfLeds"
- }
- }
- }
- }
- }
- }
- },
- "/lights/set": {
- "patch": {
- "tags": ["lights"],
- "summary": "Set individual LEDs",
- "requestBody": {
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ArrayOfLedsInput"
- }
- }
- }
- },
- "responses": {
- "200": {
- "description": "succesful operation"
- },
- "400": {
- "description": "invalid colors or wrong amount of LEDs"
- }
- }
- }
- },
- "/lights/color/{color}": {
- "get": {
- "tags": ["lights"],
- "summary": "Turn on LEDs with specific color",
- "parameters": [
- {
- "in": "path",
- "name": "color",
- "schema": {
- "type": "string",
- "default": "FFCC00"
- },
- "required": true,
- "description": "Color in RGB hex"
- }
- ],
- "responses": {
- "200": {
- "description": "successful operation"
- }
- }
- }
- },
- "/lights/off": {
- "get": {
- "tags": ["lights"],
- "summary": "Turn LEDs off",
- "responses": {
- "200": {
- "description": "successful operation"
- }
- }
- }
- },
- "/restart": {
- "get": {
- "tags": ["system"],
- "summary": "Restart BTClock",
- "responses": {
- "200": {
- "description": "successful operation"
- }
- }
- }
- }
- },
- "components": {
- "schemas": {
- "RgbColorValues": {
- "type": "object",
- "properties": {
- "red": {
- "type": "integer",
- "minimum": 0,
- "maximum": 255,
- "example": 255
- },
- "green": {
- "type": "integer",
- "minimum": 0,
- "maximum": 255,
- "example": 204
- },
- "blue": {
- "type": "integer",
- "minimum": 0,
- "maximum": 255,
- "example": 0
- }
- }
- },
- "RgbColorHex": {
- "type": "object",
- "properties": {
- "hex": {
- "type": "string",
- "pattern": "^#(?:[0-9a-fA-F]{3}){1,2}$",
- "example": "#FFCC00"
- }
- }
- },
- "RgbColorValueAndHex": {
- "allOf": [
- {
- "$ref": "#/components/schemas/RgbColorValues"
- },
- {
- "$ref": "#/components/schemas/RgbColorHex"
- }
- ]
- },
- "RgbColorValueOrHex": {
- "oneOf": [
- {
- "$ref": "#/components/schemas/RgbColorValues"
- },
- {
- "$ref": "#/components/schemas/RgbColorHex"
- }
- ]
- },
- "ArrayOfLeds": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/RgbColorValueAndHex"
- }
- },
- "ArrayOfLedsInput": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/RgbColorValueOrHex"
- }
- },
- "Settings": {
- "type": "object",
- "properties": {
- "fetchEurPrice": {
- "type": "boolean",
- "description": "Fetch EUR price instead of USD"
- },
- "fgColor": {
- "type": "string",
- "default": 16777215,
- "description": "ePaper foreground (text) color"
- },
- "bgColor": {
- "type": "string",
- "default": 0,
- "description": "ePaper background color"
- },
- "ledTestOnPower": {
- "type": "boolean",
- "default": true,
- "description": "Do LED test on power-on"
- },
- "ledFlashOnUpd": {
- "type": "boolean",
- "default": false,
- "description": "Flash LEDs on new block"
- },
- "mdnsEnabled": {
- "type": "boolean",
- "default": true,
- "description": "Enable mDNS"
- },
- "otaEnabled": {
- "type": "boolean",
- "default": true,
- "description": "Enable over-the-air updates"
- },
- "stealFocus": {
- "type": "boolean",
- "default": false,
- "description": "Steal focus on new block"
- },
- "mcapBigChar": {
- "type": "boolean",
- "default": false,
- "description": "Use big characters for market cap screen"
- },
- "mempoolInstance": {
- "type": "string",
- "default": "mempool.space",
- "description": "Mempool.space instance to connect to"
- },
- "ledBrightness": {
- "type": "integer",
- "default": 128,
- "description": "Brightness of LEDs"
- },
- "fullRefreshMin": {
- "type": "integer",
- "default": 60,
- "description": "Full refresh time of ePaper displays in minutes"
- },
- "screen[0]": {
- "type": "boolean"
- },
- "screen[1]": {
- "type": "boolean"
- },
- "screen[2]": {
- "type": "boolean"
- },
- "screen[3]": {
- "type": "boolean"
- },
- "screen[4]": {
- "type": "boolean"
- },
- "screen[5]": {
- "type": "boolean"
- },
- "screen[6]": {
- "type": "boolean"
- },
- "tzOffset": {
- "type": "integer",
- "default": 60,
- "description": "Timezone offset in minutes"
- },
- "minSecPriceUpd": {
- "type": "integer",
- "default": 30,
- "description": "Minimum time between price updates in seconds"
- },
- "timePerScreen": {
- "type": "integer",
- "default": 30,
- "description": "Time between screens when rotating in minutes"
- },
- "txPower": {
- "type": "integer",
- "description": "WiFi Tx Power"
- }
- }
- },
- "CustomText": {
- "type": "array",
- "items": {
- "type": "string"
- },
- "minItems": 7,
- "maxItems": 7
- }
- }
- }
-}
+ "openapi": "3.0.3",
+ "info": {
+ "title": "BTClock API",
+ "version": "3.0",
+ "description": "BTClock V3 API"
+ },
+ "servers": [
+ {
+ "url": "/api/"
+ }
+ ],
+ "paths": {
+ "/status": {
+ "get": {
+ "tags": [
+ "system"
+ ],
+ "summary": "Get current status",
+ "responses": {
+ "200": {
+ "description": "successful operation"
+ }
+ }
+ }
+ },
+ "/system_status": {
+ "get": {
+ "tags": [
+ "system"
+ ],
+ "summary": "Get system status",
+ "responses": {
+ "200": {
+ "description": "successful operation"
+ }
+ }
+ }
+ },
+ "/settings": {
+ "get": {
+ "tags": [
+ "system"
+ ],
+ "summary": "Get current settings",
+ "responses": {
+ "200": {
+ "description": "successful operation",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": null
+ }
+ }
+ }
+ }
+ }
+ },
+ "post": {
+ "tags": [
+ "system"
+ ],
+ "summary": "Save current settings",
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Settings"
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "successful operation"
+ }
+ }
+ },
+ "patch": {
+ "tags": [
+ "system"
+ ],
+ "summary": "Save current settings",
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Settings"
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "successful operation"
+ }
+ }
+ }
+ },
+ "/action/pause": {
+ "get": {
+ "tags": [
+ "timer"
+ ],
+ "summary": "Pause screen rotation",
+ "responses": {
+ "200": {
+ "description": "successful operation"
+ }
+ }
+ }
+ },
+ "/action/timer_restart": {
+ "get": {
+ "tags": [
+ "timer"
+ ],
+ "summary": "Restart screen rotation",
+ "responses": {
+ "200": {
+ "description": "successful operation"
+ }
+ }
+ }
+ },
+ "/show/screen/{id}": {
+ "get": {
+ "tags": [
+ "screens"
+ ],
+ "summary": "Set screen to show",
+ "parameters": [
+ {
+ "in": "path",
+ "name": "id",
+ "schema": {
+ "type": "integer",
+ "default": 1
+ },
+ "required": true,
+ "description": "ID of screen to show"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "successful operation"
+ }
+ }
+ }
+ },
+ "/show/text/{text}": {
+ "get": {
+ "tags": [
+ "screens"
+ ],
+ "summary": "Set text to show",
+ "parameters": [
+ {
+ "in": "path",
+ "name": "text",
+ "schema": {
+ "type": "string",
+ "default": "text"
+ },
+ "required": true,
+ "description": "Text to show"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "successful operation"
+ }
+ }
+ }
+ },
+ "/show/custom": {
+ "post": {
+ "tags": [
+ "screens"
+ ],
+ "summary": "Set text to show (advanced)",
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/CustomText"
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "successful operation"
+ }
+ }
+ }
+ },
+ "/full_refresh": {
+ "get": {
+ "tags": [
+ "system"
+ ],
+ "summary": "Force full refresh of all displays",
+ "responses": {
+ "200": {
+ "description": "successful operation"
+ }
+ }
+ }
+ },
+ "/lights": {
+ "get": {
+ "tags": [
+ "lights"
+ ],
+ "summary": "Get LEDs status",
+ "responses": {
+ "200": {
+ "description": "successful operation",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ArrayOfLeds"
+ }
+ }
+ }
+ }
+ }
+ },
+ "patch": {
+ "tags": [
+ "lights"
+ ],
+ "summary": "Set individual LEDs",
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ArrayOfLedsInput"
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "succesful operation"
+ },
+ "400": {
+ "description": "invalid colors or wrong amount of LEDs"
+ }
+ }
+ }
+ },
+ "/lights/{color}": {
+ "get": {
+ "tags": [
+ "lights"
+ ],
+ "summary": "Turn on LEDs with specific color",
+ "parameters": [
+ {
+ "in": "path",
+ "name": "color",
+ "schema": {
+ "type": "string",
+ "default": "FFCC00"
+ },
+ "required": true,
+ "description": "Color in RGB hex"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "successful operation"
+ }
+ }
+ }
+ },
+ "/lights/off": {
+ "get": {
+ "tags": [
+ "lights"
+ ],
+ "summary": "Turn LEDs off",
+ "responses": {
+ "200": {
+ "description": "successful operation"
+ }
+ }
+ }
+ },
+ "/restart": {
+ "get": {
+ "tags": [
+ "system"
+ ],
+ "summary": "Restart BTClock",
+ "responses": {
+ "200": {
+ "description": "successful operation"
+ }
+ }
+ }
+ }
+ },
+ "components": {
+ "schemas": {
+ "RgbColorValues": {
+ "type": "object",
+ "properties": {
+ "red": {
+ "type": "integer",
+ "minimum": 0,
+ "maximum": 255,
+ "example": 255
+ },
+ "green": {
+ "type": "integer",
+ "minimum": 0,
+ "maximum": 255,
+ "example": 204
+ },
+ "blue": {
+ "type": "integer",
+ "minimum": 0,
+ "maximum": 255,
+ "example": 0
+ }
+ }
+ },
+ "RgbColorHex": {
+ "type": "object",
+ "properties": {
+ "hex": {
+ "type": "string",
+ "pattern": "^#(?:[0-9a-fA-F]{3}){1,2}$",
+ "example": "#FFCC00"
+ }
+ }
+ },
+ "RgbColorValueAndHex": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/RgbColorValues"
+ },
+ {
+ "$ref": "#/components/schemas/RgbColorHex"
+ }
+ ]
+ },
+ "RgbColorValueOrHex": {
+ "oneOf": [
+ {
+ "$ref": "#/components/schemas/RgbColorValues"
+ },
+ {
+ "$ref": "#/components/schemas/RgbColorHex"
+ }
+ ]
+ },
+ "ArrayOfLeds": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/RgbColorValueAndHex"
+ }
+ },
+ "ArrayOfLedsInput": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/RgbColorValueOrHex"
+ }
+ },
+ "Settings": {
+ "type": "object",
+ "properties": {
+ "fetchEurPrice": {
+ "type": "boolean",
+ "description": "Fetch EUR price instead of USD"
+ },
+ "fgColor": {
+ "type": "string",
+ "default": 16777215,
+ "description": "ePaper foreground (text) color"
+ },
+ "bgColor": {
+ "type": "string",
+ "default": 0,
+ "description": "ePaper background color"
+ },
+ "ledTestOnPower": {
+ "type": "boolean",
+ "default": true,
+ "description": "Do LED test on power-on"
+ },
+ "ledFlashOnUpd": {
+ "type": "boolean",
+ "default": false,
+ "description": "Flash LEDs on new block"
+ },
+ "mdnsEnabled": {
+ "type": "boolean",
+ "default": true,
+ "description": "Enable mDNS"
+ },
+ "otaEnabled": {
+ "type": "boolean",
+ "default": true,
+ "description": "Enable over-the-air updates"
+ },
+ "stealFocus": {
+ "type": "boolean",
+ "default": false,
+ "description": "Steal focus on new block"
+ },
+ "mcapBigChar": {
+ "type": "boolean",
+ "default": false,
+ "description": "Use big characters for market cap screen"
+ },
+ "mempoolInstance": {
+ "type": "string",
+ "default": "mempool.space",
+ "description": "Mempool.space instance to connect to"
+ },
+ "ledBrightness": {
+ "type": "integer",
+ "default": 128,
+ "description": "Brightness of LEDs"
+ },
+ "fullRefreshMin": {
+ "type": "integer",
+ "default": 60,
+ "description": "Full refresh time of ePaper displays in minutes"
+ },
+ "screen[0]": {
+ "type": "boolean"
+ },
+ "screen[1]": {
+ "type": "boolean"
+ },
+ "screen[2]": {
+ "type": "boolean"
+ },
+ "screen[3]": {
+ "type": "boolean"
+ },
+ "screen[4]": {
+ "type": "boolean"
+ },
+ "screen[5]": {
+ "type": "boolean"
+ },
+ "tzOffset": {
+ "type": "integer",
+ "default": 60,
+ "description": "Timezone offset in minutes"
+ },
+ "minSecPriceUpd": {
+ "type": "integer",
+ "default": 30,
+ "description": "Minimum time between price updates in seconds"
+ },
+ "timePerScreen": {
+ "type": "integer",
+ "default": 30,
+ "description": "Time between screens when rotating in minutes"
+ }
+ }
+ },
+ "CustomText": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "minItems": 7,
+ "maxItems": 7
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/static/swagger.yml b/static/swagger.yml
index 15d918c..c07a798 100644
--- a/static/swagger.yml
+++ b/static/swagger.yml
@@ -31,9 +31,9 @@ paths:
'200':
description: successful operation
content:
- application/json:
+ application/json:
schema:
- $ref: '#/components/schemas/ArrayOfLeds'
+ $ref: #/components/schemas/ArrayOfLeds
post:
tags:
- system
@@ -139,9 +139,8 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/ArrayOfLeds'
- /lights/set:
patch:
- tags:
+ tags:
- lights
summary: Set individual LEDs
requestBody:
@@ -150,11 +149,11 @@ paths:
schema:
$ref: '#/components/schemas/ArrayOfLedsInput'
responses:
- '200':
+ "200":
description: succesful operation
- '400':
+ "400":
description: invalid colors or wrong amount of LEDs
- /lights/color/{color}:
+ /lights/{color}:
get:
tags:
- lights
@@ -189,38 +188,38 @@ paths:
components:
schemas:
RgbColorValues:
- type: object
- properties:
- red:
- type: integer
- minimum: 0
- maximum: 255
- example: 255
- green:
- type: integer
- minimum: 0
- maximum: 255
- example: 204
- blue:
- type: integer
- minimum: 0
- maximum: 255
- example: 0
+ type: object
+ properties:
+ red:
+ type: integer
+ minimum: 0
+ maximum: 255
+ example: 255
+ green:
+ type: integer
+ minimum: 0
+ maximum: 255
+ example: 204
+ blue:
+ type: integer
+ minimum: 0
+ maximum: 255
+ example: 0
RgbColorHex:
- type: object
- properties:
- hex:
- type: string
- pattern: ^#(?:[0-9a-fA-F]{3}){1,2}$
- example: '#FFCC00'
+ type: object
+ properties:
+ hex:
+ type: string
+ pattern: ^#(?:[0-9a-fA-F]{3}){1,2}$
+ example: "#FFCC00"
RgbColorValueAndHex:
- allOf:
- - $ref: '#/components/schemas/RgbColorValues'
- - $ref: '#/components/schemas/RgbColorHex'
+ allOf:
+ - $ref: '#/components/schemas/RgbColorValues'
+ - $ref: '#/components/schemas/RgbColorHex'
RgbColorValueOrHex:
- oneOf:
- - $ref: '#/components/schemas/RgbColorValues'
- - $ref: '#/components/schemas/RgbColorHex'
+ oneOf:
+ - $ref: '#/components/schemas/RgbColorValues'
+ - $ref: '#/components/schemas/RgbColorHex'
ArrayOfLeds:
type: array
items:
@@ -291,8 +290,6 @@ components:
type: boolean
screen[5]:
type: boolean
- screen[6]:
- type: boolean
tzOffset:
type: integer
default: 60
@@ -305,9 +302,6 @@ components:
type: integer
default: 30
description: Time between screens when rotating in minutes
- txPower:
- type: integer
- description: WiFi Tx Power
CustomText:
type: array
items:
diff --git a/static/zones.json b/static/zones.json
deleted file mode 100644
index 1b3f663..0000000
--- a/static/zones.json
+++ /dev/null
@@ -1,463 +0,0 @@
-{
- "Africa/Abidjan": "GMT0",
- "Africa/Accra": "GMT0",
- "Africa/Addis_Ababa": "EAT-3",
- "Africa/Algiers": "CET-1",
- "Africa/Asmara": "EAT-3",
- "Africa/Bamako": "GMT0",
- "Africa/Bangui": "WAT-1",
- "Africa/Banjul": "GMT0",
- "Africa/Bissau": "GMT0",
- "Africa/Blantyre": "CAT-2",
- "Africa/Brazzaville": "WAT-1",
- "Africa/Bujumbura": "CAT-2",
- "Africa/Cairo": "EET-2EEST,M4.5.5/0,M10.5.4/24",
- "Africa/Casablanca": "<+01>-1",
- "Africa/Ceuta": "CET-1CEST,M3.5.0,M10.5.0/3",
- "Africa/Conakry": "GMT0",
- "Africa/Dakar": "GMT0",
- "Africa/Dar_es_Salaam": "EAT-3",
- "Africa/Djibouti": "EAT-3",
- "Africa/Douala": "WAT-1",
- "Africa/El_Aaiun": "<+01>-1",
- "Africa/Freetown": "GMT0",
- "Africa/Gaborone": "CAT-2",
- "Africa/Harare": "CAT-2",
- "Africa/Johannesburg": "SAST-2",
- "Africa/Juba": "CAT-2",
- "Africa/Kampala": "EAT-3",
- "Africa/Khartoum": "CAT-2",
- "Africa/Kigali": "CAT-2",
- "Africa/Kinshasa": "WAT-1",
- "Africa/Lagos": "WAT-1",
- "Africa/Libreville": "WAT-1",
- "Africa/Lome": "GMT0",
- "Africa/Luanda": "WAT-1",
- "Africa/Lubumbashi": "CAT-2",
- "Africa/Lusaka": "CAT-2",
- "Africa/Malabo": "WAT-1",
- "Africa/Maputo": "CAT-2",
- "Africa/Maseru": "SAST-2",
- "Africa/Mbabane": "SAST-2",
- "Africa/Mogadishu": "EAT-3",
- "Africa/Monrovia": "GMT0",
- "Africa/Nairobi": "EAT-3",
- "Africa/Ndjamena": "WAT-1",
- "Africa/Niamey": "WAT-1",
- "Africa/Nouakchott": "GMT0",
- "Africa/Ouagadougou": "GMT0",
- "Africa/Porto-Novo": "WAT-1",
- "Africa/Sao_Tome": "GMT0",
- "Africa/Tripoli": "EET-2",
- "Africa/Tunis": "CET-1",
- "Africa/Windhoek": "CAT-2",
- "America/Adak": "HST10HDT,M3.2.0,M11.1.0",
- "America/Anchorage": "AKST9AKDT,M3.2.0,M11.1.0",
- "America/Anguilla": "AST4",
- "America/Antigua": "AST4",
- "America/Araguaina": "<-03>3",
- "America/Argentina/Buenos_Aires": "<-03>3",
- "America/Argentina/Catamarca": "<-03>3",
- "America/Argentina/Cordoba": "<-03>3",
- "America/Argentina/Jujuy": "<-03>3",
- "America/Argentina/La_Rioja": "<-03>3",
- "America/Argentina/Mendoza": "<-03>3",
- "America/Argentina/Rio_Gallegos": "<-03>3",
- "America/Argentina/Salta": "<-03>3",
- "America/Argentina/San_Juan": "<-03>3",
- "America/Argentina/San_Luis": "<-03>3",
- "America/Argentina/Tucuman": "<-03>3",
- "America/Argentina/Ushuaia": "<-03>3",
- "America/Aruba": "AST4",
- "America/Asuncion": "<-04>4<-03>,M10.1.0/0,M3.4.0/0",
- "America/Atikokan": "EST5",
- "America/Bahia": "<-03>3",
- "America/Bahia_Banderas": "CST6",
- "America/Barbados": "AST4",
- "America/Belem": "<-03>3",
- "America/Belize": "CST6",
- "America/Blanc-Sablon": "AST4",
- "America/Boa_Vista": "<-04>4",
- "America/Bogota": "<-05>5",
- "America/Boise": "MST7MDT,M3.2.0,M11.1.0",
- "America/Cambridge_Bay": "MST7MDT,M3.2.0,M11.1.0",
- "America/Campo_Grande": "<-04>4",
- "America/Cancun": "EST5",
- "America/Caracas": "<-04>4",
- "America/Cayenne": "<-03>3",
- "America/Cayman": "EST5",
- "America/Chicago": "CST6CDT,M3.2.0,M11.1.0",
- "America/Chihuahua": "CST6",
- "America/Costa_Rica": "CST6",
- "America/Creston": "MST7",
- "America/Cuiaba": "<-04>4",
- "America/Curacao": "AST4",
- "America/Danmarkshavn": "GMT0",
- "America/Dawson": "MST7",
- "America/Dawson_Creek": "MST7",
- "America/Denver": "MST7MDT,M3.2.0,M11.1.0",
- "America/Detroit": "EST5EDT,M3.2.0,M11.1.0",
- "America/Dominica": "AST4",
- "America/Edmonton": "MST7MDT,M3.2.0,M11.1.0",
- "America/Eirunepe": "<-05>5",
- "America/El_Salvador": "CST6",
- "America/Fort_Nelson": "MST7",
- "America/Fortaleza": "<-03>3",
- "America/Glace_Bay": "AST4ADT,M3.2.0,M11.1.0",
- "America/Godthab": "<-02>2<-01>,M3.5.0/-1,M10.5.0/0",
- "America/Goose_Bay": "AST4ADT,M3.2.0,M11.1.0",
- "America/Grand_Turk": "EST5EDT,M3.2.0,M11.1.0",
- "America/Grenada": "AST4",
- "America/Guadeloupe": "AST4",
- "America/Guatemala": "CST6",
- "America/Guayaquil": "<-05>5",
- "America/Guyana": "<-04>4",
- "America/Halifax": "AST4ADT,M3.2.0,M11.1.0",
- "America/Havana": "CST5CDT,M3.2.0/0,M11.1.0/1",
- "America/Hermosillo": "MST7",
- "America/Indiana/Indianapolis": "EST5EDT,M3.2.0,M11.1.0",
- "America/Indiana/Knox": "CST6CDT,M3.2.0,M11.1.0",
- "America/Indiana/Marengo": "EST5EDT,M3.2.0,M11.1.0",
- "America/Indiana/Petersburg": "EST5EDT,M3.2.0,M11.1.0",
- "America/Indiana/Tell_City": "CST6CDT,M3.2.0,M11.1.0",
- "America/Indiana/Vevay": "EST5EDT,M3.2.0,M11.1.0",
- "America/Indiana/Vincennes": "EST5EDT,M3.2.0,M11.1.0",
- "America/Indiana/Winamac": "EST5EDT,M3.2.0,M11.1.0",
- "America/Inuvik": "MST7MDT,M3.2.0,M11.1.0",
- "America/Iqaluit": "EST5EDT,M3.2.0,M11.1.0",
- "America/Jamaica": "EST5",
- "America/Juneau": "AKST9AKDT,M3.2.0,M11.1.0",
- "America/Kentucky/Louisville": "EST5EDT,M3.2.0,M11.1.0",
- "America/Kentucky/Monticello": "EST5EDT,M3.2.0,M11.1.0",
- "America/Kralendijk": "AST4",
- "America/La_Paz": "<-04>4",
- "America/Lima": "<-05>5",
- "America/Los_Angeles": "PST8PDT,M3.2.0,M11.1.0",
- "America/Lower_Princes": "AST4",
- "America/Maceio": "<-03>3",
- "America/Managua": "CST6",
- "America/Manaus": "<-04>4",
- "America/Marigot": "AST4",
- "America/Martinique": "AST4",
- "America/Matamoros": "CST6CDT,M3.2.0,M11.1.0",
- "America/Mazatlan": "MST7",
- "America/Menominee": "CST6CDT,M3.2.0,M11.1.0",
- "America/Merida": "CST6",
- "America/Metlakatla": "AKST9AKDT,M3.2.0,M11.1.0",
- "America/Mexico_City": "CST6",
- "America/Miquelon": "<-03>3<-02>,M3.2.0,M11.1.0",
- "America/Moncton": "AST4ADT,M3.2.0,M11.1.0",
- "America/Monterrey": "CST6",
- "America/Montevideo": "<-03>3",
- "America/Montreal": "EST5EDT,M3.2.0,M11.1.0",
- "America/Montserrat": "AST4",
- "America/Nassau": "EST5EDT,M3.2.0,M11.1.0",
- "America/New_York": "EST5EDT,M3.2.0,M11.1.0",
- "America/Nipigon": "EST5EDT,M3.2.0,M11.1.0",
- "America/Nome": "AKST9AKDT,M3.2.0,M11.1.0",
- "America/Noronha": "<-02>2",
- "America/North_Dakota/Beulah": "CST6CDT,M3.2.0,M11.1.0",
- "America/North_Dakota/Center": "CST6CDT,M3.2.0,M11.1.0",
- "America/North_Dakota/New_Salem": "CST6CDT,M3.2.0,M11.1.0",
- "America/Nuuk": "<-02>2<-01>,M3.5.0/-1,M10.5.0/0",
- "America/Ojinaga": "CST6CDT,M3.2.0,M11.1.0",
- "America/Panama": "EST5",
- "America/Pangnirtung": "EST5EDT,M3.2.0,M11.1.0",
- "America/Paramaribo": "<-03>3",
- "America/Phoenix": "MST7",
- "America/Port-au-Prince": "EST5EDT,M3.2.0,M11.1.0",
- "America/Port_of_Spain": "AST4",
- "America/Porto_Velho": "<-04>4",
- "America/Puerto_Rico": "AST4",
- "America/Punta_Arenas": "<-03>3",
- "America/Rainy_River": "CST6CDT,M3.2.0,M11.1.0",
- "America/Rankin_Inlet": "CST6CDT,M3.2.0,M11.1.0",
- "America/Recife": "<-03>3",
- "America/Regina": "CST6",
- "America/Resolute": "CST6CDT,M3.2.0,M11.1.0",
- "America/Rio_Branco": "<-05>5",
- "America/Santarem": "<-03>3",
- "America/Santiago": "<-04>4<-03>,M9.1.6/24,M4.1.6/24",
- "America/Santo_Domingo": "AST4",
- "America/Sao_Paulo": "<-03>3",
- "America/Scoresbysund": "<-02>2<-01>,M3.5.0/-1,M10.5.0/0",
- "America/Sitka": "AKST9AKDT,M3.2.0,M11.1.0",
- "America/St_Barthelemy": "AST4",
- "America/St_Johns": "NST3:30NDT,M3.2.0,M11.1.0",
- "America/St_Kitts": "AST4",
- "America/St_Lucia": "AST4",
- "America/St_Thomas": "AST4",
- "America/St_Vincent": "AST4",
- "America/Swift_Current": "CST6",
- "America/Tegucigalpa": "CST6",
- "America/Thule": "AST4ADT,M3.2.0,M11.1.0",
- "America/Thunder_Bay": "EST5EDT,M3.2.0,M11.1.0",
- "America/Tijuana": "PST8PDT,M3.2.0,M11.1.0",
- "America/Toronto": "EST5EDT,M3.2.0,M11.1.0",
- "America/Tortola": "AST4",
- "America/Vancouver": "PST8PDT,M3.2.0,M11.1.0",
- "America/Whitehorse": "MST7",
- "America/Winnipeg": "CST6CDT,M3.2.0,M11.1.0",
- "America/Yakutat": "AKST9AKDT,M3.2.0,M11.1.0",
- "America/Yellowknife": "MST7MDT,M3.2.0,M11.1.0",
- "Antarctica/Casey": "<+08>-8",
- "Antarctica/Davis": "<+07>-7",
- "Antarctica/DumontDUrville": "<+10>-10",
- "Antarctica/Macquarie": "AEST-10AEDT,M10.1.0,M4.1.0/3",
- "Antarctica/Mawson": "<+05>-5",
- "Antarctica/McMurdo": "NZST-12NZDT,M9.5.0,M4.1.0/3",
- "Antarctica/Palmer": "<-03>3",
- "Antarctica/Rothera": "<-03>3",
- "Antarctica/Syowa": "<+03>-3",
- "Antarctica/Troll": "<+00>0<+02>-2,M3.5.0/1,M10.5.0/3",
- "Antarctica/Vostok": "<+05>-5",
- "Arctic/Longyearbyen": "CET-1CEST,M3.5.0,M10.5.0/3",
- "Asia/Aden": "<+03>-3",
- "Asia/Almaty": "<+05>-5",
- "Asia/Amman": "<+03>-3",
- "Asia/Anadyr": "<+12>-12",
- "Asia/Aqtau": "<+05>-5",
- "Asia/Aqtobe": "<+05>-5",
- "Asia/Ashgabat": "<+05>-5",
- "Asia/Atyrau": "<+05>-5",
- "Asia/Baghdad": "<+03>-3",
- "Asia/Bahrain": "<+03>-3",
- "Asia/Baku": "<+04>-4",
- "Asia/Bangkok": "<+07>-7",
- "Asia/Barnaul": "<+07>-7",
- "Asia/Beirut": "EET-2EEST,M3.5.0/0,M10.5.0/0",
- "Asia/Bishkek": "<+06>-6",
- "Asia/Brunei": "<+08>-8",
- "Asia/Chita": "<+09>-9",
- "Asia/Choibalsan": "<+08>-8",
- "Asia/Colombo": "<+0530>-5:30",
- "Asia/Damascus": "<+03>-3",
- "Asia/Dhaka": "<+06>-6",
- "Asia/Dili": "<+09>-9",
- "Asia/Dubai": "<+04>-4",
- "Asia/Dushanbe": "<+05>-5",
- "Asia/Famagusta": "EET-2EEST,M3.5.0/3,M10.5.0/4",
- "Asia/Gaza": "EET-2EEST,M3.4.4/50,M10.4.4/50",
- "Asia/Hebron": "EET-2EEST,M3.4.4/50,M10.4.4/50",
- "Asia/Ho_Chi_Minh": "<+07>-7",
- "Asia/Hong_Kong": "HKT-8",
- "Asia/Hovd": "<+07>-7",
- "Asia/Irkutsk": "<+08>-8",
- "Asia/Jakarta": "WIB-7",
- "Asia/Jayapura": "WIT-9",
- "Asia/Jerusalem": "IST-2IDT,M3.4.4/26,M10.5.0",
- "Asia/Kabul": "<+0430>-4:30",
- "Asia/Kamchatka": "<+12>-12",
- "Asia/Karachi": "PKT-5",
- "Asia/Kathmandu": "<+0545>-5:45",
- "Asia/Khandyga": "<+09>-9",
- "Asia/Kolkata": "IST-5:30",
- "Asia/Krasnoyarsk": "<+07>-7",
- "Asia/Kuala_Lumpur": "<+08>-8",
- "Asia/Kuching": "<+08>-8",
- "Asia/Kuwait": "<+03>-3",
- "Asia/Macau": "CST-8",
- "Asia/Magadan": "<+11>-11",
- "Asia/Makassar": "WITA-8",
- "Asia/Manila": "PST-8",
- "Asia/Muscat": "<+04>-4",
- "Asia/Nicosia": "EET-2EEST,M3.5.0/3,M10.5.0/4",
- "Asia/Novokuznetsk": "<+07>-7",
- "Asia/Novosibirsk": "<+07>-7",
- "Asia/Omsk": "<+06>-6",
- "Asia/Oral": "<+05>-5",
- "Asia/Phnom_Penh": "<+07>-7",
- "Asia/Pontianak": "WIB-7",
- "Asia/Pyongyang": "KST-9",
- "Asia/Qatar": "<+03>-3",
- "Asia/Qyzylorda": "<+05>-5",
- "Asia/Riyadh": "<+03>-3",
- "Asia/Sakhalin": "<+11>-11",
- "Asia/Samarkand": "<+05>-5",
- "Asia/Seoul": "KST-9",
- "Asia/Shanghai": "CST-8",
- "Asia/Singapore": "<+08>-8",
- "Asia/Srednekolymsk": "<+11>-11",
- "Asia/Taipei": "CST-8",
- "Asia/Tashkent": "<+05>-5",
- "Asia/Tbilisi": "<+04>-4",
- "Asia/Tehran": "<+0330>-3:30",
- "Asia/Thimphu": "<+06>-6",
- "Asia/Tokyo": "JST-9",
- "Asia/Tomsk": "<+07>-7",
- "Asia/Ulaanbaatar": "<+08>-8",
- "Asia/Urumqi": "<+06>-6",
- "Asia/Ust-Nera": "<+10>-10",
- "Asia/Vientiane": "<+07>-7",
- "Asia/Vladivostok": "<+10>-10",
- "Asia/Yakutsk": "<+09>-9",
- "Asia/Yangon": "<+0630>-6:30",
- "Asia/Yekaterinburg": "<+05>-5",
- "Asia/Yerevan": "<+04>-4",
- "Atlantic/Azores": "<-01>1<+00>,M3.5.0/0,M10.5.0/1",
- "Atlantic/Bermuda": "AST4ADT,M3.2.0,M11.1.0",
- "Atlantic/Canary": "WET0WEST,M3.5.0/1,M10.5.0",
- "Atlantic/Cape_Verde": "<-01>1",
- "Atlantic/Faroe": "WET0WEST,M3.5.0/1,M10.5.0",
- "Atlantic/Madeira": "WET0WEST,M3.5.0/1,M10.5.0",
- "Atlantic/Reykjavik": "GMT0",
- "Atlantic/South_Georgia": "<-02>2",
- "Atlantic/St_Helena": "GMT0",
- "Atlantic/Stanley": "<-03>3",
- "Australia/Adelaide": "ACST-9:30ACDT,M10.1.0,M4.1.0/3",
- "Australia/Brisbane": "AEST-10",
- "Australia/Broken_Hill": "ACST-9:30ACDT,M10.1.0,M4.1.0/3",
- "Australia/Currie": "AEST-10AEDT,M10.1.0,M4.1.0/3",
- "Australia/Darwin": "ACST-9:30",
- "Australia/Eucla": "<+0845>-8:45",
- "Australia/Hobart": "AEST-10AEDT,M10.1.0,M4.1.0/3",
- "Australia/Lindeman": "AEST-10",
- "Australia/Lord_Howe": "<+1030>-10:30<+11>-11,M10.1.0,M4.1.0",
- "Australia/Melbourne": "AEST-10AEDT,M10.1.0,M4.1.0/3",
- "Australia/Perth": "AWST-8",
- "Australia/Sydney": "AEST-10AEDT,M10.1.0,M4.1.0/3",
- "Etc/GMT": "GMT0",
- "Etc/GMT+0": "GMT0",
- "Etc/GMT+1": "<-01>1",
- "Etc/GMT+10": "<-10>10",
- "Etc/GMT+11": "<-11>11",
- "Etc/GMT+12": "<-12>12",
- "Etc/GMT+2": "<-02>2",
- "Etc/GMT+3": "<-03>3",
- "Etc/GMT+4": "<-04>4",
- "Etc/GMT+5": "<-05>5",
- "Etc/GMT+6": "<-06>6",
- "Etc/GMT+7": "<-07>7",
- "Etc/GMT+8": "<-08>8",
- "Etc/GMT+9": "<-09>9",
- "Etc/GMT-0": "GMT0",
- "Etc/GMT-1": "<+01>-1",
- "Etc/GMT-10": "<+10>-10",
- "Etc/GMT-11": "<+11>-11",
- "Etc/GMT-12": "<+12>-12",
- "Etc/GMT-13": "<+13>-13",
- "Etc/GMT-14": "<+14>-14",
- "Etc/GMT-2": "<+02>-2",
- "Etc/GMT-3": "<+03>-3",
- "Etc/GMT-4": "<+04>-4",
- "Etc/GMT-5": "<+05>-5",
- "Etc/GMT-6": "<+06>-6",
- "Etc/GMT-7": "<+07>-7",
- "Etc/GMT-8": "<+08>-8",
- "Etc/GMT-9": "<+09>-9",
- "Etc/GMT0": "GMT0",
- "Etc/Greenwich": "GMT0",
- "Etc/UCT": "UTC0",
- "Etc/UTC": "UTC0",
- "Etc/Universal": "UTC0",
- "Etc/Zulu": "UTC0",
- "Europe/Amsterdam": "CET-1CEST,M3.5.0,M10.5.0/3",
- "Europe/Andorra": "CET-1CEST,M3.5.0,M10.5.0/3",
- "Europe/Astrakhan": "<+04>-4",
- "Europe/Athens": "EET-2EEST,M3.5.0/3,M10.5.0/4",
- "Europe/Belgrade": "CET-1CEST,M3.5.0,M10.5.0/3",
- "Europe/Berlin": "CET-1CEST,M3.5.0,M10.5.0/3",
- "Europe/Bratislava": "CET-1CEST,M3.5.0,M10.5.0/3",
- "Europe/Brussels": "CET-1CEST,M3.5.0,M10.5.0/3",
- "Europe/Bucharest": "EET-2EEST,M3.5.0/3,M10.5.0/4",
- "Europe/Budapest": "CET-1CEST,M3.5.0,M10.5.0/3",
- "Europe/Busingen": "CET-1CEST,M3.5.0,M10.5.0/3",
- "Europe/Chisinau": "EET-2EEST,M3.5.0,M10.5.0/3",
- "Europe/Copenhagen": "CET-1CEST,M3.5.0,M10.5.0/3",
- "Europe/Dublin": "IST-1GMT0,M10.5.0,M3.5.0/1",
- "Europe/Gibraltar": "CET-1CEST,M3.5.0,M10.5.0/3",
- "Europe/Guernsey": "GMT0BST,M3.5.0/1,M10.5.0",
- "Europe/Helsinki": "EET-2EEST,M3.5.0/3,M10.5.0/4",
- "Europe/Isle_of_Man": "GMT0BST,M3.5.0/1,M10.5.0",
- "Europe/Istanbul": "<+03>-3",
- "Europe/Jersey": "GMT0BST,M3.5.0/1,M10.5.0",
- "Europe/Kaliningrad": "EET-2",
- "Europe/Kiev": "EET-2EEST,M3.5.0/3,M10.5.0/4",
- "Europe/Kirov": "MSK-3",
- "Europe/Lisbon": "WET0WEST,M3.5.0/1,M10.5.0",
- "Europe/Ljubljana": "CET-1CEST,M3.5.0,M10.5.0/3",
- "Europe/London": "GMT0BST,M3.5.0/1,M10.5.0",
- "Europe/Luxembourg": "CET-1CEST,M3.5.0,M10.5.0/3",
- "Europe/Madrid": "CET-1CEST,M3.5.0,M10.5.0/3",
- "Europe/Malta": "CET-1CEST,M3.5.0,M10.5.0/3",
- "Europe/Mariehamn": "EET-2EEST,M3.5.0/3,M10.5.0/4",
- "Europe/Minsk": "<+03>-3",
- "Europe/Monaco": "CET-1CEST,M3.5.0,M10.5.0/3",
- "Europe/Moscow": "MSK-3",
- "Europe/Oslo": "CET-1CEST,M3.5.0,M10.5.0/3",
- "Europe/Paris": "CET-1CEST,M3.5.0,M10.5.0/3",
- "Europe/Podgorica": "CET-1CEST,M3.5.0,M10.5.0/3",
- "Europe/Prague": "CET-1CEST,M3.5.0,M10.5.0/3",
- "Europe/Riga": "EET-2EEST,M3.5.0/3,M10.5.0/4",
- "Europe/Rome": "CET-1CEST,M3.5.0,M10.5.0/3",
- "Europe/Samara": "<+04>-4",
- "Europe/San_Marino": "CET-1CEST,M3.5.0,M10.5.0/3",
- "Europe/Sarajevo": "CET-1CEST,M3.5.0,M10.5.0/3",
- "Europe/Saratov": "<+04>-4",
- "Europe/Simferopol": "MSK-3",
- "Europe/Skopje": "CET-1CEST,M3.5.0,M10.5.0/3",
- "Europe/Sofia": "EET-2EEST,M3.5.0/3,M10.5.0/4",
- "Europe/Stockholm": "CET-1CEST,M3.5.0,M10.5.0/3",
- "Europe/Tallinn": "EET-2EEST,M3.5.0/3,M10.5.0/4",
- "Europe/Tirane": "CET-1CEST,M3.5.0,M10.5.0/3",
- "Europe/Ulyanovsk": "<+04>-4",
- "Europe/Uzhgorod": "EET-2EEST,M3.5.0/3,M10.5.0/4",
- "Europe/Vaduz": "CET-1CEST,M3.5.0,M10.5.0/3",
- "Europe/Vatican": "CET-1CEST,M3.5.0,M10.5.0/3",
- "Europe/Vienna": "CET-1CEST,M3.5.0,M10.5.0/3",
- "Europe/Vilnius": "EET-2EEST,M3.5.0/3,M10.5.0/4",
- "Europe/Volgograd": "MSK-3",
- "Europe/Warsaw": "CET-1CEST,M3.5.0,M10.5.0/3",
- "Europe/Zagreb": "CET-1CEST,M3.5.0,M10.5.0/3",
- "Europe/Zaporozhye": "EET-2EEST,M3.5.0/3,M10.5.0/4",
- "Europe/Zurich": "CET-1CEST,M3.5.0,M10.5.0/3",
- "Indian/Antananarivo": "EAT-3",
- "Indian/Chagos": "<+06>-6",
- "Indian/Christmas": "<+07>-7",
- "Indian/Cocos": "<+0630>-6:30",
- "Indian/Comoro": "EAT-3",
- "Indian/Kerguelen": "<+05>-5",
- "Indian/Mahe": "<+04>-4",
- "Indian/Maldives": "<+05>-5",
- "Indian/Mauritius": "<+04>-4",
- "Indian/Mayotte": "EAT-3",
- "Indian/Reunion": "<+04>-4",
- "Pacific/Apia": "<+13>-13",
- "Pacific/Auckland": "NZST-12NZDT,M9.5.0,M4.1.0/3",
- "Pacific/Bougainville": "<+11>-11",
- "Pacific/Chatham": "<+1245>-12:45<+1345>,M9.5.0/2:45,M4.1.0/3:45",
- "Pacific/Chuuk": "<+10>-10",
- "Pacific/Easter": "<-06>6<-05>,M9.1.6/22,M4.1.6/22",
- "Pacific/Efate": "<+11>-11",
- "Pacific/Enderbury": "<+13>-13",
- "Pacific/Fakaofo": "<+13>-13",
- "Pacific/Fiji": "<+12>-12",
- "Pacific/Funafuti": "<+12>-12",
- "Pacific/Galapagos": "<-06>6",
- "Pacific/Gambier": "<-09>9",
- "Pacific/Guadalcanal": "<+11>-11",
- "Pacific/Guam": "ChST-10",
- "Pacific/Honolulu": "HST10",
- "Pacific/Kiritimati": "<+14>-14",
- "Pacific/Kosrae": "<+11>-11",
- "Pacific/Kwajalein": "<+12>-12",
- "Pacific/Majuro": "<+12>-12",
- "Pacific/Marquesas": "<-0930>9:30",
- "Pacific/Midway": "SST11",
- "Pacific/Nauru": "<+12>-12",
- "Pacific/Niue": "<-11>11",
- "Pacific/Norfolk": "<+11>-11<+12>,M10.1.0,M4.1.0/3",
- "Pacific/Noumea": "<+11>-11",
- "Pacific/Pago_Pago": "SST11",
- "Pacific/Palau": "<+09>-9",
- "Pacific/Pitcairn": "<-08>8",
- "Pacific/Pohnpei": "<+11>-11",
- "Pacific/Port_Moresby": "<+10>-10",
- "Pacific/Rarotonga": "<-10>10",
- "Pacific/Saipan": "ChST-10",
- "Pacific/Tahiti": "<-10>10",
- "Pacific/Tarawa": "<+12>-12",
- "Pacific/Tongatapu": "<+13>-13",
- "Pacific/Wake": "<+12>-12",
- "Pacific/Wallis": "<+12>-12"
-}
diff --git a/svelte.config.js b/svelte.config.js
index 6517ee3..468ccd1 100644
--- a/svelte.config.js
+++ b/svelte.config.js
@@ -1,18 +1,20 @@
import adapter from '@sveltejs/adapter-static';
-import { sveltePreprocess } from 'svelte-preprocess';
+import { vitePreprocess } from '@sveltejs/kit/vite';
/** @type {import('@sveltejs/kit').Config} */
const config = {
// Consult https://kit.svelte.dev/docs/integrations#preprocessors
// for more information about preprocessors
- preprocess: sveltePreprocess({}),
- build: {
- rollupOptions: {
- output: {
- assetFilenames: '[hash]'
- }
+ preprocess: vitePreprocess({
+
+ }),
+build: {
+ rollupOptions: {
+ output: {
+ assetFilenames: '[hash]'
}
- },
+ }
+},
kit: {
// adapter-auto only supports some environments, see https://kit.svelte.dev/docs/adapter-auto for a list.
// If your environment is not supported or you settled on a specific environment, switch out the adapter.
@@ -22,11 +24,11 @@ const config = {
// these options are set automatically — see below
pages: 'dist',
assets: 'dist',
- fallback: 'bundle.html',
+ fallback: "bundle.html",
precompress: false,
strict: true
}),
- appDir: 'build'
+ appDir: "build",
// inlineStyleThreshold: 9999999999
}
};
diff --git a/tests/doc-screenshots/viewport-screenshots.spec.ts b/tests/doc-screenshots/viewport-screenshots.spec.ts
deleted file mode 100644
index f9e8e25..0000000
--- a/tests/doc-screenshots/viewport-screenshots.spec.ts
+++ /dev/null
@@ -1,70 +0,0 @@
-import { test, expect } from '@playwright/test';
-
-import { initMock, settingsJson, statusJson } from '../shared';
-import sharp from 'sharp';
-
-test.beforeEach(initMock);
-
-// Define the translations for the headings
-const headings = {
- en: {
- control: 'Control',
- status: 'Status',
- settings: 'Settings',
- language: 'English'
- },
- de: {
- control: 'Steuerung',
- status: 'Status',
- settings: 'Einstellungen',
- language: 'Deutsch'
- },
- nl: {
- control: 'Besturing',
- status: 'Status',
- settings: 'Instellingen',
- language: 'Nederlands'
- },
- es: {
- control: 'Control',
- status: 'Estado',
- settings: 'Ajustes',
- language: 'Español'
- }
-};
-
-test('capture screenshots across devices', async ({ page }, testInfo) => {
- // Get the locale from the browser or default to 'en'
- const locale = testInfo.project.use?.locale?.split('-')[0].toLowerCase() || 'en';
- const translations = headings[locale] || headings.en;
-
- statusJson.isUpdating = true;
- // Set the color scheme
- if (testInfo.project.use?.colorScheme === 'dark') {
- settingsJson.invertedColor = true;
- } else {
- settingsJson.invertedColor = false;
- }
-
- await page.goto('/');
- await expect(page.getByRole('heading', { name: translations.control })).toBeVisible();
- await expect(page.getByRole('heading', { name: translations.status })).toBeVisible();
- await expect(page.getByRole('heading', { name: translations.settings })).toBeVisible();
-
- if (await page.locator('#nav-language-dropdown').isVisible()) {
- await expect(page.getByRole('link', { name: translations.language })).toBeVisible();
- }
-
- const screenshot = await page.screenshot({
- fullPage: true
- });
-
- await sharp(screenshot)
- .toFormat('webp', {
- quality: 95,
- nearLossless: true
- })
- .toFile(
- `./doc/screenshot-${test.info().project.use.colorScheme?.toLowerCase().replace(' ', '_')}.webp`
- );
-});
diff --git a/tests/playwright/test.ts b/tests/playwright/test.ts
deleted file mode 100644
index 92a600d..0000000
--- a/tests/playwright/test.ts
+++ /dev/null
@@ -1,184 +0,0 @@
-import { expect, test } from '@playwright/test';
-import { initMock, settingsJson, statusJson } from '../shared';
-
-test.beforeEach(initMock);
-
-test('index page has expected columns control, status, settings', async ({ page }) => {
- await page.goto('/');
- await expect(page.getByRole('heading', { name: 'Control' })).toBeVisible();
- await expect(page.getByRole('heading', { name: 'Status' })).toBeVisible();
- await expect(page.getByRole('heading', { name: 'Settings' })).toBeVisible();
-});
-
-test('index page has working language selector', async ({ page }) => {
- await page.goto('/');
- await expect(page.locator('//*[@id="nav-language-dropdown"]/a')).toBeVisible();
- page.locator('//*[@id="nav-language-dropdown"]/a').click();
- //*[@id="nav-language-dropdown"]/ul/li[1]/button
- await expect(page.locator('//*[@id="nav-language-dropdown"]/ul/li[1]/button')).toBeVisible();
- page.locator('//*[@id="nav-language-dropdown"]/ul/li[2]/button').click();
- await expect(page.getByRole('heading', { name: 'Instellingen' })).toBeVisible();
- page.locator('//*[@id="nav-language-dropdown"]/a').click();
- page.locator('//*[@id="nav-language-dropdown"]/ul/li[3]/button').click();
- await expect(page.getByRole('heading', { name: 'Configuración' })).toBeVisible();
-});
-
-test('api page has expected load button', async ({ page }) => {
- await page.goto('/api');
- await expect(page.getByRole('button', { name: 'Load' })).toBeVisible();
-});
-
-// test('timezone can be negative, zero and positive', async ({ page }) => {
-// await page.goto('/');
-// await page.getByRole('button', { name: 'Show all' }).click();
-
-// const tzOffsetField = 'input#tzOffset';
-
-// for (const val of ['-10', '0', '42']) {
-// await page.fill(tzOffsetField, val);
-// const resultValue = await page.$eval(tzOffsetField, (input: HTMLInputElement) => input.value);
-// expect(resultValue).toBe(val);
-// await page.getByRole('button', { name: 'Save' }).click();
-// }
-// });
-
-test('time values can not be zero or negative', async ({ page }) => {
- await page.goto('/');
- await page.getByRole('button', { name: 'Show all' }).click();
-
- for (const field of ['#timePerScreen', '#fullRefreshMin', '#minSecPriceUpd']) {
- for (const val of ['42', '210']) {
- await page.fill(field, val);
- const resultValue = await page.$eval(field, (input: HTMLInputElement) => input.value);
- expect(resultValue).toBe(val);
- await page.getByRole('button', { name: 'Save' }).click();
- const validationMessage = await page.$eval(
- field,
- (input: HTMLInputElement) => input.validationMessage
- );
- expect(validationMessage).not.toContain('Value must be greater');
- }
-
- for (const val of ['-10', '0']) {
- await page.fill(field, val);
- const resultValue = await page.$eval(field, (input: HTMLInputElement) => input.value);
- expect(resultValue).toBe(val);
- await page.getByRole('button', { name: 'Save' }).click();
- const validationMessage = await page.$eval(
- field,
- (input: HTMLInputElement) => input.validationMessage
- );
- expect(validationMessage).toContain('Value must be greater');
- }
- }
-});
-
-test('info message when fetch eur price is enabled', async ({ page }) => {
- delete (settingsJson as { actCurrencies?: string[] }).actCurrencies;
-
- await page.goto('/');
- await page.getByRole('button', { name: 'Show all' }).click();
-
- const inputField = 'input#fetchEurPrice';
- const switchElement = await page.locator(inputField);
-
- expect(switchElement).toBeTruthy();
- const isSwitchEnabled = await switchElement.isChecked();
- expect(isSwitchEnabled).toBe(false);
-
- await expect(page.getByText('the WS Price connection will show')).toBeHidden();
-
- await switchElement.click();
- const isSwitchNowEnabled = await switchElement.isChecked();
- expect(isSwitchNowEnabled).toBe(true);
-
- await expect(page.getByText('the WS Price connection will show')).toBeVisible();
-});
-
-test('npub values will be converted to hex pubkeys', async ({ page }) => {
- await page.goto('/');
- await page.getByRole('button', { name: 'Show all' }).click();
-
- for (const field of ['#nostrZapPubkey']) {
- for (const val of ['npub1k5f85zx0xdskyayqpfpc0zq6n7vwqjuuxugkayk72fgynp34cs3qfcvqg2']) {
- await page.fill(field, val);
-
- await page.getByLabel('Nostr Relay').click();
- const resultValue = await page.$eval(field, (input: HTMLInputElement) => input.value);
-
- expect(resultValue).toBe('b5127a08cf33616274800a4387881a9f98e04b9c37116e92de5250498635c422');
- }
- }
-});
-
-test('empty nostr relay field is not accepted', async ({ page }) => {
- await page.goto('/');
- await page.getByRole('button', { name: 'Show all' }).click();
-
- const nostrRelayField = page.getByLabel('Nostr Relay');
-
- nostrRelayField.fill('');
-
- await page.getByRole('button', { name: 'Save' }).click();
- const validationMessage = await nostrRelayField.evaluate((el) => el.validationMessage);
-
- expect(validationMessage).toContain('Please fill out this field');
-});
-
-test('screens should be able to change', async ({ page }) => {
- await page.goto('/');
- await expect(page.getByRole('button', { name: 'Sats per Dollar' })).toBeVisible();
- const responsePromise = page.waitForRequest('*/**/api/show/screen/*');
-
- await page.getByRole('button', { name: 'Sats per Dollar' }).click();
- const response = await responsePromise;
- expect(response.url()).toContain('api/show/screen/10');
-});
-
-test('parse all types of EPD content correctly', async ({ page }) => {
- statusJson.data[2] = '123';
-
- await page.route('**/events', (route) => {
- const newStatus = statusJson;
- newStatus.data = ['BLOCK/HEIGHT', '8', '123', '0', '8', '1', '5'];
-
- // Respond with a custom SSE message
- route.fulfill({
- status: 200,
- contentType: 'text/event-stream',
- json: `${JSON.stringify(newStatus)}\n\n`
- });
- });
-
- await page.goto('/');
-
- await expect(page.getByRole('heading', { name: 'Status' })).toBeVisible();
- await page.waitForSelector('#timerStatusText:has-text("running")');
- await page.waitForSelector('#btclock-wrapper > div > div:nth-child(1)');
-
- expect(statusJson.data[0]).toContain('/');
- await expect(page.locator('#btclock-wrapper > div > div:nth-child(1)')).toBeTruthy();
- await expect(page.locator('#btclock-wrapper > div > div:nth-child(1)')).toHaveClass('splitText');
- expect(statusJson.data[1]).toHaveLength(1);
- await expect(page.locator('#btclock-wrapper > div > div:nth-child(2)')).toHaveClass('digit');
- expect(statusJson.data[2]).toHaveLength(3);
- await expect(page.locator('#btclock-wrapper > div > div:nth-child(3)')).toHaveClass('mediumText');
-});
-
-test('should work with more than 7 screens', async ({ page }) => {
- statusJson.data[2] = '1';
- statusJson.numScreens = 9;
- settingsJson.numScreens = 9;
- statusJson.data.splice(1, 0, ' ', ' ');
-
- await page.goto('/');
-
- await expect(page.getByRole('heading', { name: 'Status' })).toBeVisible();
- await page.waitForSelector('#timerStatusText:has-text("running")');
- await expect(page.locator('#btclock-wrapper > div > div:nth-child(9)')).toBeTruthy();
-
- await expect(page.locator('#customText')).toHaveAttribute(
- 'maxlength',
- statusJson.numScreens.toString()
- );
-});
diff --git a/tests/screenshots/viewport-screenshots.spec.ts b/tests/screenshots/viewport-screenshots.spec.ts
deleted file mode 100644
index 4a27512..0000000
--- a/tests/screenshots/viewport-screenshots.spec.ts
+++ /dev/null
@@ -1,132 +0,0 @@
-import { test, expect } from '@playwright/test';
-
-import { initMock, settingsJson, statusJson } from '../shared';
-
-test.beforeEach(initMock);
-
-// Define the translations for the headings
-const headings = {
- en: {
- control: 'Control',
- status: 'Status',
- settings: 'Settings',
- language: 'English'
- },
- de: {
- control: 'Steuerung',
- status: 'Status',
- settings: 'Einstellungen',
- language: 'Deutsch'
- },
- nl: {
- control: 'Besturing',
- status: 'Status',
- settings: 'Instellingen',
- language: 'Nederlands'
- },
- es: {
- control: 'Control',
- status: 'Estado',
- settings: 'Ajustes',
- language: 'Español'
- }
-};
-
-test('capture screenshots across devices', async ({ page }, testInfo) => {
- // Get the locale from the browser or default to 'en'
- const locale = testInfo.project.use?.locale?.split('-')[0].toLowerCase() || 'en';
- const translations = headings[locale] || headings.en;
-
- await page.goto('/');
- await expect(page.getByRole('heading', { name: translations.control })).toBeVisible();
- await expect(page.getByRole('heading', { name: translations.status })).toBeVisible();
- await expect(page.getByRole('heading', { name: translations.settings })).toBeVisible();
-
- if (await page.locator('#nav-language-dropdown').isVisible()) {
- await expect(page.getByRole('link', { name: translations.language })).toBeVisible();
- }
-
- const screenshot = await page.screenshot({
- path: `./test-results/screenshots/default-${test.info().project.name.toLowerCase().replace(' ', '_')}.png`
- });
-
- await testInfo.attach(`default`, {
- body: screenshot,
- contentType: 'image/png'
- });
-});
-
-test('capture screenshots across devices with bitaxe screens', async ({ page }, testInfo) => {
- const locale = testInfo.project.use?.locale?.split('-')[0].toLowerCase() || 'en';
- const translations = headings[locale] || headings.en;
-
- settingsJson.screens = [
- {
- id: 0,
- name: 'Block Height',
- enabled: true
- },
- {
- id: 3,
- name: 'Time',
- enabled: true
- },
- {
- id: 4,
- name: 'Halving countdown',
- enabled: true
- },
- {
- id: 6,
- name: 'Block Fee Rate',
- enabled: true
- },
- {
- id: 10,
- name: 'Sats per dollar',
- enabled: true
- },
- {
- id: 20,
- name: 'Ticker',
- enabled: true
- },
- {
- id: 30,
- name: 'Market Cap',
- enabled: true
- },
- {
- id: 80,
- name: 'BitAxe Hashrate',
- enabled: true
- },
- {
- id: 81,
- name: 'BitAxe Best Difficulty',
- enabled: true
- }
- ];
-
- statusJson.data = ['mdi:bitaxe', '', 'mdi:pickaxe', '6', '3', '7', 'GH/S'];
- statusJson.rendered = ['mdi:bitaxe', '', 'mdi:pickaxe', '6', '3', '7', 'GH/S'];
-
- await page.goto('/');
-
- await expect(page.getByRole('heading', { name: translations.control })).toBeVisible();
- await expect(page.getByRole('heading', { name: translations.status })).toBeVisible();
- await expect(page.getByRole('heading', { name: translations.settings })).toBeVisible();
-
- if (await page.locator('#nav-language-dropdown').isVisible()) {
- await expect(page.getByRole('link', { name: translations.language })).toBeVisible();
- }
-
- await page.screenshot({
- path: `./test-results/screenshots/bitaxe-${test.info().project.name.toLowerCase().replace(' ', '_')}.png`
- });
-
- await testInfo.attach(`bitaxe`, {
- path: `./test-results/screenshots/bitaxe-${test.info().project.name.toLowerCase().replace(' ', '_')}.png`,
- contentType: 'image/png'
- });
-});
diff --git a/tests/shared.ts b/tests/shared.ts
deleted file mode 100644
index 9ee570c..0000000
--- a/tests/shared.ts
+++ /dev/null
@@ -1,257 +0,0 @@
-interface Page {
- route: (url: string, handler: (route: Route) => Promise) => Promise;
-}
-
-interface Route {
- fulfill: (response: {
- json?: typeof statusJson | typeof settingsJson | typeof latestReleaseFake;
- status?: number;
- headers?: Record;
- body?: ReadableStream;
- }) => Promise;
-}
-
-export const fetchLatestBlockHeight = async () => {
- const response = await fetch('https://ws.btclock.dev/api/lastblock');
- const blockHeight = await response.text();
- return ['BLOCK/HEIGHT', ...blockHeight.trim().split('')];
-};
-
-export const fetchLatestRelease = async () => {
- try {
- const response = await fetch(
- 'https://git.btclock.dev/api/v1/repos/btclock/btclock_v3/releases/latest'
- );
- if (!response.ok) throw new Error('Failed to fetch latest release');
- const data = await response.json();
- settingsJson.gitTag = data.tag_name;
- return data;
- } catch (error) {
- console.warn('Failed to fetch latest release, using fallback:', error);
- settingsJson.gitTag = latestReleaseFake.tag_name;
- return latestReleaseFake;
- }
-};
-
-export const statusJson = {
- currentScreen: 20,
- numScreens: 7,
- timerRunning: true,
- isOTAUpdating: false,
- espUptime: 4479,
- espFreeHeap: 58508,
- espHeapSize: 342108,
- connectionStatus: {
- price: false,
- blocks: false,
- V2: true,
- nostr: true
- },
- rssi: -66,
- data: ['BLOCK/HEIGHT', '0', '0', '0', '0', '0', '0'],
- currency: 'USD',
- leds: [
- { red: 0, green: 0, blue: 0, hex: '#000000' },
- { red: 0, green: 0, blue: 0, hex: '#000000' },
- { red: 0, green: 0, blue: 0, hex: '#000000' },
- { red: 0, green: 0, blue: 0, hex: '#000000' }
- ],
- isUpdating: true,
- isFake: true,
- dnd: {
- enabled: true,
- timeBasedEnabled: true,
- startTime: '23:00',
- endTime: '7:00',
- active: true
- }
-};
-
-export const settingsJson = {
- numScreens: 7,
- timerSeconds: 1800,
- timerRunning: true,
- minSecPriceUpd: 30,
- fullRefreshMin: 60,
- wpTimeout: 600,
- tzOffset: 0,
- dataSource: 0,
- mempoolInstance: 'mempool.space',
- ledTestOnPower: true,
- ledFlashOnUpd: true,
- ledBrightness: 128,
- stealFocus: true,
- mcapBigChar: true,
- mdnsEnabled: true,
- otaEnabled: true,
- fetchEurPrice: false,
- hostnamePrefix: 'btclock',
- hostname: 'btclock-d60b14',
- ip: '192.168.20.231',
- txPower: 78,
- gitRev: '25d8b92bcbc8938417c140355ea3ba99ff9eb4b7',
- gitTag: '3.2.27',
- bitaxeEnabled: false,
- bitaxeHostname: 'bitaxe1',
- miningPoolStats: false,
- miningPoolName: 'ocean',
- miningPoolUser: '38Qkkei3SuF1Eo45BaYmRHUneRD54yyTFy',
- nostrZapNotify: true,
- hwRev: 'REV_A_EPD_2_13',
- fsRev: '64e518bf58f89749753167a8b6826e10bb6455c5',
- nostrZapPubkey: 'b5127a08cf33616274800a4387881a9f98e04b9c37116e92de5250498635c422',
- lastBuildTime: Math.round(new Date().getTime() / 1000),
- screens: [
- {
- id: 0,
- name: 'Block Height',
- enabled: true
- },
- {
- id: 3,
- name: 'Time',
- enabled: false
- },
- {
- id: 4,
- name: 'Halving countdown',
- enabled: false
- },
- {
- id: 6,
- name: 'Block Fee Rate',
- enabled: false
- },
- {
- id: 10,
- name: 'Sats per dollar',
- enabled: true
- },
- {
- id: 20,
- name: 'Ticker',
- enabled: true
- },
- {
- id: 30,
- name: 'Market Cap',
- enabled: false
- }
- ],
- actCurrencies: ['USD', 'EUR'],
- availableCurrencies: ['USD', 'EUR', 'GBP', 'JPY', 'AUD', 'CAD'],
- availablePools: [
- 'ocean',
- 'noderunners',
- 'satoshi_radio',
- 'braiins',
- 'public_pool',
- 'gobrrr_pool',
- 'ckpool',
- 'eu_ckpool'
- ],
- dnd: {
- enabled: false,
- timeBasedEnabled: true,
- startHour: 23,
- startMinute: 0,
- endHour: 7,
- endMinute: 0
- },
- availableFonts: ['antonio', 'oswald'],
- invertedColor: false,
- isLoaded: true,
- isFake: true
-};
-
-export const latestReleaseFake = {
- id: 782,
- tag_name: '3.2.24',
- target_commitish: '',
- name: '3.2.24',
- body: '',
- url: 'https://git.btclock.dev/api/v1/repos/btclock/btclock_v3/releases/782',
- html_url: 'https://git.btclock.dev/btclock/btclock_v3/releases/tag/3.2.24',
- tarball_url: 'https://git.btclock.dev/btclock/btclock_v3/archive/3.2.24.tar.gz',
- zipball_url: 'https://git.btclock.dev/btclock/btclock_v3/archive/3.2.24.zip',
- hide_archive_links: false,
- upload_url: 'https://git.btclock.dev/api/v1/repos/btclock/btclock_v3/releases/782/assets',
- draft: false,
- prerelease: false,
- created_at: '2024-12-28T17:48:05Z',
- published_at: '2024-12-28T17:48:05Z',
- author: {},
- assets: [],
- archive_download_count: {
- zip: 0,
- tar_gz: 0
- }
-};
-
-export const initMock = async ({ page }: { page: Page }) => {
- // Update status with latest block height
- statusJson.data = await fetchLatestBlockHeight();
- const latestRelease = await fetchLatestRelease();
-
- await page.route('*/**/api/status', async (route) => {
- await route.fulfill({ json: statusJson });
- });
-
- await page.route('*/**/api/show/screen/10', async (route) => {
- //if (route.request().url().includes('*/**/api/show/screen/1')) {
- statusJson.currentScreen = 1;
- statusJson.data = ['MSCW/TIME', ' ', ' ', '2', '6', '4', '4'];
-
- await route.fulfill({ json: statusJson });
- });
-
- await page.route('*/**/api/show/screen/20', async (route) => {
- statusJson.currentScreen = 2;
- statusJson.data = ['BTC/USD', '$', '3', '7', '8', '2', '4'];
-
- await route.fulfill({ json: statusJson });
- });
-
- await page.route('*/**/api/show/screen/4', async (route) => {
- statusJson.currentScreen = 4;
- statusJson.data = ['BIT/COIN', 'HALV/ING', '0/YRS', '149/DAYS', '8/HRS', '30/MINS', 'TO/GO'];
-
- await route.fulfill({ json: statusJson });
- });
-
- await page.route('*/**/api/settings', async (route) => {
- await route.fulfill({ json: settingsJson });
- });
-
- await page.route('**/events', async (route) => {
- const newStatus = statusJson;
- newStatus.data = ['BLOCK/HEIGHT', '8', '0', '0', '8', '1', '5'];
- newStatus.isUpdating = true;
-
- // Format the SSE message correctly
- const sseMessage = `data: ${JSON.stringify(newStatus)}\n\n`;
-
- // Create a readable stream for SSE
- const stream = new ReadableStream({
- start(controller) {
- controller.enqueue(new TextEncoder().encode(sseMessage));
- // Keep the connection open
- // controller.close(); // Don't close if you want to send more events
- }
- });
-
- await route.fulfill({
- status: 200,
- headers: {
- 'Content-Type': 'text/event-stream',
- 'Cache-Control': 'no-cache',
- Connection: 'keep-alive'
- },
- body: stream
- });
- });
-
- await page.route('**/api/v1/repos/btclock/btclock_v3/releases/latest', async (route) => {
- await route.fulfill({ json: latestRelease });
- });
-};
diff --git a/tsconfig.json b/tsconfig.json
index 7dd43ea..82081ab 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -9,7 +9,6 @@
"skipLibCheck": true,
"sourceMap": true,
"strict": true,
- "verbatimModuleSyntax": true,
"moduleResolution": "bundler"
}
// Path aliases are handled by https://kit.svelte.dev/docs/configuration#alias
diff --git a/vite.config.test.ts b/vite.config.test.ts
deleted file mode 100644
index 3e03c63..0000000
--- a/vite.config.test.ts
+++ /dev/null
@@ -1,18 +0,0 @@
-import { sveltekit } from '@sveltejs/kit/vite';
-import { defineConfig } from 'vite';
-
-export default defineConfig({
- plugins: [sveltekit()],
- build: {
- sourcemap: true,
- minify: false,
- rollupOptions: {
- output: {
- manualChunks: undefined // Disable code splitting
- }
- }
- },
- test: {
- include: ['tests/**/*.{test,spec}.{js,ts}']
- }
-});
diff --git a/vite.config.ts b/vite.config.ts
index 3368d70..ea53800 100644
--- a/vite.config.ts
+++ b/vite.config.ts
@@ -1,107 +1,62 @@
import { sveltekit } from '@sveltejs/kit/vite';
import { defineConfig } from 'vite';
-// import { visualizer } from 'rollup-plugin-visualizer';
-import * as fs from 'fs';
-import * as path from 'path';
+import * as fs from 'fs'
+import * as path from 'path'
const doRewrap = ({ cssClass }) => {
try {
if (fs.existsSync(path.resolve(__dirname, 'dist/bundle.js'))) {
- return;
+ return
}
- } catch {
- // do nothing
- }
- console.log('\nStart re-wrapping...');
- fs.readFile(path.resolve(__dirname, 'dist/bundle.html'), 'utf8', function (err, data) {
+ } catch(e) {}
+ console.log("\nStart re-wrapping...")
+ fs.readFile(path.resolve(__dirname, 'dist/bundle.html'), 'utf8', function(err, data){
if (!data) {
- console.log(
- `[Error]: No bundle.html generated, check svelte.config.js -> config.kit.adapter -> fallback: "bundle.html"`
- );
- return;
+ console.log(`[Error]: No bundle.html generated, check svelte.config.js -> config.kit.adapter -> fallback: "bundle.html"`)
+ return
}
- const matchData = data.match(/(?<=