Compare commits

...

3 Commits

  1. BIN
      public/assets/mkr-in-pixels.png
  2. 2
      src/components/Container.tsx
  3. 9
      src/components/FlickerList.tsx
  4. 40
      src/pages/main/Home.tsx

BIN
public/assets/mkr-in-pixels.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

2
src/components/Container.tsx

@ -41,7 +41,9 @@ const Container: React.FC<{
!child || typeof child === "string"
? child
: React.cloneElement(child, {
...child.props,
style: {
...child.props.style,
opacity: 0,
transform: "translateY(3rem)",
transition: "all 300ms",

9
src/components/FlickerList.tsx

@ -23,9 +23,11 @@ const Flicker: React.FC<{
children: React.ReactNode;
index: number;
description: string;
}> = ({ children, index, description }) => {
style?: React.CSSProperties;
}> = ({ children, index, description, style }) => {
return (
<span
style={style}
className={css`
position: relative;
@ -89,6 +91,7 @@ const Flicker: React.FC<{
transition: opacity 0.2s;
user-select: none;
text-align: left;
pointer-events: none;
@media screen and (max-width: 65rem) {
position: fixed;
@ -106,9 +109,11 @@ const Flicker: React.FC<{
const FlickerList: React.FC<{
list: { text: string; description: string }[];
}> = ({ list }) => {
style?: React.CSSProperties;
}> = ({ list, style }) => {
return (
<ul
style={style}
className={css`
display: flex;
flex-wrap: wrap;

40
src/pages/main/Home.tsx

@ -14,10 +14,21 @@ const section = css`
const Home: React.FC = () => {
return (
<Container>
<section>
<Container
className={css`
--distance: 2rem;
`}>
<section
style={{
// fiddle
marginLeft: "-0.3rem",
}}>
<h1>MKRhere</h1>
<FlickerList
style={{
// fiddle
marginTop: "calc(-1.7rem - 2px + var(--distance))",
}}
list={[
{
text: "Designer",
@ -37,6 +48,29 @@ const Home: React.FC = () => {
]}
/>
</section>
<main
className={css`
/* fiddle */
margin-top: calc(-2.2rem + var(--distance));
display: flex;
flex-wrap: wrap;
gap: var(--distance);
`}>
<img
src="/assets/mkr-in-pixels.png"
alt="MKR in pixels"
style={{
imageRendering: "pixelated",
height: "8rem",
aspectRatio: "1",
}}
/>
<article
style={{
// fiddle
marginTop: "-0.4rem",
}}>
<section
className={cx(
section,
@ -85,6 +119,8 @@ const Home: React.FC = () => {
</a>
</button>
</section>
</article>
</main>
</Container>
);
};

Loading…
Cancel
Save