Files

342 lines
6.0 KiB
CSS

.player {
position: fixed;
bottom: 0;
left: 0;
z-index: 1;
width: 100%;
height: 384px;
overflow: visible;
pointer-events: none;
}
.background {
position: absolute;
width: 100%;
height: 100%;
background: linear-gradient(
to bottom,
color-mix(in srgb, var(--gray-2) 0%, transparent) 0%,
color-mix(in srgb, var(--gray-2) 100%, transparent) 50%
);
&::before {
position: absolute;
inset: 0;
content: "";
backdrop-filter: blur(16px);
mask-image: linear-gradient(
to bottom,
rgba(0, 0, 0, 0) 0%,
rgba(0, 0, 0, 1) 100%
);
}
}
.player-controls {
position: absolute;
bottom: 0;
left: 50%;
display: flex;
flex-direction: column;
gap: 24px;
align-items: center;
align-self: stretch;
justify-content: center;
width: calc(100% - 24px);
max-width: 640px;
height: fit-content;
padding: 32px 24px;
color: var(--gray-a12);
pointer-events: auto;
transform: translateX(-50%);
}
.details {
display: flex;
gap: 16px;
align-items: center;
align-self: stretch;
}
.details .cover {
position: relative;
width: 48px;
height: 48px;
overflow: hidden;
border-radius: 8px;
box-shadow: 0px 4px 16px rgba(0, 0, 0, 0.1);
}
.details .cover .shader {
position: absolute;
top: 50%;
left: 50%;
width: 100%;
height: 100%;
aspect-ratio: 1 / 1;
filter: grayscale(100%);
transform: translate(-50%, -50%);
transition: filter 400ms ease;
&.talking {
filter: none;
}
}
.details .info {
display: flex;
flex: 1 0 0;
flex-direction: column;
gap: 8px;
align-items: flex-start;
}
.details .info .player-title,
.details .info .author {
font-family: var(--font-family-display);
font-size: 14px;
line-height: 1;
letter-spacing: var(--font-letter-spacing-14px);
}
.details .info .player-title {
font-weight: var(--font-weight-medium);
color: var(--gray-a12);
}
.details .info .author {
font-weight: var(--font-weight-normal);
color: var(--gray-a8);
}
.progress {
display: flex;
gap: 16px;
align-items: center;
align-self: stretch;
justify-content: center;
}
.progress .slider {
position: relative;
flex: 1;
width: 100%;
}
.progress .control {
box-sizing: border-box;
display: flex;
align-items: center;
width: 100%;
touch-action: none;
user-select: none;
}
.progress .track {
position: relative;
width: 100%;
height: 4px;
cursor: pointer;
user-select: none;
background: var(--gray-a4);
border-radius: 100px;
}
.progress .indicator {
height: 100%;
user-select: none;
background: var(--gray-a10);
border-radius: 100px;
}
.progress .thumb {
width: 12px;
height: 12px;
cursor: grab;
outline: none;
background: var(--gray-12);
border-radius: 50%;
opacity: 0;
transition: opacity 200ms ease;
}
.progress .thumb:active {
cursor: grabbing;
}
.progress:hover .thumb,
.progress .thumb:focus-visible {
opacity: 1;
}
.progress .time {
font-family: var(--font-family-display);
font-size: 12px;
font-weight: var(--font-weight-medium);
font-variant-numeric: tabular-nums;
line-height: 24px;
color: var(--gray-a10);
letter-spacing: var(--font-letter-spacing-12px);
}
.controls {
display: flex;
gap: 32px;
align-items: center;
justify-content: space-between;
width: 100%;
}
.controls .options {
display: flex;
gap: 16px;
align-items: center;
}
.button {
display: flex;
align-items: center;
justify-content: center;
padding: 8px;
color: var(--gray-a11);
cursor: pointer;
border-radius: 12px;
transition:
color 200ms ease,
background 200ms ease;
&:hover {
color: var(--gray-a12);
background: var(--gray-a3);
}
&:active {
background: var(--gray-a4);
}
}
.volume {
display: flex;
flex-direction: column;
gap: 8px;
align-items: center;
padding: 12px 8px;
background: var(--gray-2);
border: 1px solid var(--gray-a4);
border-radius: 12px;
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}
.volume-slider {
display: flex;
align-items: center;
justify-content: center;
height: 100px;
}
.volume-control {
display: flex;
align-items: center;
justify-content: center;
height: 100%;
touch-action: none;
}
.volume-track {
position: relative;
width: 4px;
height: 100%;
cursor: pointer;
background: var(--gray-a4);
border-radius: 100px;
}
.volume-indicator {
width: 100%;
background: var(--gray-a10);
border-radius: 100px;
}
.volume-thumb {
width: 12px;
height: 12px;
cursor: grab;
outline: none;
background: var(--gray-12);
border-radius: 50%;
}
.volume-thumb:active {
cursor: grabbing;
}
/* -----------------------------------------------------------------------------
* Captions
* -------------------------------------------------------------------------- */
.captions {
display: flex;
flex-wrap: wrap;
gap: 0.25em;
font-family: var(--font-family-display);
font-size: 18px;
font-weight: var(--font-weight-normal);
line-height: 1.6;
color: var(--gray-a8);
letter-spacing: var(--font-letter-spacing-18px);
user-select: none;
}
.word {
position: relative;
padding: 0.05em 0.1em;
font: inherit;
color: var(--gray-a6);
cursor: pointer;
background: none;
border: none;
border-radius: 4px;
transition:
color 150ms ease-out,
background-color 150ms ease-out;
}
.word:hover {
background-color: var(--gray-a3);
}
.word:focus-visible {
outline: 2px solid var(--gray-a8);
outline-offset: 2px;
}
.word.past {
color: var(--gray-a10);
}
.word.active {
color: var(--gray-12);
background-color: var(--gray-a4);
}
/* -----------------------------------------------------------------------------
* Highlighted Text (inline MDX highlighting)
* -------------------------------------------------------------------------- */
.highlight {
border-radius: 2px;
transition:
color 150ms ease-out,
background-color 150ms ease-out;
}
.highlight.past {
color: var(--gray-a10);
}
.highlight.active {
color: var(--gray-12);
background-color: var(--accent-a4);
box-shadow: 0 0 0 2px var(--accent-a3);
}