diff --git a/components/styles/cards/desktop.tsx b/components/styles/cards/desktop.tsx new file mode 100644 index 0000000..55da40a --- /dev/null +++ b/components/styles/cards/desktop.tsx @@ -0,0 +1,33 @@ +import { Service } from '../../../interfaces/CardTypes'; +import styled from 'styled-components'; +import { CardLink, PageCard, CardStyleWrap, CardContentTitle, CardContentWarning, OnlineStatus } from '../content'; + +// Card Content Component for Services Page +export const CardContentService = ({ content }: { content: Service }) => { + let ret; + if (content.href) { + ret = ( + + + +

{content.desc}

+ {content.warn} +
+ {content.status} +
+ ) + } + else { + ret = ( + + + +

{content.desc}

+ {content.warn} +
+ {content.status} +
+ ) + } + return ret; +} \ No newline at end of file diff --git a/components/styles/cards/mobile.tsx b/components/styles/cards/mobile.tsx new file mode 100644 index 0000000..09bdfea --- /dev/null +++ b/components/styles/cards/mobile.tsx @@ -0,0 +1,266 @@ +import { Service } from '../../../interfaces/CardTypes'; +import styled, { css, DefaultTheme } from 'styled-components'; +import Link from 'next/link'; +import Image from 'next/image'; +import { useState } from 'react'; + +// needed for Online Status checks +interface OnlinePropType { + status: string; +} + +interface ActivePropType { + active?: number; +} + +const Card = styled.div` + display: flex; + flex-direction: column; + align-items: center; + width: 332px; + margin: 30px 0px; + border: 1px solid; + + + ${ props => { + let ret; + if(props.active) { + ret = css` + position: relative; + background-color: black; // DEBUG + margin-bottom: -120px; + height: 300px; + z-index: 10; + ` + } + else { + ret = css` + background-color: green; // DEBUG + height: 180px; + ` + } + return ret; + }} +` + +const Test = ({ content }: { content: Service }) => { + return ( +

{content.name}

+ ) +} + +const Test2 = styled.div` + ${props => props.active ? + css` + visibility: visible; + height: 50px; + ` : + css` + visibility: hidden; + height: 0px; + `} +` + +export const ServiceCardMobile = ({ content }: { content: Service }) => { + const [expanded, setExpanded] = useState(false); + let card; + + // TEMP + if (content.href) { + // TODO: adjust sizes + card = ( + setExpanded(false)}> + + + {content.desc} + + + + ) + } + else { + card = + + {content.desc} + + + } + + return card; +} + +// TODO: remove unneeded exports + +const CardStyle = css` + display: flex; + flex-direction: column; + align-items: center; + position: relative; + width: 332px; + height: 240px; +`; +const CardLink = styled(Link)` + ${CardStyle} +`; +const CardStyleWrap = styled.div` + ${CardStyle} +`; +// replaces .card & .contentcard +const PageCard = styled.div` + margin: 1rem; + padding: 23px 10px; + text-align: center; + color: ${({ theme }) => theme.colors.primary}; + background-color: ${({ theme }) => theme.colors.background}; + text-decoration: none; + border: 2px solid; + border-radius: 10px; + border-color: ${({ theme }) => theme.colors.primary}; + transition: all 0.1s linear; + width: 300px; + height: 200px; + display: flex; + flex-direction: column; + justify-content: space-between; + + h2 { + margin: 0 0 1rem 0; + font-size: 1.5rem; + } + + p { + margin: 0; + font-size: 1rem; + line-height: 1.5; + } + + ${CardStyleWrap}:focus,${CardStyleWrap}:active,${CardStyleWrap}:hover & { + color: ${({ theme }) => theme.colors.secondary}; + border-color: ${({ theme }) => theme.colors.secondary}; + background-color: ${({ theme }) => theme.invertButtons ? + theme.colors.backgroundAlt ? theme.colors.backgroundAlt : theme.colors.background : theme.colors.background}; + } + + ${CardLink}:focus,${CardLink}:active,${CardLink}:hover & { + color: ${({ theme }) => theme.colors.secondary}; + border-color: ${({ theme }) => theme.colors.secondary}; + background-color: ${({ theme }) => theme.invertButtons ? + theme.colors.backgroundAlt ? theme.colors.backgroundAlt : theme.colors.background : theme.colors.background}; + } +`; +// replaces the three status classes +const OnlineStatus = styled.p` + color: ${props => { + let ret; + switch (props.status) { + case "Online": + ret = ({ theme }: { theme: DefaultTheme }) => theme.colors.online; + break; + case "Loading": + ret = ({ theme }: { theme: DefaultTheme }) => theme.colors.loading; + break; + case "Offline": + ret = ({ theme }: { theme: DefaultTheme }) => theme.colors.offline; + break; + default: + ret = ({ theme }: { theme: DefaultTheme }) => theme.colors.offline; + } + return ret; + }}; + padding: 0.2rem; + border: 1px solid; + border-color: ${({ theme }) => theme.colors.primary}; + border-radius: 5px; + width: min-content; + position: absolute; + top: 100; right: 50; bottom: 0; left: 50; + offset-position: bottom 10px; + transition: color 0.15s ease, border-color 0.15s ease; + background-color: ${({ theme }) => theme.colors.background}; + background-image: ${({ theme }) => theme.backgroundImage ? + "linear-gradient(" + + theme.colors.background + "," + theme.colors.background + + "), url(" + theme.backgroundImage + ")" : ""}; + background-repeat: no-repeat; + background-attachment: fixed; + background-size: cover; + + ${CardStyleWrap}:focus,${CardStyleWrap}:active,${CardStyleWrap}:hover & { + border-color: ${({ theme }) => theme.colors.secondary}; + background-color: ${({ theme }) => theme.invertButtons ? + theme.colors.backgroundAlt ? theme.colors.backgroundAlt : theme.colors.background : theme.colors.background}; + } + + ${CardLink}:focus,${CardLink}:active,${CardLink}:hover & { + border-color: ${({ theme }) => theme.colors.secondary}; + background-color: ${({ theme }) => theme.invertButtons ? + theme.colors.backgroundAlt ? theme.colors.backgroundAlt : theme.colors.background : theme.colors.background}; + } +`; +// replaces .cardwarn +const CardContentWarning = styled.p` + color: ${({ theme }) => theme.colors.secondary}; + +`; +// replaces .contentIcon +const CardContentTitleIcon = styled(Image)` + object-fit: "contain"; + margin-right: 8px; + aspect-ratio: 1; + height: 28px; +`; +// replaces .contentTitle +const CardContentTitleWrap = styled.div` + position: relative; + display: flex; + flex-direction: row; + justify-content: center; + align-items: center; + margin-bottom: 1rem; + + h2 { + margin: 0; + white-space: nowrap; + } +`; +const CardContentTitle = ({ content }: { content: Service }) => { + return ( + + { + content.icon ? ( + + ) : (<>) + } +

{content.name}

+
+ ) +} +// Card Content Component for Services Page +const MobileServiceCardOld = ({ content }: { content: Service }) => { + let ret; + if (content.href) { + ret = ( + + + +

{content.desc}

+ {content.warn} +
+ {content.status} +
+ ) + } + else { + ret = ( + + + +

{content.desc}

+ {content.warn} +
+ {content.status} +
+ ) + } + return ret; +} \ No newline at end of file