Web-based Winamp controller for CarPC � Go backend, mobile-first UI
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

425 line
10.0KB

  1. :root {
  2. --bg: #1a1a2e;
  3. --surface: #16213e;
  4. --accent: #e94560;
  5. --accent2: #0f3460;
  6. --text: #eaeaea;
  7. --text-dim: #888;
  8. --radius: 12px;
  9. --btn-h: 64px;
  10. }
  11. * { box-sizing: border-box; margin: 0; padding: 0; }
  12. html, body {
  13. height: 100%;
  14. background: var(--bg);
  15. color: var(--text);
  16. font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  17. -webkit-tap-highlight-color: transparent;
  18. -webkit-user-select: none;
  19. user-select: none;
  20. }
  21. #app {
  22. max-width: 600px;
  23. margin: 0 auto;
  24. padding: 16px;
  25. display: -webkit-flex;
  26. display: flex;
  27. -webkit-flex-direction: column;
  28. flex-direction: column;
  29. min-height: 100vh;
  30. }
  31. /* gap fallback: margin between every direct child */
  32. #app > * + * { margin-top: 16px; }
  33. /* Status bar */
  34. #status-bar {
  35. display: -webkit-flex;
  36. display: flex;
  37. -webkit-align-items: center;
  38. align-items: center;
  39. font-size: 12px;
  40. color: var(--text-dim);
  41. }
  42. #status-bar > * + * { margin-left: 8px; }
  43. #winamp-status { font-size: 16px; }
  44. #winamp-status.ok { color: #4caf50; }
  45. #winamp-status.err { color: var(--accent); }
  46. /* Track info */
  47. #track-info {
  48. background: var(--surface);
  49. border-radius: var(--radius);
  50. padding: 20px;
  51. text-align: center;
  52. }
  53. #track-title {
  54. font-size: 18px;
  55. font-weight: 600;
  56. white-space: nowrap;
  57. overflow: hidden;
  58. text-overflow: ellipsis;
  59. }
  60. #star-rating {
  61. font-size: 32px;
  62. margin-top: 10px;
  63. letter-spacing: 4px;
  64. cursor: pointer;
  65. -webkit-tap-highlight-color: transparent;
  66. -webkit-user-select: none;
  67. user-select: none;
  68. }
  69. .star {
  70. color: #333;
  71. -webkit-transition: color 0.12s, -webkit-transform 0.1s;
  72. transition: color 0.12s, transform 0.1s;
  73. display: inline-block;
  74. }
  75. .star.lit { color: #f5a623; }
  76. .star:active { -webkit-transform: scale(1.25); transform: scale(1.25); }
  77. #playlist-pos {
  78. font-size: 12px;
  79. color: var(--text-dim);
  80. margin-top: 6px;
  81. }
  82. /* Visualisation canvas */
  83. #viz {
  84. width: 100%;
  85. height: 80px;
  86. border-radius: var(--radius);
  87. background: #000;
  88. display: block;
  89. cursor: pointer;
  90. }
  91. /* Progress */
  92. #progress-wrap {
  93. display: -webkit-flex;
  94. display: flex;
  95. -webkit-flex-direction: column;
  96. flex-direction: column;
  97. }
  98. #progress-wrap > * + * { margin-top: 4px; }
  99. #progress-bar {
  100. height: 8px;
  101. background: var(--accent2);
  102. border-radius: 4px;
  103. overflow: hidden;
  104. cursor: pointer;
  105. }
  106. #progress-fill {
  107. height: 100%;
  108. background: var(--accent);
  109. width: 0%;
  110. -webkit-transition: width 0.5s linear;
  111. transition: width 0.5s linear;
  112. border-radius: 4px;
  113. }
  114. #time-display {
  115. display: -webkit-flex;
  116. display: flex;
  117. -webkit-justify-content: space-between;
  118. justify-content: space-between;
  119. font-size: 12px;
  120. color: var(--text-dim);
  121. }
  122. /* Buttons base */
  123. .btn {
  124. background: var(--surface);
  125. color: var(--text);
  126. border: none;
  127. border-radius: var(--radius);
  128. font-size: 22px;
  129. cursor: pointer;
  130. -webkit-transition: background 0.15s, -webkit-transform 0.08s;
  131. transition: background 0.15s, transform 0.08s;
  132. display: -webkit-flex;
  133. display: flex;
  134. -webkit-align-items: center;
  135. align-items: center;
  136. -webkit-justify-content: center;
  137. justify-content: center;
  138. /* Fallback for iOS 9: <button> ignores justify-content on flex,
  139. so center the text the old-fashioned way too. */
  140. text-align: center;
  141. touch-action: manipulation;
  142. }
  143. .btn:active { -webkit-transform: scale(0.93); transform: scale(0.93); background: var(--accent2); }
  144. /* ── Seek row ────────────────────────────────────────────────────────────── */
  145. /* Base: flexbox (iOS 9 and up) */
  146. #seek-row {
  147. display: -webkit-flex;
  148. display: flex;
  149. }
  150. #seek-row > .btn-seek {
  151. -webkit-flex: 1;
  152. flex: 1;
  153. }
  154. #seek-row > .btn-seek + .btn-seek { margin-left: 8px; }
  155. /* Enhancement: CSS Grid (iOS 10.3+, all modern browsers) */
  156. @supports (display: grid) {
  157. #seek-row {
  158. display: grid;
  159. grid-template-columns: repeat(4, 1fr);
  160. gap: 8px;
  161. }
  162. #seek-row > .btn-seek { -webkit-flex: none; flex: none; }
  163. #seek-row > .btn-seek + .btn-seek { margin-left: 0; }
  164. }
  165. .btn-seek {
  166. height: 52px;
  167. font-size: 14px;
  168. font-weight: 600;
  169. }
  170. /* ── Controls row ───────────────────────────────────────────────────────── */
  171. /* Base: flexbox */
  172. #controls-row {
  173. display: -webkit-flex;
  174. display: flex;
  175. }
  176. #controls-row > .btn-ctrl {
  177. -webkit-flex: 1;
  178. flex: 1;
  179. }
  180. #controls-row > .btn-ctrl + .btn-ctrl { margin-left: 8px; }
  181. /* Enhancement: CSS Grid */
  182. @supports (display: grid) {
  183. #controls-row {
  184. display: grid;
  185. grid-template-columns: repeat(4, 1fr);
  186. gap: 8px;
  187. }
  188. #controls-row > .btn-ctrl { -webkit-flex: none; flex: none; }
  189. #controls-row > .btn-ctrl + .btn-ctrl { margin-left: 0; }
  190. }
  191. .btn-ctrl { height: var(--btn-h); font-size: 28px; }
  192. .btn-play {
  193. background: var(--accent);
  194. font-size: 32px;
  195. }
  196. .btn-play:active { background: #c73652; }
  197. /* Volume row */
  198. #volume-row {
  199. display: -webkit-flex;
  200. display: flex;
  201. -webkit-align-items: center;
  202. align-items: center;
  203. }
  204. #volume-row > * + * { margin-left: 10px; }
  205. .btn-vol { width: 48px; height: 48px; -webkit-flex-shrink: 0; flex-shrink: 0; font-size: 18px; }
  206. #btn-mute { font-size: 22px; }
  207. #btn-mute.muted { color: var(--accent); }
  208. #volume-bar-wrap {
  209. -webkit-flex: 1;
  210. flex: 1;
  211. display: -webkit-flex;
  212. display: flex;
  213. -webkit-flex-direction: column;
  214. flex-direction: column;
  215. }
  216. #volume-bar-wrap > * + * { margin-top: 4px; }
  217. #volume-bar {
  218. height: 8px;
  219. background: var(--accent2);
  220. border-radius: 4px;
  221. overflow: hidden;
  222. cursor: pointer;
  223. }
  224. #volume-fill {
  225. height: 100%;
  226. background: #4caf50;
  227. width: 70%;
  228. -webkit-transition: width 0.2s;
  229. transition: width 0.2s;
  230. border-radius: 4px;
  231. }
  232. #volume-pct {
  233. font-size: 11px;
  234. color: var(--text-dim);
  235. text-align: center;
  236. }
  237. #volume-fill.muted { background: var(--accent); }
  238. /* Killist */
  239. #killist-row {
  240. display: -webkit-flex;
  241. display: flex;
  242. }
  243. #killist-row > * + * { margin-left: 8px; }
  244. .btn-kill { -webkit-flex: 1; flex: 1; height: 52px; font-size: 16px; background: #3a1a1a; }
  245. .btn-kill:active { background: var(--accent); }
  246. .btn-kill-list { width: 64px; height: 52px; font-size: 14px; }
  247. .btn-action { width: 52px; height: 52px; font-size: 20px; }
  248. #killist-panel {
  249. background: var(--surface);
  250. border-radius: var(--radius);
  251. padding: 16px;
  252. }
  253. #killist-panel h3 { margin-bottom: 12px; }
  254. #killist-items {
  255. list-style: none;
  256. display: -webkit-flex;
  257. display: flex;
  258. -webkit-flex-direction: column;
  259. flex-direction: column;
  260. }
  261. #killist-items li + li { margin-top: 8px; }
  262. #killist-items li {
  263. display: -webkit-flex;
  264. display: flex;
  265. -webkit-justify-content: space-between;
  266. justify-content: space-between;
  267. -webkit-align-items: center;
  268. align-items: center;
  269. background: var(--bg);
  270. border-radius: 8px;
  271. padding: 8px 12px;
  272. font-size: 14px;
  273. }
  274. #killist-items li button {
  275. background: var(--accent);
  276. color: white;
  277. border: none;
  278. border-radius: 6px;
  279. padding: 4px 10px;
  280. cursor: pointer;
  281. }
  282. #btn-close-killist { margin-top: 12px; width: 100%; height: 44px; font-size: 15px; }
  283. /* ── Playlist overlay ────────────────────────────────────────────────────── */
  284. #playlist-overlay {
  285. position: fixed;
  286. /* inset: 0 fallback for browsers without inset support (iOS < 14.5) */
  287. top: 0;
  288. right: 0;
  289. bottom: 0;
  290. left: 0;
  291. z-index: 200;
  292. background: var(--bg);
  293. display: -webkit-flex;
  294. display: flex;
  295. -webkit-flex-direction: column;
  296. flex-direction: column;
  297. }
  298. #playlist-header {
  299. display: -webkit-flex;
  300. display: flex;
  301. -webkit-align-items: center;
  302. align-items: center;
  303. -webkit-justify-content: space-between;
  304. justify-content: space-between;
  305. padding: 16px 20px;
  306. background: var(--surface);
  307. border-bottom: 1px solid #ffffff12;
  308. -webkit-flex-shrink: 0;
  309. flex-shrink: 0;
  310. }
  311. #playlist-title-label {
  312. font-size: 16px;
  313. font-weight: 600;
  314. }
  315. #btn-close-playlist {
  316. background: none;
  317. border: none;
  318. color: var(--text-dim);
  319. font-size: 22px;
  320. cursor: pointer;
  321. padding: 4px 8px;
  322. border-radius: 8px;
  323. line-height: 1;
  324. touch-action: manipulation;
  325. }
  326. #btn-close-playlist:active { background: var(--accent2); color: var(--text); }
  327. #playlist-list {
  328. list-style: none;
  329. overflow-y: auto;
  330. -webkit-flex: 1;
  331. flex: 1;
  332. padding: 8px 0;
  333. -webkit-overflow-scrolling: touch;
  334. }
  335. #playlist-list li {
  336. display: -webkit-flex;
  337. display: flex;
  338. -webkit-align-items: center;
  339. align-items: center;
  340. padding: 12px 20px;
  341. cursor: pointer;
  342. border-radius: 0;
  343. -webkit-transition: background 0.1s;
  344. transition: background 0.1s;
  345. -webkit-tap-highlight-color: transparent;
  346. }
  347. #playlist-list li > * + * { margin-left: 12px; }
  348. #playlist-list li:active { background: var(--accent2); }
  349. #playlist-list li.current {
  350. background: #e9456018;
  351. border-left: 3px solid var(--accent);
  352. padding-left: 17px;
  353. }
  354. .pl-idx {
  355. font-size: 12px;
  356. color: var(--text-dim);
  357. min-width: 32px;
  358. text-align: right;
  359. -webkit-flex-shrink: 0;
  360. flex-shrink: 0;
  361. }
  362. .pl-title {
  363. font-size: 15px;
  364. white-space: nowrap;
  365. overflow: hidden;
  366. text-overflow: ellipsis;
  367. }
  368. li.current .pl-title { color: var(--accent); font-weight: 600; }
  369. #playlist-loading {
  370. text-align: center;
  371. color: var(--text-dim);
  372. padding: 40px;
  373. font-size: 14px;
  374. }
  375. /* ── gap enhancement for all flex containers (iOS 14.5+ / modern browsers) */
  376. @supports (gap: 1px) {
  377. #app { gap: 16px; }
  378. #app > * + * { margin-top: 0; }
  379. #status-bar { gap: 8px; }
  380. #status-bar > * + * { margin-left: 0; }
  381. #progress-wrap { gap: 4px; }
  382. #progress-wrap > * + * { margin-top: 0; }
  383. #volume-row { gap: 10px; }
  384. #volume-row > * + * { margin-left: 0; }
  385. #volume-bar-wrap { gap: 4px; }
  386. #volume-bar-wrap > * + * { margin-top: 0; }
  387. #killist-row { gap: 8px; }
  388. #killist-row > * + * { margin-left: 0; }
  389. #killist-items { gap: 8px; }
  390. #killist-items li + li { margin-top: 0; }
  391. #playlist-list li { gap: 12px; }
  392. #playlist-list li > * + * { margin-left: 0; }
  393. }
  394. .hidden { display: none !important; }