Compare commits

..

No commits in common. "7bb9cf6dea8080da87ff5fd67afb0f948f422b0d" and "95b3f4ab5909532ca4bfdd66be7604666c991cec" have entirely different histories.

4 changed files with 22 additions and 45 deletions

View file

@ -29,13 +29,11 @@ const talksByYear = computed(() => {
byLocation[key].push(talk) byLocation[key].push(talk)
} }
const groups = Object.values(byLocation) const groups = Object.values(byLocation).map(group => ({
.sort((a, b) => new Date(b[0].date) - new Date(a[0].date)) location: group[0].location,
.map(group => ({ date: group[0].date,
location: group[0].location, titles: group.map(t => t.title)
date: group[0].date, }))
titles: group.map(t => t.title)
}))
return { year, groups } return { year, groups }
}) })
@ -381,8 +379,8 @@ useHead({
.year-header { .year-header {
font-size: 12px; font-size: 12px;
font-weight: 300; font-weight: 600;
color: #7F7F7F; color: #333;
margin-bottom: 6px; margin-bottom: 6px;
} }

View file

@ -40,15 +40,12 @@
<div class="px-5"> <div class="px-5">
<p class="text-lg">lectures</p> <p class="text-lg">lectures</p>
<div v-for="yearGroup in lecturesByYear" :key="yearGroup.year"> <div class="leading-tight py-2 ml-3 text-sm" v-for="item in lectures">
<p class="text-sm font-semibold mt-4 text-[#7F7F7F]">{{ yearGroup.year }}</p> <div class="gap-1">
<div class="leading-tight py-2 ml-3 text-sm" v-for="item in yearGroup.talks"> <div>
<div class="gap-1"> {{ item.formatted_date }}: {{item.location}}
<div> <div v-for="talk in item.talks" class="ml-4 text-[#7F7F7F]">
{{item.location}} {{ talk.title }}
<div v-for="talk in item.talks" class="ml-4 text-[#7F7F7F]">
{{ talk.title }}
</div>
</div> </div>
</div> </div>
</div> </div>
@ -63,18 +60,18 @@
transform: (events) => { transform: (events) => {
for (const event of events) { for (const event of events) {
let date = new Date(event.start_date) let date = new Date(event.start_date)
event.formatted_date = ("0" + date.getDate()).slice(-2) + "." + ("0" + (date.getMonth() + 1)).slice(-2) + "." + date.getFullYear() event.formatted_date = ("0" + (date.getMonth() + 1)).slice(-2) + "." + ("0" + date.getDate()).slice(-2) + "." + date.getFullYear()
} }
return events.sort((a,b) => new Date(b.start_date) - new Date(a.start_date)) return events.sort((a,b) => new Date(b.start_date) - new Date(a.start_date))
} }
}) })
const { data: talksData } = await useFetch('/api/talks', { const { data: lectures } = await useFetch('/api/talks', {
transform: (events) => { transform: (events) => {
for (const event of events) { for (const event of events) {
let date = new Date(event.date) let date = new Date(event.date)
event.date = date event.date = date
event.formatted_date = ("0" + (date.getMonth() + 1)).slice(-2) + "." + date.getFullYear() event.formatted_date = ("0" + (date.getMonth() + 1)).slice(-2) + "." + ("0" + date.getDate()).slice(-2) + "." + date.getFullYear()
if(typeof event.title === 'string' || event.title instanceof String) {event.talks = [{'title': event.title}] if(typeof event.title === 'string' || event.title instanceof String) {event.talks = [{'title': event.title}]
} else { } else {
let talks = [] let talks = []
@ -88,24 +85,6 @@
} }
}) })
const lecturesByYear = computed(() => {
if (!talksData.value) return []
const byYear = {}
for (const talk of talksData.value) {
const year = talk.date ? talk.date.getFullYear() : 'Unknown'
if (!byYear[year]) byYear[year] = []
byYear[year].push(talk)
}
return Object.keys(byYear)
.sort((a, b) => b - a)
.map(year => {
const talks = byYear[year].sort((a, b) => new Date(b.date) - new Date(a.date))
return { year, talks }
})
})
useHead({ useHead({
titleTemplate: 'Michael Winter - Events - Performances and Lectures' titleTemplate: 'Michael Winter - Events - Performances and Lectures'
}) })

View file

@ -5,10 +5,10 @@
<p class="text-lg">pieces</p> <p class="text-lg">pieces</p>
<div class="py-2 ml-3" v-for="item in works"> <div class="py-2 ml-3" v-for="item in works">
<p class="text-sm font-semibold mt-4 text-[#7F7F7F]">{{ item.year }}</p> <p class="font-thin">{{ item.year }}</p>
<div class="leading-tight py-1 ml-3" v-for="work in item.works"> <div class="leading-tight py-1 ml-3" v-for="work in item.works">
<div class="grid grid-cols-[65%,30%] gap-1 items-start"> <div class="grid grid-cols-[65%,30%] gap-1 font-thin items-start">
<span v-html="work.title" class="italic text-sm"></span> <div class="italic text-sm">{{ work.title }}</div>
<div class="inline-flex mt-[-4px]"> <div class="inline-flex mt-[-4px]">
<div> <div>

View file

@ -42,7 +42,7 @@ function formatDate(dateStr) {
if (!dateStr) return '' if (!dateStr) return ''
const date = new Date(dateStr) const date = new Date(dateStr)
if (isNaN(date)) return dateStr if (isNaN(date)) return dateStr
return ("0" + date.getDate()).slice(-2) + "." + ("0" + (date.getMonth() + 1)).slice(-2) + "." + date.getFullYear() return date.toLocaleDateString('en-US', { month: 'short', day: 'numeric' })
} }
useHead({ useHead({
@ -134,13 +134,13 @@ useHead({
.cv-section h4 { .cv-section h4 {
font-size: 13px; font-size: 13px;
font-weight: 300; font-weight: 600;
text-transform: uppercase; text-transform: uppercase;
letter-spacing: 0.8px; letter-spacing: 0.8px;
margin: 0 0 10px 0; margin: 0 0 10px 0;
padding-bottom: 4px; padding-bottom: 4px;
border-bottom: 1px solid #ccc; border-bottom: 1px solid #ccc;
color: #7F7F7F; color: #222;
} }
.intro { .intro {