Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
burningtree committed Oct 21, 2023
1 parent c6502d0 commit 835a681
Show file tree
Hide file tree
Showing 11 changed files with 2,215 additions and 1,065 deletions.
3,177 changes: 2,142 additions & 1,035 deletions package-lock.json

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
"astro": "astro"
},
"dependencies": {
"@astrojs/image": "^0.16.6",
"@astrojs/svelte": "^2.1.0",
"@astrojs/tailwind": "^3.1.1",
"astro": "^2.3.0",
"svelte": "^3.58.0",
"tailwindcss": "^3.3.1"
"@astrojs/image": "^0.18.0",
"@astrojs/svelte": "^3.1.1",
"@astrojs/tailwind": "^4.0.0",
"astro": "^2.10.15",
"svelte": "^4.2.2",
"tailwindcss": "^3.3.3"
},
"devDependencies": {
"date-fns": "^2.29.3"
Expand Down
28 changes: 19 additions & 9 deletions src/components/EventDetail.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,27 @@
const serie = item.series ? data.series.find(s => s.id === item.series) : null
</script>

<div class="bg-gradient-to-br from-white to-gray-300">
<div class="py-10 text-center">
<div class="text-3xl font-semibold">{normalizedName(item)}</div>
<div class="text-lg mt-2">
{formatPeriod(item.date, item.days)} ({item.days} days)
<div class="text-lg inline-block ml-2">👥 {@html item.attendees_real ? `${item.attendees_real} <span class="text-sm">(≈${item.attendees})</span>` : (item.attendees ? ''+item.attendees : '?')}</div>
</div>
<div class="text-lg mt-2"><CountryIco country={item.country} /> {item.place} [{item.region}]</div>
<div class="inline-block mt-3">
<div class="flex gap-2">
{#each item.types as type}
<EventType {type} />
{/each}
</div>
</div>
</div>
</div>

<div class="event-detail">
<div class="detail-header">{normalizedName(item)}</div>

<div class="flex flex-wrap mt-2 gap-4 items-center">
<div class="flex gap-2">
{#each item.types as type}
<EventType {type} />
{/each}
</div>
<div class="text-lg">{formatPeriod(item.date, item.days)} ({item.days} days)</div>
<div class="text-lg"><CountryIco country={item.country} /> {item.place} [{item.region}]</div>
<div class="text-lg">👥 {@html item.attendees_real ? `${item.attendees_real} <span class="text-sm">(≈${item.attendees})</span>` : (item.attendees ? ''+item.attendees : '?')}</div>
</div>
<div class="flex flex-wrap gap-2 mt-3">
{#if serie}
Expand Down
8 changes: 4 additions & 4 deletions src/components/EventType.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
export let type;
const defs = {
"conference": { color: "bg-teal-500" },
"hackathon": { color: "bg-blue-500" },
"collaborative-week": { color: "bg-orange-500", name: 'Collaborative week' }
"conference": { color: "border-teal-500/50 text-teal-500" },
"hackathon": { color: "border-red-500/50 text-red-500" },
"collaborative-week": { color: "border-orange-500 text-orange-500", name: 'Collaborative week' }
}
</script>

<div class="text-xs px-1.5 py-0.5 text-white rounded uppercase {defs[type].color}">{defs[type].name || type}</div>
<div class="text-sm px-2.5 text-black rounded capitalize border {defs[type].color}">{defs[type].name || type}</div>
1 change: 0 additions & 1 deletion src/data.json

This file was deleted.

6 changes: 3 additions & 3 deletions src/layouts/Layout.astro
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ const { title } = Astro.props;
<title>{title ? title+' | ' : ''} {config.site_name} {!title ? ' - '+config.site_desc : ''}</title>
</head>
<body>
<div class="bg-gray-200 px-4 md:px-0">
<div class="md:w-4/5 mx-auto">
<div class="bg-white px-4 md:px-0 border-b">
<div class="md:w-4/5 mx-auto px-4">
<Header />
</div>
</div>
<div class="mt-8 mb-20 px-4 md:px-0">
<div class="mb-20 px-4 md:px-0">
<div class="md:w-4/5 mx-auto">
<slot />
</div>
Expand Down
11 changes: 8 additions & 3 deletions src/pages/[id].astro
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
---
import Layout from '../layouts/Layout.astro';
import EventDetail from '../components/EventDetail.svelte';
import data from '../data.json';
//import data from '../data.json';
export function getStaticPaths() {
const response = await fetch('https://chronicle.ethevents.club/data/index.json');
const data = await response.json()
export async function getStaticPaths() {
const response = await fetch('https://chronicle.ethevents.club/data/index.json');
const data = await response.json()
return data.events.map(e => ({params: {id: e.id}}))
}
Expand All @@ -12,7 +17,7 @@ const item = data.events.find(i => i.id === id);
---

<Layout title={item.name}>
<EventDetail item={item} data={data} />
<EventDetail item={item} data={data} />
</Layout>

<style>
Expand Down
24 changes: 24 additions & 0 deletions src/pages/[id]/hackathon.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
import Layout from '../../layouts/Layout.astro';
import EventDetail from '../../components/EventDetail.svelte';
//import data from '../data.json';
const response = await fetch('https://chronicle.ethevents.club/data/index.json');
const data = await response.json()
export async function getStaticPaths() {
const response = await fetch('https://chronicle.ethevents.club/data/index.json');
const data = await response.json()
return data.events.map(e => ({params: {id: e.id}}))
}
const { id } = Astro.params;
const item = data.events.find(i => i.id === id);
---

<Layout title={item.name}>
<EventDetail item={item} data={data} />
</Layout>

<style>
</style>
3 changes: 2 additions & 1 deletion src/pages/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import Layout from '../layouts/Layout.astro';
import Card from '../components/Card.astro';
import EventOverview from '../components/EventOverview.svelte';
import { config } from '../lib/config.js';
import data from '../data.json';
const response = await fetch('https://chronicle.ethevents.club/data/index.json');
const data = await response.json()
---

Expand Down
7 changes: 5 additions & 2 deletions src/pages/s/[id].astro
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
---
import Layout from '../../layouts/Layout.astro';
import SeriesDetail from '../../components/SeriesDetail.astro';
import data from '../../data.json';
const response = await fetch('https://chronicle.ethevents.club/data/index.json');
const data = await response.json()
export function getStaticPaths() {
export async function getStaticPaths() {
const response = await fetch('https://chronicle.ethevents.club/data/index.json');
const data = await response.json()
return data.series.map(s => ({params: {id: s.id}}))
}
Expand Down
3 changes: 2 additions & 1 deletion src/pages/series/index.astro
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
---
import Layout from '../../layouts/Layout.astro';
import SeriesDetail from '../../components/SeriesDetail.astro';
import data from '../../data.json';
const response = await fetch('https://chronicle.ethevents.club/data/index.json');
const data = await response.json()
const series = data.series
.map(s => {
Expand Down

0 comments on commit 835a681

Please sign in to comment.