-
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.
- Loading branch information
Showing
54 changed files
with
11,422 additions
and
17,256 deletions.
There are no files selected for viewing
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
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
File renamed without changes.
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 |
---|---|---|
@@ -1,72 +1,27 @@ | ||
import * as React from "react"; | ||
import styled from "@emotion/styled"; | ||
import { isOdd } from "../utils"; | ||
import styles from "./julekule.module.css"; | ||
|
||
const farger = ["#F8B229", "#EA4630", "#146B3A", "#BB2528", "#165B33"]; | ||
|
||
const JulekuleStyle = styled.div<{ nummer: number }>` | ||
background-color: ${(props) => farger[Math.floor(props.nummer % farger.length)]}; | ||
background-image: radial-gradient(circle at right bottom, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0)); | ||
border-radius: 50%; | ||
box-shadow: inset 0.3em 0.3em 1em rgba(255, 255, 255, 0.5); | ||
height: var(--luke-size); | ||
width: var(--luke-size); | ||
position: relative; | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
transform: ${(props: any) => (isOdd(props.nummer) ? "rotate( -5deg )" : "rotate( 5deg )")}; | ||
`; | ||
|
||
const Base = styled.span` | ||
position: absolute; | ||
content: ""; | ||
display: block; | ||
width: 1rem; | ||
height: 0.5rem; | ||
top: -0.46rem; | ||
background-color: white; | ||
left: 50%; | ||
margin-left: -0.5rem; | ||
border-radius: 2px 2px 0 0; | ||
background-image: linear-gradient(to right, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0)); | ||
`; | ||
|
||
const Snor = styled.span` | ||
position: absolute; | ||
border-color: white; | ||
height: 1.25rem; | ||
width: 0.75rem; | ||
border-width: 2px 2px 0 2px; | ||
top: -1.75rem; | ||
border-style: solid; | ||
border-radius: 50% 50% 0 0; | ||
left: calc(var(--luke-size) / 2); | ||
&::before { | ||
content: ""; | ||
display: block; | ||
height: 50%; | ||
background-color: var(--background-color); | ||
position: absolute; | ||
bottom: 0; | ||
width: 0.1875rem; | ||
right: -0.125rem; | ||
} | ||
`; | ||
|
||
interface Props { | ||
children?: React.ReactNode; | ||
nummer: number; | ||
} | ||
|
||
const Julekule = (props: Props) => { | ||
return ( | ||
<JulekuleStyle nummer={props.nummer}> | ||
<Snor /> | ||
<Base /> | ||
<div | ||
className={styles.julekule} | ||
style={{ | ||
backgroundColor: farger[Math.floor(props.nummer % farger.length)], | ||
transform: isOdd(props.nummer) ? "rotate( -5deg )" : "rotate( 5deg )", | ||
}} | ||
> | ||
<span className={styles.snor} /> | ||
<span className={styles.base} /> | ||
{props.children} | ||
</JulekuleStyle> | ||
</div> | ||
); | ||
}; | ||
export default Julekule; |
Oops, something went wrong.