Skip to content

Commit

Permalink
Merge pull request #1814 from placeAtlas/staging/code
Browse files Browse the repository at this point in the history
Various code updates
  • Loading branch information
AnonymousRandomPerson authored Nov 7, 2024
2 parents 5e6b4bc + c3c4d1c commit b27ef86
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
9 changes: 4 additions & 5 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@

staging merge:
- all:
- base-branch:
- master
- head-branch:
- cleanup
- staging/'
- base-branch: "master"
- head-branch:
- "^cleanup$"
- "^staging/.+$"
3 changes: 2 additions & 1 deletion .github/workflows/pr-labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ jobs:
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@v5
- uses: actions/labeler@v5
sync-labels: true
12 changes: 7 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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...
Expand Down
4 changes: 1 addition & 3 deletions web/_js/main/time.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand All @@ -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)
}
}

0 comments on commit b27ef86

Please sign in to comment.