-
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.
Merge pull request #139 from NIAEFEUP/feature/contacts
Feature/contacts
- Loading branch information
Showing
13 changed files
with
13,384 additions
and
11,516 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import LabelInput from './label-input.svelte'; | ||
|
||
export default { | ||
title: 'Atoms/LabelInput', | ||
component: LabelInput, | ||
argTypes: { | ||
label: { control: 'text' }, | ||
placeholder: { control: 'text' }, | ||
isTextArea: { control: 'boolean' } | ||
}, | ||
parameters: { | ||
layout: 'centered', | ||
controls: { | ||
exclude: ['id', 'type'] | ||
} | ||
} | ||
}; | ||
|
||
export const NonTextAreaInput = { | ||
args: { | ||
label: 'Label', | ||
placeholder: 'Placeholder', | ||
type: 'text' | ||
} | ||
}; | ||
|
||
export const TextAreaInput = { | ||
args: { | ||
label: 'Label', | ||
placeholder: 'Placeholder', | ||
type: 'text', | ||
isTextArea: true | ||
} | ||
}; |
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,26 @@ | ||
<script> | ||
export let label = ''; | ||
export let id = ''; | ||
export let type = 'text'; | ||
export let placeholder = ''; | ||
export let isTextArea = false; | ||
</script> | ||
|
||
<label class="m-1 font-source_code font-bold text-white" for={id}>{label}</label><br class="mb-1" /> | ||
{#if isTextArea} | ||
<textarea | ||
aria-label="textarea-input" | ||
class="mb-2 min-h-[100px] w-full rounded-lg bg-white p-2 font-source_code text-primary placeholder-primary" | ||
{id} | ||
{placeholder} | ||
rows="4" | ||
/><br /> | ||
{:else} | ||
<input | ||
aria-label="text-input" | ||
class="mb-2 w-full rounded-lg bg-white p-2 text-primary placeholder-primary" | ||
{type} | ||
{id} | ||
{placeholder} | ||
/><br /> | ||
{/if} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<script lang="ts"> | ||
import { Icon } from 'svelte-icons-pack'; | ||
import Graph from './_components/graph.svelte'; | ||
import LabelInput from '@/lib/components/icons/label-input.svelte'; | ||
import Icons from '$lib/components/icons/icons'; | ||
</script> | ||
|
||
<section class="-10 my-20 flex flex-col justify-center"> | ||
<section class="mb-4 flex flex-col text-center font-raleway text-white"> | ||
<h1 class="text-2xl font-bold">< Contacta-nos /></h1> | ||
</section> | ||
<div class="mx-10 grid-cols-2 md:grid"> | ||
<form class="min-w-[85%] justify-self-end"> | ||
<LabelInput label="// Email" id="email" type="email" placeholder="[email protected]" /> | ||
<LabelInput label="// Nome" id="name" type="text" /> | ||
<LabelInput label="// Assunto" id="subject" type="text" /> | ||
<LabelInput label="// Mensagem" id="message" type="text" isTextArea={true} /> | ||
|
||
<button | ||
class="m-1 justify-self-start rounded-lg bg-vivid-red-900 px-5 py-1 text-white" | ||
type="submit">Enviar</button | ||
> | ||
</form> | ||
<div class="m-2 flex w-full justify-center md:m-5 md:my-0"> | ||
<Graph /> | ||
</div> | ||
</div> | ||
<picture> | ||
<source media="(max-width: 767px)" srcset="/images/feup_buildings.svg" /> | ||
<source media="(min-width: 767px)" srcset="/images/feup_buildings_md.svg" /> | ||
<img | ||
src="/images/feup_buildings.svg" | ||
alt="Feup Buildings Outline" | ||
class="align-center h-52 w-full justify-self-center object-none object-center" | ||
/> | ||
</picture> | ||
<span | ||
id="location" | ||
class="ml-3 flex justify-center overflow-x-hidden text-white md:justify-start md:self-center lg:w-[1039px]" | ||
> | ||
<Icon src={Icons.Pin} color="white" size="40" className="py-2 pl-1" /> | ||
<div> | ||
<p>Rua Dr. Roberto Frias 4200-465, Porto</p> | ||
<p>Sala B315</p> | ||
</div> | ||
</span> | ||
</section> |
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,11 @@ | ||
import Graph from './graph.svelte'; | ||
|
||
export default { | ||
title: 'Organisms/Graph', | ||
component: Graph, | ||
parameters: { | ||
layout: 'fullscreen' | ||
} | ||
}; | ||
|
||
export const Default = {}; |
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,81 @@ | ||
<script lang="ts"> | ||
import Icon from '@/lib/components/icons/icon.svelte'; | ||
import Icons from '$lib/components/icons/icons'; | ||
import { copyToClipboard } from '$lib/utils'; | ||
const coords = [ | ||
[1, 1], | ||
[6, 3], | ||
[2, 5], | ||
[10, 6], | ||
[1, 8], | ||
[7, 8] | ||
]; | ||
const lines = [ | ||
[0, 2], | ||
[2, 1], | ||
[1, 5], | ||
[5, 3], | ||
[2, 4] | ||
]; | ||
let innerWidth = 0; | ||
let coefficient = 8; | ||
let iconSize = 8; | ||
const socials = [ | ||
{ url: 'https://www.instagram.com/niaefeup/', icon: Icons.Instagram, label: 'Instagram' }, | ||
{ url: 'https://github.com/NIAEFEUP', icon: Icons.Github, label: 'Github' }, | ||
{ url: 'https://www.facebook.com/NIAEFEUP', icon: Icons.Facebook, label: 'Facebook' }, | ||
{ url: '[email protected]', icon: Icons.Mail, label: 'Email' }, | ||
{ url: 'https://www.linkedin.com/company/nifeup', icon: Icons.Linkedin, label: 'Linkedin' }, | ||
{ url: 'https://twitter.com/niaefeup', icon: Icons.Twitter, label: 'Twitter' } | ||
]; | ||
</script> | ||
|
||
<svelte:window bind:innerWidth /> | ||
|
||
<svg style="height: 40dvh; min-width: 35dvw" viewBox="0 0 87 80" xmlns="http://www.w3.org/2000/svg"> | ||
<!-- Draw graph edges. --> | ||
{#each lines as line} | ||
<line | ||
x1={coords[line[0]][0] * coefficient} | ||
y1={coords[line[0]][1] * coefficient} | ||
x2={coords[line[1]][0] * coefficient} | ||
y2={coords[line[1]][1] * coefficient} | ||
class="stroke-vivid-red-900" | ||
/> | ||
{/each} | ||
|
||
<!-- Draw graph nodes. --> | ||
{#each coords as coord, index} | ||
<foreignObject | ||
x={coord[0] * coefficient - (iconSize + 2) / 2} | ||
y={coord[1] * coefficient - (iconSize + 2) / 2} | ||
width={iconSize + 2} | ||
height={iconSize + 2} | ||
> | ||
{#if socials[index].url.startsWith('https')} | ||
<div class="flex h-full w-full items-center justify-center rounded bg-white bg-opacity-30"> | ||
<Icon | ||
src={socials[index].icon} | ||
color="white" | ||
size="{iconSize.toString()}px" | ||
href={socials[index].url} | ||
ariaLabel={socials[index].label} | ||
/> | ||
</div> | ||
{:else} | ||
<div | ||
class="flex h-full w-full items-center justify-center rounded bg-white bg-opacity-30" | ||
on:click={() => copyToClipboard(socials[index].url)} | ||
on:keydown={() => copyToClipboard(socials[index].url)} | ||
role="button" | ||
tabindex="0" | ||
aria-label="copy-mail" | ||
> | ||
<Icon src={socials[index].icon} color="white" size="{iconSize.toString()}px" /> | ||
</div> | ||
{/if} | ||
</foreignObject> | ||
{/each} | ||
</svg> |
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,15 @@ | ||
import { Layout } from 'lucide-svelte'; | ||
import Page from './+page.svelte'; | ||
import LayoutDecorator from '$lib/storybook-utils/layout-decorator.svelte'; | ||
|
||
export default { | ||
title: 'Pages/Contacts', | ||
component: Page, | ||
parameters: { | ||
layout: 'fullscreen', | ||
backgrounds: { default: 'clear' } | ||
}, | ||
decorators: [() => Layout, () => LayoutDecorator] | ||
}; | ||
|
||
export const Contacts = {}; |
Oops, something went wrong.