These are my first JavaScript programs. I developed my portfolio schema and realized I needed JavaScript to make it
a (virtual) reality. I knew which structures I needed for my portfolio from my experience with Python, but I had to learn
JavaScript syntax along the way.
- toggle.js
-
toggle.js is a program that determines which "skin" is active from the browser, listens for a click from class styleToggle button in
root/index.html,it assigns "modern" if nothing is set in the browser. If the current value in "skin" is "retro" it assigns "modern"
and redirects to the homepage. Otherwise, it applies "retro" and redirects the user to transition/index.html. This program was challenging
to write, but my experience with Python made me aware of which structures to write. The most important concept I learned was how to store
information to the browser and retrieve it.
GitHub_toggle_javascript
- wht_rbt_obj.js
-
Jurassic Park is my 2nd favorite book and movie of all time. I read it in second grade. I needed a dictionary and a lot
of grit to finish it, but I understood enough to read it. It was a difficult task, but my reading comprehension was sling-shotted
far above my grade level as a result. wht_rbt_obj.js is a for loop that prints directly to a webpage. Once it finishes,
it redirects to root/index.html with retro.ccs applied. This program taught me how to build a for loop in JavaScript, and print it to a webpage. wht_rbt_obj.js
outputs in transition/index.html. transition/index.html is styled by terminal.css.
GitHub_wht_rbt_obj_javascript
- loader.js
-
loader.js determines which CSS file the browser should load. By checking the saved "skin" value in localStorage
(modern as default if none exists). The program also detects if it is running locally or is hosted on Github pages,
it uses an if/else structure to modify the file path before loading modern.css or retro.css.
GitHub_loader_javascript