diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ce83c719..63e9ca32 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -9,33 +9,59 @@ jobs: lint_check: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 20 + cache: "npm" - name: Install modules - run: yarn + run: npm ci - name: Run ESLint run: npm run lint format_check: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 20 + cache: "npm" - name: Install modules - run: yarn + run: npm ci - name: Check if Prettier could format code run: npx prettier --check --no-config . + tests: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 20 + cache: "npm" + - uses: actions/setup-python@v5 + with: + python-version: "3.x" + - name: Install modules + run: npm ci + - name: Launch Python Server + run: python3 -m http.server & + - name: Run Jest Tests + run: BASE=http://127.0.0.1:8000 npm test + jsdocs: runs-on: ubuntu-latest steps: - - name: Checkout - uses: actions/checkout@v3 - - name: Build JSDOCS - uses: andstor/jsdoc-action@v1 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: - recurse: true - output_dir: ./JSDOCs - config_file: .jsdoc.conf.json - template: minami + node-version: 20 + cache: "npm" + - name: Install modules + run: npm ci + - name: Build JSDOCS + run: npm run docs - name: Commit JSDOCS uses: EndBug/add-and-commit@v9 with: diff --git a/JSDOCs/Wheel.html b/JSDOCs/Wheel.html index 77dcace8..6fac93b2 100644 --- a/JSDOCs/Wheel.html +++ b/JSDOCs/Wheel.html @@ -2,35 +2,22 @@ - - Wheel - Documentation + JSDoc: Class: Wheel - - + + - - - - - - - - +
- -

Wheel

- + +

Class: Wheel

@@ -41,9 +28,7 @@

Wheel

-

- Wheel -

+

Wheel(elem, dateInput, angleOffset)

A rotatable zodiac wheel. @@ -56,13 +41,14 @@

-

Constructor

+

new Wheel(elem, dateInput, angleOffset)

+ @@ -77,50 +63,6 @@

new Wheel - - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - - - - - - - @@ -158,7 +100,7 @@
Parameters:
-HTMLElement +HTMLElement @@ -172,10 +114,7 @@
Parameters:
- - The wheel image element. - - + The wheel image element. @@ -188,7 +127,7 @@
Parameters:
-HTMLInputElement +HTMLInputElement @@ -202,11 +141,8 @@
Parameters:
- - The date input that shows the date -range of the selected zodiac. - - + The date input that shows the date +range of the selected zodiac. @@ -219,7 +155,7 @@
Parameters:
-number +number @@ -235,11 +171,8 @@
Parameters:
- - The offset to add to the visual rotation -angle of the wheel before determining the mapped zodiac. Default: 0. - - + The offset to add to the visual rotation +angle of the wheel before determining the mapped zodiac. Default: 0. @@ -251,6 +184,55 @@
Parameters:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + @@ -261,7 +243,6 @@
Parameters:
-

@@ -271,7 +252,9 @@

Parameters:
- + + + @@ -280,22 +263,30 @@

Members

-
-

(private) angle :number

+

(private) FRICTION :number

- The rotation angle of the wheel image. - -Note that this may not be the angle to get the zodiac mapping from, since, -for example, the right wheel takes the zodiac from the left side of the -wheel. + The amount of friction to apply to a wheel spinning with momentum. In +degrees/ms^2.
+
Type:
+
    +
  • + +number + + +
  • +
+ + +
@@ -327,7 +318,7 @@

(private) angle<
Source:
@@ -340,35 +331,32 @@

(private) angle< -

Type:
-
    -
  • - -number -
  • -
+ + +

(private) FRICTION :number

+
+ The amount of friction to apply to a wheel spinning with momentum. In +degrees/ms^2.
- - -
-

(private) angleOffset :number

+
Type:
+
    +
  • + +number -
    - An offset to add to `#angle` before determining the mapped zodiac. The -right wheel has an offset of 180° because it takes the zodiac from the left -side of the wheel. -
    +
  • +
@@ -403,7 +391,7 @@

(private)
Source:
@@ -416,34 +404,35 @@

(private) -

Type:
-
    -
  • - -number -
  • -
+ + + +

(private) angle :number

+
+ The rotation angle of the wheel image. +Note that this may not be the angle to get the zodiac mapping from, since, +for example, the right wheel takes the zodiac from the left side of the +wheel.
- - -
-

(private) animating :MomentumInfo|null

+
Type:
+
    +
  • + +number -
    - Information about the wheel momentum animation, if the wheel momentum is -being animated. -
    +
  • +
@@ -478,7 +467,7 @@

(private) an
Source:
@@ -491,36 +480,35 @@

(private) an -

Type:
- + + +

(private) angle :number

+
+ The rotation angle of the wheel image. +Note that this may not be the angle to get the zodiac mapping from, since, +for example, the right wheel takes the zodiac from the left side of the +wheel.
- - -
-

(private) dateInput :HTMLInputElement

+
Type:
+
    +
  • + +number -
    - The input element that displays the date range of the selected zodiac. -
    +
  • +
@@ -555,7 +543,7 @@

(private) da
Source:
@@ -568,33 +556,33 @@

(private) da -

Type:
-
    -
  • - -HTMLInputElement -
  • -
+ + +

(private) angleOffset :number

+
+ An offset to add to `#angle` before determining the mapped zodiac. The +right wheel has an offset of 180° because it takes the zodiac from the left +side of the wheel.
- - -
-

(private) elem :HTMLElement

+
Type:
+
    +
  • + +number -
    - The wheel image that gets rotated. -
    +
  • +
@@ -629,7 +617,7 @@

(private) elemSource:
@@ -642,39 +630,3369 @@

(private) elemType:

-
    -
  • + + + + -HTMLElement +

    (private) angleOffset :number

    -
  • -
+ + +
+ An offset to add to `#angle` before determining the mapped zodiac. The +right wheel has an offset of 180° because it takes the zodiac from the left +side of the wheel. +
+ + + +
Type:
+
    +
  • + +number + + +
  • +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

(private) animating :MomentumInfo|null

+ + + + +
+ Information about the wheel momentum animation, if the wheel momentum is +being animated. +
+ + + +
Type:
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

(private) animating :MomentumInfo|null

+ + + + +
+ Information about the wheel momentum animation, if the wheel momentum is +being animated. +
+ + + +
Type:
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

(private) dateInput :HTMLInputElement

+ + + + +
+ The input element that displays the date range of the selected zodiac. +
+ + + +
Type:
+
    +
  • + +HTMLInputElement + + +
  • +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

(private) dateInput :HTMLInputElement

+ + + + +
+ The input element that displays the date range of the selected zodiac. +
+ + + +
Type:
+
    +
  • + +HTMLInputElement + + +
  • +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

(private) elem :HTMLElement

+ + + + +
+ The wheel image that gets rotated. +
+ + + +
Type:
+
    +
  • + +HTMLElement + + +
  • +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

(private) elem :HTMLElement

+ + + + +
+ The wheel image that gets rotated. +
+ + + +
Type:
+
    +
  • + +HTMLElement + + +
  • +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

(private) handlePointerDown

+ + + + +
+ Event handler for the `pointerdown` event. + +We're using [pointer +events](https://developer.mozilla.org/en-US/docs/Web/API/Pointer_events) +rather than [mouse events](https://javascript.info/mouse-events-basics) or +[touch +events](https://developer.mozilla.org/en-US/docs/Web/API/Touch_events/Using_Touch_Events) +because pointer events have several advantages: + +- They're an all-in-one set of events that fire for both mouse cursors, + fingers, and pens (collectively called pointers). This means that I don't + need to add both `mousedown` and `touchstart` event listeners. +- The `setPointerCapture` method lets me receive `pointermove` and + `pointerup` events on the wheel image even when the pointer moves outside + of the element. For mouse and touch events, I would have to listen for + move events on the entire `document`. +- Combined with CSS `touch-action: none;`, I don't need to use + `event.preventDefault()` to prevent scrolling, which would also require + `{ passive: true }` when using touch events. +- Finally, the `pointercancel` event makes it nice in case the user holds + down their mouse and leaves the page. For mouse events, it will simply + not fire any event when this happens, so to the user when they return, + it'll look like the wheel is sticking to their cursor even though they + aren't holding it down. +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

(private) handlePointerDown

+ + + + +
+ Event handler for the `pointerdown` event. + +We're using [pointer +events](https://developer.mozilla.org/en-US/docs/Web/API/Pointer_events) +rather than [mouse events](https://javascript.info/mouse-events-basics) or +[touch +events](https://developer.mozilla.org/en-US/docs/Web/API/Touch_events/Using_Touch_Events) +because pointer events have several advantages: + +- They're an all-in-one set of events that fire for both mouse cursors, + fingers, and pens (collectively called pointers). This means that I don't + need to add both `mousedown` and `touchstart` event listeners. +- The `setPointerCapture` method lets me receive `pointermove` and + `pointerup` events on the wheel image even when the pointer moves outside + of the element. For mouse and touch events, I would have to listen for + move events on the entire `document`. +- Combined with CSS `touch-action: none;`, I don't need to use + `event.preventDefault()` to prevent scrolling, which would also require + `{ passive: true }` when using touch events. +- Finally, the `pointercancel` event makes it nice in case the user holds + down their mouse and leaves the page. For mouse events, it will simply + not fire any event when this happens, so to the user when they return, + it'll look like the wheel is sticking to their cursor even though they + aren't holding it down. +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

(private) handlePointerMove

+ + + + +
+ Event handler for the `pointermove` event. +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

(private) handlePointerMove

+ + + + +
+ Event handler for the `pointermove` event. +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

(private) handlePointerUp

+ + + + +
+ Event handler for the `pointerup` and `pointercancel` events. The latter +occurs if the user holds their mouse down then switches tabs. +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

(private) handlePointerUp

+ + + + +
+ Event handler for the `pointerup` and `pointercancel` events. The latter +occurs if the user holds their mouse down then switches tabs. +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

(private) handleWheel

+ + + + +
+ Rotates the wheel based on the mouse wheel event. +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

(private) handleWheel

+ + + + +
+ Rotates the wheel based on the mouse wheel event. +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

(private) paint

+ + + + +
+ Simulates the wheel moving and updates the wheel rotation accordingly, in +an animation frame. Automatically stops and snaps to the nearest zodiac +when the wheel slows down. +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

(private) paint

+ + + + +
+ Simulates the wheel moving and updates the wheel rotation accordingly, in +an animation frame. Automatically stops and snaps to the nearest zodiac +when the wheel slows down. +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

(private) pointer :PointerInfo|null

+ + + + +
+ Information about the pointer dragging the wheel, if the wheel is being +dragged. +
+ + + +
Type:
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

(private) pointer :PointerInfo|null

+ + + + +
+ Information about the pointer dragging the wheel, if the wheel is being +dragged. +
+ + + +
Type:
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

(private) wheelTimeout :number|null

+ + + + +
+ The `setTimeout` ID of the delay after using the scroll wheel on the wheel +before trying to snap the wheel to the closest zodiac. This timeout gets +cleared if the user continues to scroll before the timeout runs. +
+ + + +
Type:
+
    +
  • + +number +| + +null + + +
  • +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

(private) wheelTimeout :number|null

+ + + + +
+ The `setTimeout` ID of the delay after using the scroll wheel on the wheel +before trying to snap the wheel to the closest zodiac. This timeout gets +cleared if the user continues to scroll before the timeout runs. +
+ + + +
Type:
+
    +
  • + +number +| + +null + + +
  • +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + + +

getMapping() → {string}

+ + + + + + +
+ Calculates the zodiac that the wheel's arrow is pointing to. If the wheel +rotation angle is not at a perfect multiple of 30°, it will round the angle +to determine which zodiac the arrow is pointing at. +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ The zodiac. +
+ + + +
+
+ Type +
+
+ +string + + +
+
+ + + + + + + + + + + + + +

getMapping() → {string}

+ + + + + + +
+ Calculates the zodiac that the wheel's arrow is pointing to. If the wheel +rotation angle is not at a perfect multiple of 30°, it will round the angle +to determine which zodiac the arrow is pointing at. +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ The zodiac. +
+ + + +
+
+ Type +
+
+ +string + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +

Wheel(elem, dateInput, angleOffset)

+ +
A rotatable zodiac wheel. + +All units of rotation are in degrees, and units of time are in milliseconds.
+ + +
+ +
+
+ + + + +

Constructor

+ + + +

new Wheel(elem, dateInput, angleOffset)

+ + + + + + +
+ Constructs a `Wheel` based on existing DOM elements. Adds event listeners +to the wheel image. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefaultDescription
elem + + +HTMLElement + + + + + + The wheel image element.
dateInput + + +HTMLInputElement + + + + + + The date input that shows the date +range of the selected zodiac.
angleOffset + + +number + + + + + + 0 + + The offset to add to the visual rotation +angle of the wheel before determining the mapped zodiac. Default: 0.
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + +

Members

+ + + +

(private) FRICTION :number

+ + + + +
+ The amount of friction to apply to a wheel spinning with momentum. In +degrees/ms^2. +
+ + + +
Type:
+
    +
  • + +number + + +
  • +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

(private) FRICTION :number

+ + + + +
+ The amount of friction to apply to a wheel spinning with momentum. In +degrees/ms^2. +
+ + + +
Type:
+
    +
  • + +number + + +
  • +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

(private) angle :number

+ + + + +
+ The rotation angle of the wheel image. + +Note that this may not be the angle to get the zodiac mapping from, since, +for example, the right wheel takes the zodiac from the left side of the +wheel. +
+ + + +
Type:
+
    +
  • + +number + + +
  • +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

(private) angle :number

+ + + + +
+ The rotation angle of the wheel image. + +Note that this may not be the angle to get the zodiac mapping from, since, +for example, the right wheel takes the zodiac from the left side of the +wheel. +
+ + + +
Type:
+
    +
  • + +number + + +
  • +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

(private) angleOffset :number

+ + + + +
+ An offset to add to `#angle` before determining the mapped zodiac. The +right wheel has an offset of 180° because it takes the zodiac from the left +side of the wheel. +
+ + + +
Type:
+
    +
  • + +number + + +
  • +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

(private) angleOffset :number

+ + + + +
+ An offset to add to `#angle` before determining the mapped zodiac. The +right wheel has an offset of 180° because it takes the zodiac from the left +side of the wheel. +
+ + + +
Type:
+
    +
  • + +number + + +
  • +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

(private) animating :MomentumInfo|null

+ + + + +
+ Information about the wheel momentum animation, if the wheel momentum is +being animated. +
+ + + +
Type:
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

(private) animating :MomentumInfo|null

+ + + + +
+ Information about the wheel momentum animation, if the wheel momentum is +being animated. +
+ + + +
Type:
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

(private) dateInput :HTMLInputElement

+ + + + +
+ The input element that displays the date range of the selected zodiac. +
+ + + +
Type:
+
    +
  • + +HTMLInputElement + + +
  • +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

(private) dateInput :HTMLInputElement

+ + + + +
+ The input element that displays the date range of the selected zodiac. +
+ + + +
Type:
+
    +
  • + +HTMLInputElement + + +
  • +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

(private) elem :HTMLElement

+ + + + +
+ The wheel image that gets rotated. +
+ + + +
Type:
+
    +
  • + +HTMLElement + + +
  • +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

(private) elem :HTMLElement

+ + + + +
+ The wheel image that gets rotated. +
+ + + +
Type:
+
    +
  • + +HTMLElement + + +
  • +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

(private) handlePointerDown

+ + + + +
+ Event handler for the `pointerdown` event. + +We're using [pointer +events](https://developer.mozilla.org/en-US/docs/Web/API/Pointer_events) +rather than [mouse events](https://javascript.info/mouse-events-basics) or +[touch +events](https://developer.mozilla.org/en-US/docs/Web/API/Touch_events/Using_Touch_Events) +because pointer events have several advantages: + +- They're an all-in-one set of events that fire for both mouse cursors, + fingers, and pens (collectively called pointers). This means that I don't + need to add both `mousedown` and `touchstart` event listeners. +- The `setPointerCapture` method lets me receive `pointermove` and + `pointerup` events on the wheel image even when the pointer moves outside + of the element. For mouse and touch events, I would have to listen for + move events on the entire `document`. +- Combined with CSS `touch-action: none;`, I don't need to use + `event.preventDefault()` to prevent scrolling, which would also require + `{ passive: true }` when using touch events. +- Finally, the `pointercancel` event makes it nice in case the user holds + down their mouse and leaves the page. For mouse events, it will simply + not fire any event when this happens, so to the user when they return, + it'll look like the wheel is sticking to their cursor even though they + aren't holding it down. +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

(private) handlePointerDown

+ + + + +
+ Event handler for the `pointerdown` event. + +We're using [pointer +events](https://developer.mozilla.org/en-US/docs/Web/API/Pointer_events) +rather than [mouse events](https://javascript.info/mouse-events-basics) or +[touch +events](https://developer.mozilla.org/en-US/docs/Web/API/Touch_events/Using_Touch_Events) +because pointer events have several advantages: + +- They're an all-in-one set of events that fire for both mouse cursors, + fingers, and pens (collectively called pointers). This means that I don't + need to add both `mousedown` and `touchstart` event listeners. +- The `setPointerCapture` method lets me receive `pointermove` and + `pointerup` events on the wheel image even when the pointer moves outside + of the element. For mouse and touch events, I would have to listen for + move events on the entire `document`. +- Combined with CSS `touch-action: none;`, I don't need to use + `event.preventDefault()` to prevent scrolling, which would also require + `{ passive: true }` when using touch events. +- Finally, the `pointercancel` event makes it nice in case the user holds + down their mouse and leaves the page. For mouse events, it will simply + not fire any event when this happens, so to the user when they return, + it'll look like the wheel is sticking to their cursor even though they + aren't holding it down. +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

(private) handlePointerMove

+ + + + +
+ Event handler for the `pointermove` event. +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

(private) handlePointerMove

+ + + + +
+ Event handler for the `pointermove` event. +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

(private) handlePointerUp

+ + + + +
+ Event handler for the `pointerup` and `pointercancel` events. The latter +occurs if the user holds their mouse down then switches tabs. +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

(private) handlePointerUp

+ + + + +
+ Event handler for the `pointerup` and `pointercancel` events. The latter +occurs if the user holds their mouse down then switches tabs. +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

(private) handleWheel

+ + + + +
+ Rotates the wheel based on the mouse wheel event. +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
-

-
-

(private) FRICTION :number

+

(private) handleWheel

- The amount of friction to apply to a wheel spinning with momentum. In -degrees/ms^2. + Rotates the wheel based on the mouse wheel event.
+ +
@@ -704,7 +4022,7 @@

(private) FRI
Source:
@@ -717,56 +4035,23 @@

(private) FRI -

Type:
-
    -
  • - -number - - -
  • -
- - -
- -
-

(private) handlePointerDown

+

(private) paint

- Event handler for the `pointerdown` event. + Simulates the wheel moving and updates the wheel rotation accordingly, in +an animation frame. Automatically stops and snaps to the nearest zodiac +when the wheel slows down. +
-We're using [pointer -events](https://developer.mozilla.org/en-US/docs/Web/API/Pointer_events) -rather than [mouse events](https://javascript.info/mouse-events-basics) or -[touch -events](https://developer.mozilla.org/en-US/docs/Web/API/Touch_events/Using_Touch_Events) -because pointer events have several advantages: -- They're an all-in-one set of events that fire for both mouse cursors, - fingers, and pens (collectively called pointers). This means that I don't - need to add both `mousedown` and `touchstart` event listeners. -- The `setPointerCapture` method lets me receive `pointermove` and - `pointerup` events on the wheel image even when the pointer moves outside - of the element. For mouse and touch events, I would have to listen for - move events on the entire `document`. -- Combined with CSS `touch-action: none;`, I don't need to use - `event.preventDefault()` to prevent scrolling, which would also require - `{ passive: true }` when using touch events. -- Finally, the `pointercancel` event makes it nice in case the user holds - down their mouse and leaves the page. For mouse events, it will simply - not fire any event when this happens, so to the user when they return, - it'll look like the wheel is sticking to their cursor even though they - aren't holding it down. -
@@ -801,7 +4086,7 @@

(private) <
Source:
@@ -817,25 +4102,25 @@

(private) < - -

- -
-

(private) handlePointerMove

+

(private) paint

- Event handler for the `pointermove` event. + Simulates the wheel moving and updates the wheel rotation accordingly, in +an animation frame. Automatically stops and snaps to the nearest zodiac +when the wheel slows down.
+ +
@@ -865,7 +4150,7 @@

(private) <
Source:
@@ -881,24 +4166,35 @@

(private) < - -

- -
-

(private) handlePointerUp

+

(private) pointer :PointerInfo|null

- Event handler for the `pointerup` and `pointercancel` events. The latter -occurs if the user holds their mouse down then switches tabs. + Information about the pointer dragging the wheel, if the wheel is being +dragged.
+
Type:
+ + + +
@@ -930,7 +4226,7 @@

(private) Source:
@@ -946,23 +4242,35 @@

(private) - -
-

(private) handleWheel

+

(private) pointer :PointerInfo|null

- Rotates the wheel based on the mouse wheel event. + Information about the pointer dragging the wheel, if the wheel is being +dragged.
+
Type:
+ + + +
@@ -994,7 +4302,7 @@

(private)
Source:
@@ -1010,25 +4318,36 @@

(private) - -

- -
-

(private) paint

+

(private) wheelTimeout :number|null

- Simulates the wheel moving and updates the wheel rotation accordingly, in -an animation frame. Automatically stops and snaps to the nearest zodiac -when the wheel slows down. + The `setTimeout` ID of the delay after using the scroll wheel on the wheel +before trying to snap the wheel to the closest zodiac. This timeout gets +cleared if the user continues to scroll before the timeout runs.
+
Type:
+
    +
  • + +number +| + +null + + +
  • +
+ + +
@@ -1060,7 +4379,7 @@

(private) paint<
Source:
@@ -1076,24 +4395,36 @@

(private) paint< - -

- -
-

(private) pointer :PointerInfo|null

+

(private) wheelTimeout :number|null

- Information about the pointer dragging the wheel, if the wheel is being -dragged. + The `setTimeout` ID of the delay after using the scroll wheel on the wheel +before trying to snap the wheel to the closest zodiac. This timeout gets +cleared if the user continues to scroll before the timeout runs.
+
Type:
+
    +
  • + +number +| + +null + + +
  • +
+ + +
@@ -1125,7 +4456,7 @@

(private) poin
Source:
@@ -1138,38 +4469,41 @@

(private) poin -

Type:
- + + + + +

Methods

+ + + + + + +

getMapping() → {string}

+ + +
+ Calculates the zodiac that the wheel's arrow is pointing to. If the wheel +rotation angle is not at a perfect multiple of 30°, it will round the angle +to determine which zodiac the arrow is pointing at.
- - -
-

(private) wheelTimeout :number|null

-
- The `setTimeout` ID of the delay after using the scroll wheel on the wheel -before trying to snap the wheel to the closest zodiac. This timeout gets -cleared if the user continues to scroll before the timeout runs. -
+ + + @@ -1204,7 +4538,7 @@

(private) Source:
@@ -1217,38 +4551,53 @@

(private) Type:

-
    -
  • - -number -| -null -
  • -
+ + + + +
Returns:
+ + +
+ The zodiac.
+ + +
+
+ Type +
+
- +string + + +
+
-

Methods

+ + + + -
+

getMapping() → {string}

+ @@ -1264,6 +4613,14 @@

getMapping< + + + + + + + +
@@ -1293,7 +4650,7 @@

getMapping<
Source:
@@ -1318,40 +4675,33 @@

getMapping< - - - - - - -
Returns:
+
+ The zodiac. +
-
+ + +
- Type: + Type
-string +string
+ -
- The zodiac. -
- -
-

@@ -1367,13 +4717,17 @@
Returns:
+ +
- - + + \ No newline at end of file diff --git a/JSDOCs/common_index.js.html b/JSDOCs/common_index.js.html index ab3b1fd9..14d64ef3 100644 --- a/JSDOCs/common_index.js.html +++ b/JSDOCs/common_index.js.html @@ -2,35 +2,22 @@ - - common/index.js - Documentation + JSDoc: Source: common/index.js - - + + - - - - - - - - +
- -

common/index.js

- + +

Source: common/index.js

@@ -54,13 +41,17 @@

common/index.js

+ +
- - + + diff --git a/JSDOCs/common_nav.js.html b/JSDOCs/common_nav.js.html index eb12201a..9b13a309 100644 --- a/JSDOCs/common_nav.js.html +++ b/JSDOCs/common_nav.js.html @@ -2,35 +2,22 @@ - - common/nav.js - Documentation + JSDoc: Source: common/nav.js - - + + - - - - - - - - +
- -

common/nav.js

- + +

Source: common/nav.js

@@ -68,17 +55,17 @@

common/nav.js

{ label: "Love Compatibility", url: "../love-compatibility/", - imageUrl: "../home-page/images/love-compatibility-img.png", + imageUrl: "../home-page/images/love-compatibility-img.jpg", }, { label: "Fortune Cookie", url: "../fortune-cookie/", - imageUrl: "../home-page/images/fortune-cookie-img.png", + imageUrl: "../home-page/images/fortune-cookie-img.jpg", }, { label: "Palm Reading", url: "../palm-reading/", - imageUrl: "../home-page/images/palm-reading-img.png", + imageUrl: "../home-page/images/palm-reading-img.jpg", }, ]; @@ -123,13 +110,17 @@

common/nav.js

+ +
- - + + diff --git a/JSDOCs/fortune-cookie_fortunes.js.html b/JSDOCs/fortune-cookie_fortunes.js.html index d9f49f30..3c3af2b4 100644 --- a/JSDOCs/fortune-cookie_fortunes.js.html +++ b/JSDOCs/fortune-cookie_fortunes.js.html @@ -2,35 +2,22 @@ - - fortune-cookie/fortunes.js - Documentation + JSDoc: Source: fortune-cookie/fortunes.js - - + + - - - - - - - - +
- -

fortune-cookie/fortunes.js

- + +

Source: fortune-cookie/fortunes.js

@@ -168,13 +155,17 @@

fortune-cookie/fortunes.js

+ +
- - + + diff --git a/JSDOCs/fortune-cookie_script.js.html b/JSDOCs/fortune-cookie_script.js.html index d39e9450..557e3426 100644 --- a/JSDOCs/fortune-cookie_script.js.html +++ b/JSDOCs/fortune-cookie_script.js.html @@ -2,35 +2,22 @@ - - fortune-cookie/script.js - Documentation + JSDoc: Source: fortune-cookie/script.js - - + + - - - - - - - - +
- -

fortune-cookie/script.js

- + +

Source: fortune-cookie/script.js

@@ -429,13 +416,17 @@

fortune-cookie/script.js

+ +
- - + + diff --git a/JSDOCs/global.html b/JSDOCs/global.html index 9c08e661..28cdbac6 100644 --- a/JSDOCs/global.html +++ b/JSDOCs/global.html @@ -2,35 +2,22 @@ - - Global - Documentation + JSDoc: Global - - + + - - - - - - - - +
- +

Global

- @@ -41,9 +28,7 @@

Global

-

- -

+

@@ -102,7 +87,9 @@

- + + + @@ -111,18 +98,30 @@

Members

-
-

(constant) context :CanvasRenderingContext2D

+

(constant) FPS :number

- The `CanvasRenderingContext2D` for `result`. + The FPS of the animation. `paintEcg` will try to keep the animation at this +rate, for displays that have slower or faster refresh rates.
+
Type:
+
    +
  • + +number + + +
  • +
+ + +
@@ -154,7 +153,7 @@

(constant) con
Source:
@@ -167,33 +166,32 @@

(constant) con -

Type:
-
    -
  • - -CanvasRenderingContext2D -
  • -
+ + +

(constant) FPS :number

+
+ The FPS of the animation. `paintEcg` will try to keep the animation at this +rate, for displays that have slower or faster refresh rates.
- - -
-

cookieFalling :boolean

+
Type:
+
    +
  • + +number -
    - Whether to animate a new cookie falling. -
    +
  • +
@@ -228,7 +226,7 @@

cookieFa
Source:
@@ -241,33 +239,32 @@

cookieFa -

Type:
-
    -
  • - -boolean -
  • -
+ + +

(constant) GRAVITY :number

+
+ The acceleration due to "gravity" applied on all falling objects in the +animation, in px/ms^2.
- - -
-

(constant) ecgGraph :SVGSVGElement

+
Type:
+
    +
  • + +number -
    - The heartbeat graph. -
    +
  • +
@@ -302,7 +299,7 @@

(constant) ec
Source:
@@ -315,34 +312,32 @@

(constant) ec -

Type:
-
    -
  • - -SVGSVGElement -
  • -
+ + +

(constant) GRAVITY :number

+
+ The acceleration due to "gravity" applied on all falling objects in the +animation, in px/ms^2.
- - -
-

(constant) ecgHistory :Array.<number>

+
Type:
+
    +
  • + +number -
    - A queue of points (new elements added to the beginning) representing the ECG -graph. Kept to a maximum of `ecgLength` items. -
    +
  • +
@@ -377,7 +372,7 @@

(constant)
Source:
@@ -390,38 +385,28 @@

(constant) -

Type:
-
    -
  • - -Array.<number> - - -
  • -
- - -
- -
-

(constant) ecgLength :number

+

(constant) PERIOD

- The number of SVG units in width of the fake heartbeat graph. + The period of the heartbeat shape, in whatever units `ecgPoints` is in. +Increase to increase the spacing between heartbeats, but it's mostly a +guessing game.
+ +
@@ -451,7 +436,7 @@

(constant) e
Source:
@@ -464,38 +449,28 @@

(constant) e -

Type:
-
    -
  • - -number - - -
  • -
- - -
- -
-

(constant) ecgPath :SVGPathElement

+

(constant) PERIOD

- The `` element that draws the ECG graph. + The period of the heartbeat shape, in whatever units `ecgPoints` is in. +Increase to increase the spacing between heartbeats, but it's mostly a +guessing game.
+ +
@@ -525,7 +500,7 @@

(constant) ecg
Source:
@@ -538,35 +513,32 @@

(constant) ecg -

Type:
-
    -
  • - -SVGPathElement -
  • -
+ + +

(constant) XSHIFT :number

+
+ Horizontal shift factor to be added to each point in `ecgPoints`. This is +because the image I got wasn't centered at the origin.
- - -
-

(constant) ecgPoints :Array.<Array.<number, number>>

+
Type:
+
    +
  • + +number -
    - Some points on an image of an ECG graph I found on Google Images that I -manually marked out in MS Paint. Used to form the piecewise linear `ecg` -polyline. -
    +
  • +
@@ -601,7 +573,7 @@

(constant) e
Source:
@@ -614,33 +586,32 @@

(constant) e -

Type:
-
    -
  • - -Array.<Array.<number, number>> -
  • -
+ + +

(constant) XSHIFT :number

+
+ Horizontal shift factor to be added to each point in `ecgPoints`. This is +because the image I got wasn't centered at the origin.
- - -
-

(constant) fates :Array.<string>

+
Type:
+
    +
  • + +number -
    - Possible outcomes for the fate line in a palm reading. -
    +
  • +
@@ -675,7 +646,7 @@

(constant) fates
Source:
@@ -688,33 +659,31 @@

(constant) fates -

Type:
-
    -
  • - -Array.<string> -
  • -
+ + +

(constant) YSHIFT :number

+
+ Vertical shift factor to be added to each point in `ecgPoints`.
- - -
-

flipCamera :boolean

+
Type:
+
    +
  • + +number -
    - Whether the camera should be horizontally flipped (for front-facing cameras). -
    +
  • +
@@ -749,7 +718,7 @@

flipCamera<
Source:
@@ -762,33 +731,31 @@

flipCamera< -

Type:
-
    -
  • - -boolean -
  • -
+ + +

(constant) YSHIFT :number

+
+ Vertical shift factor to be added to each point in `ecgPoints`.
- - -
-

(constant) fortunes :Array.<string>

+
Type:
+
    +
  • + +number -
    - Array of general, college, and collage-romance type fortunes -
    +
  • +
@@ -823,7 +790,7 @@

(constant) fo
Source:
@@ -836,34 +803,31 @@

(constant) fo -

Type:
-
    -
  • - -Array.<string> -
  • -
+ + +

(constant) context :CanvasRenderingContext2D

+
+ The `CanvasRenderingContext2D` for `result`.
- - -
-

(constant) FPS :number

+
Type:
+
    +
  • + +CanvasRenderingContext2D -
    - The FPS of the animation. `paintEcg` will try to keep the animation at this -rate, for displays that have slower or faster refresh rates. -
    +
  • +
@@ -898,7 +862,7 @@

(constant) FPSSource:
@@ -911,34 +875,31 @@

(constant) FPSType:

-
    -
  • - -number -
  • -
+ + +

(constant) context :CanvasRenderingContext2D

+
+ The `CanvasRenderingContext2D` for `result`.
- - -
-

frameId :number|null

+
Type:
+
    +
  • + +CanvasRenderingContext2D -
    - The ID returned by `window.requestAnimationFrame`, used to cancel it or -determine whether it is animating. `null` if `paintEcg` is not animating. -
    +
  • +
@@ -973,7 +934,7 @@

frameIdSource:
@@ -986,37 +947,31 @@

frameIdType:

-
    -
  • - -number -| - -null -
  • -
+ + +

cookieFalling :boolean

+
+ Whether to animate a new cookie falling.
- - -
-

(constant) GRAVITY :number

+
Type:
+
    +
  • + +boolean -
    - The acceleration due to "gravity" applied on all falling objects in the -animation, in px/ms^2. -
    +
  • +
@@ -1051,7 +1006,7 @@

(constant) GRA
Source:
@@ -1064,33 +1019,31 @@

(constant) GRA -

Type:
-
    -
  • - -number -
  • -
+ + +

cookieFalling :boolean

+
+ Whether to animate a new cookie falling.
- - -
-

(constant) heads :Array.<string>

+
Type:
+
    +
  • + +boolean -
    - Possible outcomes for the head line in a palm reading. -
    +
  • +
@@ -1125,7 +1078,7 @@

(constant) heads
Source:
@@ -1138,33 +1091,31 @@

(constant) heads -

Type:
-
    -
  • - -Array.<string> -
  • -
+ + +

(constant) ecgGraph :SVGSVGElement

+
+ The heartbeat graph.
- - -
-

(constant) hearts :Array.<string>

+
Type:
+
    +
  • + +SVGSVGElement -
    - Possible outcomes for the heart line in a palm reading. -
    +
  • +
@@ -1199,7 +1150,7 @@

(constant) hear
Source:
@@ -1212,33 +1163,31 @@

(constant) hear -

Type:
-
    -
  • - -Array.<string> -
  • -
+ + +

(constant) ecgGraph :SVGSVGElement

+
+ The heartbeat graph.
- - -
-

lastInstructionElem :HTMLParagraphElement|null

+
Type:
+
    +
  • + +SVGSVGElement -
    - The currently displayed `.instructions` element. -
    +
  • +
@@ -1273,7 +1222,7 @@

la
Source:
@@ -1286,36 +1235,32 @@

la -

Type:
-
    -
  • - -HTMLParagraphElement -| - -null -
  • -
+ + +

(constant) ecgHistory :Array.<number>

+
+ A queue of points (new elements added to the beginning) representing the ECG +graph. Kept to a maximum of `ecgLength` items.
- - -
-

lastTime :number

+
Type:
+
    +
  • + +Array.<number> -
    - The timestamp of the last time `paint` was called. -
    +
  • +
@@ -1350,7 +1295,7 @@

lastTimeSource:
@@ -1363,33 +1308,32 @@

lastTimeType:

-
    -
  • - -number -
  • -
+ + +

(constant) ecgHistory :Array.<number>

+
+ A queue of points (new elements added to the beginning) representing the ECG +graph. Kept to a maximum of `ecgLength` items.
- - -
-

(constant) leftWheel :Wheel

+
Type:
+
    +
  • + +Array.<number> -
    - The left wheel. -
    +
  • +
@@ -1424,7 +1368,7 @@

(constant) l
Source:
@@ -1437,33 +1381,31 @@

(constant) l -

Type:
- + + +

(constant) ecgLength :number

+
+ The number of SVG units in width of the fake heartbeat graph.
- - -
-

(constant) lifes :Array.<string>

+
Type:
+
    +
  • + +number -
    - Possible outcomes for the life line in a palm reading. -
    +
  • +
@@ -1498,7 +1440,7 @@

(constant) lifes
Source:
@@ -1511,33 +1453,31 @@

(constant) lifes -

Type:
-
    -
  • - -Array.<string> -
  • -
+ + +

(constant) ecgLength :number

+
+ The number of SVG units in width of the fake heartbeat graph.
- - -
- +
Type:
+
    +
  • + +number -
    - The list of entries in the navigation menu. -
    +
  • +
@@ -1572,7 +1512,7 @@
Type:
-
    -
  • - -Array.<Link> -
  • -
+ + +

(constant) ecgPath :SVGPathElement

+
+ The `` element that draws the ECG graph.
- - -
- +
Type:
+
    +
  • + +SVGPathElement -
    - The menu icon, which is a focusable element to allow the menu contents to be -tab accessible. -
    +
  • +
@@ -1647,7 +1584,7 @@
Type:
-
    -
  • - -HTMLAnchorElement -
  • -
+ + +

(constant) ecgPath :SVGPathElement

+
+ The `` element that draws the ECG graph.
- - -
- +
Type:
+
    +
  • + +SVGPathElement -
    - The created `
    +
  • +
@@ -1722,7 +1656,7 @@

+ + + -

ecg(time) → {number}

- -
- A periodic, piecewiese linear function that draws out the shape of an ECG. -The units used in this function are kind of weird, so some guesswork is -required to shape it into a nice-looking form for the heartbeat graph. -
-
- - +
Returns:
- + +
+ The randomly chosen option +
- - - +
+
+ Type +
+
+ +T - - +
+
- - + + + + + -
Source:
-
+

pick(options) → {T}

- - -
+ +
+ Randomly selects an item in the given list. +
@@ -4345,13 +11543,13 @@
Parameters:
- time + options -number +ArrayLike.<T> @@ -4361,10 +11559,7 @@
Parameters:
- - The x-value of the ECG graph. - - + List of options to choose from. @@ -4376,62 +11571,6 @@
Parameters:
- - - - - - - - -
-
Returns:
- - - -
-
- Type: -
-
- -number - - -
-
- - -
- The resulting y-value of the graph. -
- - -
- - - -
- - -
- - - -

fallFortune()

- - - - - -
- Sets the animation to make the fortune paper fall. -
- - - - -
@@ -4461,7 +11600,7 @@

fallFortun
Source:
@@ -4486,35 +11625,62 @@

fallFortun +

Returns:
+ + +
+ The randomly chosen option +
+ + +
+
+ Type +
+
+ +T +
+
+ + -
-
-

fallLeft()

+ +

populateVoiceList()

+
- Sets the animation to make the left half of the cookie fall. + Speech synthesis API, adds options for different voices to read out fortune using voice synthesis
+ + + + + + + +
@@ -4544,7 +11710,7 @@

fallLeftSource:
@@ -4574,30 +11740,35 @@

fallLeft -
-

fallNewCookie()

+ +

populateVoiceList()

+
- Sets the animation to make a new, full fortune cookie fall. + Speech synthesis API, adds options for different voices to read out fortune using voice synthesis
+ + + + + + + +
@@ -4627,7 +11798,7 @@

fallNewC
Source:
@@ -4657,30 +11828,35 @@

fallNewC - - - -

-
-

fallRight()

+ +

prefersReducedMotion() → {boolean}

+
- Sets the animation to make the right half of the cookie fall. + Determines whether the user has `prefers-reduced-motion` enabled.
+ + + + + + + +
@@ -4710,7 +11886,7 @@

fallRightSource:
@@ -4735,35 +11911,62 @@

fallRightReturns:

+ + +
+ Whether to reduce motion. +
+ + + +
+
+ Type +
+
+ +boolean +
+
+ -

-
-

getMappingLeft(roundedAngle) → {string}

+ +

prefersReducedMotion() → {boolean}

+
- Retrieves the zodiac sign mapping for the given angle on the left wheel. + Determines whether the user has `prefers-reduced-motion` enabled.
+ + + + + + + +
@@ -4793,7 +11996,7 @@

getMapp
Source:
@@ -4802,66 +12005,8 @@

getMapp -

- - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
roundedAngle - - -number - - - - - The angle on the left wheel pre-rounded to the nearest 30 degree increment - -
+

+ @@ -4876,54 +12021,63 @@
Parameters:
-
Returns:
+
+ Whether to reduce motion. +
+ -
+ +
- Type: + Type
-string +boolean
+ -
- The corresponding zodiac sign, or `'unknown'` if the angle does not correspond to a zodiac. -
- -
-
-
-

getMappingRight(roundedAngle) → {string}

+ +

randomize()

+
- Retrieves the zodiac sign mapping for the given angle on the right wheel. + Event handler for the "Randomize" button. Clicks a random card to navigate to +the corresponding page.
+ + + + + + + +
@@ -4953,7 +12107,7 @@

getMap
Source:
@@ -4972,113 +12126,42 @@

getMap -

Parameters:
- - - - - - - - - - - - - - - - - - - - - - + - - - - -
NameTypeDescription
roundedAngle - - -number - - - The angle on the right wheel pre-rounded to the nearest 30 degree increment - -
- - - - - - - - - - - - - - -
-
Returns:
- - - -
-
- Type: -
-
- -string + +

randomize()

+ -
-
+ -
- The corresponding zodiac sign, or `'unknown'` if the angle does not correspond to a zodiac. -
- +
+ Event handler for the "Randomize" button. Clicks a random card to navigate to +the corresponding page.
-
- - -
- - -

getRandomFortune() → {string}

- -
- This function will get a random fortune from the fortune array and make sure it does not match the previous one -
@@ -5113,7 +12196,7 @@

getRa
Source:
@@ -5143,51 +12226,84 @@

getRa - -
-
Returns:
- + -
-
- Type: -
-
- -string + + +

reset(state)

+ -
-
+ -
- a random fortune + +
+ Stops the current animation and resets all animatable parts of the app to the +specified view (`state`).
+ + + + + + + + +
Parameters:
-
+ + + + + + + - - -
- + -

handleCookieReady()

+
+ + + + + + + + + + + + + + + + + + + +
NameTypeDescription
state + + +'fortune' +| +'cookie' + + + + Whether to set the view to showing the +fortune (`'fortune'`) or the cookie (`'cookie'`).
-
- A handler called whenever the animation for dropping a new fortune cookie -ends. -
@@ -5222,7 +12338,7 @@

hand
Source:
@@ -5252,30 +12368,89 @@

hand - - - -

-
-

handleFortune()

+ +

reset(state)

+
- Generates random fortunes. Called when the app finishes analyzing the palm. + Stops the current animation and resets all animatable parts of the app to the +specified view (`state`).
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
state + + +'fortune' +| + +'cookie' + + + + Whether to set the view to showing the +fortune (`'fortune'`) or the cookie (`'cookie'`).
+ + + + + +
@@ -5305,7 +12480,7 @@

handleFo
Source:
@@ -5335,30 +12510,84 @@

handleFo - - - -

-
-

handleFortuneEnd()

+ +

roundAngle(angle) → {number}

+
- A handler called whenever the animation for opening the fortune cookie ends. + Rounds the given angle to the nearest multiple of 30.
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
angle + + +number + + + + The angle to round.
+ + + + + +
@@ -5388,7 +12617,7 @@

handl
Source:
@@ -5413,76 +12642,49 @@

handl +

Returns:
- - - - - - - -
- -
- - - -

mod(a, b) → {number}

- - - - - -
- Calculates the modulus. JavaScript's `%` operator is the remainder operator, -which works differently for negative numbers. For example, `-10 % 360` in -JavaScript, but `-10 mod 360` is 350. +
+ The rounded angle.
+
+
+ Type +
+
+ +number -
- - - - - - +
+
- - - - - + + - +

roundAngle(angle) → {number}

- -
Source:
-
- - - -

+
+ Rounds the given angle to the nearest multiple of 30. +
@@ -5517,13 +12719,13 @@
Parameters:
- a + angle -number +number @@ -5533,41 +12735,58 @@
Parameters:
- - Dividend - - + The angle to round. + + - - - b - - - - -number - - - - +
- - Div-sor - - - + - - + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ @@ -5582,49 +12801,109 @@
Parameters:
-
Returns:
+
+ The rounded angle. +
-
+ + +
- Type: + Type
-number +number
+ -
- The modulus of `a` and `b` -
- -
-
-
-

paint()

+ +

setInstructions(instruction)

+ + + + + + +
+ Sets the message that appears under the webcam while it is analyzing the +palm. There will be a fade transition between the previous and new +instruction message. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
instruction + + +string + + + + The message to display. If an empty string, +it'll hide the instructions.
-
- Draws the next frame of the cookie falling animation. -
@@ -5659,7 +12938,7 @@

paintSource:
@@ -5689,28 +12968,82 @@

paintsetInstructions(instruction)

+ + + +
+ Sets the message that appears under the webcam while it is analyzing the +palm. There will be a fade transition between the previous and new +instruction message.
- - -
+ + + + + + + + +
Parameters:
-

paintEcg()

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
instruction + + +string -
- Draws the next frame of the fake heartbeat ECG graph animation. Once -`frameId` is set to `null`, the animation stops. -This should be display refresh rate independent. -
+ +
The message to display. If an empty string, +it'll hide the instructions.
+ @@ -5745,7 +13078,7 @@

paintEcgSource:
@@ -5775,30 +13108,84 @@

paintEcg -
-

pick(options) → {T}

+ +

speakFortune(fortune)

+
- Randomly selects an item in the given list. + Reads out the fortune using speech synthesis
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
fortune + + +string + + + + What the fortune to be read out is
+ + + + + +
@@ -5828,7 +13215,7 @@

pickSource:
@@ -5843,6 +13230,42 @@

pickspeakFortune(fortune)

+ + + + + + +
+ Reads out the fortune using speech synthesis +
+ + + + + @@ -5872,13 +13295,13 @@
Parameters:
- options + fortune -ArrayLike.<T> +string @@ -5888,10 +13311,7 @@
Parameters:
- - List of options to choose from. - - + What the fortune to be read out is @@ -5903,57 +13323,90 @@
Parameters:
+
+ + + + + + + + + + + + + + + -
-
Returns:
+ - + +
Source:
+
+ -
-
- Type: -
-
- -T + + -
+
-
- The randomly chosen option -
- -
-

+ + + + + + + + + + + + + + -
- + + + +

(async) startCamera()

+ + + + + + +
+ Handler for the "Begin" button that requests for camera access and turns on +the webcam. +
+ + + -

populateVoiceList()

- -
- Speech synthesis API, adds options for different voices to read out fortune using voice synthesis -
@@ -5988,7 +13441,7 @@

popu
Source:
@@ -6018,30 +13471,36 @@

popu - - - -

-
-

prefersReducedMotion() → {boolean}

+ +

(async) startCamera()

+
- Determines whether the user has `prefers-reduced-motion` enabled. + Handler for the "Begin" button that requests for camera access and turns on +the webcam.
+ + + + + + + +
@@ -6071,7 +13530,7 @@

p
Source:
@@ -6101,51 +13560,102 @@

p - -
-
Returns:
- + -
-
- Type: -
-
- -boolean + + + +

textGenerator(leftSign, rightSign) → {string}

+ + -
-
-
- Whether to reduce motion. +
+ Generates the text describing the romantic compatibility between two zodiac signs.
+ + + + + + + + +
Parameters:
-
+ + + + + + + + + - - -
+
+ + + + -

randomize()

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
leftSign + + +string + + + + The left wheel's zodiac sign.
rightSign + + +string -
- Event handler for the "Randomize" button. Clicks a random card to navigate to -the corresponding page. -
+ +
The right wheel's zodiac sign.
+ @@ -6180,7 +13690,7 @@

randomizeSource:
@@ -6205,75 +13715,49 @@

randomizeReturns:

- - - - - - - -

- -
- - - -

reset(state)

- - - - - -
- Stops the current animation and resets all animatable parts of the app to the -specified view (`state`). +
+ The generated text.
+
+
+ Type +
+
+ +string -
- - - - - - +
+
- - - - - + + - +

textGenerator(leftSign, rightSign) → {string}

- -
Source:
-
- - - -

+
+ Generates the text describing the romantic compatibility between two zodiac signs. +
@@ -6308,16 +13792,13 @@
Parameters:
- state + leftSign -'fortune' -| - -'cookie' +string @@ -6327,11 +13808,30 @@
Parameters:
- - Whether to set the view to showing the -fortune (`'fortune'`) or the cookie (`'cookie'`). + The left wheel's zodiac sign. + + + + + + + rightSign + + + + +string + + + + + + + + + The right wheel's zodiac sign. @@ -6343,76 +13843,106 @@
Parameters:
+
+ + + + + + + + + + + -
- - -
+ -

roundAngle(angle) → {number}

+ +
Source:
+
+ + + +

-
- Rounds the given angle to the nearest multiple of 30. -
-
- - - - - + + + + +
Returns:
+ + +
+ The generated text. +
+ + + +
+
+ Type +
+
+ +string + + +
+
- - - - - + + -
Source:
-
+

wait(delay) → {Promise.<void>}

- - -
+ +
+ A promise-ified version of `setTimeout`: returns a new `Promise` that +resolves after `delay` milliseconds. + +If the timeout is cancelled, the `Promise` will never resolve. +
@@ -6447,13 +13977,13 @@
Parameters:
- angle + delay -number +number @@ -6463,10 +13993,7 @@
Parameters:
- - The angle to round. - - + The time to wait for in milliseconds. @@ -6478,103 +14005,107 @@
Parameters:
+
+ + + + + + + -
-
Returns:
+ - + -
-
- Type: -
-
- -number + + -
-
+ + +
Source:
+
+ -
- The rounded angle. -
+ -
+ +
-
- - -
- -

setInstructions(instruction)

- -
- Sets the message that appears under the webcam while it is analyzing the -palm. There will be a fade transition between the previous and new -instruction message. -
-
- - +
Returns:
- + +
+ A new `Promise` that resolves in `delay` +milliseconds. +
- - - +
+
+ Type +
+
+ +Promise.<void> - - +
+
- - + + + + + -
Source:
-
+

wait(delay) → {Promise.<void>}

- - -
+ +
+ A promise-ified version of `setTimeout`: returns a new `Promise` that +resolves after `delay` milliseconds. + +If the timeout is cancelled, the `Promise` will never resolve. +
@@ -6609,13 +14140,13 @@
Parameters:
- instruction + delay -string +number @@ -6625,11 +14156,7 @@
Parameters:
- - The message to display. If an empty string, -it'll hide the instructions. - - + The time to wait for in milliseconds. @@ -6641,37 +14168,6 @@
Parameters:
- - - - - - - - - - -
- - -
- - - -

speakFortune(fortune)

- - - - - -
- Reads out the fortune using speech synthesis -
- - - - -
@@ -6701,7 +14197,7 @@

speakFort
Source:
@@ -6720,173 +14216,168 @@

speakFort -

Parameters:
- - - - - - - - - - - - - - - - - - - - +
Returns:
- - +
+
+ Type +
+
+ +Promise.<void> - -
- + + - -
NameTypeDescription
fortune - - -string + +
+ A new `Promise` that resolves in `delay` +milliseconds. +
- -
- What the fortune to be read out is - -
- - - - - - - - - - - -
- -
+ +

Type Definitions

-

(async) startCamera()

+ + + -
- Handler for the "Begin" button that requests for camera access and turns on -the webcam. + Defines an entry in the navigation menu.
+
Type:
+
    +
  • + +object -
    - - - - - - - - - - - - - - - - - - - - +
  • +
- - - -
Source:
-
- - - +
Properties:
-
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + -
- +
+ + -
- Generates the text describing the romantic compatibility between two zodiac signs. -
+ + + + +
NameTypeDescription
label + + +string + + The text to show for the link.
url + + +string + + The URL of the page to link to.
imageUrl + + +string -

textGenerator(leftSign, rightSign) → {string}

- + +
The URL of the image icon to show next to the +link text.
@@ -6920,7 +14411,7 @@

textGene
Source:
@@ -6936,13 +14427,38 @@

textGene + + +

-
Parameters:
+ +
+ Defines an entry in the navigation menu. +
+ + + +
Type:
+
    +
  • + +object + + +
  • +
+ + + + + +
Properties:
+ - +
@@ -6964,13 +14480,13 @@
Parameters:
- + + - + + - -
leftSignlabel -string +string @@ -6980,23 +14496,20 @@
Parameters:
-
- The left wheel's zodiac sign. - - The text to show for the link.
rightSignurl -string +string @@ -7006,76 +14519,36 @@
Parameters:
-
- The right wheel's zodiac sign. - - The URL of the page to link to.
- - - - - - - - - - - - - - -
-
Returns:
- - - -
-
- Type: -
-
- -string - - -
-
+ + + imageUrl + -
- The generated text. -
- - -
+ + + +string + + -
- -
- + -

wait(delay) → {Promise.<void>}

+ The URL of the image icon to show next to the +link text. + - - - -
- A promise-ified version of `setTimeout`: returns a new `Promise` that -resolves after `delay` milliseconds. - -If the timeout is cancelled, the `Promise` will never resolve. -
- + + @@ -7109,7 +14582,7 @@

waitSource:
@@ -7125,13 +14598,38 @@

waitMomentumInfo

+ -
Parameters:
+
+ Stores information about the wheel momentum animation. +
+ + + +
Type:
+
    +
  • + +object + + +
  • +
+ + + + + +
Properties:
+ - +
@@ -7153,13 +14651,37 @@
Parameters:
- + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -7182,62 +14725,73 @@
Parameters:
+
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + -
-
Returns:
+ +
- -
-
- Type: -
-
- -Promise.<void> -
-
-
- A new `Promise` that resolves in `delay` -milliseconds. -
+ + +

MomentumInfo

- - +
+ Stores information about the wheel momentum animation.
- - - - -

Type Definitions

- - -
- +
Type:
+
    +
  • + +object -
    - Defines an entry in the navigation menu. -
    +
  • +
@@ -7269,13 +14823,13 @@
Properties:
- + + - - - + + - - - + + - -
delayframeId + + +number + + + + The ID of the requested frame, returned by +`window.requestAnimationFrame`, used to cancel it.
lastTime -number +number @@ -7169,10 +14691,31 @@
Parameters:
-
- The time to wait for in milliseconds. + The timestamp of the last animation frame.
angleVel + +number + + + The angular velocity of the wheel, in +degrees/ms.
labelframeId -string +number @@ -7285,22 +14839,21 @@
Properties:
-
The text to show for the link.The ID of the requested frame, returned by +`window.requestAnimationFrame`, used to cancel it.
urllastTime -string +number @@ -7310,22 +14863,20 @@
Properties:
-
The URL of the page to link to.The timestamp of the last animation frame.
imageUrlangleVel -string +number @@ -7335,12 +14886,10 @@
Properties:
-
The URL of the image icon to show next to the -link text.The angular velocity of the wheel, in +degrees/ms.
@@ -7377,7 +14926,7 @@
Properties:
Source:
@@ -7390,33 +14939,31 @@
Properties:
-
Type:
-
    -
  • - -object -
  • -
+ + +

PointerInfo

+
+ Stores information about the pointer dragging the wheel around.
- - -
-

MomentumInfo

+
Type:
+
    +
  • + +object -
    - Stores information about the wheel momentum animation. -
    +
  • +
@@ -7448,13 +14995,13 @@
Properties:
- frameId + pointerId -number +number @@ -7464,23 +15011,44 @@
Properties:
- The ID of the requested frame, returned by -`window.requestAnimationFrame`, used to cancel it. + The ID of the pointer. - + + + + + initWheelAngle + + + + + +number + + + + + + + + + + The angle of the wheel when dragging +started. + - lastTime + initMouseAngle -number +number @@ -7490,22 +15058,44 @@
Properties:
- The timestamp of the last animation frame. + The polar coordinate angle of the mouse +when dragging started. - + + + + + lastMouseAngle2 + + + + + +number + + + + + + + + + + The second-to-last recorded mouse angle. + - angleVel + lastTime2 -number +number @@ -7515,11 +15105,55 @@
Properties:
- The angular velocity of the wheel, in -degrees/ms. + The timestamp of the second-to-last +`pointermove` event. - + + + + + lastMouseAngle1 + + + + + +number + + + + + + + + + + The last recorded mouse angle. + + + + + + + lastTime1 + + + + + +number + + + + + + + + + + The timestamp of the last `pointermove` event. + @@ -7557,7 +15191,7 @@
Properties:
Source:
@@ -7570,25 +15204,11 @@
Properties:
-
Type:
-
    -
  • - -object - - -
  • -
- - -
- -

PointerInfo

@@ -7600,6 +15220,18 @@

PointerInfo

+
Type:
+
    +
  • + +object + + +
  • +
+ + +
Properties:
@@ -7634,7 +15266,7 @@
Properties:
-number +number @@ -7647,8 +15279,6 @@
Properties:
The ID of the pointer. - - @@ -7659,7 +15289,7 @@
Properties:
-number +number @@ -7673,8 +15303,6 @@
Properties:
started. - - @@ -7685,7 +15313,7 @@
Properties:
-number +number @@ -7699,8 +15327,6 @@
Properties:
when dragging started. - - @@ -7711,7 +15337,7 @@
Properties:
-number +number @@ -7724,8 +15350,6 @@
Properties:
The second-to-last recorded mouse angle. - - @@ -7736,7 +15360,7 @@
Properties:
-number +number @@ -7750,8 +15374,6 @@
Properties:
`pointermove` event. - - @@ -7762,7 +15384,7 @@
Properties:
-number +number @@ -7775,8 +15397,6 @@
Properties:
The last recorded mouse angle. - - @@ -7787,7 +15407,7 @@
Properties:
-number +number @@ -7800,8 +15420,6 @@
Properties:
The timestamp of the last `pointermove` event. - - @@ -7838,7 +15456,7 @@
Properties:
Source:
@@ -7851,21 +15469,8 @@
Properties:
-
Type:
-
    -
  • - -object - - -
  • -
- - - -
@@ -7880,13 +15485,17 @@
Type:

+ +
- - + + \ No newline at end of file diff --git a/JSDOCs/home-page_script.js.html b/JSDOCs/home-page_script.js.html index b74d6e69..380a346a 100644 --- a/JSDOCs/home-page_script.js.html +++ b/JSDOCs/home-page_script.js.html @@ -2,35 +2,22 @@ - - home-page/script.js - Documentation + JSDoc: Source: home-page/script.js - - + + - - - - - - - - +
- -

home-page/script.js

- + +

Source: home-page/script.js

@@ -70,13 +57,17 @@

home-page/script.js

+ +
- - + + diff --git a/JSDOCs/index.html b/JSDOCs/index.html index eaf79bcb..6b383c30 100644 --- a/JSDOCs/index.html +++ b/JSDOCs/index.html @@ -2,52 +2,141 @@ - - Home - Documentation + JSDoc: Home - - + + - + - - +
- +

Home

- + + + + + + + +

+ + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +

source/common/index.js

+ + +
+ +
+
+ + +
A JavaScript file that is included on every page. If we want to apply a +script onto every page for consistency, this is the place to do so.
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + -
+ +
Source:
+
+ + + +
+ + + +
+ + + + + + + + + + +
+
@@ -59,9 +148,7 @@
-

- common/index.js -

+

source/common/index.js

@@ -128,7 +215,9 @@

- + + + @@ -153,9 +242,7 @@

-

- common/nav.js -

+

source/common/nav.js

@@ -222,7 +309,196 @@

- + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +

source/common/nav.js

+ + +
+ +
+
+ + +
Creates a navigation menu that gets added to all pages on the web app, +linking all pages with each other.
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + +
+ +
+ +

source/love-compatibility/data/data-array.js

+ + +
+ +
+
+ + +
contains data arrays related to love compatibility (zodiac wheel order, dates, and romantic pairing messages).
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + +
+ + + + + + + + + + @@ -247,9 +523,100 @@

-

- utils.js -

+

source/love-compatibility/data/data-array.js

+ + +
+ +
+
+ + +
contains data arrays related to love compatibility (zodiac wheel order, dates, and romantic pairing messages).
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + +
+ +

+ + + + + + + +
+ +
+ +

source/utils.js

@@ -316,7 +683,103 @@

- + + + + + + + + + + + + + + + +

+ + + + + + + +
+ +
+ +

source/utils.js

+ + +
+ +
+
+ + +
Utility functions. Conveniently, these functions are good candidates +for unit tests.
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + +
+ + + + + + + + + + @@ -336,13 +799,17 @@

+ +
- - + + \ No newline at end of file diff --git a/JSDOCs/love-compatibility_data_data-array.js.html b/JSDOCs/love-compatibility_data_data-array.js.html index e746e5cf..587727da 100644 --- a/JSDOCs/love-compatibility_data_data-array.js.html +++ b/JSDOCs/love-compatibility_data_data-array.js.html @@ -2,35 +2,22 @@ - - love-compatibility/data/data-array.js - Documentation + JSDoc: Source: love-compatibility/data/data-array.js - - + + - - - - - - - - +
- -

love-compatibility/data/data-array.js

- + +

Source: love-compatibility/data/data-array.js

@@ -40,6 +27,10 @@

love-compatibility/data/data-array.js

/**
+ * @file contains data arrays related to love compatibility (zodiac wheel order, dates, and romantic pairing messages).
+ */
+
+/**
  * The order of the zodiacs along a wheel.
  * @type {string[]}
  */
@@ -99,7 +90,7 @@ 

love-compatibility/data/data-array.js

], [ "Aries and Virgo", - "The combination of an Aries and a Virgo in a romantic relationship can present both challenges and opportunities. Aries is a fire sign known for their passion, enthusiasm, and impulsiveness, while Virgo is an earth sign characterized by their practicality, attention to detail, and analytical nature. These two signs have contrasting qualities, which can create a unique dynamic in their romantic connection. In this relationship, Aries may be attracted to Virgo's intelligence, groundedness, and dedication. Virgo, on the other hand, may appreciate Aries' energy, spontaneity, and boldness. However, their differing approaches to life can lead to conflicts. Aries tends to be more impulsive and action-oriented, while Virgo is more methodical and cautious. Communication and understanding are crucial for this pairing. Aries needs to be mindful of Virgo's need for structure and precision, while Virgo should try to embrace Aries' adventurous spirit. Finding a balance between Aries' passion and Virgo's practicality is key to nurturing a healthy and harmonious romance.", + "The romantic relationship between Aries and Virgo can present both challenges and opportunities. Aries is a fire sign known for their passion, enthusiasm, and impulsiveness, while Virgo is an earth sign characterized by their practicality, attention to detail, and analytical nature. These contrasting qualities can create a unique dynamic in their romantic connection. In this relationship, Aries may be attracted to Virgo's intelligence, groundedness, and dedication. Virgo, on the other hand, may appreciate Aries' energy, spontaneity, and boldness. However, their differing approaches to life can lead to conflicts. Aries tends to be more impulsive and action-oriented, while Virgo is more methodical and cautious. Communication and understanding are crucial for this pairing. Aries needs to be mindful of Virgo's need for structure and precision, while Virgo should try to embrace Aries' adventurous spirit. Finding a balance between Aries' passion and Virgo's practicality is key to nurturing a healthy and harmonious romance.", ], [ "Aries and Libra", @@ -223,11 +214,11 @@

love-compatibility/data/data-array.js

], [ "Cancer and Capricorn", - "Cancer and Capricorn can form a complementary and stable romantic relationship. Cancer is nurturing and emotionally sensitive, while Capricorn is practical and grounded. This combination creates a dynamic where Cancer provides emotional support and a nurturing environment, while Capricorn offers stability and security. Cancer appreciates Capricorn's ambition and determination, while Capricorn admires Cancer's nurturing and caring nature. Both signs value loyalty and commitment, which forms a strong foundation for their relationship. However, Cancer's emotional nature and Capricorn's reserved demeanor can sometimes lead to misunderstandings or clashes. Cancer may perceive Capricorn as emotionally distant, while Capricorn may find Cancer's mood swings challenging. It's important for both partners to communicate openly, express their needs, and find a balance between emotional expression and practicality. When they work together, Cancer and Capricorn can build a loving and secure romantic bond.", + "Cancer and Capricorn can form a stable and complementary romantic relationship. Cancer is nurturing and emotionally sensitive, providing emotional support and a caring environment. Capricorn, on the other hand, is practical and grounded, offering stability and security. Both signs value loyalty and commitment, laying a strong foundation for their relationship. Cancer admires Capricorn's ambition and determination, while Capricorn appreciates Cancer’s nurturing qualities. However, their contrasting natures can lead to challenges: Cancer may see Capricorn as emotionally distant, and Capricorn might find Cancer's mood swings challenging. For a harmonious relationship, it’s crucial they communicate openly, express their needs, and find a balance between emotional expression and practicality. By working together, Cancer and Capricorn can forge a loving and secure bond.", ], [ "Cancer and Aquarius", - "Cancer and Aquarius have different approaches to romance, but their unique qualities can create an intriguing and dynamic relationship. Cancer is deeply emotional, nurturing, and seeks emotional security in relationships. Aquarius, on the other hand, is independent, intellectual, and values freedom and individuality. The contrasting nature of these signs can initially create challenges as Cancer seeks emotional closeness and Aquarius values personal space. However, if both partners are willing to understand and appreciate each other's differences, they can complement each other well. Cancer can provide the emotional support and care that Aquarius needs, while Aquarius can bring intellectual stimulation and innovative ideas to the relationship. Both signs are also loyal and committed, which can create a strong bond. Communication and compromise are crucial in this relationship to bridge the emotional and intellectual gaps. When Cancer and Aquarius find a balance between emotional connection and intellectual stimulation, they can form a unique and fulfilling romantic partnership.", + "Cancer and Aquarius, with their differing approaches to romance, create a dynamic and compelling relationship. Cancer, deeply emotional and nurturing, craves emotional security. In contrast, Aquarius is independenct, intellectual, and cherishes freedom and individuality. This contrast can pose initial challenges—Cancer desires closeness, while Aquarius prefers space. However, embracing and understanding these differences can lead to a complementary and strong partnership. Cancer provides the emotional support Aquarius needs, and Aquarius brings fresh perspectives and intellectual excitement. Their shared loyalty fosters a deep, committed bond. Effective communication and compromise are key, allowing them to bridge their differences. Together, Cancer and Aquarius can develop a romance that balances emotional depth with intellectual richness, forming a unique and fulfilling partnership.", ], [ "Cancer and Pisces", @@ -404,13 +395,17 @@

love-compatibility/data/data-array.js

+ +
- - + + diff --git a/JSDOCs/love-compatibility_script.js.html b/JSDOCs/love-compatibility_script.js.html index 545d9f7d..0e580512 100644 --- a/JSDOCs/love-compatibility_script.js.html +++ b/JSDOCs/love-compatibility_script.js.html @@ -2,35 +2,22 @@ - - love-compatibility/script.js - Documentation + JSDoc: Source: love-compatibility/script.js - - + + - - - - - - - - +
- -

love-compatibility/script.js

- + +

Source: love-compatibility/script.js

@@ -39,7 +26,20 @@

love-compatibility/script.js

-
import { wait } from "../utils.js";
+            
/**
+ *
+ * This file contains the logic to manage and animate two interactive zodiac wheels.
+ * It enables users to select zodiac signs using draggable wheels to determine astrological compatibility.
+ * Features include pointer events for interaction, momentum physics for wheel rotation, and dynamic update of date
+ * ranges based on wheel positions. Additional functionality manages pop-ups displaying compatibility results and guides.
+ *
+ * - utils.js: delay mechanism
+ * - zodiac-angles.js:calculate angles and zodiac signs based on date ranges.
+ *
+ * - Adds interaction capabilities to the wheels and buttons.
+ * - Manages pop-up for displaying results and instructions.
+ */
+import { wait } from "../utils.js";
 import {
   angleDiff,
   determineDateRangeLeft,
@@ -504,13 +504,17 @@ 

love-compatibility/script.js

+ +
- - + + diff --git a/JSDOCs/love-compatibility_zodiac-angles.js.html b/JSDOCs/love-compatibility_zodiac-angles.js.html index 238a870e..591b610a 100644 --- a/JSDOCs/love-compatibility_zodiac-angles.js.html +++ b/JSDOCs/love-compatibility_zodiac-angles.js.html @@ -2,35 +2,22 @@ - - love-compatibility/zodiac-angles.js - Documentation + JSDoc: Source: love-compatibility/zodiac-angles.js - - + + - - - - - - - - +
- -

love-compatibility/zodiac-angles.js

- + +

Source: love-compatibility/zodiac-angles.js

@@ -39,7 +26,22 @@

love-compatibility/zodiac-angles.js

-
// @ts-check
+            
/**
+ * zodiac-angles.js: Wheel Angle Calculations and Compatibility Functions
+ *
+ * This file contains functions to manage and calculate the orientations of zodiac wheels,
+ * translate these angles into zodiac signs, and determine compatibility between selected signs.
+ * It utilizes modular arithmetic to handle angular calculations and ensures proper mapping of angles to zodiac signs.
+ *
+ * Key unctions include: Rounding angles to nearest division, retrieving zodiac signs based on angles,
+ * calculating date ranges associated with signs for both wheels, calculating the angular difference to support wheel interaction dynamics,
+ *  determining zodiac sign pairs, and generating compatibility text.
+ *
+ * Dependencies:
+ * - utils.js: Contains utility functions such as the mod function for angle calculations.
+ * - data/data-array.js: Stores data related to zodiac orders, date ranges, and romantic compatibility text.
+ */
+// @ts-check
 
 import { mod } from "../utils.js";
 import { zodiacOrder, zodiacDateRanges, romantic } from "./data/data-array.js";
@@ -144,13 +146,17 @@ 

love-compatibility/zodiac-angles.js

+ +
- - + + diff --git a/JSDOCs/palm-reading_fortunes.js.html b/JSDOCs/palm-reading_fortunes.js.html index 7262573b..4ae6d29a 100644 --- a/JSDOCs/palm-reading_fortunes.js.html +++ b/JSDOCs/palm-reading_fortunes.js.html @@ -2,35 +2,22 @@ - - palm-reading/fortunes.js - Documentation + JSDoc: Source: palm-reading/fortunes.js - - + + - - - - - - - - +
- -

palm-reading/fortunes.js

- + +

Source: palm-reading/fortunes.js

@@ -40,6 +27,16 @@

palm-reading/fortunes.js

/**
+ * palm-readings.js: Outcomes of Palm Reading Lines
+ *
+ * This file contains arrays of strings detailing possible outcomes for various lines interpreted in palm reading.
+ * Each array contains strings that represent different outcomes based on the appearance and qualities of the respective palm lines.
+ * Each line on a person's palm is associated with different aspects of their life and personality
+ *
+ * The outcomes are used within the application to provide users with personalized readings based on the lines present on their palms.
+ */
+
+/**
  * Possible outcomes for the head line in a palm reading.
  * @type {string[]}
  */
@@ -133,13 +130,17 @@ 

palm-reading/fortunes.js

+ +
- - + + diff --git a/JSDOCs/palm-reading_script.js.html b/JSDOCs/palm-reading_script.js.html index 4772f69b..cb77d397 100644 --- a/JSDOCs/palm-reading_script.js.html +++ b/JSDOCs/palm-reading_script.js.html @@ -2,35 +2,22 @@ - - palm-reading/script.js - Documentation + JSDoc: Source: palm-reading/script.js - - + + - - - - - - - - +
- -

palm-reading/script.js

- + +

Source: palm-reading/script.js

@@ -39,7 +26,19 @@

palm-reading/script.js

-
import { heads, hearts, lifes, fates, suns } from "./fortunes.js";
+            
/**
+ * script.js: Random Fortune Generation and Display Logic
+ *
+ * This JavaScript module imports predefined fortune outcomes from the "fortunes.js" file and
+ * provides functionality to randomly select and display these fortunes based on the user's
+ * interaction with the palm reading application (head, heart,
+ * life, fate, and sun lines within user's palm reading).
+ *
+ * Dependencies:
+ * - fortunes.js: Contains arrays of possible outcomes for various palm lines.
+ */
+
+import { heads, hearts, lifes, fates, suns } from "./fortunes.js";
 
 /**
  * Generates random fortunes. Called when the app finishes analyzing the palm.
@@ -95,13 +94,17 @@ 

palm-reading/script.js

+ +
- - + + diff --git a/JSDOCs/palm-reading_webcam.js.html b/JSDOCs/palm-reading_webcam.js.html index dccde78c..9778a703 100644 --- a/JSDOCs/palm-reading_webcam.js.html +++ b/JSDOCs/palm-reading_webcam.js.html @@ -2,35 +2,22 @@ - - palm-reading/webcam.js - Documentation + JSDoc: Source: palm-reading/webcam.js - - + + - - - - - - - - +
- -

palm-reading/webcam.js

- + +

Source: palm-reading/webcam.js

@@ -332,13 +319,17 @@

palm-reading/webcam.js

+ +
- - + + diff --git a/JSDOCs/scripts/linenumber.js b/JSDOCs/scripts/linenumber.js index 8d52f7ea..4354785c 100644 --- a/JSDOCs/scripts/linenumber.js +++ b/JSDOCs/scripts/linenumber.js @@ -1,12 +1,12 @@ /*global document */ -(function() { - var source = document.getElementsByClassName('prettyprint source linenums'); - var i = 0; - var lineNumber = 0; - var lineId; - var lines; - var totalLines; - var anchorHash; +(() => { + const source = document.getElementsByClassName('prettyprint source linenums'); + let i = 0; + let lineNumber = 0; + let lineId; + let lines; + let totalLines; + let anchorHash; if (source && source[0]) { anchorHash = document.location.hash.substring(1); @@ -15,7 +15,7 @@ for (; i < totalLines; i++) { lineNumber++; - lineId = 'line' + lineNumber; + lineId = `line${lineNumber}`; lines[i].id = lineId; if (lineId === anchorHash) { lines[i].className += ' selected'; diff --git a/JSDOCs/styles/jsdoc-default.css b/JSDOCs/styles/jsdoc-default.css index c14e3b9f..7d1729dc 100644 --- a/JSDOCs/styles/jsdoc-default.css +++ b/JSDOCs/styles/jsdoc-default.css @@ -1,417 +1,307 @@ -@import url(https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,500i,500,600,600i|Roboto); - -* { - box-sizing: border-box -} - -html, body { - height: 100%; - width: 100%; -} - -body { - color: #4d4e53; - background-color: white; - margin: 0 auto; - padding: 0; - font-family: 'Source Sans Pro', Helvetica, sans-serif; - font-size: 16px; - line-height: 160%; -} - -a, -a:active { - color: #0095dd; - text-decoration: none; +@font-face { + font-family: 'Open Sans'; + font-weight: normal; + font-style: normal; + src: url('../fonts/OpenSans-Regular-webfont.eot'); + src: + local('Open Sans'), + local('OpenSans'), + url('../fonts/OpenSans-Regular-webfont.eot?#iefix') format('embedded-opentype'), + url('../fonts/OpenSans-Regular-webfont.woff') format('woff'), + url('../fonts/OpenSans-Regular-webfont.svg#open_sansregular') format('svg'); +} + +@font-face { + font-family: 'Open Sans Light'; + font-weight: normal; + font-style: normal; + src: url('../fonts/OpenSans-Light-webfont.eot'); + src: + local('Open Sans Light'), + local('OpenSans Light'), + url('../fonts/OpenSans-Light-webfont.eot?#iefix') format('embedded-opentype'), + url('../fonts/OpenSans-Light-webfont.woff') format('woff'), + url('../fonts/OpenSans-Light-webfont.svg#open_sanslight') format('svg'); +} + +html +{ + overflow: auto; + background-color: #fff; + font-size: 14px; +} + +body +{ + font-family: 'Open Sans', sans-serif; + line-height: 1.5; + color: #4d4e53; + background-color: white; +} + +a, a:visited, a:active { + color: #0095dd; + text-decoration: none; } a:hover { - text-decoration: underline -} - -p, ul, ol, blockquote { - margin-bottom: 1em; -} - -h1, h2, h3, h4, h5, h6 { - font-family: 'Roboto', sans-serif; -} - -h1, h2, h3, h4, h5, h6 { - color: #000; - font-weight: 400; - margin: 0; -} - -h1 { - font-weight: 300; - font-size: 48px; - margin: 1em 0 .5em; -} - -h1.page-title {margin-bottom: 10px;font-size: 34px;font-weight: 300;border-bottom: solid 2px #ddd;padding: .5em 0 .5em;margin-top: 0;} - -h2 { - font-size: 32px; - margin: 1.2em 0 .8em; - font-weight: bold; -} - -h3 { - /* margin-top: 1em; */ - /* margin-bottom: 16px; */ - /* font-weight: bold; */ - padding: 0; - margin: 1em 0 .6em; - font-size: 28px; - /* border-bottom: 1px solid #eee; */ - /* padding-bottom: 15px; */ -} - -h4 { - font-size: 18px; - margin: 1em 0 .2em; - color: #4d4e53; - /* border-bottom: 1px solid #eee; */ - padding-bottom: 8px; -} - -h5, .container-overview .subsection-title { - font-size: 120%; - /* letter-spacing: -0.01em; */ - margin: 20px 0 5px; + text-decoration: underline; } -h6 { - font-size: 100%; - letter-spacing: -0.01em; - margin: 6px 0 3px 0; - font-style: italic; +header +{ + display: block; + padding: 0px 4px; } tt, code, kbd, samp { - font-family: Consolas, Monaco, 'Andale Mono', monospace; - background: #f4f4f4; - padding: 1px 5px; - border-radius: 5px; - font-size: 14px; -} - -blockquote { - display: block; - border-left: 4px solid #eee; - margin: 0; - padding-left: 1em; - color: #888; + font-family: Consolas, Monaco, 'Andale Mono', monospace; } .class-description { - font-size: 130%; - line-height: 140%; - margin-bottom: 1em; - margin-top: 1em; + font-size: 130%; + line-height: 140%; + margin-bottom: 1em; + margin-top: 1em; } .class-description:empty { - margin: 0 + margin: 0; } -/** Container **/ #main { - float: right; - min-width: 360px; - width: calc(100% - 250px); - padding: 0 30px 20px 30px; -} - -header { - display: block -} - -section { - display: block; - background-color: #fff; - padding: 0; -} - -.variation { - display: none -} - -.signature-attributes { - font-size: 60%; - color: #aaa; - font-style: italic; - font-weight: lighter; -} - -/** Readme **/ - -.readme { - font-size: 16px; -} - -.readme h1, -.readme h2, -.readme h3, -.readme h4, -.readme h5 { - margin-top: 1em; - margin-bottom: 16px; - font-weight: bold; - padding: 0; -} - -.readme h1 { - font-size: 2em; - padding-bottom: 0.3em; + float: left; + width: 70%; } -.readme h2 { - font-size: 1.75em; - padding-bottom: 0.3em; +article dl { + margin-bottom: 40px; } -.readme h3 { - font-size: 1.5em; - background-color: transparent; -} - -.readme h4 { - font-size: 1.25em; -} - -.readme h5 { - font-size: 1em; -} - -.readme img { +article img { max-width: 100%; } -.readme ul, .readme ol { - padding-left: 2em; +section +{ + display: block; + background-color: #fff; + padding: 12px 24px; + border-bottom: 1px solid #ccc; + margin-right: 30px; } -.readme pre > code { - font-size: 0.85em; +.variation { + display: none; } -.readme table { - margin-bottom: 1em; - border-collapse: collapse; - border-spacing: 0; +.signature-attributes { + font-size: 60%; + color: #aaa; + font-style: italic; + font-weight: lighter; +} + +nav +{ + display: block; + float: right; + margin-top: 28px; + width: 30%; + box-sizing: border-box; + border-left: 1px solid #ccc; + padding-left: 16px; +} + +nav ul { + font-family: 'Lucida Grande', 'Lucida Sans Unicode', arial, sans-serif; + font-size: 100%; + line-height: 17px; + padding: 0; + margin: 0; + list-style-type: none; } -.readme table tr { - background-color: #fff; - border-top: 1px solid #ccc; +nav ul a, nav ul a:visited, nav ul a:active { + font-family: Consolas, Monaco, 'Andale Mono', monospace; + line-height: 18px; + color: #4D4E53; } -.readme table th, -.readme table td { - padding: 6px 13px; - border: 1px solid #ddd; +nav h3 { + margin-top: 12px; } -.readme table tr:nth-child(2n) { - background-color: #f8f8f8; +nav li { + margin-top: 6px; } -/** Nav **/ -nav { - float: left; - display: block; - width: 250px; - background: #fff; - overflow: auto; - position: fixed; - height: 100%; - padding: 10px; - border-right: 1px solid #eee; - /* box-shadow: 0 0 3px rgba(0,0,0,0.1); */ +footer { + display: block; + padding: 6px; + margin-top: 12px; + font-style: italic; + font-size: 90%; } -nav li { - list-style: none; - padding: 0; - margin: 0; +h1, h2, h3, h4 { + font-weight: 200; + margin: 0; } -.nav-heading { - margin-top: 10px; - font-weight: bold; +h1 +{ + font-family: 'Open Sans Light', sans-serif; + font-size: 48px; + letter-spacing: -2px; + margin: 12px 24px 20px; } -.nav-heading a { - color: #888; - font-size: 14px; - display: inline-block; +h2, h3.subsection-title +{ + font-size: 30px; + font-weight: 700; + letter-spacing: -1px; + margin-bottom: 12px; } -.nav-item-type { - /* margin-left: 5px; */ - width: 18px; - height: 18px; - display: inline-block; - text-align: center; - border-radius: 0.2em; - margin-right: 5px; - font-weight: bold; - line-height: 20px; - font-size: 13px; +h3 +{ + font-size: 24px; + letter-spacing: -0.5px; + margin-bottom: 12px; } -.type-function { - background: #B3E5FC; - color: #0288D1; +h4 +{ + font-size: 18px; + letter-spacing: -0.33px; + margin-bottom: 12px; + color: #4d4e53; } -.type-class { - background: #D1C4E9; - color: #4527A0; +h5, .container-overview .subsection-title +{ + font-size: 120%; + font-weight: bold; + letter-spacing: -0.01em; + margin: 8px 0 3px 0; } -.type-member { - background: #C8E6C9; - color: #388E3C; +h6 +{ + font-size: 100%; + letter-spacing: -0.01em; + margin: 6px 0 3px 0; + font-style: italic; } -.type-module { - background: #E1BEE7; - color: #7B1FA2; +table +{ + border-spacing: 0; + border: 0; + border-collapse: collapse; } - -/** Footer **/ -footer { - color: hsl(0, 0%, 28%); - margin-left: 250px; - display: block; - padding: 30px; - font-style: italic; - font-size: 90%; - border-top: 1px solid #eee; +td, th +{ + border: 1px solid #ddd; + margin: 0px; + text-align: left; + vertical-align: top; + padding: 4px 6px; + display: table-cell; } -.ancestors { - color: #999 +thead tr +{ + background-color: #ddd; + font-weight: bold; } -.ancestors a { - color: #999 !important; - text-decoration: none; +th { border-right: 1px solid #aaa; } +tr > th:last-child { border-right: 1px solid #ddd; } + +.ancestors, .attribs { color: #999; } +.ancestors a, .attribs a +{ + color: #999 !important; + text-decoration: none; } -.clear { - clear: both +.clear +{ + clear: both; } -.important { - font-weight: bold; - color: #950B02; +.important +{ + font-weight: bold; + color: #950B02; } .yes-def { - text-indent: -1000px + text-indent: -1000px; } .type-signature { - color: #aaa + color: #aaa; } .name, .signature { - font-family: Consolas, Monaco, 'Andale Mono', monospace -} - -.details { - margin-top: 14px; - border-left: 2px solid #DDD; - line-height: 30px; -} - -.details dt { - width: 120px; - float: left; - padding-left: 10px; -} - -.details dd { - margin-left: 70px + font-family: Consolas, Monaco, 'Andale Mono', monospace; } -.details ul { - margin: 0 -} - -.details ul { - list-style-type: none -} - -.details li { - margin-left: 30px -} - -.details pre.prettyprint { - margin: 0 -} - -.details .object-value { - padding-top: 0 -} +.details { margin-top: 14px; border-left: 2px solid #DDD; } +.details dt { width: 120px; float: left; padding-left: 10px; padding-top: 6px; } +.details dd { margin-left: 70px; } +.details ul { margin: 0; } +.details ul { list-style-type: none; } +.details li { margin-left: 30px; padding-top: 6px; } +.details pre.prettyprint { margin: 0 } +.details .object-value { padding-top: 0; } .description { - margin-bottom: 1em; - margin-top: 1em; + margin-bottom: 1em; + margin-top: 1em; } -.code-caption { - font-style: italic; - font-size: 107%; - margin: 0; +.code-caption +{ + font-style: italic; + font-size: 107%; + margin: 0; } -.prettyprint { - font-size: 13px; - border: 1px solid #ddd; - border-radius: 3px; - box-shadow: 0 1px 3px hsla(0, 0%, 0%, 0.05); - overflow: auto; +.source +{ + border: 1px solid #ddd; + width: 80%; + overflow: auto; } .prettyprint.source { - width: inherit + width: inherit; } -.prettyprint code { - font-size: 12px; - line-height: 18px; - display: block; - background-color: #fff; - color: #4D4E53; +.source code +{ + font-size: 100%; + line-height: 18px; + display: block; + padding: 4px 12px; + margin: 0; + background-color: #fff; + color: #4D4E53; } -.prettyprint code:empty:before { - content: ''; -} - -.prettyprint > code { - padding: 15px -} - -.prettyprint .linenums code { - padding: 0 15px -} - -.prettyprint .linenums li:first-of-type code { - padding-top: 15px -} - -.prettyprint code span.line { - display: inline-block +.prettyprint code span.line +{ + display: inline-block; } -.prettyprint.linenums { +.prettyprint.linenums +{ padding-left: 70px; -webkit-user-select: none; -moz-user-select: none; @@ -419,274 +309,50 @@ footer { user-select: none; } -.prettyprint.linenums ol { - padding-left: 0 +.prettyprint.linenums ol +{ + padding-left: 0; } -.prettyprint.linenums li { - border-left: 3px #ddd solid +.prettyprint.linenums li +{ + border-left: 3px #ddd solid; } -.prettyprint.linenums li.selected, .prettyprint.linenums li.selected * { - background-color: lightyellow +.prettyprint.linenums li.selected, +.prettyprint.linenums li.selected * +{ + background-color: lightyellow; } -.prettyprint.linenums li * { - -webkit-user-select: text; - -moz-user-select: text; - -ms-user-select: text; - user-select: text; -} - -.params, .props { - border-spacing: 0; - border: 1px solid #ddd; - border-collapse: collapse; - border-radius: 3px; - box-shadow: 0 1px 3px rgba(0,0,0,0.1); - width: 100%; - font-size: 14px; - /* margin-left: 15px; */ +.prettyprint.linenums li * +{ + -webkit-user-select: text; + -moz-user-select: text; + -ms-user-select: text; + user-select: text; } .params .name, .props .name, .name code { - color: #4D4E53; - font-family: Consolas, Monaco, 'Andale Mono', monospace; - font-size: 100%; -} - -.params td, .params th, .props td, .props th { - margin: 0px; - text-align: left; - vertical-align: top; - padding: 10px; - display: table-cell; -} - -.params td { - border-top: 1px solid #eee -} - -.params thead tr, .props thead tr { - background-color: #fff; - font-weight: bold; -} - -.params .params thead tr, .props .props thead tr { - background-color: #fff; - font-weight: bold; + color: #4D4E53; + font-family: Consolas, Monaco, 'Andale Mono', monospace; + font-size: 100%; } -.params td.description > p:first-child, .props td.description > p:first-child { - margin-top: 0; - padding-top: 0; +.params td.description > p:first-child, +.props td.description > p:first-child +{ + margin-top: 0; + padding-top: 0; } -.params td.description > p:last-child, .props td.description > p:last-child { - margin-bottom: 0; - padding-bottom: 0; -} - -dl.param-type { - /* border-bottom: 1px solid hsl(0, 0%, 87%); */ - margin: 0; - padding: 0; - font-size: 16px; -} - -.param-type dt, .param-type dd { - display: inline-block -} - -.param-type dd { - font-family: Consolas, Monaco, 'Andale Mono', monospace; - display: inline-block; - padding: 0; - margin: 0; - font-size: 14px; +.params td.description > p:last-child, +.props td.description > p:last-child +{ + margin-bottom: 0; + padding-bottom: 0; } .disabled { - color: #454545 -} - -/* navicon button */ -.navicon-button { - display: none; - position: relative; - padding: 2.0625rem 1.5rem; - transition: 0.25s; - cursor: pointer; - user-select: none; - opacity: .8; -} -.navicon-button .navicon:before, .navicon-button .navicon:after { - transition: 0.25s; -} -.navicon-button:hover { - transition: 0.5s; - opacity: 1; -} -.navicon-button:hover .navicon:before, .navicon-button:hover .navicon:after { - transition: 0.25s; -} -.navicon-button:hover .navicon:before { - top: .825rem; -} -.navicon-button:hover .navicon:after { - top: -.825rem; -} - -/* navicon */ -.navicon { - position: relative; - width: 2.5em; - height: .3125rem; - background: #000; - transition: 0.3s; - border-radius: 2.5rem; -} -.navicon:before, .navicon:after { - display: block; - content: ""; - height: .3125rem; - width: 2.5rem; - background: #000; - position: absolute; - z-index: -1; - transition: 0.3s 0.25s; - border-radius: 1rem; -} -.navicon:before { - top: .625rem; -} -.navicon:after { - top: -.625rem; -} - -/* open */ -.nav-trigger:checked + label:not(.steps) .navicon:before, -.nav-trigger:checked + label:not(.steps) .navicon:after { - top: 0 !important; -} - -.nav-trigger:checked + label .navicon:before, -.nav-trigger:checked + label .navicon:after { - transition: 0.5s; -} - -/* Minus */ -.nav-trigger:checked + label { - transform: scale(0.75); -} - -/* × and + */ -.nav-trigger:checked + label.plus .navicon, -.nav-trigger:checked + label.x .navicon { - background: transparent; -} - -.nav-trigger:checked + label.plus .navicon:before, -.nav-trigger:checked + label.x .navicon:before { - transform: rotate(-45deg); - background: #FFF; -} - -.nav-trigger:checked + label.plus .navicon:after, -.nav-trigger:checked + label.x .navicon:after { - transform: rotate(45deg); - background: #FFF; -} - -.nav-trigger:checked + label.plus { - transform: scale(0.75) rotate(45deg); -} - -.nav-trigger:checked ~ nav { - left: 0 !important; -} - -.nav-trigger:checked ~ .overlay { - display: block; -} - -.nav-trigger { - position: fixed; - top: 0; - clip: rect(0, 0, 0, 0); -} - -.overlay { - display: none; - position: fixed; - top: 0; - bottom: 0; - left: 0; - right: 0; - width: 100%; - height: 100%; - background: hsla(0, 0%, 0%, 0.5); - z-index: 1; -} - -.section-method { - margin-bottom: 30px; - padding-bottom: 30px; - border-bottom: 1px solid #eee; -} - -@media only screen and (min-width: 320px) and (max-width: 680px) { - body { - overflow-x: hidden; - } - - nav { - background: #FFF; - width: 250px; - height: 100%; - position: fixed; - top: 0; - right: 0; - bottom: 0; - left: -250px; - z-index: 3; - padding: 0 10px; - transition: left 0.2s; - } - - .navicon-button { - display: inline-block; - position: fixed; - top: 1.5em; - right: 0; - z-index: 2; - } - - #main { - width: 100%; - min-width: 360px; - } - - #main h1.page-title { - margin: 1em 0; - } - - #main section { - padding: 0; - } - - footer { - margin-left: 0; - } -} - -@media only print { - nav { - display: none; - } - - #main { - float: none; - width: 100%; - } + color: #454545; } diff --git a/JSDOCs/styles/prettify-jsdoc.css b/JSDOCs/styles/prettify-jsdoc.css index 834a866d..5a2526e3 100644 --- a/JSDOCs/styles/prettify-jsdoc.css +++ b/JSDOCs/styles/prettify-jsdoc.css @@ -9,7 +9,7 @@ /* string content */ .str { - color: hsl(104, 100%, 24%); + color: #006400; font-weight: normal; font-style: normal; } diff --git a/JSDOCs/styles/prettify-tomorrow.css b/JSDOCs/styles/prettify-tomorrow.css index 81e74d13..b6f92a78 100644 --- a/JSDOCs/styles/prettify-tomorrow.css +++ b/JSDOCs/styles/prettify-tomorrow.css @@ -9,35 +9,35 @@ @media screen { /* string content */ .str { - color: hsl(104, 100%, 24%); } + color: #718c00; } /* a keyword */ .kwd { - color: hsl(240, 100%, 50%); } + color: #8959a8; } /* a comment */ .com { - color: hsl(0, 0%, 60%); } + color: #8e908c; } /* a type name */ .typ { - color: hsl(240, 100%, 32%); } + color: #4271ae; } /* a literal value */ .lit { - color: hsl(240, 100%, 40%); } + color: #f5871f; } /* punctuation */ .pun { - color: #000000; } + color: #4d4d4c; } /* lisp open bracket */ .opn { - color: #000000; } + color: #4d4d4c; } /* lisp close bracket */ .clo { - color: #000000; } + color: #4d4d4c; } /* a markup tag name */ .tag { diff --git a/JSDOCs/utils.js.html b/JSDOCs/utils.js.html index 3b11848b..0eb2efb8 100644 --- a/JSDOCs/utils.js.html +++ b/JSDOCs/utils.js.html @@ -2,35 +2,22 @@ - - utils.js - Documentation + JSDoc: Source: utils.js - - + + - - - - - - - - +
- -

utils.js

- + +

Source: utils.js

@@ -104,13 +91,17 @@

utils.js

+ +
- - + + diff --git a/README.md b/README.md index 1e49bc33..0c38b2ed 100644 --- a/README.md +++ b/README.md @@ -2,14 +2,58 @@ Improving the student experience by alleviating decision-making anxiety. Brought to you by [20/20 Visionaries](./admin/team.md) (CSE 110 SP23 Team 20). -[![Try it out button](./docs/images/try-button.svg)](https://cse110-sp23-group20.github.io/fortune-teller/source/home-page/) -[![Documentation button](./docs/images/docs-button.svg)](https://cse110-sp23-group20.github.io/fortune-teller/JSDOCs/) +[![Try it out button](./docs/images/try-button.svg)](https://20-20reenvisioned.github.io/Refactored-fortune-teller/source/home-page/) +[![Documentation button](./docs/images/docs-button.svg)](https://20-20reenvisioned.github.io/Refactored-fortune-teller/JSDOCs/) [![Team page button](./docs/images/team-page-button.svg)](./admin/team.md) ## Development +### Getting Started + +You will need Node.js and npm for, among other things, running tests (Jest), JS statis code analysis (ESLint) and code formatting (Prettier). For installation instructions see [the official documentation](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm). + +After you've successfully installed Node.js and npm and verified installation, simply run the following to initialize npm for the project: + +```sh +npm install +``` + +### Code Formatting + +To run Prettier to format your code (and to make sure you earn that check-mark when you push to the Github repository), simply run the following: + +```sh +npm run format +``` + +### Testing + By default, our test suite runs E2E tests on the live version of the site. To specify where your local version is, set the `BASE` environment variable. For example: ```sh $ BASE=http://127.0.0.1:5502 npm test ``` + +If you have Python3 installed, you can start a simple http server to run the E2E tests by simply navigating to the repo root folder and then running: + +```sh +python3 -m http.server +``` + +Then in a seperate window run: + +```sh +BASE=http://127.0.0.1:8000 npm test +``` + +### Checking for JavaScript Problems + +To check for any code quality or coding style issues using ESLint, just run the following: + +```sh +npm run lint +``` + +## Additional Documentation + +Additional documentation is available in the [wiki](https://github.com/20-20REENVISIONED/Refactored-fortune-teller/wiki). diff --git a/__tests__/consts.js b/__tests__/consts.js index 2f72c590..67322ce6 100644 --- a/__tests__/consts.js +++ b/__tests__/consts.js @@ -1,4 +1,5 @@ /* global process */ export const BASE = - process.env.BASE || "https://cse110-sp23-group20.github.io/fortune-teller"; + process.env.BASE || + "https://20-20reenvisioned.github.io/Refactored-fortune-teller"; diff --git a/__tests__/home-page.test.js b/__tests__/home-page.test.js index 2c8bce22..21fb9f61 100644 --- a/__tests__/home-page.test.js +++ b/__tests__/home-page.test.js @@ -13,7 +13,7 @@ describe("Basic unit Tests for the Home Page", () => { const hrefValue = await hrefProperty.jsonValue(); expect(hrefValue).toBe( - "https://github.com/cse110-sp23-group20/fortune-teller/blob/main/admin/team.md" + "https://github.com/20-20REENVISIONED/Refactored-fortune-teller/blob/main/admin/team.md" ); }); @@ -30,7 +30,7 @@ describe("Basic unit Tests for the Home Page", () => { // Assert that the current URL matches the expected destination expect(currentURL).toBe( - "https://github.com/cse110-sp23-group20/fortune-teller/blob/main/admin/team.md" + "https://github.com/20-20REENVISIONED/Refactored-fortune-teller/blob/main/admin/team.md" ); }); }); diff --git a/admin/meetings/050224-features-brainstorm.md b/admin/meetings/050224-features-brainstorm.md new file mode 100644 index 00000000..5454fef3 --- /dev/null +++ b/admin/meetings/050224-features-brainstorm.md @@ -0,0 +1,81 @@ +# 💡 Ideas for New Features + +- [L] **Setup of a CI/CD pipeline** + - Automatically flattens HTML, CSS, and JavaScript files into one HTML file to reduce latency (ping-ponging). Maybe use something like this. +- [M] **Make site installable as a Progressive Web App** + + - {uncertainty: low} Provide offline access. + +- [M] **Setup for site translation** + + - {uncertainty: high} Allow the site to be translated into various languages. + - Possible CI/CD pipeline that generates an `en` folder, `zh` folder, etc., by reading localization overrides for text. + - Alternatively, this can be done locally in JavaScript with a JSON containing localizations. + - Support the usage of different writing modes for applicable languages. + +- [L/M] **Add a fortune-telling feature** + + - {uncertainty: high} Use ChatGPT to generate a response for the user. + - Implement/configure a backend for managing ChatGPT calls. + +- [L] **Add background music** + + - {uncertainty: high} Play background music when certain actions are taken on the website. + - Could use voice recognition API (target music by age) and/or Suno (music generation). + +- [L] **Add opening animation** + + - {uncertainty: high} Implement a CSS animation for the opening sequence. + +- [L] **Add voiceover via text-to-speech** + + - {uncertainty: high} Provide voiceover for portions of the website. + +- **Add user settings** + - {uncertainty: low} Allow users to change the following: + - Language + - Enable/disable music + - Theme/color background (match system light/dark mode) + - User feedback option (consider Google Analytics) + - Reference user’s font settings/increase font size + +# 🪲 Bugs That Probably Need to Be Fixed + +- [H, Easy] **Notify users with JavaScript off** + + - Inform users that the site will not work (probably a `

+ +
+ + +
- Love Compatibility Card + + + + Love Compatibility Card + Love Compatibility @@ -47,7 +69,11 @@

Envision Your Destiny

- Fortune Cookie Card + + + + Fortune Cookie Card + Fortune Cookie @@ -57,7 +83,11 @@

Envision Your Destiny

- Palm Reading Card + + + + Palm Reading Card + Palm Reading @@ -78,7 +108,7 @@

Can't decide?

Improving the student experience by alleviating decision-making anxiety since 2023.
GitHub diff --git a/source/home-page/styles.css b/source/home-page/styles.css index 04404ebf..da0bff49 100644 --- a/source/home-page/styles.css +++ b/source/home-page/styles.css @@ -1,7 +1,7 @@ /* used to set background image*/ body { - background-image: url("../common/Images/Background.png"); + background-image: url("../common/Images/Background.jpg"); display: flex; flex-direction: column; } diff --git a/source/love-compatibility/data/data-array.js b/source/love-compatibility/data/data-array.js index bd983080..ab0227ec 100644 --- a/source/love-compatibility/data/data-array.js +++ b/source/love-compatibility/data/data-array.js @@ -1,3 +1,7 @@ +/** + * @file contains data arrays related to love compatibility (zodiac wheel order, dates, and romantic pairing messages). + */ + /** * The order of the zodiacs along a wheel. * @type {string[]} @@ -58,7 +62,7 @@ const romantic = new Map([ ], [ "Aries and Virgo", - "The combination of an Aries and a Virgo in a romantic relationship can present both challenges and opportunities. Aries is a fire sign known for their passion, enthusiasm, and impulsiveness, while Virgo is an earth sign characterized by their practicality, attention to detail, and analytical nature. These two signs have contrasting qualities, which can create a unique dynamic in their romantic connection. In this relationship, Aries may be attracted to Virgo's intelligence, groundedness, and dedication. Virgo, on the other hand, may appreciate Aries' energy, spontaneity, and boldness. However, their differing approaches to life can lead to conflicts. Aries tends to be more impulsive and action-oriented, while Virgo is more methodical and cautious. Communication and understanding are crucial for this pairing. Aries needs to be mindful of Virgo's need for structure and precision, while Virgo should try to embrace Aries' adventurous spirit. Finding a balance between Aries' passion and Virgo's practicality is key to nurturing a healthy and harmonious romance.", + "The romantic relationship between Aries and Virgo can present both challenges and opportunities. Aries is a fire sign known for their passion, enthusiasm, and impulsiveness, while Virgo is an earth sign characterized by their practicality, attention to detail, and analytical nature. These contrasting qualities can create a unique dynamic in their romantic connection. In this relationship, Aries may be attracted to Virgo's intelligence, groundedness, and dedication. Virgo, on the other hand, may appreciate Aries' energy, spontaneity, and boldness. However, their differing approaches to life can lead to conflicts. Aries tends to be more impulsive and action-oriented, while Virgo is more methodical and cautious. Communication and understanding are crucial for this pairing. Aries needs to be mindful of Virgo's need for structure and precision, while Virgo should try to embrace Aries' adventurous spirit. Finding a balance between Aries' passion and Virgo's practicality is key to nurturing a healthy and harmonious romance.", ], [ "Aries and Libra", @@ -182,11 +186,11 @@ const romantic = new Map([ ], [ "Cancer and Capricorn", - "Cancer and Capricorn can form a complementary and stable romantic relationship. Cancer is nurturing and emotionally sensitive, while Capricorn is practical and grounded. This combination creates a dynamic where Cancer provides emotional support and a nurturing environment, while Capricorn offers stability and security. Cancer appreciates Capricorn's ambition and determination, while Capricorn admires Cancer's nurturing and caring nature. Both signs value loyalty and commitment, which forms a strong foundation for their relationship. However, Cancer's emotional nature and Capricorn's reserved demeanor can sometimes lead to misunderstandings or clashes. Cancer may perceive Capricorn as emotionally distant, while Capricorn may find Cancer's mood swings challenging. It's important for both partners to communicate openly, express their needs, and find a balance between emotional expression and practicality. When they work together, Cancer and Capricorn can build a loving and secure romantic bond.", + "Cancer and Capricorn can form a stable and complementary romantic relationship. Cancer is nurturing and emotionally sensitive, providing emotional support and a caring environment. Capricorn, on the other hand, is practical and grounded, offering stability and security. Both signs value loyalty and commitment, laying a strong foundation for their relationship. Cancer admires Capricorn's ambition and determination, while Capricorn appreciates Cancer’s nurturing qualities. However, their contrasting natures can lead to challenges: Cancer may see Capricorn as emotionally distant, and Capricorn might find Cancer's mood swings challenging. For a harmonious relationship, it’s crucial they communicate openly, express their needs, and find a balance between emotional expression and practicality. By working together, Cancer and Capricorn can forge a loving and secure bond.", ], [ "Cancer and Aquarius", - "Cancer and Aquarius have different approaches to romance, but their unique qualities can create an intriguing and dynamic relationship. Cancer is deeply emotional, nurturing, and seeks emotional security in relationships. Aquarius, on the other hand, is independent, intellectual, and values freedom and individuality. The contrasting nature of these signs can initially create challenges as Cancer seeks emotional closeness and Aquarius values personal space. However, if both partners are willing to understand and appreciate each other's differences, they can complement each other well. Cancer can provide the emotional support and care that Aquarius needs, while Aquarius can bring intellectual stimulation and innovative ideas to the relationship. Both signs are also loyal and committed, which can create a strong bond. Communication and compromise are crucial in this relationship to bridge the emotional and intellectual gaps. When Cancer and Aquarius find a balance between emotional connection and intellectual stimulation, they can form a unique and fulfilling romantic partnership.", + "Cancer and Aquarius, with their differing approaches to romance, create a dynamic and compelling relationship. Cancer, deeply emotional and nurturing, craves emotional security. In contrast, Aquarius is independenct, intellectual, and cherishes freedom and individuality. This contrast can pose initial challenges—Cancer desires closeness, while Aquarius prefers space. However, embracing and understanding these differences can lead to a complementary and strong partnership. Cancer provides the emotional support Aquarius needs, and Aquarius brings fresh perspectives and intellectual excitement. Their shared loyalty fosters a deep, committed bond. Effective communication and compromise are key, allowing them to bridge their differences. Together, Cancer and Aquarius can develop a romance that balances emotional depth with intellectual richness, forming a unique and fulfilling partnership.", ], [ "Cancer and Pisces", diff --git a/source/love-compatibility/images/arrow-left.avif b/source/love-compatibility/images/arrow-left.avif new file mode 100644 index 00000000..e115063a Binary files /dev/null and b/source/love-compatibility/images/arrow-left.avif differ diff --git a/source/love-compatibility/images/arrow-right.avif b/source/love-compatibility/images/arrow-right.avif new file mode 100644 index 00000000..3ec12727 Binary files /dev/null and b/source/love-compatibility/images/arrow-right.avif differ diff --git a/source/love-compatibility/images/close.avif b/source/love-compatibility/images/close.avif new file mode 100644 index 00000000..22bad15e Binary files /dev/null and b/source/love-compatibility/images/close.avif differ diff --git a/source/love-compatibility/images/close.png b/source/love-compatibility/images/close.png index 9c5b64c3..56493e7b 100644 Binary files a/source/love-compatibility/images/close.png and b/source/love-compatibility/images/close.png differ diff --git a/source/love-compatibility/images/close.webp b/source/love-compatibility/images/close.webp new file mode 100644 index 00000000..688ef33c Binary files /dev/null and b/source/love-compatibility/images/close.webp differ diff --git a/source/love-compatibility/images/zodiac-wheel.avif b/source/love-compatibility/images/zodiac-wheel.avif new file mode 100644 index 00000000..8f05f6c2 Binary files /dev/null and b/source/love-compatibility/images/zodiac-wheel.avif differ diff --git a/source/love-compatibility/images/zodiac-wheel.png b/source/love-compatibility/images/zodiac-wheel.png index c567c49a..8c98c3ed 100644 Binary files a/source/love-compatibility/images/zodiac-wheel.png and b/source/love-compatibility/images/zodiac-wheel.png differ diff --git a/source/love-compatibility/images/zodiac-wheel.webp b/source/love-compatibility/images/zodiac-wheel.webp new file mode 100644 index 00000000..3c92a0d9 Binary files /dev/null and b/source/love-compatibility/images/zodiac-wheel.webp differ diff --git a/source/love-compatibility/index.html b/source/love-compatibility/index.html index 3eaaa62a..fca5289e 100644 --- a/source/love-compatibility/index.html +++ b/source/love-compatibility/index.html @@ -1,3 +1,8 @@ + @@ -20,9 +25,17 @@ /> + + +

Love Compatibility

@@ -32,13 +45,17 @@

Love Compatibility

- left zodiac wheel + + + + left zodiac wheel +
@@ -61,13 +78,17 @@

Love Compatibility

- right zodiac wheel + + + + right zodiac wheel +
@@ -105,7 +126,11 @@

Pop-up Box