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:
parent
c084f348d9
commit
f34d533dc6
5 changed files with 96 additions and 26 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue