Moved data out of stores
This commit is contained in:
@@ -15,12 +15,12 @@ defineProps<{
|
||||
class="text-xs text-white px-2 py-1 block w-full text-left rounded-sm whitespace-nowrap overflow-hidden text-ellipsis"
|
||||
:class="{
|
||||
'bg-slate-600 hover:bg-slate-700': !event.category,
|
||||
'bg-green-700 hover:bg-green-800': event.category === 'birth',
|
||||
'bg-stone-600 hover:bg-stone-800': event.category === 'death',
|
||||
'bg-red-600 hover:bg-red-800': event.category === 'catastrophe',
|
||||
'bg-pink-600 hover:bg-pink-800': event.category === 'natural-disaster',
|
||||
'bg-blue-600 hover:bg-blue-800': event.category === 'legal',
|
||||
'bg-amber-700 hover:bg-amber-800': event.category === 'player'
|
||||
'bg-lime-600 hover:bg-lime-700': event.category === 'birth',
|
||||
'bg-stone-600 hover:bg-stone-700': event.category === 'death',
|
||||
'bg-orange-600 hover:bg-orange-700': event.category === 'catastrophe',
|
||||
'bg-pink-600 hover:bg-pink-700': event.category === 'natural-disaster',
|
||||
'bg-sky-600 hover:bg-sky-700': event.category === 'legal',
|
||||
'bg-emerald-600 hover:bg-emerald-700': event.category === 'player'
|
||||
}"
|
||||
>
|
||||
{{ event.title }}
|
||||
|
||||
@@ -51,8 +51,8 @@ const dateDifference = computed(() => getRelativeString(defaultDate, selectedDat
|
||||
</div>
|
||||
<div class="container">
|
||||
<div class="flex">
|
||||
<div class="px-4 py-2 border-slate-700 border-x-[1px] border-t-[1px] rounded-sm">
|
||||
<span class="text-sm font-bold">{{ currentDate.currentDateTitle }}</span>
|
||||
<div class="px-4 py-2 border-slate-700 border-x-[1px] border-t-[1px] rounded-t-sm">
|
||||
<span class="text-sm">{{ currentDate.currentDateTitle }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
34
src/data/Characters.ts
Normal file
34
src/data/Characters.ts
Normal file
@@ -0,0 +1,34 @@
|
||||
import type { Character } from '@/models/Characters'
|
||||
|
||||
export const charactersList: Character[] = [
|
||||
// Counts of the Alliance
|
||||
{ name: 'Alfrid de Lagarde', birth: { day: 29, month: 7, year: 3193, period: 'nante' } },
|
||||
{ name: 'Alaric de Lagarde', birth: { day: 23, month: 8, year: 3192, period: 'nante' } },
|
||||
{ name: 'Anastael III de Quillon', birth: { day: 1, month: 5, year: 3184, period: 'nante' } },
|
||||
{ name: 'Antoine de Mireloin', birth: { day: 31, month: 5, year: 3190, period: 'nante' } },
|
||||
{ name: 'Armance Ronchère', birth: { day: 1, month: 1, year: 3132, period: 'nante' } },
|
||||
{ name: 'Baranne Rougefer', birth: { day: 1, month: 0, year: 3175, period: 'nante' } },
|
||||
{ name: 'Béatrice II de Grandlac', birth: { day: 21, month: 4, year: 3158, period: 'nante' } },
|
||||
{ name: 'Favio Asharos-Losantelle', birth: { day: 17, month: 3, year: 3091, period: 'nante' } },
|
||||
{ name: 'Firmin de Montardieu', birth: { day: 9, month: 2, year: 3203, period: 'nante' } },
|
||||
{
|
||||
name: 'Laura de Montardieu',
|
||||
birth: { day: 32, month: 3, year: 3167, period: 'nante' },
|
||||
death: { day: 1, month: 4, year: 3217, period: 'nante' }
|
||||
},
|
||||
{ name: 'Lazarus Tymos', birth: { day: 29, month: 9, year: 3145, period: 'nante' } },
|
||||
{ name: 'Marion de Corambre', birth: { day: 14, month: 7, year: 3190, period: 'nante' } },
|
||||
{ name: 'Relforg Pergaré', birth: { day: 18, month: 9, year: 3182, period: 'nante' } },
|
||||
{ name: 'Vilgarde de Ternâcre', birth: { day: 3, month: 3, year: 2998, period: 'nante' } },
|
||||
{ name: 'Ysildy Milopée', birth: { day: 3, month: 1, year: 3187, period: 'nante' } },
|
||||
|
||||
// "Les Milles Cages"
|
||||
{ name: 'Ernestin Pomel', birth: { day: 11, month: 2, year: 3179, period: 'nante' } },
|
||||
{ name: 'Quacille Lévios', birth: { day: 3, month: 6, year: 3162, period: 'nante' } },
|
||||
{ name: 'Anastael Simon', birth: { day: 32, month: 2, year: 3166, period: 'nante' } },
|
||||
{ name: 'Grestain', birth: { day: 9, month: 2, year: 3162, period: 'nante' } },
|
||||
{ name: 'Tivian Rodhus', birth: { day: 13, month: 3, year: 3157, period: 'nante' } },
|
||||
|
||||
// Player characters
|
||||
{ name: 'Sulvan Trois-Barbes', birth: { day: 20, month: 3, year: 3169, period: 'nante' } }
|
||||
]
|
||||
36
src/data/Events.ts
Normal file
36
src/data/Events.ts
Normal file
@@ -0,0 +1,36 @@
|
||||
import type { CalendarEvent } from '@/models/Events'
|
||||
|
||||
export const regularEvents: CalendarEvent[] = [
|
||||
{
|
||||
title: "Arrivée d'aventuriers à Borélis",
|
||||
date: { day: 12, month: 7, year: 3209, period: 'nante' },
|
||||
description:
|
||||
'Tara Belyus, Vascylly et Adol Sulvan livrent 3 condamnés à Handany. Ils partent pour la mer durant la journée.',
|
||||
category: 'player'
|
||||
},
|
||||
{
|
||||
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.",
|
||||
date: { day: 14, month: 7, year: 3209, period: 'nante' },
|
||||
category: 'catastrophe'
|
||||
},
|
||||
{
|
||||
title: 'Emprisonnement de Tivian Rodhus',
|
||||
description: "Celui qu'on surnomme la Bête d'Ambrose arrive à Handany, où il purgera sa peine.",
|
||||
date: { day: 14, month: 7, year: 3209, period: 'nante' },
|
||||
category: 'legal'
|
||||
},
|
||||
{
|
||||
title: 'Sulvan et Anastael atteignent Bamast',
|
||||
date: { day: 19, month: 2, year: 3210, period: 'nante' },
|
||||
category: 'player'
|
||||
},
|
||||
{
|
||||
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.",
|
||||
date: { day: 4, month: 8, year: 3209, period: 'nante' },
|
||||
category: 'legal'
|
||||
}
|
||||
]
|
||||
@@ -81,7 +81,7 @@ export const useCalendar = defineStore('calendar', () => {
|
||||
write: true
|
||||
})
|
||||
|
||||
// Default date settings (current day)
|
||||
// Default date settings (current day in the world)
|
||||
const defaultDay = 23
|
||||
const defaultMonth = 8
|
||||
const defaultYear = 3209
|
||||
|
||||
@@ -1,40 +1,10 @@
|
||||
import { charactersList } from '@/data/Characters'
|
||||
import type { Character } from '@/models/Characters'
|
||||
import { defineStore } from 'pinia'
|
||||
import { computed, type ComputedRef } from 'vue'
|
||||
|
||||
export const useCharacters = defineStore('characters', () => {
|
||||
const characters: Character[] = [
|
||||
// Counts of the Alliance
|
||||
{ name: 'Alfrid de Lagarde', birth: { day: 29, month: 7, year: 3193, period: 'nante' } },
|
||||
{ name: 'Alaric de Lagarde', birth: { day: 23, month: 8, year: 3192, period: 'nante' } },
|
||||
{ name: 'Anastael III de Quillon', birth: { day: 1, month: 5, year: 3184, period: 'nante' } },
|
||||
{ name: 'Antoine de Mireloin', birth: { day: 31, month: 5, year: 3190, period: 'nante' } },
|
||||
{ name: 'Armance Ronchère', birth: { day: 1, month: 1, year: 3132, period: 'nante' } },
|
||||
{ name: 'Baranne Rougefer', birth: { day: 1, month: 0, year: 3175, period: 'nante' } },
|
||||
{ name: 'Béatrice II de Grandlac', birth: { day: 21, month: 4, year: 3158, period: 'nante' } },
|
||||
{ name: 'Favio Asharos-Losantelle', birth: { day: 17, month: 3, year: 3091, period: 'nante' } },
|
||||
{ name: 'Firmin de Montardieu', birth: { day: 9, month: 2, year: 3203, period: 'nante' } },
|
||||
{
|
||||
name: 'Laura de Montardieu',
|
||||
birth: { day: 32, month: 3, year: 3167, period: 'nante' },
|
||||
death: { day: 1, month: 4, year: 3217, period: 'nante' }
|
||||
},
|
||||
{ name: 'Lazarus Tymos', birth: { day: 29, month: 9, year: 3145, period: 'nante' } },
|
||||
{ name: 'Marion de Corambre', birth: { day: 14, month: 7, year: 3190, period: 'nante' } },
|
||||
{ name: 'Relforg Pergaré', birth: { day: 18, month: 9, year: 3182, period: 'nante' } },
|
||||
{ name: 'Vilgarde de Ternâcre', birth: { day: 3, month: 3, year: 2998, period: 'nante' } },
|
||||
{ name: 'Ysildy Milopée', birth: { day: 3, month: 1, year: 3187, period: 'nante' } },
|
||||
|
||||
// "Les Milles Cages"
|
||||
{ name: 'Ernestin Pomel', birth: { day: 11, month: 2, year: 3179, period: 'nante' } },
|
||||
{ name: 'Quacille Lévios', birth: { day: 3, month: 6, year: 3162, period: 'nante' } },
|
||||
{ name: 'Anastael Simon', birth: { day: 32, month: 2, year: 3166, period: 'nante' } },
|
||||
{ name: 'Grestain', birth: { day: 9, month: 2, year: 3162, period: 'nante' } },
|
||||
{ name: 'Tivian Rodhus', birth: { day: 13, month: 3, year: 3157, period: 'nante' } },
|
||||
|
||||
// Player characters
|
||||
{ name: 'Sulvan Trois-Barbes', birth: { day: 20, month: 3, year: 3169, period: 'nante' } }
|
||||
]
|
||||
const characters: Character[] = charactersList
|
||||
|
||||
// Get all birth events
|
||||
const charactersWithBirthData: ComputedRef<Character[]> = computed(() =>
|
||||
|
||||
@@ -3,39 +3,13 @@ import { defineStore } from 'pinia'
|
||||
import { computed, ref, watch, type Ref } from 'vue'
|
||||
import { useCalendar } from './CalendarStore'
|
||||
import { useCharacters } from './CharacterStore'
|
||||
import { regularEvents } from '@/data/Events'
|
||||
|
||||
export const useCalendarEvents = defineStore('calendar-events', () => {
|
||||
const { currentDate, currentConfig } = useCalendar()
|
||||
const { charactersWithBirthData, charactersWithDeathData } = useCharacters()
|
||||
|
||||
const baseEvents = ref<CalendarEvent[]>([
|
||||
{
|
||||
title: "Arrivée d'aventuriers à Borélis",
|
||||
date: { day: 12, month: 7, year: 3209, period: 'nante' },
|
||||
description:
|
||||
'Tara Belyus, Vascylly et Adol Sulvan livrent 3 condamnés à Handany. Ils partent pour la mer durant la journée.',
|
||||
category: 'player'
|
||||
},
|
||||
{
|
||||
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.",
|
||||
date: { day: 14, month: 7, year: 3209, period: 'nante' },
|
||||
category: 'catastrophe'
|
||||
},
|
||||
{
|
||||
title: 'Sulvan et Anastael atteignent Bamast',
|
||||
date: { day: 19, month: 2, year: 3210, period: 'nante' },
|
||||
category: 'player'
|
||||
},
|
||||
{
|
||||
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.",
|
||||
date: { day: 4, month: 8, year: 3209, period: 'nante' },
|
||||
category: 'legal'
|
||||
}
|
||||
])
|
||||
const baseEvents = ref<CalendarEvent[]>(regularEvents)
|
||||
|
||||
const characterBirthEvents = computed(() => {
|
||||
return charactersWithBirthData.map((character) => {
|
||||
|
||||
Reference in New Issue
Block a user