Coder Social home page Coder Social logo

orbiit / gunn-web-app Goto Github PK

View Code? Open in Web Editor NEW
12.0 5.0 13.0 12.36 MB

The source code for a web app that displays the Gunn schedule; the app itself is here:

Home Page: https://orbiit.github.io/gunn-web-app/

License: MIT License

HTML 42.56% JavaScript 50.94% CSS 6.51%
schedule gunn gunn-schedule gunn-web

gunn-web-app's Introduction

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:

  • HTML/appdesign.html

  • CSS/css/index.css, linked by appdesign.html, which imports the other CSS files using @import:

    • /css/assignments.css — assignments

    • /css/colourpicker.css — colour picker

    • /css/datepicker.css — date picker

    • /css/material.css — Material design components like the ripple, buttons, switches, radios, and sliders EXCEPT for inputs (see below)

    • /css/periodcustomisation.css — Material input and other required components for the period customisation options

    • /schedule/schedule.css — schedule, specifically anything in the <div class="schedule-container"> element (NOTE: this is in a different folder)

    • /css/main.css — everything else

  • JS/js/main.js, linked by appdesign.html, which is an ES module that imports the other JS files:

    • /js/altScheduleGenerator.js?for=appdesign — alternate schedule parsing from the school's Google Calendar (note that the same file is used by Ugwita)

    • /js/assignments.js — assignments

    • /js/barcodes.js — student ID generator in the Utilities section

    • /js/code39.js — barcode rendering using Code 39

    • /js/colour.js — colour picker

    • /js/date.js — date picker

    • /js/footer.js — the bottom navbar and showing/hiding sections

    • /js/l10n.js — allow translating UGWA by using translation strings

    • /js/languages/ has translation files for English (en.js), French (fr.js), and Google Translated English (en-gt.js); there are also other languages that can be accessed by adding ?all-langs to the URL

    • /js/lists.js — club and staff lists

    • /js/material.js — animations and functionality for Material design components like the ripple, inputs, and dropdowns

    • /js/saved-clubs.js — centralized manager for saved clubs

    • /js/utils.js — constants and utility functions; getting the current time is centralized here so it's easier to simulate a specific time

    • /touchy/rotate1.js — zoom/rotation/pan interactions for the image campus map

    • /js/app.js — re-exports /schedule/app.js, which is in a separate folder for some reason

    • /schedule/app.js — renders the schedule and anything time-related regarding the schedule (eg notifications and updating the tab title)

    • /js/schedule.js — anything remotely related to the schedule, such as personalisation options, editing assignments, events, the week preview, saving/loading/fetching alternate schedules, etc.

    • /js/main.js — everything else

  • IMAGES:

    • /js/gunn-together.svg — the animated SVG used for unknown Gunn Together periods

    • /js/images/newmap.min.png — the map

    • /favicon/ — creates cool embeds for when UGWA is linked on other platforms

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

gunn-web-app's People

Contributors

acrantel avatar anematode avatar ashvin-ranjan avatar dependabot[bot] avatar heaucques avatar ky28059 avatar mg27713 avatar poolehenry avatar qpwoeirut avatar sheeptester avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

gunn-web-app's Issues

Multiple barcodes

Would it be helpful/useful to allow multiple barcodes? They could be labeled and/or colour coded (not on the barcode, of course); this could be useful for, for example, signing in multiple people for Flex

Staff List Bug?

The human named Robert Ceja seems to be in the null department or something
screen shot 2017-10-01 at 11 39 54 am
Also each staff member starts with the word title before their occupation or whatever it's called
screen shot 2017-10-01 at 11 39 29 am

Schedule issue?

In the schedule section of the UGWA on the week of January 1-6 it says that there's school on Monday, but not the other weekdays. It also says winter break on Saturday, which also is not supposed to show
Did the schedule shift?

Make this a native app.

I have posted this in the other issue but I think it is of the upmost importance to wrap this in something like CORDOVA or its extension PHONEGAP and put it on the native app stores so more people can use your awesome project.

Dealing with time ranges

On a normal Tuesday schedule, the schedule specifies that E period ends at 12:15 and lunch starts at 12:15.

It is 12:15; is it E period or lunch?

More Customization

Is it possible to change the colors for flex/lunch/brunch in addition to the original ones
sometimes it won't blend well with colors

Small Feature Not Implemented

About a month ago, I asked to be named as the "Supreme Leader of the Universe" in the Staff section.

Why has this not been implemented? Are you mortals trying to go against your leader?

easter eggs in staff and clubs

club:

["Sophomore Club"]: {
"desc":"A club to commemorate the class of 2021, the first class to undergo SELF. All grades welcome!",
"day":"Thursday",
"time":"Flex",
"room":"Any room",
"president":"Tara Firenzi",
"teacher":"Courtney Carlomagno",
"email":"[email protected]"
}

staff: #37
(note: he needs to renew his rank)

game

Perhaps we should add a small simple game, like the Chrome dinosaur game

It can be anything, like a dodge/catch game, or a game with randomly generated levels. It can't have a point where one can consider themselves "finished" with the game (eg a storyline or "levels" or anything that is unlocked through playing), be multiplayer, or require sounds

Examples (we can make a clone of one of these games, but people'll accuse us of doing that):

  • Chrome dino game
  • flappy bird
  • 2048
  • one of those jumpy-platform games
  • one of those stacking games

We also might want to make the games touch-friendly, so minimal controls and typing would be best

Easter egg modifications

Add One of the best attendance rates in the school! to sophomore club description

Has Aaryan the Person replaced Nick?

Add current seconds timer

Sometimes when you watch in awe as the schedule updates, it's nice to know when the minute is about to change

24 hour time

I think that you should make an option for 24 hour time. It would be great for us Europeans.

You could make an option under the theme selection that makes you chose 24 hour or 12 hour time.

Period colours not updating when changed

window.scheduleapp should be just scheduleapp here because it's a local variable; window.scheduleapp doesn't exist

The result is that when one changes the period colour, the app thinks the schedule hasn't been set up yet and so it doesn't bother telling the schedule about the new colour

make a javascript thing to convert Ugwita alt-schedule format to UGWA

(it doesn't have to work automatically; I can continue inputting the alternate schedules into the json file)

Here's the UGWA alternate schedule format:

"3-26": {
  "dayname": "Monday",
  "day": 1,
  "monthname": "March",
  "month": 3,
  "date": 26,
  "description": "Testing for juniors, FlexTime for others",
  "periods": [
    {
      "name": "A",
      "start": {
        "totalminutes": 505,
        "hour": 8,
        "minute": 25
      },
      "end": {
        "totalminutes": 565,
        "hour": 9,
        "minute": 25
      }
    },
    "and so on"
  ]
}

and this is Ugwita's format

"05-29": [
  {
    "name": "Period A",
    "start": 505,
    "end": 557
  },
  "and so on"
]

description can be "lol good luck with our schedule" (because it's displayed as 'This is an alternate schedule. The school says, "lol good luck with our schedule" ') by default.

Responsive Design

responsive design or something please
ripple effect hangs too long on smaller devices
still I like the design :D

Swipe on mobile

The separate schedule version can swipe between days on a touchscreen device
Perhaps this should be implemented to the UGWA?

EDIT by Sean: fixing your markdown

Add alternate schedules

The only reason why people even use TheGunnApp is because it features alternate schedules, and the school is notorious for it.

  • add alternate schedule support to /schedule or something

It might help others who want to make their own schedule app if we included a text, JSON, and/or XML file including the alternate schedules from the PDF they've provided.

  • come up with a format for an alternate schedule for JSON and TXT
  • put those on the repository/Github Gist

I'll probably make a JS thing that reads off a table copied and pasted from the PDF that makes the things for us.

Settings and About

I'm working on the app design right now (demo here)

I plan to only have a bottom navigation (which currently mostly follows the material design guidelines, except for the shadow, and possibly the ripple animation but the guidelines aren't very clear on those). However, Material Design says that there should only be a max of 5 items, and we've hit that max. (also, the items fit just perfectly on phones)

So how should we incorporate the settings and about pages? Should we have a FAB (floating action button), merge a section with another and replace it with settings, or hide the button in one of the sections? Or should there be a touch gesture/keyboard shortcut that opens it?

The settings section will include an option to toggle dark/light themes, change the colours/labels of the periods, and whatever else you want to include

Sorry for the long post, I decided to bold random parts to break it up.

(who here agrees that the material ripple effect is the best thing Google has ever made?)

alternate schedule for week of 2018-04-09

tuesday

Tuesday,April 10

Period D (8:25-9:45)

Brunch (9:45-10:00)

Period E (10:00-11:15)

Period B (11:25-12:25)

Lunch (12:25-1:05)

Period A (1:05-2:05)

Period G (2:15-3:30)

wednesday

Wednesday,April 11

Period C (8:25-9:30)

Brunch (9:30-9:45)

· FRESHMEN: to Assembly(9:45-10:45), to SELF (10:55-11:55), to FlexTime (12:05-1:05)

· SOPHOMORES: to FlexTime(9:45-10:45), to Assembly (10:55-11:55), to FlexTime (12:05-1:05)

· JUNIORS: to FlexTime(9:45-10:45), to FlexTime (10:55-11:55), to Assembly (12:05-1:05)

· SENIORS: to CASTstate test (9:45-11:55), to Assembly (12:05-1:05)

Lunch (1:05-1:45)

Period F (1:45-2:45)

Staff Meeting (3:00-3:45)

thursday

Thursday,April 12

Period D (8:25-9:30)

Brunch (9:30-9:45)

Period E (9:45-10:45)

Period B (10:55-12:05)

Lunch (12:05-12:45)

Period A (12:45-1:55)

Period G (2:05-3:05)

Optional Tutorial (3:10-3:40)

Schedule Issue?

December 18's events says that there is an alternate schedule but the schedule denies it

Final testing and release of UGWA 1

Hooray; UGWA 1 is almost ready to be out in the wild! 🎉

Just a few thing to be done:

Testing

We need to ensure UGWA works in the following places:

  • Chromebook
  • Chrome on Windows
  • Chrome on Mac
  • Chrome on Android
  • Safari on iOS
  • (optional) Chrome on Linux

If possible, it'd be nice to know the oldest version UGWA 1 works on, but if it works on whatever version you have available, then that's fine by me.

We'll need to test:

  • the cache (open the page, then turn off the internet and reload)
  • barcode generator (adding, editing, viewing, removing)
  • the map image (panning, rotating, zooming)
  • Google Maps
  • club list (searching, scrolling, opening the full description)
  • seconds timer
  • date selector (events and schedule update accordingly, going more yesterday/tomorrow-wise)
  • schedule (uses custom colours and names, alternate schedules show up properly)
  • events
  • staff list (searching, scrolling, opening the full description)
  • settings (theme, period colours and names)

Releasing

After the app seems to work properly

  • write an about and credits section
  • combine all the JS files into one and minify it (should reduce loading time and storage required for cache)
  • do the same with CSS
  • add cache
  • move to index.html

After that, we can maybe work on a video that shows off what the app can do

UGWA Lite (Ugwita)

We should make a version of UGWA that doesn't look as good and isn't as functional, but should load much faster and take up less space offline.

Here is a list of what it should be able to do:

  • be able to select a date to view
  • for all days display:
    • the date and day of the week
    • period order (no custom colour / period name)
    • the start/end time and length of periods
    • whether it's an alternate schedule or not
    • the time the last period ends
  • display time left in current period / time until next period
  • get alternate schedules from Google Calendar API and save them offline (can refresh via button or something)
  • option to save the app itself offline (not automatic)

Google Calendar API

just dumping info here so i can rip the events from google calendar mauahahaha

helpful java file mi ne scias java, but the string concatenation of the url looks like something i can understand

basically it looks like

https://www.googleapis.com/calendar/v3/calendars/[CALENDARID]/events?key=[KEY]&timeMin=[???]&timeMax=[???]&maxResults=20&showDeleted=false&singleEvents=true&orderBy=startTime

this is what i get with just the keys

can use the ajax thingy

var xmlHttp=new XMLHttpRequest();
xmlHttp.onreadystatechange=function(){
  if (xmlHttp.readyState===4) {
    if (xmlHttp.status===200) // xmlHttp.responseText has the stuff
  }
};
xmlHttp.open("GET",URL,true); // true for asynchronous
xmlHttp.send(null);

with JSON.parse and do things

Link to PAUSD portal

Since the original Gunn App has this, I feel like we should have it as well

I'm putting it in the utilities section, and it'll just be a red raised button with a ripple effect that'll link to RapidIdentity

We could maybe instead link it to a shortened URL, so we can keep track of how many times the link is clicked on so that we know how useless the featured is, but for now I'm not going to do that

so we need a feature set

we should create some sort of dynamic webpage template that works well with phones

plus we should have some features -- it probably should have

  • a basic schedule
  • alternate schedule finder (possibly use a scraper to rip them from here or the official site)
  • a campus map (preferably with classrooms)
  • a staff list with contact info
  • upcoming activities (possibly rip them from the events calendar on the site)
  • flextime barcode generator (code 39)

let me know what else I need to add to this

Other languages support

It'd be cool to have the app available in multiple languages

The current app was not designed with this in mind, so implementation of this would be messy, so this'll probably be placed in UGWA 2

However, Gunn themselves do not provide information such as events, alternate schedules, or staff information in other languages. Either we leave them in English, leave everything in English and reject this suggestion, or find a way to convert the alternate schedules and staff info into other languages

Also, I have very little knowledge in RTL languages and designing websites/apps accommodating them. Languages like German with longer words might make some labels not fit correctly on phones, while languages like Chinese with very short words might leave awkward whitespace behind

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.