first commit
This commit is contained in:
@@ -0,0 +1,347 @@
|
||||
/* ============================================================
|
||||
Jisoo Showcase — 纯人物图片画廊
|
||||
默认全灰 · hover 展开并恢复彩色 · 最后 hover 的保持展开
|
||||
缓动:非线性 cubic-bezier
|
||||
============================================================ */
|
||||
|
||||
:root {
|
||||
--bg: #08060f;
|
||||
--glow-a: 99, 102, 241;
|
||||
--glow-b: 217, 70, 239;
|
||||
--violet: #8b5cf6;
|
||||
--magenta: #d946ef;
|
||||
--indigo: #6366f1;
|
||||
--gradient: linear-gradient(120deg, var(--indigo), var(--violet) 52%, var(--magenta));
|
||||
--line: rgba(167, 139, 250, 0.16);
|
||||
--surface: rgba(22, 17, 38, 0.86);
|
||||
--muted: #9b92b8;
|
||||
--ease: cubic-bezier(0.16, 1, 0.3, 1);
|
||||
--skew: 56px;
|
||||
--card-width: 168px;
|
||||
--card-height: 660px;
|
||||
--gap: 12px;
|
||||
--duration: 960ms;
|
||||
}
|
||||
|
||||
* { box-sizing: border-box; margin: 0; padding: 0; }
|
||||
|
||||
body {
|
||||
display: grid;
|
||||
place-content: center;
|
||||
min-height: 100vh;
|
||||
padding: 48px 24px;
|
||||
background:
|
||||
radial-gradient(920px 600px at 12% -8%, rgba(var(--glow-a), 0.18), transparent 62%),
|
||||
radial-gradient(760px 560px at 96% 4%, rgba(var(--glow-b), 0.12), transparent 60%),
|
||||
var(--bg);
|
||||
transition: background-color 620ms var(--ease);
|
||||
overflow-x: hidden;
|
||||
}
|
||||
|
||||
.ambient {
|
||||
position: fixed;
|
||||
width: 440px;
|
||||
height: 440px;
|
||||
border-radius: 50%;
|
||||
filter: blur(130px);
|
||||
pointer-events: none;
|
||||
z-index: 0;
|
||||
}
|
||||
.ambient-a { top: -140px; left: -120px; background: rgb(var(--glow-a)); opacity: 0.18; }
|
||||
.ambient-b { bottom: -200px; right: -120px; background: rgb(var(--glow-b)); opacity: 0.12; }
|
||||
|
||||
.gallery {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
display: grid;
|
||||
grid-template-columns: repeat(6, min(var(--card-width), calc((100vw - 5 * var(--gap)) / 6)));
|
||||
justify-content: center;
|
||||
gap: var(--gap);
|
||||
--skew: 52px;
|
||||
width: 94vw;
|
||||
height: var(--card-height);
|
||||
transition:
|
||||
grid-template-columns var(--duration) var(--ease),
|
||||
width var(--duration) var(--ease),
|
||||
height var(--duration) var(--ease);
|
||||
}
|
||||
|
||||
.box {
|
||||
position: relative;
|
||||
min-width: 0;
|
||||
background-image: var(--img), linear-gradient(160deg, #1b1533, #100c1e);
|
||||
background-size: cover, cover;
|
||||
background-repeat: no-repeat, no-repeat;
|
||||
/* 默认焦点居中;展开时上移到人物头部,见 .box.is-active */
|
||||
background-position: center 50%, center center;
|
||||
filter: grayscale(100%) opacity(38%) drop-shadow(0 16px 28px rgba(0, 0, 0, 0.5));
|
||||
cursor: pointer;
|
||||
outline: none;
|
||||
transition:
|
||||
filter var(--duration) var(--ease),
|
||||
transform var(--duration) var(--ease),
|
||||
background-position var(--duration) var(--ease);
|
||||
animation: box-in var(--duration) var(--ease) both;
|
||||
animation-delay: var(--delay, 0ms);
|
||||
}
|
||||
@keyframes box-in { from { opacity: 0; transform: translateY(20px); } }
|
||||
|
||||
.box { transform: translateY(var(--stagger, 0px)); }
|
||||
|
||||
/* ---------- Card shapes ---------- */
|
||||
/* 默认:平行四边形。左右边垂直,上下边倾斜;--skew-a/b 决定倾斜方向 */
|
||||
.gallery[data-shape="parallelogram"] .box,
|
||||
.gallery:not([data-shape]) .box {
|
||||
--skew-a: var(--skew);
|
||||
--skew-b: 0px;
|
||||
clip-path: polygon(0 var(--skew-a), 100% var(--skew-b), 100% calc(100% - var(--skew-a)), 0 calc(100% - var(--skew-b)));
|
||||
}
|
||||
/* 向上偏移的卡片翻转斜切方向:向左倾 */
|
||||
.gallery[data-shape="parallelogram"] .box.tilt-left,
|
||||
.gallery:not([data-shape]) .box.tilt-left {
|
||||
--skew-a: 0px;
|
||||
--skew-b: var(--skew);
|
||||
}
|
||||
|
||||
/* 四边形:规则矩形,四条边横平竖直 */
|
||||
.gallery[data-shape="quad"] .box {
|
||||
clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
|
||||
}
|
||||
|
||||
/* 六边形:顶部与底部各一个尖角,左右两侧为垂直边 */
|
||||
.gallery[data-shape="hexagon"] .box {
|
||||
clip-path: polygon(
|
||||
50% 0, 100% var(--skew),
|
||||
100% calc(100% - var(--skew)), 50% 100%,
|
||||
0 calc(100% - var(--skew)), 0 var(--skew)
|
||||
);
|
||||
}
|
||||
|
||||
.box.is-active {
|
||||
/* 焦点上移到人物头部,与列宽变化同步过渡 */
|
||||
background-position: center 12%, center center;
|
||||
filter: grayscale(0%) opacity(100%)
|
||||
drop-shadow(0 0 12px rgba(167, 139, 250, 0.55))
|
||||
drop-shadow(0 22px 48px rgba(124, 58, 237, 0.4));
|
||||
}
|
||||
|
||||
/* ---------- Settings ---------- */
|
||||
|
||||
.settings-toggle {
|
||||
position: fixed;
|
||||
right: 26px;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
z-index: 20;
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
display: grid;
|
||||
place-items: center;
|
||||
border-radius: 11px;
|
||||
border: 1px solid rgba(167, 139, 250, 0.14);
|
||||
background: rgba(22, 17, 38, 0.34);
|
||||
backdrop-filter: blur(6px);
|
||||
-webkit-backdrop-filter: blur(6px);
|
||||
color: rgba(205, 191, 240, 0.34);
|
||||
cursor: pointer;
|
||||
box-shadow: none;
|
||||
transition: color 320ms var(--ease), border-color 320ms var(--ease), background 320ms var(--ease), box-shadow 320ms var(--ease), transform 320ms var(--ease);
|
||||
}
|
||||
.settings-toggle svg {
|
||||
width: 17px;
|
||||
height: 17px;
|
||||
fill: none;
|
||||
stroke: currentColor;
|
||||
stroke-width: 1.6;
|
||||
stroke-linecap: round;
|
||||
stroke-linejoin: round;
|
||||
}
|
||||
.settings-toggle:hover, .settings-toggle[aria-expanded="true"] {
|
||||
color: #fff;
|
||||
border-color: rgba(167, 139, 250, 0.5);
|
||||
background: rgba(22, 17, 38, 0.88);
|
||||
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 0 16px rgba(139, 92, 246, 0.28);
|
||||
}
|
||||
.settings-toggle[aria-expanded="true"] svg { transform: rotate(60deg); }
|
||||
.settings-toggle svg { transition: transform 420ms var(--ease); }
|
||||
|
||||
.settings-panel {
|
||||
position: fixed;
|
||||
right: 92px;
|
||||
top: 50%;
|
||||
transform: translate(16px, -50%);
|
||||
z-index: 20;
|
||||
width: 300px;
|
||||
padding: 22px 22px 26px;
|
||||
border-radius: 22px;
|
||||
border: 1px solid rgba(167, 139, 250, 0.32);
|
||||
background: rgba(18, 14, 32, 0.92);
|
||||
backdrop-filter: blur(18px);
|
||||
-webkit-backdrop-filter: blur(18px);
|
||||
box-shadow: 0 26px 70px rgba(0, 0, 0, 0.6), 0 0 32px rgba(124, 58, 237, 0.22);
|
||||
opacity: 0;
|
||||
visibility: hidden;
|
||||
pointer-events: none;
|
||||
transition: opacity 380ms var(--ease), transform 380ms var(--ease), visibility 380ms;
|
||||
}
|
||||
.settings-panel.is-open {
|
||||
opacity: 1;
|
||||
visibility: visible;
|
||||
pointer-events: auto;
|
||||
transform: translate(0, -50%);
|
||||
}
|
||||
.settings-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
|
||||
.settings-title { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.22em; color: #cdbff0; }
|
||||
.settings-close {
|
||||
width: 26px;
|
||||
height: 26px;
|
||||
border-radius: 8px;
|
||||
border: 1px solid rgba(167, 139, 250, 0.24);
|
||||
background: rgba(255, 255, 255, 0.04);
|
||||
color: var(--muted, #9b92b8);
|
||||
font-size: 18px;
|
||||
line-height: 1;
|
||||
cursor: pointer;
|
||||
}
|
||||
.settings-close:hover { color: #fff; border-color: var(--magenta); }
|
||||
|
||||
.control + .control { margin-top: 22px; }
|
||||
.control-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
|
||||
.control-head label, .control-label { font-size: 13px; color: #e8e0ff; }
|
||||
.control-head output {
|
||||
font-family: var(--font-mono);
|
||||
font-size: 11px;
|
||||
color: #cdbff0;
|
||||
background: rgba(139, 92, 246, 0.14);
|
||||
border: 1px solid rgba(167, 139, 250, 0.24);
|
||||
border-radius: 7px;
|
||||
padding: 3px 8px;
|
||||
}
|
||||
|
||||
.control input[type="range"] {
|
||||
-webkit-appearance: none;
|
||||
appearance: none;
|
||||
width: 100%;
|
||||
height: 6px;
|
||||
border-radius: 999px;
|
||||
background: linear-gradient(90deg, var(--indigo), var(--violet) 52%, var(--magenta));
|
||||
outline: none;
|
||||
cursor: pointer;
|
||||
}
|
||||
.control input[type="range"]::-webkit-slider-thumb {
|
||||
-webkit-appearance: none;
|
||||
appearance: none;
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
border-radius: 50%;
|
||||
background: #fff;
|
||||
border: 3px solid var(--violet);
|
||||
box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.2), 0 0 14px rgba(217, 70, 239, 0.55);
|
||||
transition: transform 220ms var(--ease);
|
||||
}
|
||||
.control input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.14); }
|
||||
.control input[type="range"]::-moz-range-thumb {
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
border-radius: 50%;
|
||||
background: #fff;
|
||||
border: 3px solid var(--violet);
|
||||
box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.2), 0 0 14px rgba(217, 70, 239, 0.55);
|
||||
}
|
||||
|
||||
.shape-picker { display: flex; flex-wrap: wrap; gap: 8px; }
|
||||
.shape-chip {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
padding: 7px 13px 7px 9px;
|
||||
border-radius: 999px;
|
||||
border: 1px solid rgba(167, 139, 250, 0.18);
|
||||
background: rgba(255, 255, 255, 0.03);
|
||||
color: #bdb2d8;
|
||||
font-family: inherit;
|
||||
font-size: 12px;
|
||||
cursor: pointer;
|
||||
transition: color 300ms var(--ease), border-color 300ms var(--ease), background 300ms var(--ease), box-shadow 300ms var(--ease);
|
||||
}
|
||||
.shape-chip svg {
|
||||
width: 15px;
|
||||
height: 15px;
|
||||
flex: none;
|
||||
fill: none;
|
||||
stroke: currentColor;
|
||||
stroke-width: 1.5;
|
||||
stroke-linejoin: round;
|
||||
}
|
||||
.shape-chip:hover { color: #fff; border-color: rgba(167, 139, 250, 0.5); }
|
||||
.shape-chip.is-active {
|
||||
color: #fff;
|
||||
border-color: transparent;
|
||||
background: var(--gradient);
|
||||
box-shadow: 0 6px 18px rgba(139, 92, 246, 0.38), 0 0 14px rgba(217, 70, 239, 0.24);
|
||||
}
|
||||
|
||||
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
|
||||
.swatch {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 7px;
|
||||
padding: 7px 13px 7px 8px;
|
||||
border-radius: 999px;
|
||||
border: 1px solid rgba(167, 139, 250, 0.18);
|
||||
background: rgba(255, 255, 255, 0.03);
|
||||
color: #bdb2d8;
|
||||
font-family: inherit;
|
||||
font-size: 12px;
|
||||
cursor: pointer;
|
||||
transition: color 300ms var(--ease), border-color 300ms var(--ease), background 300ms var(--ease), box-shadow 300ms var(--ease);
|
||||
}
|
||||
.swatch:hover { color: #fff; border-color: rgba(167, 139, 250, 0.5); }
|
||||
.swatch.is-active {
|
||||
color: #fff;
|
||||
border-color: transparent;
|
||||
background: var(--gradient);
|
||||
box-shadow: 0 6px 18px rgba(139, 92, 246, 0.38), 0 0 14px rgba(217, 70, 239, 0.24);
|
||||
}
|
||||
.swatch-dot {
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
flex: none;
|
||||
border-radius: 50%;
|
||||
border: 1px solid rgba(255, 255, 255, 0.4);
|
||||
}
|
||||
|
||||
@media (max-width: 720px) {
|
||||
body { padding: 32px 16px; place-content: start center; }
|
||||
.gallery {
|
||||
grid-template-columns: 1fr !important;
|
||||
justify-content: stretch;
|
||||
width: 92vw !important;
|
||||
height: auto;
|
||||
gap: var(--gap);
|
||||
}
|
||||
.box {
|
||||
height: min(var(--card-height), 340px);
|
||||
transform: none !important;
|
||||
--skew: 24px;
|
||||
filter: grayscale(100%) opacity(38%) drop-shadow(0 12px 22px rgba(0, 0, 0, 0.5));
|
||||
}
|
||||
.box.is-active {
|
||||
filter: grayscale(0%) opacity(100%)
|
||||
drop-shadow(0 0 10px rgba(167, 139, 250, 0.5))
|
||||
drop-shadow(0 16px 36px rgba(124, 58, 237, 0.38));
|
||||
}
|
||||
.settings-toggle { right: 16px; top: auto; bottom: 20px; transform: none; }
|
||||
.settings-panel {
|
||||
right: 16px;
|
||||
left: 16px;
|
||||
top: auto;
|
||||
bottom: 82px;
|
||||
width: auto;
|
||||
transform: translateY(16px);
|
||||
}
|
||||
.settings-panel.is-open { transform: translateY(0); }
|
||||
}
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
*, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
|
||||
}
|
||||
Reference in New Issue
Block a user