Added initial content on top of standard pages
This commit is contained in:
parent
612e564b31
commit
36d001c589
6 changed files with 100 additions and 29 deletions
12
static/js/site.js
Normal file
12
static/js/site.js
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
|
||||
const quotesForPage = {
|
||||
getQuoteData: async function() {
|
||||
return (await axios.get('/static/json/quotes.json')).data;
|
||||
},
|
||||
|
||||
getRandomQuoteAsync: async function() {
|
||||
let quotes = (await quotesForPage.getQuoteData()).christmasQuotes;
|
||||
let indexChoice = Math.floor(Math.random() * quotes.length);
|
||||
return quotes[indexChoice];
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue