diff --git a/frontend/src/components/mdx/homescreen/homescreen.module.scss b/frontend/src/components/mdx/homescreen/homescreen.module.scss new file mode 100644 index 0000000..8cd057b --- /dev/null +++ b/frontend/src/components/mdx/homescreen/homescreen.module.scss @@ -0,0 +1,23 @@ +@use '../../style/globals'; + +.homeContainer { + display: grid; + place-items: center; + position: absolute; + bottom: 0; + color: black; + content: ""; + z-index: -5; + width: 100%; + height: 100%; + background-size: cover; + background-position: center 0%; +} + +.homeContainer-inside { + background-color: white; + color: black; + font-size: 40pt; + text-align: center; + z-index: 1; +} diff --git a/frontend/src/components/mdx/homescreen/homescreen.tsx b/frontend/src/components/mdx/homescreen/homescreen.tsx new file mode 100644 index 0000000..090fbeb --- /dev/null +++ b/frontend/src/components/mdx/homescreen/homescreen.tsx @@ -0,0 +1,10 @@ +import homescreenStyles from './homescreen.module.scss'; +import React from "react"; + +export function Homescreen({ src, text }: { src: string, props: string, alt: string, text: string }): React.ReactElement { + return
+
+ {text} +
+
; +} diff --git a/frontend/src/components/mdx/round-image/roundImage.module.scss b/frontend/src/components/mdx/image/image.module.scss similarity index 81% rename from frontend/src/components/mdx/round-image/roundImage.module.scss rename to frontend/src/components/mdx/image/image.module.scss index f5fe230..fe049c6 100644 --- a/frontend/src/components/mdx/round-image/roundImage.module.scss +++ b/frontend/src/components/mdx/image/image.module.scss @@ -26,8 +26,16 @@ &-large { @include square-image(15rem); } + + &-full { + @include square-image(clamp(0px, 100%, 1080px)); + } } .round { border-radius: 50%; } + +.rectangle { + border-radius: 5%; +} diff --git a/frontend/src/components/mdx/image/image.tsx b/frontend/src/components/mdx/image/image.tsx new file mode 100644 index 0000000..ec27c51 --- /dev/null +++ b/frontend/src/components/mdx/image/image.tsx @@ -0,0 +1,13 @@ +import imageStyles from './image.module.scss'; + +import React from "react"; + +export type ImageSize = "small" | "medium" | "large" | "full"; +export type ImageShape = "round" | "rectangle"; + +export function Image({ src, alt, size, shape }: { src: string, alt: string, size?: ImageSize, shape?: ImageShape}): React.ReactElement { + const sizeStyleName: keyof typeof imageStyles = `square-${size ?? "medium"}` as const; + const shapeStyleName: keyof typeof imageStyles = shape ?? "rectangle" as const; + + return {alt}; +} diff --git a/frontend/src/components/mdx/info/info.module.scss b/frontend/src/components/mdx/info/info.module.scss new file mode 100644 index 0000000..9ed99ac --- /dev/null +++ b/frontend/src/components/mdx/info/info.module.scss @@ -0,0 +1,50 @@ +@use '../../style/globals'; + +.infoContainer { + display: flex; + position: relative; + text-align: center; + width: 100%; + color: rgb(0, 0, 0); + font-size: 20pt; + flex-direction: column; + margin-bottom: 25px; +} + +.text { + width: 100%; +} + +.image { + width: 100%; +} + +.additionalInfo { + display: none; +} + +@media (min-width: 450px) { + .infoContainer-left { + flex-direction: row; + } + + .infoContainer-right { + flex-direction: row-reverse; + } + + .text { + width: 65%; + } + + .image { + width: 25%; + } + .additionalInfo { + width: 15%; + font-size: 10pt; + display: flex; + &:empty { + display: none; + } + } +} diff --git a/frontend/src/components/mdx/info/info.tsx b/frontend/src/components/mdx/info/info.tsx new file mode 100644 index 0000000..d4a2431 --- /dev/null +++ b/frontend/src/components/mdx/info/info.tsx @@ -0,0 +1,22 @@ +import infoStyles from './info.module.scss'; +import { Image } from 'components/mdx/image/image'; + +import React from "react"; + +export type ImagePosition = "left" | "right"; + +export function Info({ src, text, addInfo, imagePosition, alt } + :{ src: string, text: string, addInfo: string, propsImage: string, imagePosition?: ImagePosition, alt: string }) + : React.ReactElement { + const position: keyof typeof infoStyles = `infoContainer-${imagePosition ?? "left"}` as const; + + return
+
{addInfo}
+
+ {alt} +
+
+ {text} +
+
; +} diff --git a/frontend/src/components/mdx/round-image/roundImage.tsx b/frontend/src/components/mdx/round-image/roundImage.tsx deleted file mode 100644 index 9bf6582..0000000 --- a/frontend/src/components/mdx/round-image/roundImage.tsx +++ /dev/null @@ -1,11 +0,0 @@ -import imageStyles from './roundImage.module.scss'; - -import React from "react"; - -export type ImageSize = "small" | "medium" | "large"; - -export function RoundImage({ src, alt, size }: { src: string, alt: string, size?: ImageSize }): React.ReactElement { - const sizeStyleName: keyof typeof imageStyles = `square-${size ?? "medium"}` as const; - - return {alt}; -} diff --git a/frontend/src/content/contentPage.mdx b/frontend/src/content/contentPage.mdx new file mode 100644 index 0000000..7cf4676 --- /dev/null +++ b/frontend/src/content/contentPage.mdx @@ -0,0 +1,16 @@ +import { Info } from '../components/mdx/info/info'; +import {Homescreen} from '../components/mdx/homescreen/homescreen'; + + + + + + + diff --git a/frontend/src/content/helloWorld.mdx b/frontend/src/content/helloWorld.mdx index e42b7b5..a76873b 100644 --- a/frontend/src/content/helloWorld.mdx +++ b/frontend/src/content/helloWorld.mdx @@ -1,8 +1,4 @@ -import { RoundImage } from '../components/mdx/round-image/roundImage'; - -# Hello world from mdx! - -## Regular markdown (GitHub flavor) +import { Image } from '../components/mdx/image/image'; You can write anything here that is allowed in regulra markdown files as well. This includes _italic_, **bold** and ~~struck-through~~ text, [links with a descriptor](https://github.github.com/gfm/) and even tables: @@ -32,7 +28,7 @@ As a surprise, mdx also supports task list items: The following image is a regular React component. By writing powerful, highly-adjustable components, we can write beautiful-looking articles with almost no effort in a maintainable way. - +{"A ## A note on styling