1
0
mirror of https://github.com/kremalicious/portfolio.git synced 2024-12-22 09:13:19 +01:00
This commit is contained in:
Matthias Kretschmann 2023-01-29 03:02:05 +00:00
parent 049853bb0b
commit e3176fc692
Signed by: m
GPG Key ID: 606EEEF3C479A91F
7 changed files with 94 additions and 66 deletions

View File

@ -13,6 +13,8 @@ export default function LogoUnit({ small }: Props) {
const { pathname } = router const { pathname } = router
const isHome = pathname === '/' const isHome = pathname === '/'
const H = small ? 'h2' : 'h1'
return ( return (
<Link <Link
className={`${styles.logounit} ${small ? styles.small : null}`} className={`${styles.logounit} ${small ? styles.small : null}`}
@ -20,9 +22,9 @@ export default function LogoUnit({ small }: Props) {
aria-current={isHome ? 'page' : null} aria-current={isHome ? 'page' : null}
> >
<Logo className={styles.logo} /> <Logo className={styles.logo} />
<h1 className={`p-name ${styles.title}`}> <H className={`p-name ${styles.title}`}>
{resume.basics.name.toLowerCase()} {resume.basics.name.toLowerCase()}
</h1> </H>
<p className={`p-job-title ${styles.description}`}> <p className={`p-job-title ${styles.description}`}>
{resume.basics.label.toLowerCase()} {resume.basics.label.toLowerCase()}
</p> </p>

View File

@ -1,6 +1,6 @@
import Icon from '../Icon' import Icon from '../Icon'
import styles from './index.module.css' import styles from './index.module.css'
import { LazyMotion, m, domAnimation, useReducedMotion } from 'framer-motion' import { LazyMotion, m, domAnimation } from 'framer-motion'
import { moveInTop } from '../Transitions' import { moveInTop } from '../Transitions'
export const NetworkLink = ({ name, url }: { name: string; url: string }) => { export const NetworkLink = ({ name, url }: { name: string; url: string }) => {

View File

@ -0,0 +1,37 @@
.item {
font-size: var(--font-size-small);
color: var(--text-color);
position: relative;
padding: calc(var(--spacer) / 4) var(--spacer);
user-select: none;
border-radius: calc(var(--border-radius) / 1.25);
display: flex;
align-items: center;
text-transform: capitalize;
}
.item[data-highlighted] {
outline: none;
background-color: var(--text-color);
color: var(--body-background-color);
cursor: default;
}
.item span {
display: inline-flex;
align-items: center;
justify-content: center;
}
.itemIndicator {
position: absolute;
left: 0;
width: var(--spacer);
display: inline-flex;
align-items: center;
justify-content: center;
}
.itemIcon {
margin-right: calc(var(--spacer) / 4);
}

View File

@ -0,0 +1,20 @@
import Icon from '../Icon'
import * as Select from '@radix-ui/react-select'
import { getIconName } from './index'
import styles from './Item.module.css'
export function Item({ theme }: { theme: string }) {
return (
<Select.Item value={theme} className={styles.item}>
<Select.ItemIndicator className={styles.itemIndicator}>
<Icon name="Check" />
</Select.ItemIndicator>
<Select.Icon className={styles.itemIcon}>
<Icon name={getIconName(theme)} />
</Select.Icon>
<Select.ItemText className={styles.itemText}>{theme}</Select.ItemText>
</Select.Item>
)
}

View File

@ -39,50 +39,22 @@
} }
.content { .content {
overflow: hidden;
padding: calc(var(--spacer) / 3); padding: calc(var(--spacer) / 3);
background-color: var(--box-background-color); background-color: var(--box-background-color);
border-radius: var(--border-radius); border-radius: var(--border-radius);
box-shadow: var(--box-shadow); box-shadow: var(--box-shadow);
border: 1px solid var(--text-color-dimmed);
animation-duration: 0.2s;
animation-timing-function: var(--easing);
will-change: transform, opacity;
} }
.item { .content[data-state='open'] {
font-size: var(--font-size-small); animation-name: slideUpAndFade;
color: var(--text-color);
position: relative;
padding: calc(var(--spacer) / 8) var(--spacer);
padding-left: var(--spacer);
padding-right: var(--spacer);
user-select: none;
border-radius: calc(var(--border-radius) / 1.5);
display: flex;
align-items: center;
} }
.item[data-highlighted] { .arrow {
outline: none; fill: var(--text-color-dimmed);
background-color: var(--text-color);
color: var(--body-background-color);
cursor: default;
}
.item span {
display: inline-flex;
align-items: center;
justify-content: center;
}
.itemIndicator {
position: absolute;
left: 0;
width: var(--spacer);
display: inline-flex;
align-items: center;
justify-content: center;
}
.itemIcon {
margin-right: calc(var(--spacer) / 4);
} }
@media print { @media print {
@ -90,3 +62,14 @@
display: none; display: none;
} }
} }
@keyframes slideUpAndFade {
from {
opacity: 0;
transform: translateY(1rem);
}
to {
opacity: 1;
transform: translateY(0);
}
}

View File

@ -1,11 +1,12 @@
import styles from './index.module.css'
import Head from 'next/head'
import { useTheme } from 'next-themes'
import { useState, useEffect } from 'react'
import * as Select from '@radix-ui/react-select'
import Icon from '../Icon' import Icon from '../Icon'
import styles from './index.module.css'
import * as Select from '@radix-ui/react-select'
import { useTheme } from 'next-themes'
import Head from 'next/head'
import { useState, useEffect } from 'react'
import { Item } from './Item'
function getIconName(theme: string) { export function getIconName(theme: string) {
return theme === 'light' ? 'Sun' : theme === 'dark' ? 'Moon' : 'Monitor' return theme === 'light' ? 'Sun' : theme === 'dark' ? 'Moon' : 'Monitor'
} }
@ -46,26 +47,11 @@ export default function ThemeSwitch() {
<Select.Portal> <Select.Portal>
<Select.Content className={styles.content} position="popper"> <Select.Content className={styles.content} position="popper">
<Select.Arrow className={styles.arrow} width={14} height={7} />
<Select.Viewport className={styles.viewport}> <Select.Viewport className={styles.viewport}>
{themes.map((theme) => ( {themes
<Select.Item .map((theme) => <Item key={theme} theme={theme}></Item>)
key={theme} .reverse()}
value={theme}
className={styles.item}
>
<Select.ItemIndicator className={styles.itemIndicator}>
<Icon name="Check" />
</Select.ItemIndicator>
<Select.Icon className={styles.itemIcon}>
<Icon name={getIconName(theme)} />
</Select.Icon>
<Select.ItemText className={styles.itemText}>
{theme}
</Select.ItemText>
</Select.Item>
))}
</Select.Viewport> </Select.Viewport>
</Select.Content> </Select.Content>
</Select.Portal> </Select.Portal>

View File

@ -12,7 +12,7 @@
/* Backgrounds */ /* Backgrounds */
--body-background-color: var(--brand-light); --body-background-color: var(--brand-light);
--box-background-color: rgba(255, 255, 255, 0.4); --box-background-color: #f0f5f8;
/* Text Colors */ /* Text Colors */
--text-color: var(--brand-grey); --text-color: var(--brand-grey);
@ -64,7 +64,7 @@
.dark { .dark {
--body-background-color: #161a1b; --body-background-color: #161a1b;
--box-background-color: rgba(255, 255, 255, 0.03); --box-background-color: #1d2122;
--box-shadow: 0 1.3px 5.4px rgba(0, 7, 8, 0.6); --box-shadow: 0 1.3px 5.4px rgba(0, 7, 8, 0.6);
/* --box-shadow: 0 1.3px 5.4px rgba(0, 7, 8, 0.6), /* --box-shadow: 0 1.3px 5.4px rgba(0, 7, 8, 0.6),
0 4.5px 18.1px rgba(0, 7, 8, 0.4), 0 20px 81px rgba(0, 7, 8, 0.1); */ 0 4.5px 18.1px rgba(0, 7, 8, 0.4), 0 20px 81px rgba(0, 7, 8, 0.1); */