⛩️ WarsawJS Workshop #41 — JavaScript (Basic Level)
https://piecioshka.github.io/warsawjs-workshop-41-gallery
- Place holders
- https://bulma.io/documentation/
- https://www.webfx.com/tools/emoji-cheat-sheet/
- https://icons8.com/preloaders
- https://github.com/piecioshka/innerhtml-vs-innertext-vs-textcontent
JavaScript
- ✅ Variables
(var, let, const)
- ✅ Data Types
(string, number, array)
- ✅ Operators
(++, ===, <)
- ✅ Functions
(Function Declaration, Method Shorthand Definition)
- ✅ Arrays
- ✅ Objects
- ✅ Conditions
(if)
- ✅ Loops
(for, forEach)
- ✅ Error Handling
(try...catch)
⚠️ Falsy Values(false, 0, '', NaN, null, undefined)
⚠️ JSON⚠️ BOM — Browser Object Model- ✅ Date
⚠️ Math- ✅ Clocks
(setTimeout, setInterval)
- ✅ Comments
- ✅ DOM Elements
(ClassList API)
- EDIT:
scripts/main.js
- EDIT:
index.html
- Link a
main.js
file byscript
tag
- Link a
- EDIT:
scripts/main.js
- Create function
main()
- Create list of different URLs to photos
- Create loop
for
- Create
HTMLImageElement
for each array item
- Create function
- EDIT:
scripts/main.js
- Create function
renderPhoto()
- With
for
loop content
- With
- Create function
renderPhotos()
- Use
Array.prototype.forEach
- Use
- Change structure of photos
- Switch from URL to object with
url
property
- Switch from URL to object with
- Create function
- EDIT:
scripts/main.js
- Create function
displayMessage()
- TALK:
innerHTML
,innerText
,textContent
- Use simple strategy with
textContent
- Use complex strategy with
innerHTML
with Bulma component
- TALK:
- Create function
displayEmptyGalleryMessage()
- Add condition if an array is empty
- Comment content of photos collection
- Create function
- EDIT:
scripts/main.js
- Add
null
as next element of photos - Add
try...catch
to catchUncaught TypeError
Cannot read property 'url' of null
- Add
- EDIT:
images/loader.gif
- EDIT:
scripts/loader.js
- Create object
loader
with functions:show()
,hide()
- Create object
- EDIT:
index.html
- Link a
loader.js
file byscript
tag
- Link a
- EDIT:
scripts/loader.js
- Funkcja
show()
- Get reference to outlet container
- Create
HTMLElement
- Funkcja
hide()
- Remove
HTMLElement
from DOM
- Remove
- Funkcja
- EDIT:
scripts/main.js
- Invoke
loader.show()
and the beginning - Invoke
loader.hide()
before rendering usesetTimeout
- Invoke
- EDIT:
scripts/main.js
- Create function
displayCurrentTime()
- Use
setInterval()
to render time on each second
- Create function
- Other trainers
The MIT License @ 2020