js+css实现简洁大气音乐风格多选代码
代码语言:html
所属分类:布局界面
代码描述:js+css实现简洁大气音乐风格多选代码
代码标签: js css 简洁 大气 音乐 风格 多选 代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<style>
@import url("https://fonts.googleapis.com/css2?family=Instrument+Sans:wght@400;600;700&display=swap");
@layer theme, base, infopanel, select;
@layer theme {
:root {
--primary-green: #10b981;
--accent-mint: #34d399;
--bg-deep: #061712;
--glass-bg: rgba(255, 255, 255, 0.03);
--glass-border: rgba(16, 185, 129, 0.15);
}
}
@layer select {
select,
::picker(select) {
appearance: base-select;
}
.genre-select {
display: block;
inline-size: 100%;
background: transparent;
border: none;
block-size: fit-content;
@supports (appearance: base-select) {
&,
&::picker(select) {
appearance: base-select;
}
.options-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
gap: 20px;
option {
position: relative;
aspect-ratio: 1;
background: var(--glass-bg);
backdrop-filter: blur(10px);
border: 1px solid var(--glass-border);
border-radius: 28px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 15px;
cursor: pointer;
transition: all 0.3s ease;
overflow: hidden;
svg {
inline-size: 38px;
block-size: 38px;
color: rgb(255 255 255 / 0.5);
transition: all 0.3s ease;
}
span {
font-weight: 500;
font-size: 1rem;
color: rgb(255 255 255 / 0.8);
transition: all 0.3s ease;
}
&::checkmark {
content: "✓";
position: absolute;
inset-block-start: 15px;
inset-inline-end: 15px;
inline-size: 22px;
block-size: 22px;
background: var(--primary-green);
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
font-size: 12px;
font-weight: bold;
opacity: 0;
transition: opacity 0.3s ease;
}
&::before {
content: "";
position: absolute;
inset-block-start: 0;
inset-inline-start: -150%;
inline-size: 100%;
block-size: 100%;
background: linear-gradient(
120deg,
transparent,
rgb(255 255 255 / 0.08),
transparent
);
pointer-events: none;
}
&:hover {
background: rgb(16 185 129 / 0.08);
border-color: rgb(16 185 129 / 0.4);
box-shadow: 0 0 20px rgb(16 185 129 / 0.1);
svg {
color: var(--accent-mint);
}
&::before {
inset-inline-start: 150%;
transition: inset-inline-start 0.7s ease-in-out;
}
}
&:checked {
background: rgb(16 185 129 / 0.15);
border-color: var(--primary-green);
box-shadow: 0 0 30px rgb(16 185 129 / 0.1);
svg {
color: var(--primary-green);
filter: drop-shadow(0 0 5px rgb(16 185 129 / 0.4));
}
span {
color: white;
font-weight: 600;
}
&::checkmark {
opacity: 1;
}
}
&:active {
background: rgb(16 185 129 / 0.25);
box-shadow: inset 0 0 15px rgb(0 0 0 / 0.2);
}
}
}
}
}
}
@layer base {
body {
margin: 0;
min-block-size: 100vh;
font-family: "Instrument Sans", sans-serif;.........完整代码请登录后点击上方下载按钮下载查看















网友评论0