Moved data to api server route
This commit is contained in:
@@ -10,6 +10,7 @@ import DecadeLayout from './state/decennially/Layout.vue'
|
|||||||
import YearLayout from './state/yearly/Layout.vue'
|
import YearLayout from './state/yearly/Layout.vue'
|
||||||
|
|
||||||
const { currentConfig } = useCalendar()
|
const { currentConfig } = useCalendar()
|
||||||
|
const { eventsLoaded, eventsAreLoading } = storeToRefs(useCalendarEvents())
|
||||||
|
|
||||||
const currentViewComponent: ComputedRef<Component> = computed<Component>(() => {
|
const currentViewComponent: ComputedRef<Component> = computed<Component>(() => {
|
||||||
switch (currentConfig.viewType) {
|
switch (currentConfig.viewType) {
|
||||||
@@ -32,8 +33,14 @@ const currentViewComponent: ComputedRef<Component> = computed<Component>(() => {
|
|||||||
<template>
|
<template>
|
||||||
<div class="h-full grid grid-rows-[auto,1fr]">
|
<div class="h-full grid grid-rows-[auto,1fr]">
|
||||||
<CalendarMenu />
|
<CalendarMenu />
|
||||||
<KeepAlive>
|
|
||||||
<component :is="currentViewComponent" />
|
<template v-if="eventsAreLoading">
|
||||||
</KeepAlive>
|
<div>
|
||||||
|
Loading
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<template v-else-if="eventsLoaded">
|
||||||
|
<component :is="currentViewComponent" v-if="eventsLoaded" />
|
||||||
|
</template>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -8,11 +8,9 @@ import { areDatesIdentical } from '@/models/Date'
|
|||||||
const { defaultDate, selectedDate } = storeToRefs(useCalendar())
|
const { defaultDate, selectedDate } = storeToRefs(useCalendar())
|
||||||
const { jumpToDefaultDate, getFormattedDateTitle } = useCalendar()
|
const { jumpToDefaultDate, getFormattedDateTitle } = useCalendar()
|
||||||
|
|
||||||
const defaultDateFormatted = getFormattedDateTitle(defaultDate.value, true)
|
const defaultDateFormatted: string = getFormattedDateTitle(defaultDate.value, true)
|
||||||
|
|
||||||
const isDefaultDate = computed(() => {
|
const isDefaultDate: ComputedRef<boolean> = computed<boolean>(() => areDatesIdentical(selectedDate.value, defaultDate.value))
|
||||||
return areDatesIdentical(selectedDate.value, defaultDate.value)
|
|
||||||
})
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|||||||
@@ -30,10 +30,10 @@ import {
|
|||||||
|
|
||||||
import SearchList from './lists/SearchList.vue'
|
import SearchList from './lists/SearchList.vue'
|
||||||
|
|
||||||
const { characters } = useCharacters()
|
const { characters } = storeToRefs(useCharacters())
|
||||||
const { allEvents } = useCalendarEvents()
|
const { allEvents } = storeToRefs(useCalendarEvents())
|
||||||
|
|
||||||
const modalOpen = defineModel({ default: false })
|
const modalOpen = defineModel<boolean>({ default: false })
|
||||||
|
|
||||||
const searchQuery = ref<string>('')
|
const searchQuery = ref<string>('')
|
||||||
// const searchEnough = computed<boolean>(() => searchQuery.value.length >= 2)
|
// const searchEnough = computed<boolean>(() => searchQuery.value.length >= 2)
|
||||||
@@ -73,11 +73,11 @@ const searchResults = computed<(Character | CalendarEvent)[]>(() => {
|
|||||||
// Assign data to loop over and filter
|
// Assign data to loop over and filter
|
||||||
// They are assigned this way for readability
|
// They are assigned this way for readability
|
||||||
if (selectedEntity.value === 'events') {
|
if (selectedEntity.value === 'events') {
|
||||||
dataToFilter = allEvents
|
dataToFilter = allEvents.value
|
||||||
} else if (selectedEntity.value === 'characters') {
|
} else if (selectedEntity.value === 'characters') {
|
||||||
dataToFilter = characters
|
dataToFilter = characters.value
|
||||||
} else {
|
} else {
|
||||||
dataToFilter = [...allEvents, ...characters]
|
dataToFilter = [...allEvents.value, ...characters.value]
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,252 +0,0 @@
|
|||||||
import type { Character } from '@/models/Characters'
|
|
||||||
|
|
||||||
export const charactersList: Character[] = [
|
|
||||||
/**
|
|
||||||
* Player characters
|
|
||||||
*/
|
|
||||||
// "Les Milles Cages"
|
|
||||||
{
|
|
||||||
name: 'Sulvan Trois-Barbes',
|
|
||||||
birth: { day: 20, month: 3, year: 3169 },
|
|
||||||
wiki: 'https://alexcreates.fr/leim/index.php/Sulvan_Trois-Barbes',
|
|
||||||
category: 'joueur',
|
|
||||||
secondaryCategories: ['criminel', 'étincelle']
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'Vascylly',
|
|
||||||
birth: { day: 3, month: 5, year: 3181 },
|
|
||||||
wiki: 'https://alexcreates.fr/leim/index.php/Vascylly',
|
|
||||||
category: 'joueur',
|
|
||||||
secondaryCategories: ['mage']
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'Tara Belyus',
|
|
||||||
birth: { day: 14, month: 9, year: 3186 },
|
|
||||||
category: 'joueur',
|
|
||||||
secondaryCategories: ['mage']
|
|
||||||
},
|
|
||||||
// "Les Cloches de Cantane"
|
|
||||||
{
|
|
||||||
name: 'Malik',
|
|
||||||
birth: { day: 22, month: 8, year: 3181 },
|
|
||||||
category: 'joueur',
|
|
||||||
secondaryCategories: ['scientifique']
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'Elie',
|
|
||||||
birth: { day: 5, month: 6, year: 3192 },
|
|
||||||
category: 'joueur',
|
|
||||||
secondaryCategories: ['ecclésiastique']
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'Clayron',
|
|
||||||
birth: { day: 3, month: 5, year: 3178 },
|
|
||||||
category: 'joueur',
|
|
||||||
secondaryCategories: ['sentinelle']
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* NPC
|
|
||||||
*/
|
|
||||||
// Counts of the Alliance
|
|
||||||
{
|
|
||||||
name: 'Alfrid de Lagarde',
|
|
||||||
birth: { day: 29, month: 7, year: 3193 },
|
|
||||||
wiki: 'https://alexcreates.fr/leim/index.php/Alfrid_de_Lagarde',
|
|
||||||
category: 'comte',
|
|
||||||
secondaryCategories: ['sentinelle']
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'Alaric de Lagarde',
|
|
||||||
birth: { day: 23, month: 8, year: 3192 },
|
|
||||||
wiki: 'https://alexcreates.fr/leim/index.php/Alaric_de_Lagarde',
|
|
||||||
category: 'comte',
|
|
||||||
secondaryCategories: ['sentinelle']
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'Anastael III de Quillon',
|
|
||||||
birth: { day: 1, month: 5, year: 3184 },
|
|
||||||
wiki: 'https://alexcreates.fr/leim/index.php/Anastael_III_de_Quillon',
|
|
||||||
category: 'comte',
|
|
||||||
secondaryCategories: ['sentinelle', 'buse blanche']
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'Antoine de Mireloin',
|
|
||||||
birth: { day: 31, month: 5, year: 3190 },
|
|
||||||
wiki: 'https://alexcreates.fr/leim/index.php/Antoine_de_Mireloin',
|
|
||||||
category: 'comte'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'Armance Ronchère',
|
|
||||||
birth: { day: 1, month: 1, year: 3132 },
|
|
||||||
wiki: 'https://alexcreates.fr/leim/index.php/Armance_Ronchère',
|
|
||||||
category: 'comte'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'Baranne Rougefer',
|
|
||||||
birth: { day: 1, month: 0, year: 3175 },
|
|
||||||
wiki: 'https://alexcreates.fr/leim/index.php/Baranne_Rougefer',
|
|
||||||
category: 'comte',
|
|
||||||
secondaryCategories: ['sentinelle']
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'Béatrice II de Grandlac',
|
|
||||||
birth: { day: 21, month: 4, year: 3158 },
|
|
||||||
wiki: 'https://alexcreates.fr/leim/index.php/Béatrice_II_de_Grandlac',
|
|
||||||
category: 'comte',
|
|
||||||
secondaryCategories: ['mage']
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'Favio Asharos-Losantelle',
|
|
||||||
birth: { day: 17, month: 3, year: 3091 },
|
|
||||||
wiki: 'https://alexcreates.fr/leim/index.php/Favio_Asharos-Losantelle',
|
|
||||||
category: 'comte',
|
|
||||||
secondaryCategories: ['mage']
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'Firmin de Montardieu',
|
|
||||||
birth: { day: 9, month: 2, year: 3203 },
|
|
||||||
wiki: 'https://alexcreates.fr/leim/index.php/Firmin_de_Montardieu',
|
|
||||||
category: 'comte'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'Laura de Montardieu',
|
|
||||||
birth: { day: 32, month: 3, year: 3167 },
|
|
||||||
death: { day: 1, month: 4, year: 3217 },
|
|
||||||
hiddenDeath: true,
|
|
||||||
wiki: 'https://alexcreates.fr/leim/index.php/Laura_de_Montardieu',
|
|
||||||
category: 'comte'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'Lazarus Tymos',
|
|
||||||
birth: { day: 29, month: 9, year: 3145 },
|
|
||||||
wiki: 'https://alexcreates.fr/leim/index.php/Lazarus_Tymos',
|
|
||||||
category: 'comte',
|
|
||||||
secondaryCategories: ['mage', 'buse blanche']
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'Marion de Corambre',
|
|
||||||
birth: { day: 14, month: 7, year: 3190 },
|
|
||||||
wiki: 'https://alexcreates.fr/leim/index.php/Marion_de_Corambre',
|
|
||||||
category: 'comte',
|
|
||||||
secondaryCategories: ['scientifique', 'ecclésiastique']
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'Relforg Pergaré',
|
|
||||||
birth: { day: 18, month: 9, year: 3182 },
|
|
||||||
wiki: 'https://alexcreates.fr/leim/index.php/Relforg_Pergaré',
|
|
||||||
category: 'comte'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'Vilgarde de Ternâcre',
|
|
||||||
birth: { day: 3, month: 3, year: 2998 },
|
|
||||||
wiki: 'https://alexcreates.fr/leim/index.php/Vilgarde_de_Ternâcre',
|
|
||||||
category: 'comte'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'Ysildy Milopée',
|
|
||||||
birth: { day: 3, month: 1, year: 3187 },
|
|
||||||
wiki: 'https://alexcreates.fr/leim/index.php/Ysildy_Milopée',
|
|
||||||
category: 'comte',
|
|
||||||
secondaryCategories: ['mage', 'scientifique', 'professeur']
|
|
||||||
},
|
|
||||||
|
|
||||||
// Sparks
|
|
||||||
{
|
|
||||||
name: 'Izàc Tymos',
|
|
||||||
birth: { day: 13, month: 6, year: 3192 },
|
|
||||||
wiki: 'https://alexcreates.fr/leim/index.php/Izàc_Tymos',
|
|
||||||
category: 'mage',
|
|
||||||
secondaryCategories: ['étincelle', 'criminel', 'professeur', 'scientifique']
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'Tvernée',
|
|
||||||
birth: { day: 19, month: 2, year: 3205 },
|
|
||||||
wiki: 'https://alexcreates.fr/leim/index.php/Tvernée',
|
|
||||||
category: 'étincelle',
|
|
||||||
secondaryCategories: ['criminel']
|
|
||||||
},
|
|
||||||
|
|
||||||
// Pirates
|
|
||||||
{
|
|
||||||
name: 'Räzal',
|
|
||||||
birth: { day: 13, month: 8, year: 3178 },
|
|
||||||
wiki: 'https://alexcreates.fr/leim/index.php/Räzal'
|
|
||||||
},
|
|
||||||
|
|
||||||
// Legends
|
|
||||||
{
|
|
||||||
name: 'Jorhas Kirendre',
|
|
||||||
birth: { day: 2, month: 9, year: -452 },
|
|
||||||
death: { day: 2, month: 2, year: -419 },
|
|
||||||
category: 'sentinelle',
|
|
||||||
wiki: 'https://alexcreates.fr/leim/index.php/Jorhas_Kirendre'
|
|
||||||
},
|
|
||||||
|
|
||||||
// "Les Milles Cages"
|
|
||||||
{
|
|
||||||
name: 'Ernestin Pomel',
|
|
||||||
birth: { day: 11, month: 2, year: 3179 },
|
|
||||||
wiki: 'https://alexcreates.fr/leim/index.php/Ernestin_Pomel',
|
|
||||||
category: 'mage'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'Quacille Lévios',
|
|
||||||
birth: { day: 3, month: 6, year: 3162 },
|
|
||||||
wiki: 'https://alexcreates.fr/leim/index.php/Quacille_Lévios',
|
|
||||||
category: 'professeur',
|
|
||||||
secondaryCategories: ['mage']
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'Morel Lévios',
|
|
||||||
birth: { day: 26, month: 3, year: 3157 },
|
|
||||||
wiki: 'https://alexcreates.fr/leim/index.php/Morel_Lévios',
|
|
||||||
category: 'sentinelle',
|
|
||||||
secondaryCategories: ['mage', 'buse blanche']
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'Anastael Simon',
|
|
||||||
birth: { day: 32, month: 2, year: 3166 },
|
|
||||||
wiki: 'https://alexcreates.fr/leim/index.php/Anastael_Simon',
|
|
||||||
category: 'étincelle',
|
|
||||||
secondaryCategories: ['mage']
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'Grestain',
|
|
||||||
birth: { day: 9, month: 2, year: 3162 },
|
|
||||||
wiki: 'https://alexcreates.fr/leim/index.php/Grestain',
|
|
||||||
category: 'criminel',
|
|
||||||
secondaryCategories: ['mage']
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'Lucien Malanth',
|
|
||||||
birth: { day: 31, month: 4, year: 3167 },
|
|
||||||
wiki: 'https://alexcreates.fr/leim/index.php/Lucien_Malanth',
|
|
||||||
category: 'criminel',
|
|
||||||
secondaryCategories: ['mage']
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'Tivian Rodhus',
|
|
||||||
birth: { day: 13, month: 3, year: 3157 },
|
|
||||||
wiki: 'https://alexcreates.fr/leim/index.php/Tivian_Rodhus',
|
|
||||||
category: 'professeur',
|
|
||||||
secondaryCategories: ['mage', 'criminel']
|
|
||||||
},
|
|
||||||
|
|
||||||
// "Les Cloches de Cantane"
|
|
||||||
{
|
|
||||||
name: 'Bénédicte Vaht',
|
|
||||||
description: "Moine d'Ikami ayant entrepris la construction du Pilier Blanc de Cantane",
|
|
||||||
birth: { day: 28, month: 6, year: 3139 },
|
|
||||||
category: 'ecclésiastique'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'Taleb Vaht',
|
|
||||||
description:
|
|
||||||
"Fils de Bénédicte, il s'est engagé auprès des Étincelles comme alchimiste artificier.",
|
|
||||||
birth: { day: 9, month: 1, year: 3180 },
|
|
||||||
death: { day: 28, month: 7, year: 3209 },
|
|
||||||
category: 'étincelle',
|
|
||||||
secondaryCategories: ['scientifique']
|
|
||||||
}
|
|
||||||
]
|
|
||||||
217
data/Events.ts
217
data/Events.ts
@@ -1,217 +0,0 @@
|
|||||||
import type { CalendarEvent } from '@/models/Events'
|
|
||||||
|
|
||||||
export const initialEvents: CalendarEvent[] = [
|
|
||||||
// Histoire Antique
|
|
||||||
{
|
|
||||||
title: "Laurdieu devient la première cité de l'empire de Kaliatos",
|
|
||||||
startDate: { day: 3, month: 4, year: -1932 },
|
|
||||||
description:
|
|
||||||
"L'empire de Kaliatos établi sa capitale dans la cité de Laurdieu, qui connaitra une prospérité nouvelle au sein d'Aldys.",
|
|
||||||
category: 'législation',
|
|
||||||
secondaryCategories: ['inauguration'],
|
|
||||||
wiki: 'https://alexcreates.fr/leim/index.php/Laurdieu',
|
|
||||||
hidden: true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "Apparition d'Asménys",
|
|
||||||
startDate: { day: 19, month: 7, year: -1358 },
|
|
||||||
description:
|
|
||||||
"La défunte chanteuse Asménys apparaît à un barde pendant son jeune public, démarrant la religion des Prêtresses d'Asménys.",
|
|
||||||
category: 'religion',
|
|
||||||
secondaryCategories: ['bénédiction'],
|
|
||||||
wiki: 'https://alexcreates.fr/leim/index.php/Pr%C3%AAtresses_d%27Asm%C3%A9nys',
|
|
||||||
hidden: true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: 'La Rupture',
|
|
||||||
startDate: { day: 26, month: 5, year: -756 },
|
|
||||||
endDate: { day: 4, month: 9, year: 29 },
|
|
||||||
description:
|
|
||||||
"Les Abysses se déversent à la surface de Léim, à travers plusieurs brèches. Plusieurs hordes de démons se rapprochent des villes, et ce qu'on appellera l'Âge des Abysses commencent alors sur la planète entière.",
|
|
||||||
category: 'catastrophe',
|
|
||||||
secondaryCategories: ['catastrophe naturelle'],
|
|
||||||
wiki: 'https://alexcreates.fr/leim/index.php/Seconde_Rupture',
|
|
||||||
hidden: true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: 'Marche du sang',
|
|
||||||
startDate: { day: 18, month: 9, year: -420 },
|
|
||||||
endDate: { day: 27, month: 1, year: -419 },
|
|
||||||
description:
|
|
||||||
"L'empereur de Kaliatos ordonne personnellement la traque de Jorhas Kirendre pour connivence avec les démons. Plusieurs bataillons sont affectés à la chasse de Jorhas, qui se terminera par son incarcération ainsi que la mort de plusieurs centaines de soldats.",
|
|
||||||
category: 'criminalité',
|
|
||||||
wiki: 'https://alexcreates.fr/leim/index.php/Jorhas_Kirendre',
|
|
||||||
hidden: true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: 'Exécution de Tyhos',
|
|
||||||
startDate: { day: 1, month: 0, year: 0 },
|
|
||||||
description:
|
|
||||||
"Le léviathan Tyhos rend l'âme après un combat de plusieurs années contre Lystos, le dieu du Soleil.",
|
|
||||||
category: 'bénédiction',
|
|
||||||
secondaryCategories: ['mort'],
|
|
||||||
wiki: 'https://alexcreates.fr/leim/index.php/Tyhos',
|
|
||||||
hidden: true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: 'Traité de Kadel',
|
|
||||||
startDate: { day: 29, month: 4, year: 100 },
|
|
||||||
description: '',
|
|
||||||
category: 'inauguration',
|
|
||||||
secondaryCategories: ['législation'],
|
|
||||||
wiki: 'https://alexcreates.fr/leim/index.php/Alliance_Kald%C3%A9lienne#Trait%C3%A9_de_Kadel'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: 'Découverte des Plaines de Poussières',
|
|
||||||
startDate: { day: 17, month: 7, year: 305 },
|
|
||||||
description:
|
|
||||||
"Les troupes de la reconquête aldienne explorent le littoral d'une immense étendue grise et inerte.",
|
|
||||||
category: 'découverte',
|
|
||||||
secondaryCategories: ['exploration'],
|
|
||||||
wiki: 'https://alexcreates.fr/leim/index.php/Plaines_de_poussi%C3%A8re',
|
|
||||||
hidden: true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: 'Construction du Rempart de Laurdieu',
|
|
||||||
startDate: { day: 30, month: 2, year: 340 },
|
|
||||||
endDate: { day: 27, month: 9, year: 355 },
|
|
||||||
description:
|
|
||||||
"Le Grand Conseil Kaldélien ordonne la construction d'une muraille autour des Plaines de Poussières, afin de contenir les démons y sortant.",
|
|
||||||
category: 'construction',
|
|
||||||
wiki: 'https://alexcreates.fr/leim/index.php/Plaines_de_poussi%C3%A8re',
|
|
||||||
hidden: true
|
|
||||||
},
|
|
||||||
|
|
||||||
// Histoire Récente
|
|
||||||
{
|
|
||||||
title: "Inauguration de l'Académie Artistique Arcanique",
|
|
||||||
startDate: { day: 11, month: 6, year: 2545 },
|
|
||||||
description:
|
|
||||||
"Scäd Sceni ouvre son institut artistique dédié à l'apprentissage des arts arcaniques",
|
|
||||||
category: 'inauguration',
|
|
||||||
secondaryCategories: ['arcanologie'],
|
|
||||||
wiki: 'https://alexcreates.fr/leim/index.php/Buse_(arme)'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: 'Création de la buse kaldélienne',
|
|
||||||
startDate: { day: 4, month: 2, year: 3113 },
|
|
||||||
description:
|
|
||||||
'Sophia de Rougefer invente la buse kaldélienne, une arme à feu souple à deux canons.',
|
|
||||||
category: 'invention',
|
|
||||||
secondaryCategories: ['science'],
|
|
||||||
wiki: 'https://alexcreates.fr/leim/index.php/Buse_(arme)'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: 'Feux dans les champs de Bamast',
|
|
||||||
startDate: { day: 9, month: 5, year: 3200 },
|
|
||||||
description:
|
|
||||||
"Plusieurs incendies criminels se propagent à travers les champs de sérille des fermiers des littoraux de Bamast. Aucun suspect ni coupable ne sera trouvé et l'enquête sera baclée.",
|
|
||||||
category: 'catastrophe',
|
|
||||||
secondaryCategories: ['criminalité'],
|
|
||||||
wiki: 'https://alexcreates.fr/leim/index.php/Vascylly'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: 'Meurtre de Darléon Typhos',
|
|
||||||
startDate: { day: 21, month: 6, year: 3200 },
|
|
||||||
description:
|
|
||||||
'Darléon Typhos surprend Vascylly fouillant sa demeure peu après la tombée de la nuit. Le majordome de la famille Typhos découvre le corps sans vie de son maître le lendemain.',
|
|
||||||
category: 'criminalité',
|
|
||||||
secondaryCategories: ['joueurs'],
|
|
||||||
wiki: 'https://alexcreates.fr/leim/index.php/Vascylly'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: 'Scandale Rodhus',
|
|
||||||
startDate: { day: 25, month: 9, year: 3208 },
|
|
||||||
description:
|
|
||||||
"Tivian Rodhus, un professeur estimé de l'Académie Centrale Kaldélienne, est emprisonné pour corruption et aggression sexuelle. Le corps enseignant y est remanié sur ordre de Lazarus Tymos, comte de Nacride.",
|
|
||||||
category: 'criminalité',
|
|
||||||
secondaryCategories: ['scandale'],
|
|
||||||
wiki: 'https://alexcreates.fr/leim/index.php/Tivian_Rodhus'
|
|
||||||
},
|
|
||||||
|
|
||||||
// "Les Milles Cages"
|
|
||||||
{
|
|
||||||
title: "Arrivée d'aventuriers à Borélis",
|
|
||||||
startDate: { day: 12, month: 7, year: 3209 },
|
|
||||||
description:
|
|
||||||
'Tara Belyus, Vascylly et Adol Sulvan livrent 3 condamnés à Handany. Ils partent pour la mer durant la journée.',
|
|
||||||
category: 'joueurs'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "Naufrage de l'Éclipse",
|
|
||||||
description:
|
|
||||||
"L'Éclipse, le navire de la garde contenant des condamnés à destination des Cages Handaniennes, s'échoue au large des côtes montagneuses de la Lance d'Aldys.",
|
|
||||||
startDate: { day: 14, month: 7, year: 3209 },
|
|
||||||
category: 'catastrophe'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: 'Emprisonnement de Tivian Rodhus',
|
|
||||||
description: "Celui qu'on surnomme la Bête d'Ambrose arrive à Handany, où il purgera sa peine.",
|
|
||||||
startDate: { day: 14, month: 7, year: 3209 },
|
|
||||||
category: 'législation'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: 'Sulvan et Anastael atteignent Bamast',
|
|
||||||
startDate: { day: 19, month: 2, year: 3210 },
|
|
||||||
category: 'joueurs'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: 'Jugement de Bormis Griloup',
|
|
||||||
description:
|
|
||||||
"Bromis Griloup est jugé coupable d'escroquerie et sabotage aux Cours d'Acier de Tourgrise. Il purgera une peine de 10 ans au sein des prisons royales.",
|
|
||||||
startDate: { day: 4, month: 8, year: 3209 },
|
|
||||||
category: 'législation'
|
|
||||||
},
|
|
||||||
|
|
||||||
// "Les Cloches de Cantane"
|
|
||||||
{
|
|
||||||
title: 'Inauguration de la Cloche du Pilier',
|
|
||||||
description: "Le Moine Premier inaugure la grande cloche d'argent au sommet du Pilier d'Ikami.",
|
|
||||||
startDate: { day: 29, month: 5, year: 3209 },
|
|
||||||
category: 'religion',
|
|
||||||
secondaryCategories: ['inauguration']
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '1ère disparation à Cantane',
|
|
||||||
description: "Taleb Vaht décède dans une grotte à la suite d'une attaque d'ischiels enragées.",
|
|
||||||
startDate: { day: 28, month: 7, year: 3209 },
|
|
||||||
category: 'mort',
|
|
||||||
hidden: true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '2ème disparation à Cantane',
|
|
||||||
description: 'Donovane le mineur kéturien disparait sans laisser de traces.',
|
|
||||||
startDate: { day: 32, month: 7, year: 3209 },
|
|
||||||
category: 'mort',
|
|
||||||
hidden: true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '3ème disparation à Cantane',
|
|
||||||
description: 'Disparition de Sébastien, gredin sauride.',
|
|
||||||
startDate: { day: 10, month: 8, year: 3209 },
|
|
||||||
category: 'mort',
|
|
||||||
hidden: true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '4ème disparation à Cantane',
|
|
||||||
description: 'Disparition de Thérence, patrouilleur sauride de la Vieille Garde.',
|
|
||||||
startDate: { day: 19, month: 8, year: 3209 },
|
|
||||||
category: 'mort',
|
|
||||||
hidden: true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '5ème disparation à Cantane',
|
|
||||||
description: 'Disparition de Mathilda Boulais, vendeuse de pierres.',
|
|
||||||
startDate: { day: 22, month: 8, year: 3209 },
|
|
||||||
category: 'mort',
|
|
||||||
hidden: true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: 'Grande Banque Minérale de Cantane',
|
|
||||||
description:
|
|
||||||
'Les artisans et mineurs de Rougefer se réunissent à Cantane pour vendre le fruit de leur dur labeur.',
|
|
||||||
startDate: { day: 23, month: 8, year: 3209 },
|
|
||||||
endDate: { day: 26, month: 8, year: 3209 },
|
|
||||||
category: 'commerce'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
@@ -3,11 +3,12 @@ export default defineNuxtConfig({
|
|||||||
devtools: { enabled: true },
|
devtools: { enabled: true },
|
||||||
|
|
||||||
modules: [
|
modules: [
|
||||||
"@nuxtjs/tailwindcss",
|
'@nuxtjs/tailwindcss',
|
||||||
"shadcn-nuxt",
|
'shadcn-nuxt',
|
||||||
"@nuxtjs/color-mode",
|
'@nuxtjs/color-mode',
|
||||||
'@pinia/nuxt',
|
'@pinia/nuxt',
|
||||||
"@nuxt/eslint"
|
'@nuxt/eslint',
|
||||||
|
'@vueuse/nuxt'
|
||||||
],
|
],
|
||||||
css: ['~/assets/main.css'],
|
css: ['~/assets/main.css'],
|
||||||
|
|
||||||
@@ -27,4 +28,4 @@ export default defineNuxtConfig({
|
|||||||
fallback: 'dark',
|
fallback: 'dark',
|
||||||
},
|
},
|
||||||
eslint: {}
|
eslint: {}
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@nuxt/eslint": "^0.3.12",
|
"@nuxt/eslint": "^0.3.12",
|
||||||
|
"@vueuse/nuxt": "^10.9.0",
|
||||||
"@phosphor-icons/vue": "^2.2.1",
|
"@phosphor-icons/vue": "^2.2.1",
|
||||||
"@pinia/nuxt": "^0.5.1",
|
"@pinia/nuxt": "^0.5.1",
|
||||||
"@vueuse/core": "^10.9.0",
|
"@vueuse/core": "^10.9.0",
|
||||||
|
|||||||
@@ -5,50 +5,11 @@ import { useCalendar } from '@/stores/CalendarStore'
|
|||||||
import Calendar from '@/components/calendar/Calendar.vue'
|
import Calendar from '@/components/calendar/Calendar.vue'
|
||||||
import Sidebar from '@/components/calendar/Sidebar.vue'
|
import Sidebar from '@/components/calendar/Sidebar.vue'
|
||||||
import CalendarSearch from '@/components/calendar/search/CalendarSearch.vue'
|
import CalendarSearch from '@/components/calendar/search/CalendarSearch.vue'
|
||||||
import { useRoute, useRouter } from 'vue-router'
|
|
||||||
import { isDigit, isInt, isSignedInt } from '@/utils/Regex'
|
|
||||||
import { onBeforeMount } from 'vue'
|
|
||||||
|
|
||||||
const router = useRouter()
|
|
||||||
const route = useRoute()
|
|
||||||
const { defaultDate, selectedDate, jumpToDate } = useCalendar()
|
|
||||||
const { isAdvancedSearchOpen } = storeToRefs(useCalendar())
|
const { isAdvancedSearchOpen } = storeToRefs(useCalendar())
|
||||||
|
|
||||||
// Check whether all the params are good to go before rendering anything
|
useHead({
|
||||||
onBeforeMount(() => {
|
title: 'Calendar'
|
||||||
let isInvalid: boolean = false
|
|
||||||
|
|
||||||
// If the user already has a selected date from session, jump to it
|
|
||||||
if (selectedDate) {
|
|
||||||
jumpToDate(selectedDate)
|
|
||||||
} else {
|
|
||||||
// Assign default values if no params exist in URL
|
|
||||||
if (!route.query.day || typeof route.query.day === 'object' || !isInt(route.query.day)) {
|
|
||||||
route.query.day = defaultDate.day.toString()
|
|
||||||
isInvalid = true
|
|
||||||
}
|
|
||||||
if (
|
|
||||||
!route.query.month ||
|
|
||||||
typeof route.query.month === 'object' ||
|
|
||||||
!isDigit(route.query.month)
|
|
||||||
) {
|
|
||||||
route.query.month = defaultDate.month.toString()
|
|
||||||
isInvalid = true
|
|
||||||
}
|
|
||||||
if (
|
|
||||||
!route.query.year ||
|
|
||||||
typeof route.query.year === 'object' ||
|
|
||||||
!isSignedInt(route.query.year)
|
|
||||||
) {
|
|
||||||
route.query.year = defaultDate.year.toString()
|
|
||||||
isInvalid = true
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isInvalid) {
|
|
||||||
console.log('replaced')
|
|
||||||
router.replace({ query: route.query, replace: true })
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,9 @@
|
|||||||
|
<script lang="ts" setup>
|
||||||
|
useHead({
|
||||||
|
title: 'Dashboard'
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<main class="h-full grid place-items-center">
|
<main class="h-full grid place-items-center">
|
||||||
<UiCard class="w-1/3 min-w-72" link="/calendar">
|
<UiCard class="w-1/3 min-w-72" link="/calendar">
|
||||||
|
|||||||
22
pnpm-lock.yaml
generated
22
pnpm-lock.yaml
generated
@@ -20,6 +20,9 @@ importers:
|
|||||||
'@vueuse/core':
|
'@vueuse/core':
|
||||||
specifier: ^10.9.0
|
specifier: ^10.9.0
|
||||||
version: 10.9.0(vue@3.4.27(typescript@5.4.5))
|
version: 10.9.0(vue@3.4.27(typescript@5.4.5))
|
||||||
|
'@vueuse/nuxt':
|
||||||
|
specifier: ^10.9.0
|
||||||
|
version: 10.9.0(nuxt@3.11.2(@opentelemetry/api@1.8.0)(@parcel/watcher@2.4.1)(@types/node@20.12.11)(@unocss/reset@0.60.2)(encoding@0.1.13)(eslint@8.57.0)(floating-vue@5.2.2(@nuxt/kit@3.11.2(rollup@4.17.2))(vue@3.4.27(typescript@5.4.5)))(ioredis@5.4.1)(optionator@0.9.4)(rollup@4.17.2)(sass@1.77.1)(terser@5.31.0)(typescript@5.4.5)(unocss@0.60.2(postcss@8.4.38)(rollup@4.17.2)(vite@5.2.11(@types/node@20.12.11)(sass@1.77.1)(terser@5.31.0)))(vite@5.2.11(@types/node@20.12.11)(sass@1.77.1)(terser@5.31.0)))(rollup@4.17.2)(vue@3.4.27(typescript@5.4.5))
|
||||||
class-variance-authority:
|
class-variance-authority:
|
||||||
specifier: ^0.7.0
|
specifier: ^0.7.0
|
||||||
version: 0.7.0
|
version: 0.7.0
|
||||||
@@ -1473,6 +1476,11 @@ packages:
|
|||||||
'@vueuse/metadata@10.9.0':
|
'@vueuse/metadata@10.9.0':
|
||||||
resolution: {integrity: sha512-iddNbg3yZM0X7qFY2sAotomgdHK7YJ6sKUvQqbvwnf7TmaVPxS4EJydcNsVejNdS8iWCtDk+fYXr7E32nyTnGA==}
|
resolution: {integrity: sha512-iddNbg3yZM0X7qFY2sAotomgdHK7YJ6sKUvQqbvwnf7TmaVPxS4EJydcNsVejNdS8iWCtDk+fYXr7E32nyTnGA==}
|
||||||
|
|
||||||
|
'@vueuse/nuxt@10.9.0':
|
||||||
|
resolution: {integrity: sha512-nC4Efg28Q6E41fUD5R+zM9uT5c+NfaDzaJCpqaEV/qHj+/BNJmkDBK8POLIUsiVOY35d0oD/YxZ+eVizqWBZow==}
|
||||||
|
peerDependencies:
|
||||||
|
nuxt: ^3.0.0
|
||||||
|
|
||||||
'@vueuse/shared@10.9.0':
|
'@vueuse/shared@10.9.0':
|
||||||
resolution: {integrity: sha512-Uud2IWncmAfJvRaFYzv5OHDli+FbOzxiVEQdLCKQKLyhz94PIyFC3CHcH7EDMwIn8NPtD06+PNbC/PiO0LGLtw==}
|
resolution: {integrity: sha512-Uud2IWncmAfJvRaFYzv5OHDli+FbOzxiVEQdLCKQKLyhz94PIyFC3CHcH7EDMwIn8NPtD06+PNbC/PiO0LGLtw==}
|
||||||
|
|
||||||
@@ -6535,6 +6543,20 @@ snapshots:
|
|||||||
|
|
||||||
'@vueuse/metadata@10.9.0': {}
|
'@vueuse/metadata@10.9.0': {}
|
||||||
|
|
||||||
|
'@vueuse/nuxt@10.9.0(nuxt@3.11.2(@opentelemetry/api@1.8.0)(@parcel/watcher@2.4.1)(@types/node@20.12.11)(@unocss/reset@0.60.2)(encoding@0.1.13)(eslint@8.57.0)(floating-vue@5.2.2(@nuxt/kit@3.11.2(rollup@4.17.2))(vue@3.4.27(typescript@5.4.5)))(ioredis@5.4.1)(optionator@0.9.4)(rollup@4.17.2)(sass@1.77.1)(terser@5.31.0)(typescript@5.4.5)(unocss@0.60.2(postcss@8.4.38)(rollup@4.17.2)(vite@5.2.11(@types/node@20.12.11)(sass@1.77.1)(terser@5.31.0)))(vite@5.2.11(@types/node@20.12.11)(sass@1.77.1)(terser@5.31.0)))(rollup@4.17.2)(vue@3.4.27(typescript@5.4.5))':
|
||||||
|
dependencies:
|
||||||
|
'@nuxt/kit': 3.11.2(rollup@4.17.2)
|
||||||
|
'@vueuse/core': 10.9.0(vue@3.4.27(typescript@5.4.5))
|
||||||
|
'@vueuse/metadata': 10.9.0
|
||||||
|
local-pkg: 0.5.0
|
||||||
|
nuxt: 3.11.2(@opentelemetry/api@1.8.0)(@parcel/watcher@2.4.1)(@types/node@20.12.11)(@unocss/reset@0.60.2)(encoding@0.1.13)(eslint@8.57.0)(floating-vue@5.2.2(@nuxt/kit@3.11.2(rollup@4.17.2))(vue@3.4.27(typescript@5.4.5)))(ioredis@5.4.1)(optionator@0.9.4)(rollup@4.17.2)(sass@1.77.1)(terser@5.31.0)(typescript@5.4.5)(unocss@0.60.2(postcss@8.4.38)(rollup@4.17.2)(vite@5.2.11(@types/node@20.12.11)(sass@1.77.1)(terser@5.31.0)))(vite@5.2.11(@types/node@20.12.11)(sass@1.77.1)(terser@5.31.0))
|
||||||
|
vue-demi: 0.14.7(vue@3.4.27(typescript@5.4.5))
|
||||||
|
transitivePeerDependencies:
|
||||||
|
- '@vue/composition-api'
|
||||||
|
- rollup
|
||||||
|
- supports-color
|
||||||
|
- vue
|
||||||
|
|
||||||
'@vueuse/shared@10.9.0(vue@3.4.27(typescript@5.4.5))':
|
'@vueuse/shared@10.9.0(vue@3.4.27(typescript@5.4.5))':
|
||||||
dependencies:
|
dependencies:
|
||||||
vue-demi: 0.14.7(vue@3.4.27(typescript@5.4.5))
|
vue-demi: 0.14.7(vue@3.4.27(typescript@5.4.5))
|
||||||
|
|||||||
252
server/api/characters.ts
Normal file
252
server/api/characters.ts
Normal file
@@ -0,0 +1,252 @@
|
|||||||
|
export default defineEventHandler(() => {
|
||||||
|
return [
|
||||||
|
/**
|
||||||
|
* Player characters
|
||||||
|
*/
|
||||||
|
// "Les Milles Cages"
|
||||||
|
{
|
||||||
|
name: 'Sulvan Trois-Barbes',
|
||||||
|
birth: { day: 20, month: 3, year: 3169 },
|
||||||
|
wiki: 'https://alexcreates.fr/leim/index.php/Sulvan_Trois-Barbes',
|
||||||
|
category: 'joueur',
|
||||||
|
secondaryCategories: ['criminel', 'étincelle']
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'Vascylly',
|
||||||
|
birth: { day: 3, month: 5, year: 3181 },
|
||||||
|
wiki: 'https://alexcreates.fr/leim/index.php/Vascylly',
|
||||||
|
category: 'joueur',
|
||||||
|
secondaryCategories: ['mage']
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'Tara Belyus',
|
||||||
|
birth: { day: 14, month: 9, year: 3186 },
|
||||||
|
category: 'joueur',
|
||||||
|
secondaryCategories: ['mage']
|
||||||
|
},
|
||||||
|
// "Les Cloches de Cantane"
|
||||||
|
{
|
||||||
|
name: 'Malik',
|
||||||
|
birth: { day: 22, month: 8, year: 3181 },
|
||||||
|
category: 'joueur',
|
||||||
|
secondaryCategories: ['scientifique']
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'Elie',
|
||||||
|
birth: { day: 5, month: 6, year: 3192 },
|
||||||
|
category: 'joueur',
|
||||||
|
secondaryCategories: ['ecclésiastique']
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'Clayron',
|
||||||
|
birth: { day: 3, month: 5, year: 3178 },
|
||||||
|
category: 'joueur',
|
||||||
|
secondaryCategories: ['sentinelle']
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* NPC
|
||||||
|
*/
|
||||||
|
// Counts of the Alliance
|
||||||
|
{
|
||||||
|
name: 'Alfrid de Lagarde',
|
||||||
|
birth: { day: 29, month: 7, year: 3193 },
|
||||||
|
wiki: 'https://alexcreates.fr/leim/index.php/Alfrid_de_Lagarde',
|
||||||
|
category: 'comte',
|
||||||
|
secondaryCategories: ['sentinelle']
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'Alaric de Lagarde',
|
||||||
|
birth: { day: 23, month: 8, year: 3192 },
|
||||||
|
wiki: 'https://alexcreates.fr/leim/index.php/Alaric_de_Lagarde',
|
||||||
|
category: 'comte',
|
||||||
|
secondaryCategories: ['sentinelle']
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'Anastael III de Quillon',
|
||||||
|
birth: { day: 1, month: 5, year: 3184 },
|
||||||
|
wiki: 'https://alexcreates.fr/leim/index.php/Anastael_III_de_Quillon',
|
||||||
|
category: 'comte',
|
||||||
|
secondaryCategories: ['sentinelle', 'buse blanche']
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'Antoine de Mireloin',
|
||||||
|
birth: { day: 31, month: 5, year: 3190 },
|
||||||
|
wiki: 'https://alexcreates.fr/leim/index.php/Antoine_de_Mireloin',
|
||||||
|
category: 'comte'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'Armance Ronchère',
|
||||||
|
birth: { day: 1, month: 1, year: 3132 },
|
||||||
|
wiki: 'https://alexcreates.fr/leim/index.php/Armance_Ronchère',
|
||||||
|
category: 'comte'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'Baranne Rougefer',
|
||||||
|
birth: { day: 1, month: 0, year: 3175 },
|
||||||
|
wiki: 'https://alexcreates.fr/leim/index.php/Baranne_Rougefer',
|
||||||
|
category: 'comte',
|
||||||
|
secondaryCategories: ['sentinelle']
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'Béatrice II de Grandlac',
|
||||||
|
birth: { day: 21, month: 4, year: 3158 },
|
||||||
|
wiki: 'https://alexcreates.fr/leim/index.php/Béatrice_II_de_Grandlac',
|
||||||
|
category: 'comte',
|
||||||
|
secondaryCategories: ['mage']
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'Favio Asharos-Losantelle',
|
||||||
|
birth: { day: 17, month: 3, year: 3091 },
|
||||||
|
wiki: 'https://alexcreates.fr/leim/index.php/Favio_Asharos-Losantelle',
|
||||||
|
category: 'comte',
|
||||||
|
secondaryCategories: ['mage']
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'Firmin de Montardieu',
|
||||||
|
birth: { day: 9, month: 2, year: 3203 },
|
||||||
|
wiki: 'https://alexcreates.fr/leim/index.php/Firmin_de_Montardieu',
|
||||||
|
category: 'comte'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'Laura de Montardieu',
|
||||||
|
birth: { day: 32, month: 3, year: 3167 },
|
||||||
|
death: { day: 1, month: 4, year: 3217 },
|
||||||
|
hiddenDeath: true,
|
||||||
|
wiki: 'https://alexcreates.fr/leim/index.php/Laura_de_Montardieu',
|
||||||
|
category: 'comte'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'Lazarus Tymos',
|
||||||
|
birth: { day: 29, month: 9, year: 3145 },
|
||||||
|
wiki: 'https://alexcreates.fr/leim/index.php/Lazarus_Tymos',
|
||||||
|
category: 'comte',
|
||||||
|
secondaryCategories: ['mage', 'buse blanche']
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'Marion de Corambre',
|
||||||
|
birth: { day: 14, month: 7, year: 3190 },
|
||||||
|
wiki: 'https://alexcreates.fr/leim/index.php/Marion_de_Corambre',
|
||||||
|
category: 'comte',
|
||||||
|
secondaryCategories: ['scientifique', 'ecclésiastique']
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'Relforg Pergaré',
|
||||||
|
birth: { day: 18, month: 9, year: 3182 },
|
||||||
|
wiki: 'https://alexcreates.fr/leim/index.php/Relforg_Pergaré',
|
||||||
|
category: 'comte'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'Vilgarde de Ternâcre',
|
||||||
|
birth: { day: 3, month: 3, year: 2998 },
|
||||||
|
wiki: 'https://alexcreates.fr/leim/index.php/Vilgarde_de_Ternâcre',
|
||||||
|
category: 'comte'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'Ysildy Milopée',
|
||||||
|
birth: { day: 3, month: 1, year: 3187 },
|
||||||
|
wiki: 'https://alexcreates.fr/leim/index.php/Ysildy_Milopée',
|
||||||
|
category: 'comte',
|
||||||
|
secondaryCategories: ['mage', 'scientifique', 'professeur']
|
||||||
|
},
|
||||||
|
|
||||||
|
// Sparks
|
||||||
|
{
|
||||||
|
name: 'Izàc Tymos',
|
||||||
|
birth: { day: 13, month: 6, year: 3192 },
|
||||||
|
wiki: 'https://alexcreates.fr/leim/index.php/Izàc_Tymos',
|
||||||
|
category: 'mage',
|
||||||
|
secondaryCategories: ['étincelle', 'criminel', 'professeur', 'scientifique']
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'Tvernée',
|
||||||
|
birth: { day: 19, month: 2, year: 3205 },
|
||||||
|
wiki: 'https://alexcreates.fr/leim/index.php/Tvernée',
|
||||||
|
category: 'étincelle',
|
||||||
|
secondaryCategories: ['criminel']
|
||||||
|
},
|
||||||
|
|
||||||
|
// Pirates
|
||||||
|
{
|
||||||
|
name: 'Räzal',
|
||||||
|
birth: { day: 13, month: 8, year: 3178 },
|
||||||
|
wiki: 'https://alexcreates.fr/leim/index.php/Räzal'
|
||||||
|
},
|
||||||
|
|
||||||
|
// Legends
|
||||||
|
{
|
||||||
|
name: 'Jorhas Kirendre',
|
||||||
|
birth: { day: 2, month: 9, year: -452 },
|
||||||
|
death: { day: 2, month: 2, year: -419 },
|
||||||
|
category: 'sentinelle',
|
||||||
|
wiki: 'https://alexcreates.fr/leim/index.php/Jorhas_Kirendre'
|
||||||
|
},
|
||||||
|
|
||||||
|
// "Les Milles Cages"
|
||||||
|
{
|
||||||
|
name: 'Ernestin Pomel',
|
||||||
|
birth: { day: 11, month: 2, year: 3179 },
|
||||||
|
wiki: 'https://alexcreates.fr/leim/index.php/Ernestin_Pomel',
|
||||||
|
category: 'mage'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'Quacille Lévios',
|
||||||
|
birth: { day: 3, month: 6, year: 3162 },
|
||||||
|
wiki: 'https://alexcreates.fr/leim/index.php/Quacille_Lévios',
|
||||||
|
category: 'professeur',
|
||||||
|
secondaryCategories: ['mage']
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'Morel Lévios',
|
||||||
|
birth: { day: 26, month: 3, year: 3157 },
|
||||||
|
wiki: 'https://alexcreates.fr/leim/index.php/Morel_Lévios',
|
||||||
|
category: 'sentinelle',
|
||||||
|
secondaryCategories: ['mage', 'buse blanche']
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'Anastael Simon',
|
||||||
|
birth: { day: 32, month: 2, year: 3166 },
|
||||||
|
wiki: 'https://alexcreates.fr/leim/index.php/Anastael_Simon',
|
||||||
|
category: 'étincelle',
|
||||||
|
secondaryCategories: ['mage']
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'Grestain',
|
||||||
|
birth: { day: 9, month: 2, year: 3162 },
|
||||||
|
wiki: 'https://alexcreates.fr/leim/index.php/Grestain',
|
||||||
|
category: 'criminel',
|
||||||
|
secondaryCategories: ['mage']
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'Lucien Malanth',
|
||||||
|
birth: { day: 31, month: 4, year: 3167 },
|
||||||
|
wiki: 'https://alexcreates.fr/leim/index.php/Lucien_Malanth',
|
||||||
|
category: 'criminel',
|
||||||
|
secondaryCategories: ['mage']
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'Tivian Rodhus',
|
||||||
|
birth: { day: 13, month: 3, year: 3157 },
|
||||||
|
wiki: 'https://alexcreates.fr/leim/index.php/Tivian_Rodhus',
|
||||||
|
category: 'professeur',
|
||||||
|
secondaryCategories: ['mage', 'criminel']
|
||||||
|
},
|
||||||
|
|
||||||
|
// "Les Cloches de Cantane"
|
||||||
|
{
|
||||||
|
name: 'Bénédicte Vaht',
|
||||||
|
description: "Moine d'Ikami ayant entrepris la construction du Pilier Blanc de Cantane",
|
||||||
|
birth: { day: 28, month: 6, year: 3139 },
|
||||||
|
category: 'ecclésiastique'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'Taleb Vaht',
|
||||||
|
description:
|
||||||
|
"Fils de Bénédicte, il s'est engagé auprès des Étincelles comme alchimiste artificier.",
|
||||||
|
birth: { day: 9, month: 1, year: 3180 },
|
||||||
|
death: { day: 28, month: 7, year: 3209 },
|
||||||
|
category: 'étincelle',
|
||||||
|
secondaryCategories: ['scientifique']
|
||||||
|
}
|
||||||
|
]
|
||||||
|
})
|
||||||
217
server/api/events.ts
Normal file
217
server/api/events.ts
Normal file
@@ -0,0 +1,217 @@
|
|||||||
|
export default defineEventHandler(() => {
|
||||||
|
return [
|
||||||
|
// Histoire Antique
|
||||||
|
{
|
||||||
|
title: "Laurdieu devient la première cité de l'empire de Kaliatos",
|
||||||
|
startDate: { day: 3, month: 4, year: -1932 },
|
||||||
|
description:
|
||||||
|
"L'empire de Kaliatos établi sa capitale dans la cité de Laurdieu, qui connaitra une prospérité nouvelle au sein d'Aldys.",
|
||||||
|
category: 'législation',
|
||||||
|
secondaryCategories: ['inauguration'],
|
||||||
|
wiki: 'https://alexcreates.fr/leim/index.php/Laurdieu',
|
||||||
|
hidden: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "Apparition d'Asménys",
|
||||||
|
startDate: { day: 19, month: 7, year: -1358 },
|
||||||
|
description:
|
||||||
|
"La défunte chanteuse Asménys apparaît à un barde pendant son jeune public, démarrant la religion des Prêtresses d'Asménys.",
|
||||||
|
category: 'religion',
|
||||||
|
secondaryCategories: ['bénédiction'],
|
||||||
|
wiki: 'https://alexcreates.fr/leim/index.php/Pr%C3%AAtresses_d%27Asm%C3%A9nys',
|
||||||
|
hidden: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: 'La Rupture',
|
||||||
|
startDate: { day: 26, month: 5, year: -756 },
|
||||||
|
endDate: { day: 4, month: 9, year: 29 },
|
||||||
|
description:
|
||||||
|
"Les Abysses se déversent à la surface de Léim, à travers plusieurs brèches. Plusieurs hordes de démons se rapprochent des villes, et ce qu'on appellera l'Âge des Abysses commencent alors sur la planète entière.",
|
||||||
|
category: 'catastrophe',
|
||||||
|
secondaryCategories: ['catastrophe naturelle'],
|
||||||
|
wiki: 'https://alexcreates.fr/leim/index.php/Seconde_Rupture',
|
||||||
|
hidden: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: 'Marche du sang',
|
||||||
|
startDate: { day: 18, month: 9, year: -420 },
|
||||||
|
endDate: { day: 27, month: 1, year: -419 },
|
||||||
|
description:
|
||||||
|
"L'empereur de Kaliatos ordonne personnellement la traque de Jorhas Kirendre pour connivence avec les démons. Plusieurs bataillons sont affectés à la chasse de Jorhas, qui se terminera par son incarcération ainsi que la mort de plusieurs centaines de soldats.",
|
||||||
|
category: 'criminalité',
|
||||||
|
wiki: 'https://alexcreates.fr/leim/index.php/Jorhas_Kirendre',
|
||||||
|
hidden: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: 'Exécution de Tyhos',
|
||||||
|
startDate: { day: 1, month: 0, year: 0 },
|
||||||
|
description:
|
||||||
|
"Le léviathan Tyhos rend l'âme après un combat de plusieurs années contre Lystos, le dieu du Soleil.",
|
||||||
|
category: 'bénédiction',
|
||||||
|
secondaryCategories: ['mort'],
|
||||||
|
wiki: 'https://alexcreates.fr/leim/index.php/Tyhos',
|
||||||
|
hidden: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: 'Traité de Kadel',
|
||||||
|
startDate: { day: 29, month: 4, year: 100 },
|
||||||
|
description: '',
|
||||||
|
category: 'inauguration',
|
||||||
|
secondaryCategories: ['législation'],
|
||||||
|
wiki: 'https://alexcreates.fr/leim/index.php/Alliance_Kald%C3%A9lienne#Trait%C3%A9_de_Kadel'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: 'Découverte des Plaines de Poussières',
|
||||||
|
startDate: { day: 17, month: 7, year: 305 },
|
||||||
|
description:
|
||||||
|
"Les troupes de la reconquête aldienne explorent le littoral d'une immense étendue grise et inerte.",
|
||||||
|
category: 'découverte',
|
||||||
|
secondaryCategories: ['exploration'],
|
||||||
|
wiki: 'https://alexcreates.fr/leim/index.php/Plaines_de_poussi%C3%A8re',
|
||||||
|
hidden: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: 'Construction du Rempart de Laurdieu',
|
||||||
|
startDate: { day: 30, month: 2, year: 340 },
|
||||||
|
endDate: { day: 27, month: 9, year: 355 },
|
||||||
|
description:
|
||||||
|
"Le Grand Conseil Kaldélien ordonne la construction d'une muraille autour des Plaines de Poussières, afin de contenir les démons y sortant.",
|
||||||
|
category: 'construction',
|
||||||
|
wiki: 'https://alexcreates.fr/leim/index.php/Plaines_de_poussi%C3%A8re',
|
||||||
|
hidden: true
|
||||||
|
},
|
||||||
|
|
||||||
|
// Histoire Récente
|
||||||
|
{
|
||||||
|
title: "Inauguration de l'Académie Artistique Arcanique",
|
||||||
|
startDate: { day: 11, month: 6, year: 2545 },
|
||||||
|
description:
|
||||||
|
"Scäd Sceni ouvre son institut artistique dédié à l'apprentissage des arts arcaniques",
|
||||||
|
category: 'inauguration',
|
||||||
|
secondaryCategories: ['arcanologie'],
|
||||||
|
wiki: 'https://alexcreates.fr/leim/index.php/Buse_(arme)'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: 'Création de la buse kaldélienne',
|
||||||
|
startDate: { day: 4, month: 2, year: 3113 },
|
||||||
|
description:
|
||||||
|
'Sophia de Rougefer invente la buse kaldélienne, une arme à feu souple à deux canons.',
|
||||||
|
category: 'invention',
|
||||||
|
secondaryCategories: ['science'],
|
||||||
|
wiki: 'https://alexcreates.fr/leim/index.php/Buse_(arme)'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: 'Feux dans les champs de Bamast',
|
||||||
|
startDate: { day: 9, month: 5, year: 3200 },
|
||||||
|
description:
|
||||||
|
"Plusieurs incendies criminels se propagent à travers les champs de sérille des fermiers des littoraux de Bamast. Aucun suspect ni coupable ne sera trouvé et l'enquête sera baclée.",
|
||||||
|
category: 'catastrophe',
|
||||||
|
secondaryCategories: ['criminalité'],
|
||||||
|
wiki: 'https://alexcreates.fr/leim/index.php/Vascylly'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: 'Meurtre de Darléon Typhos',
|
||||||
|
startDate: { day: 21, month: 6, year: 3200 },
|
||||||
|
description:
|
||||||
|
'Darléon Typhos surprend Vascylly fouillant sa demeure peu après la tombée de la nuit. Le majordome de la famille Typhos découvre le corps sans vie de son maître le lendemain.',
|
||||||
|
category: 'criminalité',
|
||||||
|
secondaryCategories: ['joueurs'],
|
||||||
|
wiki: 'https://alexcreates.fr/leim/index.php/Vascylly'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: 'Scandale Rodhus',
|
||||||
|
startDate: { day: 25, month: 9, year: 3208 },
|
||||||
|
description:
|
||||||
|
"Tivian Rodhus, un professeur estimé de l'Académie Centrale Kaldélienne, est emprisonné pour corruption et aggression sexuelle. Le corps enseignant y est remanié sur ordre de Lazarus Tymos, comte de Nacride.",
|
||||||
|
category: 'criminalité',
|
||||||
|
secondaryCategories: ['scandale'],
|
||||||
|
wiki: 'https://alexcreates.fr/leim/index.php/Tivian_Rodhus'
|
||||||
|
},
|
||||||
|
|
||||||
|
// "Les Milles Cages"
|
||||||
|
{
|
||||||
|
title: "Arrivée d'aventuriers à Borélis",
|
||||||
|
startDate: { day: 12, month: 7, year: 3209 },
|
||||||
|
description:
|
||||||
|
'Tara Belyus, Vascylly et Adol Sulvan livrent 3 condamnés à Handany. Ils partent pour la mer durant la journée.',
|
||||||
|
category: 'joueurs'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "Naufrage de l'Éclipse",
|
||||||
|
description:
|
||||||
|
"L'Éclipse, le navire de la garde contenant des condamnés à destination des Cages Handaniennes, s'échoue au large des côtes montagneuses de la Lance d'Aldys.",
|
||||||
|
startDate: { day: 14, month: 7, year: 3209 },
|
||||||
|
category: 'catastrophe'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: 'Emprisonnement de Tivian Rodhus',
|
||||||
|
description: "Celui qu'on surnomme la Bête d'Ambrose arrive à Handany, où il purgera sa peine.",
|
||||||
|
startDate: { day: 14, month: 7, year: 3209 },
|
||||||
|
category: 'législation'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: 'Sulvan et Anastael atteignent Bamast',
|
||||||
|
startDate: { day: 19, month: 2, year: 3210 },
|
||||||
|
category: 'joueurs'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: 'Jugement de Bormis Griloup',
|
||||||
|
description:
|
||||||
|
"Bromis Griloup est jugé coupable d'escroquerie et sabotage aux Cours d'Acier de Tourgrise. Il purgera une peine de 10 ans au sein des prisons royales.",
|
||||||
|
startDate: { day: 4, month: 8, year: 3209 },
|
||||||
|
category: 'législation'
|
||||||
|
},
|
||||||
|
|
||||||
|
// "Les Cloches de Cantane"
|
||||||
|
{
|
||||||
|
title: 'Inauguration de la Cloche du Pilier',
|
||||||
|
description: "Le Moine Premier inaugure la grande cloche d'argent au sommet du Pilier d'Ikami.",
|
||||||
|
startDate: { day: 29, month: 5, year: 3209 },
|
||||||
|
category: 'religion',
|
||||||
|
secondaryCategories: ['inauguration']
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '1ère disparation à Cantane',
|
||||||
|
description: "Taleb Vaht décède dans une grotte à la suite d'une attaque d'ischiels enragées.",
|
||||||
|
startDate: { day: 28, month: 7, year: 3209 },
|
||||||
|
category: 'mort',
|
||||||
|
hidden: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '2ème disparation à Cantane',
|
||||||
|
description: 'Donovane le mineur kéturien disparait sans laisser de traces.',
|
||||||
|
startDate: { day: 32, month: 7, year: 3209 },
|
||||||
|
category: 'mort',
|
||||||
|
hidden: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '3ème disparation à Cantane',
|
||||||
|
description: 'Disparition de Sébastien, gredin sauride.',
|
||||||
|
startDate: { day: 10, month: 8, year: 3209 },
|
||||||
|
category: 'mort',
|
||||||
|
hidden: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '4ème disparation à Cantane',
|
||||||
|
description: 'Disparition de Thérence, patrouilleur sauride de la Vieille Garde.',
|
||||||
|
startDate: { day: 19, month: 8, year: 3209 },
|
||||||
|
category: 'mort',
|
||||||
|
hidden: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '5ème disparation à Cantane',
|
||||||
|
description: 'Disparition de Mathilda Boulais, vendeuse de pierres.',
|
||||||
|
startDate: { day: 22, month: 8, year: 3209 },
|
||||||
|
category: 'mort',
|
||||||
|
hidden: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: 'Grande Banque Minérale de Cantane',
|
||||||
|
description:
|
||||||
|
'Les artisans et mineurs de Rougefer se réunissent à Cantane pour vendre le fruit de leur dur labeur.',
|
||||||
|
startDate: { day: 23, month: 8, year: 3209 },
|
||||||
|
endDate: { day: 26, month: 8, year: 3209 },
|
||||||
|
category: 'commerce'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
})
|
||||||
@@ -7,7 +7,7 @@ import {
|
|||||||
type LeimPeriod,
|
type LeimPeriod,
|
||||||
type LeimPeriodShort
|
type LeimPeriodShort
|
||||||
} from '@/models/Date'
|
} from '@/models/Date'
|
||||||
import { useStorage, useUrlSearchParams } from '@vueuse/core'
|
import { useSessionStorage, useUrlSearchParams } from '@vueuse/core'
|
||||||
import { defineStore } from 'pinia'
|
import { defineStore } from 'pinia'
|
||||||
import { computed, ref, type ComputedRef, type Ref } from 'vue'
|
import { computed, ref, type ComputedRef, type Ref } from 'vue'
|
||||||
|
|
||||||
@@ -161,7 +161,7 @@ export const useCalendar = defineStore('calendar', () => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
const selectedDate = useStorage<LeimDate>('selected-date', currentLeimDate.value)
|
const selectedDate = useSessionStorage<LeimDate>('selected-date', currentLeimDate.value, { deep: true })
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check whether the current viewType is active
|
* Check whether the current viewType is active
|
||||||
|
|||||||
@@ -1,15 +1,27 @@
|
|||||||
import { charactersList } from '@/data/Characters'
|
|
||||||
import type { Character } from '@/models/Characters'
|
import type { Character } from '@/models/Characters'
|
||||||
import { defineStore } from 'pinia'
|
import { defineStore } from 'pinia'
|
||||||
|
|
||||||
export const useCharacters = defineStore('characters', () => {
|
export const useCharacters = defineStore('characters', () => {
|
||||||
const characters: Character[] = charactersList
|
const characters = ref<Character[]>([])
|
||||||
|
const charactersAreLoading = ref<boolean>(false)
|
||||||
|
const charactersLoaded = ref<boolean>(false)
|
||||||
|
|
||||||
// Get all birth events
|
async function fetchCharacters() {
|
||||||
const charactersWithBirthData: Character[] = characters.filter((character) => character.birth)
|
try {
|
||||||
|
charactersAreLoading.value = true
|
||||||
|
const fetched = await useFetch<Character[]>('/api/characters')
|
||||||
|
|
||||||
// Get all death events
|
if (fetched.data.value) {
|
||||||
const charactersWithDeathData: Character[] = characters.filter((character) => character.death)
|
charactersLoaded.value = true
|
||||||
|
characters.value = fetched.data.value
|
||||||
|
}
|
||||||
|
} catch (err) {
|
||||||
|
console.log(err)
|
||||||
|
} finally {
|
||||||
|
charactersAreLoading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
fetchCharacters()
|
||||||
|
|
||||||
return { characters, charactersWithBirthData, charactersWithDeathData }
|
return { characters }
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,45 +1,45 @@
|
|||||||
import { initialEvents } from '@/data/Events'
|
|
||||||
import { compareDates, convertDateToDays, daysPerMonth, type LeimDate } from '@/models/Date'
|
import { compareDates, convertDateToDays, daysPerMonth, type LeimDate } from '@/models/Date'
|
||||||
import type { CalendarEvent } from '@/models/Events'
|
import type { CalendarEvent } from '@/models/Events'
|
||||||
import { defineStore } from 'pinia'
|
import { defineStore } from 'pinia'
|
||||||
import { ref, watch, type Ref } from 'vue'
|
import { ref, watch, type Ref } from 'vue'
|
||||||
import { useCalendar } from './CalendarStore'
|
import { useCalendar } from './CalendarStore'
|
||||||
// import { useCharacters } from './CharacterStore'
|
|
||||||
|
|
||||||
export const useCalendarEvents = defineStore('calendar-events', () => {
|
export const useCalendarEvents = defineStore('calendar-events', () => {
|
||||||
const { currentDate, currentConfig } = useCalendar()
|
const { currentDate, currentConfig } = useCalendar()
|
||||||
// const { charactersWithBirthData, charactersWithDeathData } = useCharacters()
|
|
||||||
|
|
||||||
const baseEvents: CalendarEvent[] = initialEvents
|
const baseEvents = ref<CalendarEvent[]>([])
|
||||||
|
const eventsAreLoading = ref<boolean>(false)
|
||||||
|
const eventsLoaded = ref<boolean>(false)
|
||||||
|
|
||||||
// const characterBirthEvents = charactersWithBirthData.map((character) => {
|
const allEvents = computed(() => baseEvents.value.sort((a, b) => {
|
||||||
// return {
|
|
||||||
// title: `Naissance de ${character.name}`,
|
|
||||||
// startDate: character.birth,
|
|
||||||
// category: 'naissance'
|
|
||||||
// } as CalendarEvent
|
|
||||||
// })
|
|
||||||
|
|
||||||
// const characterDeathEvents = charactersWithDeathData.map((character) => {
|
|
||||||
// return {
|
|
||||||
// title: `Décès de ${character.name}`,
|
|
||||||
// startDate: character.death,
|
|
||||||
// category: 'mort'
|
|
||||||
// } as CalendarEvent
|
|
||||||
// })
|
|
||||||
|
|
||||||
const allEvents = [...baseEvents].sort((a, b) => {
|
|
||||||
return compareDates(a.startDate, b.startDate, 'desc')
|
return compareDates(a.startDate, b.startDate, 'desc')
|
||||||
})
|
}))
|
||||||
|
|
||||||
// Gets all current event in its default state
|
// Gets all current event in its default state
|
||||||
const currentEvents: Ref<CalendarEvent[]> = ref(computeCurrentEvents())
|
const currentEvents: Ref<CalendarEvent[]> = ref(computeCurrentEvents())
|
||||||
|
|
||||||
// Watch for currentDate changes
|
// Watch for currentDate changes
|
||||||
watch(currentDate, () => {
|
watch([currentDate, allEvents], () => {
|
||||||
currentEvents.value = computeCurrentEvents()
|
currentEvents.value = computeCurrentEvents()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
async function fetchEvents() {
|
||||||
|
try {
|
||||||
|
eventsAreLoading.value = true
|
||||||
|
const fetched = await useFetch<CalendarEvent[]>('/api/events')
|
||||||
|
|
||||||
|
if (fetched.data.value) {
|
||||||
|
eventsLoaded.value = true
|
||||||
|
baseEvents.value = fetched.data.value
|
||||||
|
}
|
||||||
|
} catch (err) {
|
||||||
|
console.log(err)
|
||||||
|
} finally {
|
||||||
|
eventsAreLoading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
fetchEvents()
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Determines if the event can appear in the front end
|
* Determines if the event can appear in the front end
|
||||||
*
|
*
|
||||||
@@ -105,7 +105,7 @@ export const useCalendarEvents = defineStore('calendar-events', () => {
|
|||||||
* @returns A list of events that can appear in the current view
|
* @returns A list of events that can appear in the current view
|
||||||
*/
|
*/
|
||||||
function computeCurrentEvents(): CalendarEvent[] {
|
function computeCurrentEvents(): CalendarEvent[] {
|
||||||
return allEvents.filter((event) => shouldEventBeDisplayed(event))
|
return allEvents.value.filter((event) => shouldEventBeDisplayed(event))
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -140,8 +140,8 @@ export const useCalendarEvents = defineStore('calendar-events', () => {
|
|||||||
let t: { eventData: CalendarEvent; distance: number; targetKey: 'startDate' | 'endDate' }[] = []
|
let t: { eventData: CalendarEvent; distance: number; targetKey: 'startDate' | 'endDate' }[] = []
|
||||||
|
|
||||||
// Loop over all event once to convert the structure to a usable one
|
// Loop over all event once to convert the structure to a usable one
|
||||||
for (let i = 0; i < allEvents.length; i++) {
|
for (let i = 0; i < allEvents.value.length; i++) {
|
||||||
const e: CalendarEvent = allEvents[i]
|
const e: CalendarEvent = allEvents.value[i]
|
||||||
|
|
||||||
// Estimate distance from pivot
|
// Estimate distance from pivot
|
||||||
const startDateDays: number = convertDateToDays(e.startDate)
|
const startDateDays: number = convertDateToDays(e.startDate)
|
||||||
@@ -211,5 +211,5 @@ export const useCalendarEvents = defineStore('calendar-events', () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return { allEvents, currentEvents, getRelativeEventFromDate, getRelativeEventFromEvent }
|
return { allEvents, eventsAreLoading, eventsLoaded, currentEvents, fetchEvents, getRelativeEventFromDate, getRelativeEventFromEvent }
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user