From 691614600554097ef0befe288521d24c19272032 Mon Sep 17 00:00:00 2001 From: Hans5958 Date: Sat, 30 Sep 2023 21:04:45 +0700 Subject: [PATCH 1/4] Do not draw additional layer when the size is 0 --- web/_js/main/time.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/_js/main/time.js b/web/_js/main/time.js index 9ddb01e4..02191056 100644 --- a/web/_js/main/time.js +++ b/web/_js/main/time.js @@ -142,7 +142,7 @@ async function updateBackground(newPeriod = currentPeriod, newVariation = curren context.drawImage(imageLayer, 0, 0) } - context.drawImage(additionalLayerCanvas, 0, 0) + if (additionalLayerCanvas.width !== 0 && additionalLayerCanvas.height !== 0) context.drawImage(additionalLayerCanvas, 0, 0) if (myAbortController.signal.aborted || newPeriod !== currentPeriod || newVariation !== currentVariation || currentUpdateIndex !== myUpdateIndex) { return false From 29cb5ee5f2d67e14a83b5cd784939ac43190383c Mon Sep 17 00:00:00 2001 From: Hans5958 Date: Sat, 30 Sep 2023 21:04:58 +0700 Subject: [PATCH 2/4] Remove debug logs --- web/_js/main/time.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/web/_js/main/time.js b/web/_js/main/time.js index 02191056..3e58c59b 100644 --- a/web/_js/main/time.js +++ b/web/_js/main/time.js @@ -421,7 +421,6 @@ const updateAdditionalLayer = () => { canvas.width = 0 canvas.height = 0 - for (const layer of layers) { if (!layer.imageLayer) continue canvas.width = Math.max(layer.x + layer.imageLayer.width, canvas.width) @@ -431,6 +430,5 @@ const updateAdditionalLayer = () => { for (const layer of layers) { if (!layer.imageLayer) continue context.drawImage(layer.imageLayer, layer.x, layer.y) - console.log(layer.imageLayer) } } From d4fa8dca1cf196637963ecf3afe106c76cfa3c7d Mon Sep 17 00:00:00 2001 From: Hans5958 Date: Wed, 6 Nov 2024 13:50:21 +0700 Subject: [PATCH 3/4] Update information regarding running a local HTTP server - Remove ports when running http.server - Add mention of VS Code extensions - Update so a local HTTP server is required --- CONTRIBUTING.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index efa50240..24b559a0 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -126,19 +126,21 @@ Other than contributing to the Atlas data, code contributions are also accepted. This website is built using classic HTML 5 (no JS frameworks such as Vue, React, etc are used). Bootstrap 5 is used as a CSS framework. -Opening the HTML file on your browser is adequate enough to edit. If it doesn't work, you can try running a local HTTP server. +You need a local HTTP server to open the site properly. If you have either Python or Node.js, try using one of these options. ```sh # Run it inside the web/ folder. cd web # Choose one of the following: -python -m SimpleHTTPServer 8000 # Python 2 -python -m http.server 8000 # Python 3 -npx http-server # Node.js (http-server) -npx serve # Node.js (serve) +python -m SimpleHTTPServer 8000 # Python 2 +python -m http.server # Python 3 +npx http-server # Node.js (http-server) +npx serve # Node.js (serve) ``` +If you have Visual Studio Code, you can use an extension such as [Live Server](https://marketplace.visualstudio.com/items?itemName=ritwickdey.LiveServer), [Five Server](https://marketplace.visualstudio.com/items?itemName=yandeu.five-server), or [Live Preview](https://marketplace.visualstudio.com/items?itemName=ms-vscode.live-server) to run a local HTTP server. For better results, ensure that the root is set to `web/`. + ### Tools The `tools` folder have various scripts for the maintainance of the project, such as... From c3c4d1c0c8dfbedc0f57d13bb9d0c37d4f0d543b Mon Sep 17 00:00:00 2001 From: Hans5958 Date: Wed, 6 Nov 2024 14:19:17 +0700 Subject: [PATCH 4/4] Fix labeler branch Or at least try fixing it --- .github/labeler.yml | 9 ++++----- .github/workflows/pr-labeler.yml | 3 ++- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/labeler.yml b/.github/labeler.yml index e7760e8d..96a3b8f8 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -8,8 +8,7 @@ staging merge: - all: - - base-branch: - - master - - head-branch: - - cleanup - - staging/' \ No newline at end of file + - base-branch: "master" + - head-branch: + - "^cleanup$" + - "^staging/.+$" \ No newline at end of file diff --git a/.github/workflows/pr-labeler.yml b/.github/workflows/pr-labeler.yml index 943f3e73..286e08a9 100644 --- a/.github/workflows/pr-labeler.yml +++ b/.github/workflows/pr-labeler.yml @@ -10,4 +10,5 @@ jobs: pull-requests: write runs-on: ubuntu-latest steps: - - uses: actions/labeler@v5 \ No newline at end of file + - uses: actions/labeler@v5 + sync-labels: true \ No newline at end of file