New login screen with featured images
This commit is contained in:
@@ -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];
|
||||
}
|
||||
|
||||
24
frontend/src/lib/json/backgrounds.json
Normal file
24
frontend/src/lib/json/backgrounds.json
Normal file
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"backgrounds": [
|
||||
{
|
||||
"url": "backgrounds/adventurelog_showcase_1.webp",
|
||||
"author": "Sean Morley",
|
||||
"location": "Franconia Notch State Park, New Hampshire, USA"
|
||||
},
|
||||
{
|
||||
"url": "backgrounds/adventurelog_showcase_2.webp",
|
||||
"author": "Sean Morley",
|
||||
"location": "Tumbledown Mountain, Maine, USA"
|
||||
},
|
||||
{
|
||||
"url": "backgrounds/adventurelog_showcase_3.webp",
|
||||
"author": "Sean Morley",
|
||||
"location": "Philmont Scout Ranch, New Mexico, USA"
|
||||
},
|
||||
{
|
||||
"url": "backgrounds/adventurelog_showcase_4.webp",
|
||||
"author": "Sean Morley",
|
||||
"location": "Great Sand Dunes National Park, Colorado, USA"
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user