Orbiit / gunn-web-app

The source code for a web app that displays the Gunn schedule; the app itself is here:
https://orbiit.github.io/gunn-web-app/
MIT License
12 stars 13 forks source link
gunn gunn-schedule gunn-web schedule

The Unofficial Gunn Web App (UGWA)

The Gunn App, this project's predecessor, was originally only available to Android and iOS users.

The Unofficial Gunn Web App (abbrev. UGWA, pronounced /ˈuːɡwə/ or OOG-wah) aims to bring the capabilities of the Gunn App to the web (Chrome and maybe iOS Safari; it'd be a miracle if it worked on other browsers too).

Versions

and their faults:

Please give us your ideas/suggestions! :D

Development

This repository contains a lot of files, most of which aren't actually used by UGWA. UGWA uses no framework or libraries for its front end, which allows you to directly open appdesign.html (the source HTML) in a browser. You can then view the Sources tab in inspect element to see all the relevant source files used by UGWA:

After modifying UGWA's code, you can minify everything by doing

# Optional: ensure that your code follows the StandardJS style guide
npm run format

# Install dependencies (you only really need to do this once)
npm install

# Build
npm run build

This will automatically bundle and minify the source files using build.js into a single index.html and update the service worker (sw.js).

Good luck!

Simulating a different time

On appdesign.html in the console, you can run

const start = Date.now()
// Set `baseTime` to be the desired start time (months are 0-indexed)
const baseTime = new Date(2020, 8, 9, 11, 0).getTime()
const speed = 100
setCurrentTime(() => {
  return (Date.now() - start) * speed + baseTime
})

Updating staff and club lists

See updating-staff-and-club-lists.md.

Updating UGWA for a new school year

Refer to new-school-year.md for updating UGWA to a new school year.

Creating a PSA

# IMPORTANT: If a PSA has already been created for today, it'll overwrite that
# file
npm run newpsa

Then edit the newly created file in the /psa/ folder.

Localization

You can run the following command to check that the published languages have all the required translations. You can edit the langs array in /js/languages/check-l10n.js to check other languages.

npm run check-l10n

To add a new language, just make a copy of /js/languages/en.js and name in <language code>.js. Replace export default with window.langs.<language code> =. In the availableLangs object in js/l10n.js, specify the language's name, and when you want to publish it, add it to the array in the else condition of the ternary statement that determines publicLangs's value.

You can automatically generate /js/languages/en-gt.js by running the following command; you might have to manually translate some strings yourself, though.

node js/languages/make-en-gt.js