Skip to content

feat: earthquakes near this screen — two files, no libraries - #4

Merged
Sir-Monke merged 9 commits into
masterfrom
initial-simple-simple
Aug 20, 2026
Merged

feat: earthquakes near this screen — two files, no libraries#4
Sir-Monke merged 9 commits into
masterfrom
initial-simple-simple

Conversation

@Sir-Monke

Copy link
Copy Markdown
Contributor

Description of Change

The edge app, rebuilt: two files, no libraries, no build step, no web fonts, one setting, nothing fetched but the feed.

  • index.html — the whole app. Calls out the nearest quake (magnitude, place, distance, direction, age) with a dashed line to it and faint pins on the rest. USGS 7-day feed through the CORS proxy, refetched every five minutes. Coordinates, location name and units come from screenly.js. Nothing animates.
  • The map is inlined: a flat (equirectangular) world from public-domain Natural Earth outlines. Longitude is a fraction across the view, latitude a fraction down — so placing a pin is arithmetic rather than a mapping library, and reframing is one viewBox. Inlined rather than fetched because a separate asset does not reach the player.
  • Plate boundaries from the plate data already in this repo's history. Worth having: the quakes visibly follow them.
  • screenly.yml — manifest, plus one setting: miles or kilometres.
  • .ignore — keeps .git, .github and the README out of the deployed bundle. Also removes .pre-commit-config.yaml, ruff.toml, .sqlfluff and pyrightconfig.json — no Python or SQL in this repo.

The view is centred on the screen and sized to hold the ten nearest quakes, so a screen in California sees its own neighbourhood and one in London sees the North Atlantic. A screen with no location set says exactly that, rather than showing the Gulf of Guinea — which is what an unset screen actually reports.

  • Are these changes breaking any existing functionality? If so, please provide details.
  • Have tests been added/updated to cover the changes?

Checklist

Before submitting this PR, please ensure that you have completed the following:

  • I have performed a self-review of my own code
  • I have commented on my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

Same app, less of it. Own code goes from ~990 lines to ~450.

- merge maths.js and render.js into app.js; both files are gone
- the map label is now a Leaflet tooltip, so Leaflet places it. Drops the
  screen projection, the label-area measuring, the card position clamping
  and the leader-line geometry (~200 lines)
- only quakes currently on screen can be labelled, which is one call to
  map.getBounds().contains instead of the old on-screen test
- drop the Pacific-centred world view. It needed every longitude wrapped
  and the whole map drawn twice to fill past the date line. Map is now
  centred on 0, so wrapLongitude, shiftGeoJsonEast and drawWorldCopies go
- magnitude colours move from CSS variables into app.js, so pickMagnitudeColor
  no longer reads them back out of the stylesheet
- the screen scale factor is worked out once at startup instead of being
  re-read inside six draw functions
- add magnitudeOf/locationOf/timeOf so nothing else has to know that
  coordinates[1] means latitude
- the map now stops where the rail starts, so nothing drawn can hide under it

Kept as they were: config and readSetting, pickMagnitudeColor, the plate
boundaries, Leaflet and the offline world data.

No change to the settings, the feed, or what the player sees apart from the
world view no longer being Pacific-centred.
@Sir-Monke
Sir-Monke requested a review from a team as a code owner August 18, 2026 13:27
@renatgalimov
renatgalimov requested a balanced review from Copilot August 18, 2026 19:22

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Introduces a dependency-free Screenly Edge App that displays nearby USGS earthquakes relative to the player’s configured location.

Changes:

  • Adds the complete map and earthquake-feed UI.
  • Adds Screenly deployment configuration and distance-unit selection.
  • Updates documentation and removes unused Python/SQL tooling.

Reviewed changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
index.html Implements the earthquake map and feed handling.
screenly.yml Defines the Screenly app manifest and units setting.
.ignore Excludes non-deployment files.
README.md Documents behavior, mapping, and deployment.
.pre-commit-config.yaml Removes unused Python hooks.
.sqlfluff Removes unused SQL linting configuration.
pyrightconfig.json Removes unused Python type-checking configuration.
ruff.toml Removes unused Python linting configuration.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread index.html Outdated
Comment thread screenly.yml
Sir-Monke and others added 2 commits August 18, 2026 20:31
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@renatgalimov

Copy link
Copy Markdown
Contributor

readySignal, please

@Sir-Monke
Sir-Monke merged commit 6e0886a into master Aug 20, 2026
2 checks passed
@Sir-Monke
Sir-Monke deleted the initial-simple-simple branch August 23, 2026 20:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants