Commit 153bc5a9 authored by timel's avatar timel

refactor: 90%

parent 0fbbf24e
section#mat { section.mat {
// margin-top: 200px;
// padding-top: 50px; // 先不管 后面调整
position: relative; position: relative;
#camera { .camera {
height: 100%; height: 100%;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
...@@ -10,7 +8,7 @@ section#mat { ...@@ -10,7 +8,7 @@ section#mat {
align-items: center; align-items: center;
// perspective: var(--perspective); // perspective: var(--perspective);
} }
#plane { .plane {
transform: translateX(0) translateY(0) translateZ(0) transform: translateX(0) translateY(0) translateZ(0)
rotateX(var(--plane-rotate-x)); rotateX(var(--plane-rotate-x));
width: fit-content; width: fit-content;
...@@ -19,7 +17,7 @@ section#mat { ...@@ -19,7 +17,7 @@ section#mat {
} }
} }
.mat-card-container { .container {
position: absolute; position: absolute;
top: 50%; top: 50%;
left: 50%; left: 50%;
......
import "./index.scss"; import styles from "./index.module.scss";
import { useSnapshot } from "valtio"; import { useSnapshot } from "valtio";
...@@ -12,7 +12,7 @@ export const Mat: React.FC = () => { ...@@ -12,7 +12,7 @@ export const Mat: React.FC = () => {
const snap = useSnapshot(cardStore.inner); const snap = useSnapshot(cardStore.inner);
return ( return (
<section <section
id="mat" className="mat"
style={{ style={{
width: "100%", width: "100%",
}} }}
...@@ -30,11 +30,11 @@ export const Mat: React.FC = () => { ...@@ -30,11 +30,11 @@ export const Mat: React.FC = () => {
}; };
const Plane: React.FC<React.PropsWithChildren> = ({ children }) => ( const Plane: React.FC<React.PropsWithChildren> = ({ children }) => (
<div id="camera"> <div className={styles.camera}>
<div id="plane">{children}</div> <div className={styles.plane}>{children}</div>
</div> </div>
); );
const CardContainer: React.FC<React.PropsWithChildren> = ({ children }) => ( const CardContainer: React.FC<React.PropsWithChildren> = ({ children }) => (
<div className="mat-card-container">{children}</div> <div className={styles.container}>{children}</div>
); );
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment