Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add abstract page content skeleton #8

Merged
merged 15 commits into from
Aug 21, 2024
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,6 @@ Thumbs.db
# Vite
vite.config.js.timestamp-*
vite.config.ts.timestamp-*

# packaging
package-lock.json
108 changes: 108 additions & 0 deletions src/lib/components/AbstractContent.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
<script>
import {
Avatar,
BottomNav,
BottomNavItem,
DarkMode,
Navbar,
NavBrand,
NavHamburger,
NavLi,
NavUl,
Tooltip
} from 'flowbite-svelte';

import {
CaretLeftSolid,
CaretRightSolid,
LightbulbSolid,
MoonSolid,
SunSolid
} from 'flowbite-svelte-icons';

import logo_dark from '../assets/mondey_dark.svg';
import logo_light from '../assets/mondey_light.svg';

// variables for showing or hiding elements
export let showBottomNavbar = true;

// variables for communication upon hitting the page
// FIXME: these are placeholders and must later be changed using contexts or other better mechanisms for inter component comunication
export let lastpage = '/';
export let nextpage = '/';
export let infopage = '/';

export let name = 'Registrieren';

const basicStyle = {
basicBtnForm: 'rounded-lg text-xl p-2',
basicColorBehavior:
'text-gray-500 dark:text-gray-400 hover:text-primary-800 dark:hover:text-primary-500 group-hover:text-primary-800 dark:group-hover:text-primary-500'
};

const topNavStyle = {
topBarBtnStyle: basicStyle.basicColorBehavior + basicStyle.basicBtnForm,
navULStyle:
'flex flex-col p-4 mt-4 md:flex-row md:space-x-8 rtl:space-x-reverse md:mt-0 md:text-lg md:font-medium'
};

const bottomNavStyle = {
bottomBarBtnStyle: 'w-8 h-8 mb-1' + basicStyle.basicColorBehavior,
bottomNavStyleInner: 'grid-cols-3'
};

const avatar_style = {
outer: 'flex items-center space-x-4 rtl:space-x-reverse',
avatar: 'flex items-center space-x-4 rtl:space-x-reverse',
inner: 'space-y-1' + basicStyle.basicColorBehavior
};
const contentContainerStyle = 'mx-auto max-w-6xl p-4';
</script>

<!-- Top element: basic navigation-->
<Navbar>
<NavBrand href="/">
<img src={logo_light} class="block h-16 dark:hidden" alt="MONDEY Logo" />
<img src={logo_dark} class="hidden h-16 dark:block" alt="MONDEY Logo" />
</NavBrand>
<NavHamburger />
<NavUl ulClass={topNavStyle.navULStyle}>
<NavLi href="/" active={true}>Home</NavLi>
<NavLi href="/">Aktuelles</NavLi>
<NavLi href="/">Downloads</NavLi>
<NavLi href="/">Kontakt</NavLi>
<DarkMode class={topNavStyle.topBarBtnStyle}>
<MoonSolid slot="darkIcon" />
<SunSolid slot="lightIcon" />
</DarkMode>
<Tooltip arrow={false}>Darkmode ein- oder ausschalten</Tooltip>
</NavUl>
<div class={avatar_style.outer}>
<Avatar class={avatar_style.avatar} rounded border />
<div class={avatar_style.inner}>{name}</div>
<Tooltip>Registrieren oder einloggen</Tooltip>
</div>
</Navbar>

<!--Page content goes here-->
<div class={contentContainerStyle}>
<slot></slot>
</div>

{#if showBottomNavbar}
<!-- bottom element: back, info and next buttons-->
<BottomNav position="absolute" classInner={bottomNavStyle.bottomNavStyleInner}>
<BottomNavItem href={lastpage} btnName="Zurück" btnClass={basicStyle.basicColorBehavior}>
<CaretLeftSolid class={bottomNavStyle.bottomBarBtnStyle} />
<Tooltip arrow={false}>Zur letzten Seite</Tooltip>
</BottomNavItem>
<BottomNavItem href={infopage} btnName="Hilfe" btnClass={basicStyle.basicColorBehavior}>
<LightbulbSolid class={bottomNavStyle.bottomBarBtnStyle} />
<Tooltip arrow={false}>Hilfe</Tooltip>
</BottomNavItem>
<BottomNavItem href={nextpage} btnName="Weiter" btnClass={basicStyle.basicColorBehavior}>
<CaretRightSolid class={bottomNavStyle.bottomBarBtnStyle} />
<Tooltip arrow={false}>Zur nächsten Seite</Tooltip>
</BottomNavItem>
</BottomNav>
{/if}
61 changes: 61 additions & 0 deletions src/lib/components/Frontpage.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<script>
import { Button, Card, Gallery } from 'flowbite-svelte';
import { ArrowRightOutline } from 'flowbite-svelte-icons';

// Define the styles for the header, paragraph, arrow, and button
const headerStyle = 'mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-white';
const paragraphStyle = 'mb-3 font-normal text-gray-700 dark:text-gray-400 leading-tight';
const arrowStyle = 'ms-2 h-6 w-6 text-white';
const buttonStyle = 'w-fit';
const galleryStyle = 'grid-cols-2 gap-y-12';
MaHaWo marked this conversation as resolved.
Show resolved Hide resolved
const cardStyle = 'p-6 m-4 w-full';
</script>

<!-- This is a dummy landing page that is only there to check that the AbstractComponent works as it should-->
<Gallery class={galleryStyle}>
<Card class={cardStyle}>
<h5 class={headerStyle}>Was ist Mondey?</h5>
<p class={paragraphStyle}>
<i>Mondey</i> ist ein wissentschaftlich geprüftes Programm zure Dokumentation der Entwicklung von
Kindern bis 6 Jahren.
</p>
<Button class={buttonStyle}>Mehr Info <ArrowRightOutline class={arrowStyle} /></Button>
</Card>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might make sense to make custom Card component that can be reused here, with inline component styling, the header text as a prop, and a slot for the content?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

was thinking about this. but given that this is a dummy page and Mrs. Pauen wanted to design the page herself, I didn´t go to these lengths. Or do you think we should use the cards therein/somewhere else? In that case I would suggest having a separate issue?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


<Card class={cardStyle}>
<h5 class={headerStyle}>Wozu ist Mondey gut?</h5>
<p class={paragraphStyle}>
Anhand ihrer Bewertungen der Fähigkeiten des Kindes erhalten sie Feedback zum
Entwicklungsstand des Kindes und können so frühzeitig Fördermaßnahmen einleiten. Dies folgt
einem übersichtlichen Ampelsystem.
</p>
<Button class={buttonStyle}>Mehr Info <ArrowRightOutline class={arrowStyle} /></Button>
</Card>

<Card class={cardStyle}>
<h5 class={headerStyle}>Was umfasst Mondey?</h5>
<p class={paragraphStyle}>
<i>Mondey</i> umfasst unterschiedliche Entwicklungsbereiche wie von Kindern im Alter von 0 bis
6 Jahren. Dazu gehören unter anderem Grob-und feinmotorik, Wahrnehmung, Denkne, Sprache und Soziale
Beziehungen.
</p>
<Button class={buttonStyle}>Mehr Info <ArrowRightOutline class={arrowStyle} /></Button>
</Card>

<Card class={cardStyle}>
<h5 class={headerStyle}>Wie funktioniert Mondey?</h5>
<p class={paragraphStyle}>
Sie bewerten wie gut das Kind bestimmte Alltagshandlungen durchführen kann mit Hilfe einer
Liste von Fragen.
</p>
<Button class={buttonStyle}>Mehr Info <ArrowRightOutline class={arrowStyle} /></Button>
</Card>

<Card class={cardStyle}>
<h5 class={headerStyle}>Wo fange ich an?</h5>
<p class={paragraphStyle}>
Um zu beginnen, müssen sie sich registrieren und ein Profil für ihr Kind anlegen.
</p>
<Button class={buttonStyle}>Los geht's <ArrowRightOutline class={arrowStyle} /></Button>
</Card>
</Gallery>
33 changes: 5 additions & 28 deletions src/routes/+page.svelte
Original file line number Diff line number Diff line change
@@ -1,31 +1,8 @@
<script>
import {
P,
Banner,
Navbar,
NavBrand,
NavLi,
NavUl,
NavHamburger,
DarkMode
} from 'flowbite-svelte';
import logo_light from '$lib/assets/mondey_light.svg';
import logo_dark from '$lib/assets/mondey_dark.svg';
import AbstractContent from '$lib/components/AbstractContent.svelte';
import Frontpage from '$lib/components/Frontpage.svelte';
</script>

<Banner><P>This is a work-in-progress prototype frontend for the MONDEY website</P></Banner>
<Navbar>
<NavBrand href="/">
<img src={logo_light} class="block h-16 dark:hidden" alt="MONDEY Logo" />
<img src={logo_dark} class="hidden h-16 dark:block" alt="MONDEY Logo" />
</NavBrand>
<NavHamburger />
<NavUl>
<NavLi href="/" active={true}>Home</NavLi>
<NavLi href="/">Downloads</NavLi>
<NavLi href="/">Aktuelles</NavLi>
<NavLi href="/">Kontakt</NavLi>
</NavUl>
<DarkMode />
</Navbar>
<div class="flex flex-col items-center justify-center"></div>
<AbstractContent showBottomNavbar={false}>
<Frontpage />
</AbstractContent>
19 changes: 16 additions & 3 deletions tailwind.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import flowbitePlugin from 'flowbite/plugin';
import typographyPlugin from '@tailwindcss/typography';
import flowbitePlugin from 'flowbite/plugin';

import type { Config } from 'tailwindcss';

Expand All @@ -8,7 +8,7 @@ export default {
'./src/**/*.{html,js,svelte,ts}',
'./node_modules/flowbite-svelte/**/*.{html,js,svelte,ts}'
],
darkMode: 'selector',
darkMode: 'class',
MaHaWo marked this conversation as resolved.
Show resolved Hide resolved
theme: {
extend: {
colors: {
Expand All @@ -25,7 +25,20 @@ export default {
800: '#CC4522',
900: '#A5371B'
}
}
},
fontSize: {
'xs': '.75rem',
'sm': '.875rem',
'base': '1rem',
'lg': '1.125rem',
'xl': '1.25rem',
'2xl': '1.5rem',
'3xl': '1.875rem',
'4xl': '2.25rem',
'5xl': '3rem',
'6xl': '4rem',
'7xl': '5rem'
}
}
},

Expand Down