Skip to content

Commit

Permalink
chore: docs updates (#57)
Browse files Browse the repository at this point in the history
* chore: use dvw/dvh for frame

* chore: animate only colors

* chore: pass --hos to vite for debugging

* chore: fix frame height && adjust animation

* chore: fix image margins
  • Loading branch information
fand authored Jun 10, 2024
1 parent 5805db7 commit 75297cd
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 17 deletions.
2 changes: 1 addition & 1 deletion packages/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"dev": "vite --host",
"build": "tsc && vite build",
"preview": "vite preview"
},
Expand Down
1 change: 1 addition & 0 deletions packages/docs/src/dom/ExamplesSection.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

.ImgContainer img {
height: 320px;
max-width: calc(100% - 40px);
margin: 0 20px;
}

Expand Down
35 changes: 28 additions & 7 deletions packages/docs/src/dom/Frame.css
Original file line number Diff line number Diff line change
@@ -1,13 +1,34 @@
.Frame {
position: fixed;
left: 0;
top: 0;
width: 100%;
height: 100%;
box-sizing: border-box;
border: 1px solid #00FFEE;
z-index: 999999;
pointer-events: none;
box-shadow: inset 0px 0px 10px #00FFEE;
transition: all 1s;
}
.Frame.top {
width: 100%;
height: 2px;
top: 0px;
left: 0px;
transition: all 0.5s 0s;
}
.Frame.bottom {
width: 100%;
height: 2px;
bottom: 0px;
left: 0px;
transition: all 0.5s 0.4s;
}
.Frame.left {
width: 2px;
height: 200%;
top: 0px;
left: 0px;
transition: all 0.5s 0.2s;
}
.Frame.right {
width: 2px;
height: 200%;
top: 0px;
right: 0px;
transition: all 0.5s 0.2s;
}
25 changes: 22 additions & 3 deletions packages/docs/src/dom/Frame.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ type Props = {
};

const Frame: React.FC<Props> = (props: Props) => {
const [borderColor, setBorderColor] = useState("#00FFEE");
const [backgroundColor, setBorderColor] = useState("#00FFEE");
const [boxShadow, setBoxShadow] = useState("inset 0 0 10px #00FFEE");
const interval = props.interval || 5000;
const interval = props.interval || 4000;

useEffect(() => {
let count = 0;
Expand All @@ -25,7 +25,26 @@ const Frame: React.FC<Props> = (props: Props) => {
};
}, [interval]);

return <div className="Frame" style={{ borderColor, boxShadow }}></div>;
return (
<>
<div
className="Frame top"
style={{ backgroundColor, boxShadow }}
></div>
<div
className="Frame bottom"
style={{ backgroundColor, boxShadow }}
></div>
<div
className="Frame left"
style={{ backgroundColor, boxShadow }}
></div>
<div
className="Frame right"
style={{ backgroundColor, boxShadow }}
></div>
</>
);
};

export default Frame;
6 changes: 0 additions & 6 deletions packages/docs/src/dom/LogoSection.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,3 @@
width: 1280px;
max-width: 100%;
}

@media (max-width: 768px) {
.LogoSection .logo {
max-width: 110%;
}
}

0 comments on commit 75297cd

Please sign in to comment.