Skip to content

Commit

Permalink
Added top margin and voerflow scroll on body
Browse files Browse the repository at this point in the history
  • Loading branch information
MRita443 committed Nov 15, 2024
2 parents de2f9de + 1d31676 commit 01bd249
Show file tree
Hide file tree
Showing 12 changed files with 550 additions and 3,563 deletions.
4 changes: 4 additions & 0 deletions codecov.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,7 @@ coverage:
default:
target: 80%
threshold: 5%
patch:
default:
target: 80%
threshold: 5%
3,902 changes: 352 additions & 3,550 deletions package-lock.json

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@
"build-storybook": "storybook build"
},
"devDependencies": {
"@storybook/addon-a11y": "^8.0.8",
"@storybook/addon-a11y": "^8.4.2",
"@storybook/addon-coverage": "^1.0.1",
"@storybook/addon-essentials": "^8.0.8",
"@storybook/addon-interactions": "^8.0.8",
"@storybook/addon-links": "^8.0.8",
"@storybook/blocks": "^8.0.8",
"@storybook/addon-essentials": "^8.4.2",
"@storybook/addon-interactions": "^8.4.2",
"@storybook/addon-links": "^8.4.2",
"@storybook/blocks": "^8.4.2",
"@storybook/jest": "^0.2.3",
"@storybook/svelte": "^8.0.8",
"@storybook/sveltekit": "^8.0.8",
"@storybook/test": "^8.0.8",
"@storybook/svelte": "^8.4.2",
"@storybook/sveltekit": "^8.4.2",
"@storybook/test": "^8.4.2",
"@storybook/test-runner": "^0.17.0",
"@storybook/testing-library": "^0.2.2",
"@sveltejs/adapter-auto": "^3.2.0",
Expand All @@ -57,7 +57,7 @@
"prettier-plugin-tailwindcss": "^0.5.13",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"storybook": "^8.0.8",
"storybook": "^8.4.2",
"svelte": "^4.2.13",
"svelte-check": "^3.6.9",
"svelte-icons-pack": "^3.1.3",
Expand Down
3 changes: 2 additions & 1 deletion src/lib/components/hexagons/hexagon-grid.svelte
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<script lang="ts">
import type EventHexagon from './EventHexagon.svelte';
import type TeamMemberHexagon from '@/routes/(app)/team/_components/team-member-hexagon.svelte';
// Inspired by https://github.com/sveltejs/svelte-virtual-list/blob/master/VirtualList.svelte
Expand All @@ -9,7 +10,7 @@
export let gap: 'small' | 'medium' | 'big' = 'medium';
export let orientation: 'horizontal' | 'vertical';
export let component: typeof TeamMemberHexagon;
export let component: typeof TeamMemberHexagon | typeof EventHexagon;
const gridColumnsStyle =
orientation === 'horizontal'
Expand Down
4 changes: 3 additions & 1 deletion src/routes/(app)/+layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<ModeWatcher defaultMode="dark" />
<Sidebar />
<Navbar />
<main class="bg-ni-primary flex-grow">
<main class="bg-ni-primary my-20 flex-grow">
<BackgroundHexagon position="right" />
<slot />
</main>
Expand All @@ -22,12 +22,14 @@
:global(html) {
height: 100%;
min-height: 100vh;
overflow: scroll;
}
:global(body) {
height: 100%;
min-height: 100vh;
display: flex;
flex-direction: column;
overflow: scroll;
}
</style>
2 changes: 1 addition & 1 deletion src/routes/(app)/contacts/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import Icons from '$lib/components/icons/icons';
</script>

<section class="-10 my-20 flex flex-col justify-center">
<section class="flex flex-col justify-center">
<section class="mb-4 flex flex-col text-center font-raleway text-white">
<h1 class="text-2xl font-bold">&lt; Contacta-nos /&gt;</h1>
</section>
Expand Down
77 changes: 77 additions & 0 deletions src/routes/(app)/events/_components/event-hexagon.stories.ts
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'
}
}
};
63 changes: 63 additions & 0 deletions src/routes/(app)/events/_components/event-hexagon.svelte
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>
4 changes: 4 additions & 0 deletions src/types/date-interval.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export type DateInterval = {
startDate: Date;
endDate?: Date;
};
13 changes: 13 additions & 0 deletions src/types/event.ts
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;
};
Binary file added static/images/previews/evento.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 22 additions & 1 deletion tailwind.config.cjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
/** @type {import('tailwindcss').Config} */

const plugin = require('tailwindcss/plugin');

module.exports = {
content: ['./src/**/*.{html,js,svelte,ts,stories.js,stories.ts}'],
theme: {
Expand Down Expand Up @@ -82,8 +85,26 @@ module.exports = {
},
fontSize: {
huge: '10rem'
},

textShadow: {
none: '0 0 0 var(--tw-shadow-color)',
sm: '0 2px 4px var(--tw-shadow-color)',
DEFAULT: '0 4px 6px var(--tw-shadow-color)',
lg: '0 8px 16px var(--tw-shadow-color)'
}
}
},
plugins: []
plugins: [
plugin(function ({ matchUtilities, theme }) {
matchUtilities(
{
'text-shadow': (value) => ({
textShadow: value
})
},
{ values: theme('textShadow') }
);
})
]
};

0 comments on commit 01bd249

Please sign in to comment.