create navigation card-button
This commit is contained in:
1 parent
c6e4801ff6
commit
6770eba5b6
2 files changed
+131
No files matched your search
@@ -0,0 +1,100 @@
|
||||
.card {
|
||||
position: relative;
|
||||
display: grid;
|
||||
min-height: 220px;
|
||||
gap: var(--space-4);
|
||||
align-content: start;
|
||||
padding: var(--space-8);
|
||||
overflow: hidden;
|
||||
text-align: left;
|
||||
color: var(--color-text);
|
||||
cursor: pointer;
|
||||
background:
|
||||
linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0)),
|
||||
var(--color-surface);
|
||||
border: 1px solid var(--color-border);
|
||||
border-radius: var(--radius-md);
|
||||
box-shadow: var(--shadow-sm);
|
||||
transition:
|
||||
border-color var(--duration-fast) var(--ease-standard),
|
||||
box-shadow var(--duration-fast) var(--ease-standard),
|
||||
transform var(--duration-fast) var(--ease-standard);
|
||||
}
|
||||
|
||||
.card::before {
|
||||
position: absolute;
|
||||
inset: auto -28px -58px auto;
|
||||
width: 180px;
|
||||
height: 180px;
|
||||
content: "";
|
||||
background: radial-gradient(circle, var(--card-accent), transparent 66%);
|
||||
opacity: 0.24;
|
||||
}
|
||||
|
||||
.card:hover {
|
||||
border-color: var(--card-accent);
|
||||
box-shadow: var(--shadow-lg);
|
||||
transform: translateY(-4px);
|
||||
}
|
||||
|
||||
.card:focus-visible {
|
||||
outline: 3px solid var(--card-focus);
|
||||
outline-offset: 3px;
|
||||
}
|
||||
|
||||
.cyan {
|
||||
--card-accent: var(--color-primary);
|
||||
--card-focus: var(--color-primary-soft);
|
||||
}
|
||||
|
||||
.violet {
|
||||
--card-accent: var(--color-accent);
|
||||
--card-focus: rgba(143, 84, 255, 0.24);
|
||||
}
|
||||
|
||||
.kicker {
|
||||
width: fit-content;
|
||||
padding: var(--space-2) var(--space-3);
|
||||
font-size: 12px;
|
||||
font-weight: 800;
|
||||
line-height: 1;
|
||||
color: var(--color-black);
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0;
|
||||
background: var(--card-accent);
|
||||
border-radius: var(--radius-sm);
|
||||
}
|
||||
|
||||
.title {
|
||||
max-width: 12ch;
|
||||
font-size: clamp(28px, 5vw, 48px);
|
||||
font-weight: 900;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.description {
|
||||
max-width: 34ch;
|
||||
color: var(--color-text-muted);
|
||||
}
|
||||
|
||||
.action {
|
||||
display: inline-flex;
|
||||
width: fit-content;
|
||||
align-items: center;
|
||||
padding-block: var(--space-2);
|
||||
margin-top: auto;
|
||||
font-weight: 800;
|
||||
color: var(--card-accent);
|
||||
}
|
||||
|
||||
.action::after {
|
||||
margin-left: var(--space-2);
|
||||
content: "->";
|
||||
}
|
||||
|
||||
@media (max-width: 640px) {
|
||||
.card {
|
||||
min-height: 190px;
|
||||
padding: var(--space-6);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
import styles from "./GeneratorCard.module.css";
|
||||
|
||||
interface GeneratorCardProps{
|
||||
title: string;
|
||||
description: string;
|
||||
label: string;
|
||||
accent: "cyan" | "violet";
|
||||
onClick: () => void;
|
||||
};
|
||||
|
||||
export default function GeneratorCard({
|
||||
title,
|
||||
description,
|
||||
label,
|
||||
accent,
|
||||
onClick,
|
||||
}: GeneratorCardProps) {
|
||||
return (
|
||||
<button
|
||||
className={`${styles.card} ${styles[accent]}`}
|
||||
type="button"
|
||||
onClick={onClick}
|
||||
aria-label={label}
|
||||
>
|
||||
<span className={styles.kicker}>{label}</span>
|
||||
<span className={styles.title}>{title}</span>
|
||||
<span className={styles.description}>{description}</span>
|
||||
<span className={styles.action}>Открыть</span>
|
||||
</button>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user