-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add mute button, improve playlist logic
- Loading branch information
1 parent
f095b07
commit 6491668
Showing
8 changed files
with
198 additions
and
59 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,14 @@ | ||
import { getRandomNum } from "./slider.js"; | ||
import quotes from './quotes.json' assert { type: "json" }; | ||
|
||
const quoteDiv = document.querySelector(".quote"); | ||
const authorDiv = document.querySelector(".author"); | ||
|
||
export const changeQuoteButton = document.querySelector(".change-quote"); | ||
|
||
export async function setQuote() { | ||
const url = 'https://type.fit/api/quotes'; | ||
const res = await fetch(url); | ||
const data = await res.json(); | ||
export function setQuote() { | ||
const random = getRandomNum(0, quotes.length - 1); | ||
|
||
const random = getRandomNum(0, data.length - 1); | ||
|
||
quoteDiv.textContent = data[random].text; | ||
authorDiv.textContent = data[random].author; | ||
quoteDiv.textContent = quotes[random].text; | ||
authorDiv.textContent = quotes[random].author; | ||
} |
Oops, something went wrong.