Files
codey.lol/src/assets/styles/player.css

281 lines
5.1 KiB
CSS
Raw Normal View History

/* Universal box-sizing for consistency */
*,
*::before,
*::after {
box-sizing: border-box;
2025-06-18 07:46:59 -04:00
}
body {
font-family: "Mukta", sans-serif;
width: 100%;
height: 100%;
margin: 0;
padding: 0;
min-width: 100vw;
min-height: 100vh;
/* background: linear-gradient(-45deg, #FFCDD2 50%, #B2EBF2 50%); */
}
/* Container for the player and album cover */
2025-06-18 07:46:59 -04:00
.music-container {
width: 800px; /* fixed desktop width */
max-width: 90vw; /* prevent overflow on smaller screens */
height: 290px;
margin: 0 auto 120px auto; /* increased bottom margin */
overflow-x: visible; /* allow horizontal overflow if needed */
overflow-y: hidden;
position: relative;
display: flex;
justify-content: center;
align-items: center;
box-sizing: border-box;
padding: 1rem;
box-shadow: 1px 1px 5px 0 rgba(0, 0, 0, 0.3);
2025-06-18 07:46:59 -04:00
}
/* Album cover section */
2025-06-18 07:46:59 -04:00
.album-cover {
flex: 0 0 30%; /* Fixed ~30% width */
max-width: 30%;
height: 100%;
overflow: hidden; /* Prevent image spill */
min-width: 0; /* Fix flex overflow */
2025-06-18 07:46:59 -04:00
}
/* Album cover image */
.album-cover > img {
width: 100%;
height: 100%;
object-fit: cover;
aspect-ratio: 1;
transition: 300ms;
2025-06-18 07:46:59 -04:00
}
.album-cover > img:hover {
opacity: 0.7;
cursor: pointer;
2025-06-18 07:46:59 -04:00
}
/* Player info and controls */
2025-06-18 07:46:59 -04:00
.music-player {
flex: 1 1 70%; /* Take remaining ~70% */
max-width: 70%;
width: auto;
height: 100%; /* Match container height */
padding: 1em;
text-align: center;
display: flex;
flex-direction: column;
justify-content: center;
background: inherit;
box-sizing: border-box;
min-width: 0; /* Fix flex overflow */
flex-shrink: 0; /* Prevent shrinking that hides content */
2025-06-18 07:46:59 -04:00
}
/* Text styling */
2025-06-18 07:46:59 -04:00
.music-player__title {
color: inherit;
font-size: 0.9rem;
margin: 0 0 0.1em 0;
2025-06-18 07:46:59 -04:00
}
2025-06-18 07:46:59 -04:00
.music-player__header {
color: inherit;
font-size: 1rem;
margin: 1 0 0.1em 0;
2025-06-18 07:46:59 -04:00
}
2025-06-18 07:46:59 -04:00
.music-player__author {
color: inherit;
font-size: 0.9rem;
margin: 0 0 0.5em 0;
2025-06-18 07:46:59 -04:00
}
.music-player__genre {
color: inherit;
font-size: 0.9rem;
margin: 0 0 0.5em 0;
2025-06-18 07:46:59 -04:00
}
.music-player__genre:before {
font-weight: bold;
content: "Genre: ";
2025-06-18 07:46:59 -04:00
}
.station-tabs {
padding-top: 2%;
}
2025-06-18 07:46:59 -04:00
/* Music bar and progress */
2025-06-18 07:46:59 -04:00
.music-bar {
background: #efefef;
stroke-width: 1;
height: 8px;
width: 100%;
cursor: pointer;
2025-06-18 07:46:59 -04:00
}
2025-06-18 07:46:59 -04:00
.music-bar #length {
width: 0%;
background: #2196F3;
height: 100%;
transition: width linear 200ms;
2025-06-18 07:46:59 -04:00
}
/* Time display */
2025-06-18 07:46:59 -04:00
.music-time {
display: flex;
flex-flow: row wrap;
2025-06-18 07:46:59 -04:00
}
2025-06-18 07:46:59 -04:00
.music-time__last {
margin-left: auto;
2025-06-18 07:46:59 -04:00
}
/* Playback order icons */
2025-06-18 07:46:59 -04:00
.music-order {
display: flex;
flex-flow: row wrap;
2025-06-18 07:46:59 -04:00
}
.music-order__shuffle,
.music-order__loop {
width: 1.2em;
height: 1.2em;
opacity: 0.2;
margin: 0.3em 0;
2025-06-18 07:46:59 -04:00
}
.music-order__shuffle.is-loop,
.music-order__loop.is-loop,
.music-order__shuffle.is-loop-one,
.music-order__loop.is-loop-one {
opacity: 1 !important;
2025-06-18 07:46:59 -04:00
}
2025-06-18 07:46:59 -04:00
.music-order__shuffle {
margin-left: auto;
2025-06-18 07:46:59 -04:00
}
/* Controls container */
2025-06-18 07:46:59 -04:00
.music-control {
display: flex;
flex-flow: row wrap;
justify-content: center;
align-items: center;
height: 2em;
2025-06-18 07:46:59 -04:00
}
2025-06-18 07:46:59 -04:00
.music-control__play {
width: 3em;
height: 3em;
margin: 0 1em;
}
.music-control__backward,
.music-control__forward {
width: 1.5em;
height: 1.5em;
}
/* Arrows for navigation */
.arrow {
position: absolute;
top: calc(50% - 2.5em);
background: rgba(255, 255, 255, 0.3);
border: 0;
width: 5em;
height: 5em;
cursor: pointer;
display: flex;
justify-content: center;
align-items: center;
transition: background 0.3s ease;
}
.arrow:hover {
background: rgba(255, 255, 255, 0.5);
}
.arrow img {
display: block;
width: 20px;
margin: 0 auto;
2025-06-18 07:46:59 -04:00
}
.arrow.left {
left: -5em;
2025-06-18 07:46:59 -04:00
}
.arrow.right {
right: -5em;
}
/* Mobile override */
2025-06-18 07:46:59 -04:00
@media all and (max-width: 960px) {
.music-container {
flex-direction: column !important;
width: 100% !important;
max-width: 100% !important;
height: auto !important;
margin-bottom: 50px !important;
overflow: visible !important;
padding: 1rem !important;
}
.album-cover {
flex: none !important;
width: 100% !important;
max-width: 100% !important;
height: auto !important;
margin-bottom: 1rem !important;
min-width: 0 !important;
}
.album-cover > img {
aspect-ratio: unset !important;
height: auto !important;
width: 100% !important;
}
.music-player {
flex: none !important;
width: 100% !important;
max-width: 100% !important;
height: auto !important;
padding: 0 !important;
min-width: 0 !important;
flex-shrink: 0 !important;
}
.arrow.left,
.arrow.right {
position: relative !important;
top: auto !important;
left: auto !important;
right: auto !important;
width: auto !important;
height: auto !important;
background: transparent !important;
cursor: default !important;
margin: 0 1em !important;
}
.arrow img {
width: 24px !important;
}
}
.tap-overlay {
position: fixed;
inset: 0;
z-index: 50;
background-color: rgba(0, 0, 0, 0.8);
color: white;
font-size: 1.5rem;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
}