1
0
Fork 0
mirror of https://github.com/seanmorley15/AdventureLog.git synced 2025-07-19 04:49:37 +02:00

New login screen with featured images

This commit is contained in:
Sean Morley 2024-10-17 21:35:55 -04:00
parent 792d9bcda2
commit c084f348d9
7 changed files with 105 additions and 49 deletions

View file

@ -1,4 +1,5 @@
import inspirationalQuotes from './json/quotes.json';
import randomBackgrounds from './json/backgrounds.json';
import type { Adventure, Checklist, Collection, Note, Transportation, User } from './types';
export function getRandomQuote() {
@ -6,7 +7,7 @@ export function getRandomQuote() {
const randomIndex = Math.floor(Math.random() * quotes.length);
let quoteString = quotes[randomIndex].quote;
let authorString = quotes[randomIndex].author;
return '"' + quoteString + '" - ' + authorString;
return { quote: quoteString, author: authorString };
}
export function getFlag(size: number, country: string) {
@ -274,3 +275,8 @@ export function isAdventureVisited(adventure: Adventure) {
})
);
}
export function getRandomBackground() {
const randomIndex = Math.floor(Math.random() * randomBackgrounds.backgrounds.length);
return randomBackgrounds.backgrounds[randomIndex];
}