Compare commits
No commits in common. "5cfebd4c6fa4bd6b2abe34c2e45df07455c548df" and "0488d18e9b4b7af9a1f4c7a0ed1f784da8cbb6c4" have entirely different histories.
5cfebd4c6f
...
0488d18e9b
4 changed files with 43 additions and 135 deletions
|
|
@ -7,7 +7,7 @@
|
|||
:title="title_html"
|
||||
/>
|
||||
<Dashboard :message="message_html">
|
||||
<CalendarCarousel />
|
||||
<Calendar />
|
||||
</Dashboard>
|
||||
</v-main>
|
||||
<TickerBar
|
||||
|
|
@ -20,14 +20,14 @@
|
|||
|
||||
<script lang="ts">
|
||||
import { Component, Vue } from "vue-property-decorator";
|
||||
import CalendarCarousel from "./components/calendar/CalendarCarousel.vue";
|
||||
import Calendar from "./components/calendar/Calendar.vue";
|
||||
import Dashboard from "./components/Dashboard.vue";
|
||||
import TitleBar from "./components/title_bar/TitleBar.vue";
|
||||
import TickerBar from "./components/TickerBar.vue";
|
||||
|
||||
@Component({
|
||||
components: {
|
||||
CalendarCarousel,
|
||||
Calendar,
|
||||
Dashboard,
|
||||
TitleBar,
|
||||
TickerBar,
|
||||
|
|
|
|||
|
|
@ -1,10 +1,9 @@
|
|||
<template>
|
||||
<v-list>
|
||||
<span class="text-h5 text-md-h4 d-inline-block mb-2">{{ title }}</span>
|
||||
<template v-for="(event, index) in events">
|
||||
<template v-for="(event, index) in parsed_events">
|
||||
<EventItem :event="event" :key="event.hash" />
|
||||
<v-divider
|
||||
v-if="index < events.length - 1"
|
||||
v-if="index < parsed_events.length - 1"
|
||||
class="mx-5"
|
||||
:key="event.hash + '-div'"
|
||||
/>
|
||||
|
|
@ -13,7 +12,7 @@
|
|||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { Component, Prop, Vue } from "vue-property-decorator";
|
||||
import { Component, Vue } from "vue-property-decorator";
|
||||
import Event from "./event";
|
||||
import EventItem from "./EventItem.vue";
|
||||
|
||||
|
|
@ -23,11 +22,37 @@ import EventItem from "./EventItem.vue";
|
|||
},
|
||||
})
|
||||
export default class Calendar extends Vue {
|
||||
@Prop({ default: "CALENDAR" })
|
||||
private readonly title!: string;
|
||||
private readonly events = [
|
||||
{
|
||||
summary: "Lorem Ipsum",
|
||||
description:
|
||||
"Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo.",
|
||||
dtstart: "2022-09-08T07:00:00+00:00",
|
||||
dtend: "2022-09-08T16:00:00+00:00",
|
||||
},
|
||||
{
|
||||
summary: "Sed ut perspiciatis unde omnis",
|
||||
description: "Lorem ipsum dolor sit amet, consectetur",
|
||||
dtstart: "2022-09-09T07:00:00+00:00",
|
||||
dtend: "2022-09-09T09:00:00+00:00",
|
||||
},
|
||||
{
|
||||
summary: "At vero eos et accusamus",
|
||||
description: "",
|
||||
dtstart: "2022-09-10T07:00:00+00:00",
|
||||
dtend: "2022-09-10T16:00:00+00:00",
|
||||
},
|
||||
];
|
||||
|
||||
@Prop({ default: () => [] })
|
||||
private readonly events!: Array<Event>;
|
||||
private get parsed_events(): Array<Event> {
|
||||
let arr = [];
|
||||
|
||||
for (let json of this.events) {
|
||||
arr.push(new Event(json));
|
||||
}
|
||||
|
||||
return arr;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,91 +0,0 @@
|
|||
<template>
|
||||
<v-carousel
|
||||
cycle
|
||||
interval="10000"
|
||||
height="auto"
|
||||
:show-arrows="false"
|
||||
touchless
|
||||
hide-delimiters
|
||||
>
|
||||
<v-carousel-item v-for="calendar in calendars" :key="calendar.title">
|
||||
<Calendar
|
||||
:key="calendar.title + '-cal'"
|
||||
:title="calendar.title"
|
||||
:events="calendar.events"
|
||||
/>
|
||||
</v-carousel-item>
|
||||
</v-carousel>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { Component, Vue } from "vue-property-decorator";
|
||||
import Calendar from "./Calendar.vue";
|
||||
import { CalendarData, CalendarJSONData } from "./event";
|
||||
|
||||
@Component({
|
||||
components: {
|
||||
Calendar,
|
||||
},
|
||||
})
|
||||
export default class CalendarCarousel extends Vue {
|
||||
private readonly data: Array<CalendarJSONData> = [
|
||||
{
|
||||
title: "Lorem Ipsum",
|
||||
events: [
|
||||
{
|
||||
summary: "Lorem Ipsum",
|
||||
description:
|
||||
"Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo.",
|
||||
dtstart: "2022-09-08T07:00:00+00:00",
|
||||
dtend: "2022-09-08T16:00:00+00:00",
|
||||
},
|
||||
{
|
||||
summary: "Sed ut perspiciatis unde omnis",
|
||||
description: "Lorem ipsum dolor sit amet, consectetur",
|
||||
dtstart: "2022-09-09T07:00:00+00:00",
|
||||
dtend: "2022-09-09T09:00:00+00:00",
|
||||
},
|
||||
{
|
||||
summary: "At vero eos et accusamus",
|
||||
description: "",
|
||||
dtstart: "2022-09-10T07:00:00+00:00",
|
||||
dtend: "2022-09-10T16:00:00+00:00",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: "Li Europan lingues",
|
||||
events: [
|
||||
{
|
||||
summary: "Occidental in fact, it va esser Occidental",
|
||||
description:
|
||||
"Omnicos directe al desirabilite de un nov lingua franca: On refusa continuar payar custosi traductores. At solmen va esser necessi far uniform grammatica, pronunciation e plu sommun paroles. Ma quande lingues coalesce, li grammatica del resultant lingue es plu simplic e regulari quam ti del coalescent lingues.",
|
||||
dtstart: "2022-09-08T07:00:00+00:00",
|
||||
dtend: "2022-09-08T16:00:00+00:00",
|
||||
},
|
||||
{
|
||||
summary: "Membres del sam familie",
|
||||
description: "Lor separat existentie es un myth.",
|
||||
dtstart: "2022-09-09T07:00:00+00:00",
|
||||
dtend: "2022-09-09T09:30:30+00:00",
|
||||
},
|
||||
{
|
||||
summary: "On refusa continuar payar custosi traductores",
|
||||
description: "",
|
||||
dtstart: "2022-09-10T07:00:00+00:00",
|
||||
dtend: "2022-09-20T16:00:00+00:00",
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
private get calendars(): Array<CalendarData> {
|
||||
let arr = [];
|
||||
|
||||
for (const json_data of this.data) {
|
||||
arr.push(new CalendarData(json_data));
|
||||
}
|
||||
return arr;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
@ -1,26 +1,19 @@
|
|||
import { DateTime, Duration } from "luxon";
|
||||
|
||||
export type EventJSONData = {
|
||||
summary: string;
|
||||
description: string;
|
||||
dtstart: string;
|
||||
dtend: string;
|
||||
};
|
||||
|
||||
export default class EventData {
|
||||
export default class Event {
|
||||
public summary: string;
|
||||
public description: string;
|
||||
public start: DateTime;
|
||||
public duration: Duration;
|
||||
|
||||
public constructor(json_data: EventJSONData) {
|
||||
this.summary = json_data.summary;
|
||||
this.description = json_data.description;
|
||||
public constructor(json_data: Record<string, string>) {
|
||||
this.summary = json_data["summary"];
|
||||
this.description = json_data["description"];
|
||||
this.start = DateTime
|
||||
.fromISO(json_data.dtstart)
|
||||
.fromISO(json_data["dtstart"])
|
||||
.setLocale(navigator.language);
|
||||
const end = DateTime
|
||||
.fromISO(json_data.dtend)
|
||||
.fromISO(json_data["dtend"])
|
||||
.setLocale(navigator.language);
|
||||
|
||||
this.duration = end.diff(this.start);
|
||||
|
|
@ -36,23 +29,4 @@ export default class EventData {
|
|||
|
||||
return new Uint32Array([hash])[0].toString(36);
|
||||
}
|
||||
}
|
||||
|
||||
export type CalendarJSONData = {
|
||||
title: string;
|
||||
events: Array<EventJSONData>;
|
||||
};
|
||||
|
||||
export class CalendarData {
|
||||
public title: string;
|
||||
public events: Array<EventData>;
|
||||
|
||||
public constructor(json_data: CalendarJSONData) {
|
||||
this.title = json_data.title
|
||||
|
||||
this.events = [];
|
||||
for (const event_data of json_data.events) {
|
||||
this.events.push(new EventData(event_data))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue