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

Load background from server page

This commit is contained in:
Sean Morley 2024-10-20 21:56:16 -04:00
parent c084f348d9
commit f34d533dc6
5 changed files with 96 additions and 26 deletions

View file

@ -1,6 +1,14 @@
import inspirationalQuotes from './json/quotes.json';
import randomBackgrounds from './json/backgrounds.json';
import type { Adventure, Checklist, Collection, Note, Transportation, User } from './types';
import type {
Adventure,
Background,
Checklist,
Collection,
Note,
Transportation,
User
} from './types';
export function getRandomQuote() {
const quotes = inspirationalQuotes.quotes;
@ -278,5 +286,5 @@ export function isAdventureVisited(adventure: Adventure) {
export function getRandomBackground() {
const randomIndex = Math.floor(Math.random() * randomBackgrounds.backgrounds.length);
return randomBackgrounds.backgrounds[randomIndex];
return randomBackgrounds.backgrounds[randomIndex] as Background;
}