-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Massive Changes and Overhauls #76
Conversation
…erhead. Plus fixed a race condition in clientside page loading
I am pretty sure that the issue is with the localStorage json data being malformed to the expected format so it is trying to load the new ones and reload, but the version numbers are the same so it isn't applying the new ones. I just pushed a commit that add some better error logging in the places that would be not descriptive otherwise, as well as making localStorage values for eventsJSON, scheduleJSON, and languageJSON, auto-remove themselves if they fail to parse or load. |
seems like the error occurs when trying to update the languageJSON (and probably other similar jsons), which doesn't get removed yet |
gonna convert this to a draft for now, some breaking issues that should be addressed |
…o fix a bug in webkit not displaying saturation
…th nested elements, 🪦 rip fancy dynamicly saturated elements
I think this is ready to go. As far as I can tell, this is stable and if there are any more style changes that need to be made, they can be added later, |
still getting a reload loop when checking out from your master then switching to your develop, so can't merge unfortunately (happens to me both on arch linux firefox and ios safari) :(
|
…f localstorage key did not exist)
|
…radelevel and language.
alright, think this is in a good enough state to merge into develop (after resolving merge conflicts of course) |
Yup, I am currently trying to solve those conflicts with a pull request on my fork.
|
aight |
I get what you mean, but unless we write a conversion layer to match / guess keys to the new ones, the setting will get lost. |
got it |
The Changes
There are a lot of changes in this pull request. Some are big changes like external pages and others are small like new settings or formatting changes.
Let's get into the big ones first:
New File Structure
The file structure of the project has been overhauled to be more organized and less "a bunch of files in one folder". The main files that need to sit at the root are still there but all other reference files have been moved into sub-folders.
/ ├ index.html ├ offline.html ├ readme.md + robots.txt ├ firebase.json └ .gitignore
The
robots.txt
was added for completeness but not strictly necessary, although I might add asitemap.xml
in the future.The rest of the files have been divided into
src
for scripts,public
for static files,pages
for the pages,templates
for the Vue templates, anddata
for the JSON data.These files were renamed for clarity and all file references and links have been updated to match.
External Pages & Templates
As you may have noticed there is now a pages directory with html pages inside. These pages and templates were extracted from the main
index.html
file for a more simplistic developer experience and a slimming of theindex.html
file down a bit. In their place, there is a div that holds the pages that get added as children.Then the code to load the pages is in the
index.js
fileThis simplifies the process of adding pages because now all you need to do is add it to the
Pages
object and create a file by the same name in thepages
folder.This all works the same for the templates except they get appended to the bottom of the page because they get referenced by
id
in the code.Settings Tweaking
The
settings.js
file got reworked a little. Firstly you will see JSDoc comments in this file for type definitions for the settings object and the types of settings. This was mostly an experiment to see how well they work because I miss Typescript. We can remove them if needed and I will cover them more in the future improvements section.The settings now reference themselves by key in the settings object. Plus the defaults have also been moved into the settings object.
Toggle settings have been changed from 2D arrays with booleans and strings to an array of objects with a value and text. The value can be anything because I have removed all truthy references to it in the HTML. As an example, the
EMOJI_DISTROBUTION
setting uses strings for values.The sliders have been generalized by removing the
color-slider
mode and replacing it with justslider
. In the HTML for settings, there is a specific exception for theCOLOR_THEME
settings to use extra CSS for the slider.Lastly for settings, the
userSettings
has been consolidated at the bottom to pull the defaults from thesettings
.Schedule Functions
The
schdeule.js
file has been simplified when checking for the data loading versions and the language loading offers warning messages when languages are missing keys that are present inENGLISH
.The
getSchedule
function has been broken into subparts that can be called independently reducing the calls togetSchedule
for simple checks like the schedule or if on break. The function also now returns an object with more information instead of just the array of periods.The new functions are as follows:
This file has also been equipped with some JSDoc comments to make typing easier.
Speaking of schedule, the
schedule.json
file has had some upgrades.dateRanges.breaks
is now a multidimensional array allowing for multiple date ranges for the same schedule type. This should ease the transition between one break and the next so it doesn't just disappear off the calendar when you add the next one.gradeLevels
has been split into specific grades, ie.GRADE_7, GRADE_8, ...
where now you can specify individual schedules for each grade level. For grade levels that share a schedule, 7/8, there isinheritsFrom
.Future Improvements
During this upgrade, I kept thinking about the size of the files being sent to the clients, so I was thinking we could add a minifying step to the Firebase builds so that unnecessary comments and code would be pruned and shrunk to make for a smaller file size. It is not very necessary, but it could be nice.
I also think we should totally have achievements to collect and badges when you get them so people can find easter eggs and show them off with a realtime leader board and ranks and seasons and special cosmetics.
Small Changes
Overall code has been cleaned, renamed for clarity, or removed because of not being used or not needed.
Additionally, all styles and CSS have been rewritten from scratch to remove unneeded classes or elements from the DOM. These new styles should be more cohesive, nicer looking, more accessible, and better for responsiveness on all platforms.
There is also a new setting for Emoji Rain where one can specify an emoji that will fall in the background of the page.
Lastly, the version numbers still need to be updated in the data files to reflect the new version.