Added more options to events

This commit is contained in:
Alexis
2024-04-08 09:49:36 +02:00
parent b3129c7c72
commit 802a3707ca
4 changed files with 41 additions and 17 deletions

View File

@@ -13,17 +13,18 @@ defineProps<{
<Popover>
<PopoverTrigger as-child>
<button
class="text-xs text-white px-2 py-1 block w-full text-left rounded-sm whitespace-nowrap overflow-hidden text-ellipsis"
class="text-xs 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-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',
'text-white bg-slate-600 hover:bg-slate-700': !event.category,
'text-white bg-lime-600 hover:bg-lime-700': event.category === 'birth',
'text-white bg-stone-600 hover:bg-stone-700': event.category === 'death',
'text-white bg-orange-600 hover:bg-orange-700': event.category === 'catastrophe',
'text-white bg-pink-600 hover:bg-pink-700': event.category === 'natural-disaster',
'text-white bg-sky-600 hover:bg-sky-700': event.category === 'legal',
'text-slate-900 bg-amber-300 hover:bg-amber-400': event.category === 'inauguration',
'bg-purple-600 hover:bg-purple-700': event.category === 'religious',
'bg-emerald-600 hover:bg-emerald-700': event.category === 'player'
'text-white bg-purple-600 hover:bg-purple-700': event.category === 'religious',
'text-slate-900 bg-yellow-100 hover:bg-yellow-300': event.category === 'boon',
'text-white bg-emerald-600 hover:bg-emerald-700': event.category === 'player'
}"
>
{{ event.title }}

View File

@@ -62,15 +62,16 @@ const sortedResults = computed(() => {
v-if="isCalendarEvent(r)"
class="block w-full text-left p-2 rounded-sm"
:class="{
'bg-slate-600 hover:bg-slate-700': !r.category,
'bg-lime-600 hover:bg-lime-700': r.category === 'birth',
'bg-stone-600 hover:bg-stone-700': r.category === 'death',
'bg-orange-600 hover:bg-orange-700': r.category === 'catastrophe',
'bg-pink-600 hover:bg-pink-700': r.category === 'natural-disaster',
'bg-sky-600 hover:bg-sky-700': r.category === 'legal',
'text-white bg-slate-600 hover:bg-slate-700': !r.category,
'text-white bg-lime-600 hover:bg-lime-700': r.category === 'birth',
'text-white bg-stone-600 hover:bg-stone-700': r.category === 'death',
'text-white bg-orange-600 hover:bg-orange-700': r.category === 'catastrophe',
'text-white bg-pink-600 hover:bg-pink-700': r.category === 'natural-disaster',
'text-white bg-sky-600 hover:bg-sky-700': r.category === 'legal',
'text-slate-900 bg-amber-300 hover:bg-amber-400': r.category === 'inauguration',
'bg-purple-600 hover:bg-purple-700': r.category === 'religious',
'bg-emerald-600 hover:bg-emerald-700': r.category === 'player'
'text-white bg-purple-600 hover:bg-purple-700': r.category === 'religious',
'text-slate-900 bg-yellow-50 hover:bg-yellow-200': r.category === 'boon',
'text-white bg-emerald-600 hover:bg-emerald-700': r.category === 'player'
}"
@click="handleJumpToDate(r.date)"
>

View File

@@ -1,6 +1,25 @@
import type { CalendarEvent } from '@/models/Events'
export const regularEvents: CalendarEvent[] = [
// Histoire Ancienne
{
title: 'Exécution de Tyhos',
date: { day: 1, month: 0, year: 0, period: 'nante' },
description:
"Le léviathan Tyhos rend l'âme après un combat de plusieurs années contre Lystos, le dieu du Soleil.",
category: 'boon',
secondaryCategories: ['death'],
wiki: 'https://alexcreates.fr/leim/index.php/Alliance_Kald%C3%A9lienne#Trait%C3%A9_de_Kadel'
},
{
title: 'Traité de Kadel',
date: { day: 20, month: 4, year: 100, period: 'nante' },
description: '',
category: 'inauguration',
secondaryCategories: ['legal'],
wiki: 'https://alexcreates.fr/leim/index.php/Alliance_Kald%C3%A9lienne#Trait%C3%A9_de_Kadel'
},
// "Les Milles Cages"
{
title: "Arrivée d'aventuriers à Borélis",
date: { day: 12, month: 7, year: 3209, period: 'nante' },

View File

@@ -5,6 +5,8 @@ export interface CalendarEvent {
date: LeimDate
description?: string
category?: CalendarEventCategory
secondaryCategories?: CalendarEventCategory[]
wiki?: string
}
export type CalendarEventCategory =
@@ -15,6 +17,7 @@ export type CalendarEventCategory =
| 'natural-disaster'
| 'inauguration'
| 'religious'
| 'boon'
| 'player'
export function isCalendarEvent(object: any): object is CalendarEvent {