Methods
accessElement(speechify)
Inject event listeners to elements with class 'speechify' and 'speechify-onload' to enable text-to-speech on mouseover and click and on page load respectively.
Parameters:
Name | Type | Description |
---|---|---|
speechify |
Speechify | The speechify object |
- Source:
(async) accessibilitySwitch()
General control of the accessibility switch
- Source:
bgMusicController()
Controls background music toggler button
- Source:
buttonFunct()
Function to toggle dropbown
- Source:
checkWindowSize()
Detects window size and decide what page content to use (single or double)
- Source:
doSmokeEffect()
Animates the smoke image exactly once
- Source:
doublePageUpdateNoodle()
Double page update content function
- Source:
(async) getDescription(horoscopeSignAsNumber) → {string}
Function that get noodle description for a specific sign
Parameters:
Name | Type | Description |
---|---|---|
horoscopeSignAsNumber |
int | the number of the sign (1-12) |
- Source:
Returns:
the noodle description for the sign
- Type
- string
(async) getHoroscope(horoscopeSignAsNumber) → {string}
Function that gets the day's horoscope for a specific sign
Parameters:
Name | Type | Description |
---|---|---|
horoscopeSignAsNumber |
int | the number of the sign (1-12) |
- Source:
Returns:
the horoscope for the day as a string
- Type
- string
getJSON(url) → {json}
Returns JSON object from url. Used for testing.
Parameters:
Name | Type | Description |
---|---|---|
url |
string | path to JSON file |
Returns:
JSON object in url
- Type
- json
getLocalStorage(key) → {string}
Parameters:
Name | Type | Description |
---|---|---|
key |
string | The name to use to get the value under in localStorage |
Returns:
The value of the key in localStorage
- Type
- string
(async) getNoodleData() → {obj}
Function that gets all noodle descriptions
- Source:
Returns:
the noodle descriptions for all signs as an object
- Type
- obj
getRandomInt(min, max) → {int}
Returns a random int value between min and max
Parameters:
Name | Type | Description |
---|---|---|
min |
int | Minimum int value (inclusive) |
max |
int | Maximum int value (exclusive) |
Returns:
Random int value between min and max
- Type
- int
gradeQuiz()
Grades the quiz and returns the closest personality.
- Source:
(async) init()
On load function
- Source:
(async) init()
On load function
(async) init()
On load function
(async) init()
On load function, use localStorage to get the quiz result and display the corresponding noodle
- Source:
init()
On load function
- Source:
(async) init()
On load function
- Source:
islocalStorageAvailable() → {boolean}
Returns if localStorage is available
Returns:
true if localStorage is available, false otherwise
- Type
- boolean
nextMember()
Function to select next carousel content
nextNoodle()
Function to select next carousel content in double page
- Source:
pauseBgMusic()
Pause background music
- Source:
playBgMusic()
Play background music
- Source:
prevMember()
Function to select previous carousel content
prevNoodle()
Function to select previous carousel content in double page
- Source:
questionsHandler()
Fade-in Fade-out animation for the questions and update the progress bar
- Source:
readOnload(speechify)
Read the selected choice of the user on the questionaire page
Parameters:
Name | Type | Description |
---|---|---|
speechify |
Speechify | The speechify object |
- Source:
removeLocalStorage(key)
Parameters:
Name | Type | Description |
---|---|---|
key |
string | The key to use to remove the value under in localStorage |
resetQuestionnare()
Reset the questionnaire view
- Source:
selectNoodle(index)
Selects a noodle by index
Parameters:
Name | Type | Description |
---|---|---|
index |
int | The index of the noodle to select |
- Source:
(async) setDescriptionAndResult()
Set the noodle description and quiz result to the corresponding text of the user's quiz result
- Source:
(async) setImageCorrectly()
Set the noodle image to the corresponding image of the user's quiz result
- Source:
setLocalStorage(key, value)
Parameters:
Name | Type | Description |
---|---|---|
key |
string | The name to use to store the value under in localStorage |
value |
any | The value to set in localStorage |
singlePageUpdateNoodle()
Single page update content function
- Source:
(async) spinNoodleWheel()
Animates the image to shuffle through all noodle images
- Source:
toggleBgMusic()
Toggle background music
- Source:
transition()
animation when loading a page
- Source:
updateMember()
Function to update member content
(async) updateNoodle(newNoodleIndex)
Parameters:
Name | Type | Description |
---|---|---|
newNoodleIndex |
int | The index of the noodle to be displayed |
- Source: