💄 Style product grid, rm images
♻ Move Wireframe to own component
This commit is contained in:
1 parent
8577fb9f11
commit
05d3dcbb3e
7 files changed
+85
-91
No files matched your search
@@ -1,62 +1,52 @@
|
||||
.product {
|
||||
display: flex;
|
||||
overflow: hidden;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border: 1px solid transparent;
|
||||
background: transparent;
|
||||
border: none;
|
||||
/*border: 1px solid var(--background);*/
|
||||
background: rgb(35, 15, 41);
|
||||
border-radius: 4px;
|
||||
transition: background-color 0.1s ease-out, border 0.1s ease-out;
|
||||
position: relative;
|
||||
align-items: flex-start;
|
||||
padding: 1rem;
|
||||
}
|
||||
|
||||
.product:hover,
|
||||
.active.product {
|
||||
border-color: var(--border);
|
||||
background-color: var(--background);
|
||||
box-shadow: 0 0 4px var(--background), 0 0 11px var(--background), 0 0 19px var(--background);
|
||||
}
|
||||
|
||||
.productText {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
padding: 4px;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
font-size: 1.2rem;
|
||||
text-shadow: none;
|
||||
color: white;
|
||||
font-size: 1.5rem;
|
||||
}
|
||||
|
||||
.productImage {
|
||||
width: 140px;
|
||||
height: 140px;
|
||||
border-radius: 4px;
|
||||
filter: opacity(0.2);
|
||||
object-fit: contain;
|
||||
}
|
||||
.active .productImage {
|
||||
filter: none;
|
||||
}
|
||||
|
||||
.noProductImage {
|
||||
width: 140px;
|
||||
height: 140px;
|
||||
}
|
||||
|
||||
.amount {
|
||||
position: absolute;
|
||||
z-index: 1;
|
||||
top: 0px;
|
||||
left: 0px;
|
||||
padding: 4px;
|
||||
border-radius: 4px;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
padding: 10px 12px 8px 8px;
|
||||
border-left: 1px solid transparent;
|
||||
color: transparent;
|
||||
font-size: 2rem;
|
||||
font-weight: bold;
|
||||
line-height: 1;
|
||||
background-color: transparent;
|
||||
border-top-right-radius: 4px;
|
||||
border-bottom-right-radius: 4px;
|
||||
display: none;
|
||||
}
|
||||
|
||||
.wrap {
|
||||
position: relative;
|
||||
}
|
||||
.active .amount {
|
||||
background: rgba(0, 0, 0, 0.8);
|
||||
color: white;
|
||||
display: block;
|
||||
color: var(--background);
|
||||
text-shadow: none;
|
||||
border-left-color: rgb(35, 15, 41);
|
||||
background-color: var(--sun-end);
|
||||
}
|
||||
@@ -14,13 +14,9 @@ type ProductCardProps = {
|
||||
export const ProductCard = ({ product, onProduct, amount, active = false }: ProductCardProps): JSX.Element => {
|
||||
const classes = clsx(styles.product, { [styles.active]: active });
|
||||
return (
|
||||
<button className={classes} type="button" onClick={onProduct}>
|
||||
<div className={styles.wrap}>
|
||||
<span className={styles.amount}>{amount}</span>
|
||||
{product.imageUrl && <img src={product.imageUrl} className={styles.productImage} alt={product.name} />}
|
||||
{!product.imageUrl && <div className={styles.noProductImage} />}
|
||||
<span className={styles.productText}>{product.name}</span>
|
||||
</div>
|
||||
<button className={classes} type="button" onClick={onProduct} title={product.name}>
|
||||
<span className={styles.amount}>{amount}</span>
|
||||
<span className={styles.productText}>{product.name}</span>
|
||||
</button>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,38 @@
|
||||
.wireframe {
|
||||
position: absolute;
|
||||
bottom: calc(22% - 512px);
|
||||
left: calc(50% - 512px);
|
||||
width: 1024px;
|
||||
height: 1024px;
|
||||
display: grid;
|
||||
grid-template-columns: repeat(8, 128px);
|
||||
animation-iteration-count: infinite;
|
||||
animation-name: isometric-rotate;
|
||||
animation-duration: 10s;
|
||||
animation-timing-function: linear;
|
||||
pointer-events: none;
|
||||
z-index: -1;
|
||||
}
|
||||
|
||||
.cell {
|
||||
border-bottom: 2px solid var(--sun);
|
||||
border-right: 2px solid var(--sun);
|
||||
|
||||
}
|
||||
|
||||
.cell:nth-child(8n) {
|
||||
border-right: none;
|
||||
}
|
||||
|
||||
.cell:nth-child(n+57) {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
@keyframes isometric-rotate {
|
||||
0% {
|
||||
transform: rotateX(70deg) rotateY(0deg) rotateZ(-45deg);
|
||||
}
|
||||
100% {
|
||||
transform: rotateX(70deg) rotateY(0deg) rotateZ(-405deg);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
import React from "react";
|
||||
|
||||
import styles from "./Wireframe.module.css";
|
||||
|
||||
export const Wireframe = () => (
|
||||
<div className={styles.wireframe}>
|
||||
{[...Array(64)].map((_, idx) => (
|
||||
<div key={idx} className={styles.cell} />
|
||||
))}
|
||||
</div>
|
||||
);
|
||||
Reference in new issue
Block a user