From 640bdc13a585fcb73c741698093c97e975b7e132 Mon Sep 17 00:00:00 2001 From: Sean Date: Tue, 30 May 2023 19:01:27 -0700 Subject: [PATCH 1/2] Format code --- source/FortuneCookie/index.html | 69 ++++--- source/FortuneCookie/script.js | 207 +++++++++---------- source/FortuneCookie/style.css | 29 +-- source/PalmReading/index.html | 75 +++---- source/PalmReading/style.css | 2 +- source/PalmReading/webcam.js | 44 ++-- source/Zodiac_compatibility/index.html | 33 ++- source/Zodiac_compatibility/script.js | 273 ++++++++++++------------- source/Zodiac_compatibility/styles.css | 23 +-- source/home-page/index.html | 75 ++++--- source/home-page/script.js | 16 +- source/home-page/styles.css | 132 ++++++------ specs/adrs/fortuneCookieAdr.md | 82 ++++---- 13 files changed, 534 insertions(+), 526 deletions(-) diff --git a/source/FortuneCookie/index.html b/source/FortuneCookie/index.html index 4754824c..e76fb4df 100644 --- a/source/FortuneCookie/index.html +++ b/source/FortuneCookie/index.html @@ -2,52 +2,57 @@ Fortune Cookie - - - + + +

DAILY FORTUNE COOKIE

- "Start your day by cracking a fortune cookie and finds out what your future holds..." + "Start your day by cracking a fortune cookie and finds out what your + future holds..."

- fortune cookie + fortune cookie

- + diff --git a/source/FortuneCookie/script.js b/source/FortuneCookie/script.js index d56dc213..d5791f88 100644 --- a/source/FortuneCookie/script.js +++ b/source/FortuneCookie/script.js @@ -1,115 +1,112 @@ const fortunes = [ - "Your future is bright, embrace it with open arms.", - "A wonderful surprise is coming your way.", - "Believe in yourself and you will achieve great things.", - "Your kindness will lead to good fortune.", - "The journey may be difficult, but the destination is worth it.", - "Your talents will soon be recognized and rewarded.", - "Don't be afraid to take a chance, it may lead to great things.", - "Your hard work and perseverance will pay off in the end.", - "Keep an open mind and you will find new opportunities.", - "Your positivity and optimism will bring you success.", - "You will soon experience a life-changing event.", - "Your creativity and imagination will bring you great success.", - "The best things in life are yet to come.", - "You will soon receive unexpected blessings.", - "A new friendship will bring you great happiness.", - "Your future is full of endless possibilities.", - "Good things come to those who work hard and never give up.", - "Let go of the past and embrace a bright future.", - "Your perseverance will lead to victory.", - "Your ability to adapt to change will bring you great success.", - "Your determination and hard work will pay off in the long run.", - "The journey may be tough, but the reward will be worth it.", - "Trust in your intuition and you will make the right decisions.", - "A new opportunity is on the horizon, seize it.", - "Your courage and confidence will bring you great success.", - "Your future is filled with abundance and prosperity.", - "Your greatest treasure is the love and support of those around you.", - "Your creativity will bring you great success in all areas of life.", - "Embrace change and you will find success and happiness.", - "Your positive attitude will bring you good luck and fortune." - ]; - - const fortuneButton = document.getElementById("fortune-button"); - const fortuneText = document.getElementById("fortune-text"); - const fortuneAudioCrack = document.getElementById("fortune-crack"); - const voiceToggle = document.getElementById("voice-toggle-checkbox"); + "Your future is bright, embrace it with open arms.", + "A wonderful surprise is coming your way.", + "Believe in yourself and you will achieve great things.", + "Your kindness will lead to good fortune.", + "The journey may be difficult, but the destination is worth it.", + "Your talents will soon be recognized and rewarded.", + "Don't be afraid to take a chance, it may lead to great things.", + "Your hard work and perseverance will pay off in the end.", + "Keep an open mind and you will find new opportunities.", + "Your positivity and optimism will bring you success.", + "You will soon experience a life-changing event.", + "Your creativity and imagination will bring you great success.", + "The best things in life are yet to come.", + "You will soon receive unexpected blessings.", + "A new friendship will bring you great happiness.", + "Your future is full of endless possibilities.", + "Good things come to those who work hard and never give up.", + "Let go of the past and embrace a bright future.", + "Your perseverance will lead to victory.", + "Your ability to adapt to change will bring you great success.", + "Your determination and hard work will pay off in the long run.", + "The journey may be tough, but the reward will be worth it.", + "Trust in your intuition and you will make the right decisions.", + "A new opportunity is on the horizon, seize it.", + "Your courage and confidence will bring you great success.", + "Your future is filled with abundance and prosperity.", + "Your greatest treasure is the love and support of those around you.", + "Your creativity will bring you great success in all areas of life.", + "Embrace change and you will find success and happiness.", + "Your positive attitude will bring you good luck and fortune.", +]; - - // Gets a random fortune and displays it - function showFortune() { - const randomIndex = Math.floor(Math.random() * fortunes.length); - const fortune = fortunes[randomIndex]; - fortuneText.textContent = fortune; - fortuneText.style.display = "block"; - if (voiceToggle.checked) { - speakFortune(fortune); - } - } +const fortuneButton = document.getElementById("fortune-button"); +const fortuneText = document.getElementById("fortune-text"); +const fortuneAudioCrack = document.getElementById("fortune-crack"); +const voiceToggle = document.getElementById("voice-toggle-checkbox"); - // Uses speech synthesis to read out fortune - function speakFortune(fortune) { - const speech = new SpeechSynthesisUtterance(fortune); - const option = voiceSelect.selectedOptions[0].getAttribute('data-name'); - for(let i = 0; i < voices.length; i++) - { - if(voices[i].name == option) - speech.voice = voices[i]; - } - speech.lang = "en-US"; - speech.rate = 0.8; - speech.pitch = 1.2; - window.speechSynthesis.speak(speech); +// Gets a random fortune and displays it +function showFortune() { + const randomIndex = Math.floor(Math.random() * fortunes.length); + const fortune = fortunes[randomIndex]; + fortuneText.textContent = fortune; + fortuneText.style.display = "block"; + if (voiceToggle.checked) { + speakFortune(fortune); + } +} - // Turn button back on when fortune is done being read - speech.addEventListener("end", (event) => { - fortuneButton.disabled = false; - fortuneButton.style.opacity = "1"; - }); +// Uses speech synthesis to read out fortune +function speakFortune(fortune) { + const speech = new SpeechSynthesisUtterance(fortune); + const option = voiceSelect.selectedOptions[0].getAttribute("data-name"); + for (let i = 0; i < voices.length; i++) { + if (voices[i].name == option) speech.voice = voices[i]; } - - // When button is clicked, audio plays and then fortune is read/displayed - fortuneButton.addEventListener("click", function() { - fortuneAudioCrack.play(); + speech.lang = "en-US"; + speech.rate = 0.8; + speech.pitch = 1.2; + window.speechSynthesis.speak(speech); - // Turn button off so user cannot spam click button - fortuneButton.disabled = true; - fortuneButton.style.opacity = "0.5"; - setTimeout(showFortune, 1000); + // Turn button back on when fortune is done being read + speech.addEventListener("end", (event) => { + fortuneButton.disabled = false; + fortuneButton.style.opacity = "1"; }); - - // Added options for different voices - const synth = window.speechSynthesis; +} + +// When button is clicked, audio plays and then fortune is read/displayed +fortuneButton.addEventListener("click", function () { + fortuneAudioCrack.play(); + + // Turn button off so user cannot spam click button + fortuneButton.disabled = true; + fortuneButton.style.opacity = "0.5"; + setTimeout(showFortune, 1000); +}); + +// Added options for different voices +const synth = window.speechSynthesis; - const inputForm = document.querySelector("form"); - const inputTxt = document.querySelector(".txt"); - const voiceSelect = document.querySelector("select"); - const pitch = document.querySelector("#pitch"); - const pitchValue = document.querySelector(".pitch-value"); - const rate = document.querySelector("#rate"); - const rateValue = document.querySelector(".rate-value"); - - let voices = []; - - function populateVoiceList() { - voices = synth.getVoices(); - - for (let i = 0; i < voices.length; i++) { - const option = document.createElement("option"); - option.textContent = `${voices[i].name} (${voices[i].lang})`; - - if (voices[i].default) { - option.textContent += " — DEFAULT"; - } - - option.setAttribute("data-lang", voices[i].lang); - option.setAttribute("data-name", voices[i].name); - voiceSelect.appendChild(option); +const inputForm = document.querySelector("form"); +const inputTxt = document.querySelector(".txt"); +const voiceSelect = document.querySelector("select"); +const pitch = document.querySelector("#pitch"); +const pitchValue = document.querySelector(".pitch-value"); +const rate = document.querySelector("#rate"); +const rateValue = document.querySelector(".rate-value"); + +let voices = []; + +function populateVoiceList() { + voices = synth.getVoices(); + + for (let i = 0; i < voices.length; i++) { + const option = document.createElement("option"); + option.textContent = `${voices[i].name} (${voices[i].lang})`; + + if (voices[i].default) { + option.textContent += " — DEFAULT"; } + + option.setAttribute("data-lang", voices[i].lang); + option.setAttribute("data-name", voices[i].name); + voiceSelect.appendChild(option); } - - populateVoiceList(); - if (speechSynthesis.onvoiceschanged !== undefined) { - speechSynthesis.onvoiceschanged = populateVoiceList; - } \ No newline at end of file +} + +populateVoiceList(); +if (speechSynthesis.onvoiceschanged !== undefined) { + speechSynthesis.onvoiceschanged = populateVoiceList; +} diff --git a/source/FortuneCookie/style.css b/source/FortuneCookie/style.css index f8783a3b..b29e86c7 100644 --- a/source/FortuneCookie/style.css +++ b/source/FortuneCookie/style.css @@ -16,7 +16,7 @@ ul { margin: 0; padding: 0; overflow: hidden; - background-color: #1E1F2E; + background-color: #1e1f2e; } /* Navigation bar settings */ @@ -25,7 +25,8 @@ li { } /* Navigation bar settings */ -li a, .dropbtn { +li a, +.dropbtn { display: inline-block; color: white; text-align: center; @@ -33,11 +34,11 @@ li a, .dropbtn { text-decoration: none; } -li a:hover, .audio-dropdown:hover .dropbtn { +li a:hover, +.audio-dropdown:hover .dropbtn { /* background-color: #3d3c59; */ - background-color: #1E1F2E; + background-color: #1e1f2e; color: #5d59d1; - } li.audio-dropdown { @@ -49,7 +50,7 @@ li.audio-dropdown { position: absolute; background-color: #f9f9f9; min-width: 160px; - box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2); + box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2); z-index: 1; } @@ -62,7 +63,7 @@ li.audio-dropdown { } .audio-content a:hover { - background-color: #1E1F2E; + background-color: #1e1f2e; color: #5d59d1; } @@ -89,7 +90,7 @@ li.audio-dropdown { font-size: 18px; padding: 10px 20px; border-radius: 50px; - background-color: #DAA520; + background-color: #daa520; color: #fff; border: none; cursor: pointer; @@ -97,13 +98,13 @@ li.audio-dropdown { } #fortune-button:hover { - background-color: #FFD700; + background-color: #ffd700; } #fortune-text { margin-top: 20px; font-size: 24px; - color: #F1C86C; + color: #f1c86c; font-weight: bold; text-align: center; display: none; @@ -116,18 +117,18 @@ li.audio-dropdown { .page-title { display: flex; justify-content: center; - color: #FFFFFF; + color: #ffffff; } .page-subtitle { display: flex; justify-content: center; - color: #FFFFFF; + color: #ffffff; } .nav-list a { text-decoration: none; - color: #FFFFFF; + color: #ffffff; } .menu-bar { @@ -144,4 +145,4 @@ li.audio-dropdown { .nav-list { margin: 0 10px; -} \ No newline at end of file +} diff --git a/source/PalmReading/index.html b/source/PalmReading/index.html index 9a690712..7f9e328d 100644 --- a/source/PalmReading/index.html +++ b/source/PalmReading/index.html @@ -5,39 +5,29 @@ PalmReading - - - - - -
- -

Palm Reading

-
- - -

Please hold your hand over your camera.

+ + + + + +
+ +

Palm Reading

+
+ + +

Please hold your hand over your camera.

+
+
+
-
- -
- - -