-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added top margin and voerflow scroll on body
- Loading branch information
Showing
12 changed files
with
550 additions
and
3,563 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,7 @@ coverage: | |
default: | ||
target: 80% | ||
threshold: 5% | ||
patch: | ||
default: | ||
target: 80% | ||
threshold: 5% |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
77 changes: 77 additions & 0 deletions
77
src/routes/(app)/events/_components/event-hexagon.stories.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
import EventHexagon from './event-hexagon.svelte'; | ||
|
||
export default { | ||
title: 'Atoms/Hexagons/Event Hexagon', | ||
component: EventHexagon, | ||
parameters: { | ||
layout: 'centered', | ||
controls: { exclude: ['orientation', 'event'] } | ||
} | ||
}; | ||
|
||
export const DateIntervalHexagon = { | ||
args: { | ||
title: { control: 'text' }, | ||
data: { | ||
title: 'Jantar de Curso', | ||
description: 'Muito fixe', | ||
teamMemberIds: [], | ||
registerUrl: 'https://www.google.com/intl/pt-PT/forms/about/', | ||
dateInterval: { startDate: new Date('2023-12-10'), endDate: new Date('2024-01-01') }, | ||
location: 'Cervejaria Diu', | ||
thumbnailPath: 'images/previews/evento.png' | ||
} | ||
} | ||
}; | ||
|
||
export const SingleDateHexagon = { | ||
args: { | ||
data: { | ||
title: 'Jantar de Curso', | ||
description: 'Muito fixe', | ||
teamMemberIds: [], | ||
registerUrl: 'https://www.google.com/intl/pt-PT/forms/about/', | ||
dateInterval: { startDate: new Date('2023-12-10') }, | ||
location: 'Cervejaria Diu', | ||
thumbnailPath: 'images/previews/evento.png' | ||
} | ||
} | ||
}; | ||
|
||
export const HoveredHexagon = { | ||
args: { | ||
title: { control: 'text' }, | ||
data: { | ||
title: 'Jantar de Curso', | ||
description: 'Muito fixe', | ||
teamMemberIds: [], | ||
registerUrl: 'https://www.google.com/intl/pt-PT/forms/about/', | ||
dateInterval: { startDate: new Date('2023-12-10'), endDate: new Date('2024-01-01') }, | ||
location: 'Cervejaria Diu', | ||
thumbnailPath: 'images/previews/evento.png' | ||
} | ||
}, | ||
parameters: { | ||
pseudo: { hover: true } | ||
} | ||
}; | ||
|
||
export const MobileHexagon = { | ||
parameters: { | ||
viewport: { | ||
defaultViewport: 'mobile2' | ||
} | ||
}, | ||
args: { | ||
title: { control: 'text' }, | ||
data: { | ||
title: 'Jantar de Curso', | ||
description: 'Muito fixe', | ||
teamMemberIds: [], | ||
registerUrl: 'https://www.google.com/intl/pt-PT/forms/about/', | ||
dateInterval: { startDate: new Date('2023-12-10'), endDate: new Date('2023-12-05') }, | ||
location: 'Cervejaria Diu', | ||
thumbnailPath: 'images/previews/evento.png' | ||
} | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
<script lang="ts"> | ||
import Hexagon from '@/lib/components/hexagons/hexagon.svelte'; | ||
import type { Event } from '@/types/event.ts'; | ||
export let data; | ||
export const orientation = 'vertical'; | ||
export let event = data as Event; | ||
</script> | ||
|
||
<Hexagon orientation="vertical"> | ||
<div | ||
class="group relative box-content flex h-full w-full justify-center md:shadow-black/[.58] md:text-shadow" | ||
data-testid="event-hexagon" | ||
> | ||
<div class="flex w-fit flex-col content-center justify-center"> | ||
<p | ||
class="z-20 w-full whitespace-nowrap px-8 text-center text-xs text-gray-100 sm:text-xs md:text-sm lg:text-base xl:text-lg" | ||
> | ||
{#if !event.dateInterval.endDate} | ||
{event.dateInterval.startDate | ||
.toLocaleString('pt', { | ||
day: 'numeric', | ||
month: 'long', | ||
year: 'numeric' | ||
}) | ||
.replaceAll(/(de\s)|(\.)/gi, '')} | ||
{:else} | ||
{event.dateInterval.startDate | ||
.toLocaleString('pt', { | ||
day: 'numeric', | ||
month: 'short', | ||
year: '2-digit' | ||
}) | ||
.replaceAll(/(de\s)|(\.)/gi, '') + | ||
' - ' + | ||
event.dateInterval.endDate | ||
.toLocaleDateString('pt', { | ||
day: 'numeric', | ||
month: 'short', | ||
year: '2-digit' | ||
}) | ||
.replaceAll(/(de\s)|(\.)/gi, '')} | ||
{/if} | ||
</p> | ||
<p | ||
class="z-20 my-1.5 w-full bg-taupe-200 text-center text-sm font-semibold text-rose-950 outline outline-2 outline-offset-2 outline-taupe-200 transition-colors ease-in group-hover:bg-taupe-200 group-hover:text-rose-950 group-hover:outline-taupe-200 group-hover:text-shadow-none sm:bg-transparent sm:text-sm sm:text-gray-100 sm:outline-transparent md:text-base lg:text-lg xl:text-xl" | ||
> | ||
{event.title} | ||
</p> | ||
<p | ||
class="z-20 w-full whitespace-nowrap text-center text-xs text-gray-100 transition-all sm:text-xs md:text-sm lg:text-base xl:text-lg" | ||
> | ||
{event.location} | ||
</p> | ||
</div> | ||
<div class="absolute inset-0 z-10 h-full w-full bg-vivid-red-950/[.62] text-lg" /> | ||
<img | ||
src={event.thumbnailPath} | ||
alt="Event thumbnail" | ||
class="absolute inset-0 z-0 h-full w-full object-cover" | ||
/> | ||
</div> | ||
</Hexagon> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export type DateInterval = { | ||
startDate: Date; | ||
endDate?: Date; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import type { DateInterval } from './date-interval.ts'; | ||
|
||
export type Event = { | ||
title: string; | ||
description: string; | ||
teamMemberIds: bigint[]; | ||
registerUrl: string; | ||
dateInterval: DateInterval; | ||
location?: string; | ||
category?: string; | ||
thumbnailPath: string; | ||
slug?: string; | ||
}; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters