Web-based Winamp controller for CarPC � Go backend, mobile-first UI
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

422 linhas
9.9KB

  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. touch-action: manipulation;
  139. }
  140. .btn:active { -webkit-transform: scale(0.93); transform: scale(0.93); background: var(--accent2); }
  141. /* ── Seek row ────────────────────────────────────────────────────────────── */
  142. /* Base: flexbox (iOS 9 and up) */
  143. #seek-row {
  144. display: -webkit-flex;
  145. display: flex;
  146. }
  147. #seek-row > .btn-seek {
  148. -webkit-flex: 1;
  149. flex: 1;
  150. }
  151. #seek-row > .btn-seek + .btn-seek { margin-left: 8px; }
  152. /* Enhancement: CSS Grid (iOS 10.3+, all modern browsers) */
  153. @supports (display: grid) {
  154. #seek-row {
  155. display: grid;
  156. grid-template-columns: repeat(4, 1fr);
  157. gap: 8px;
  158. }
  159. #seek-row > .btn-seek { -webkit-flex: none; flex: none; }
  160. #seek-row > .btn-seek + .btn-seek { margin-left: 0; }
  161. }
  162. .btn-seek {
  163. height: 52px;
  164. font-size: 14px;
  165. font-weight: 600;
  166. }
  167. /* ── Controls row ───────────────────────────────────────────────────────── */
  168. /* Base: flexbox */
  169. #controls-row {
  170. display: -webkit-flex;
  171. display: flex;
  172. }
  173. #controls-row > .btn-ctrl {
  174. -webkit-flex: 1;
  175. flex: 1;
  176. }
  177. #controls-row > .btn-ctrl + .btn-ctrl { margin-left: 8px; }
  178. /* Enhancement: CSS Grid */
  179. @supports (display: grid) {
  180. #controls-row {
  181. display: grid;
  182. grid-template-columns: repeat(4, 1fr);
  183. gap: 8px;
  184. }
  185. #controls-row > .btn-ctrl { -webkit-flex: none; flex: none; }
  186. #controls-row > .btn-ctrl + .btn-ctrl { margin-left: 0; }
  187. }
  188. .btn-ctrl { height: var(--btn-h); font-size: 28px; }
  189. .btn-play {
  190. background: var(--accent);
  191. font-size: 32px;
  192. }
  193. .btn-play:active { background: #c73652; }
  194. /* Volume row */
  195. #volume-row {
  196. display: -webkit-flex;
  197. display: flex;
  198. -webkit-align-items: center;
  199. align-items: center;
  200. }
  201. #volume-row > * + * { margin-left: 10px; }
  202. .btn-vol { width: 48px; height: 48px; -webkit-flex-shrink: 0; flex-shrink: 0; font-size: 18px; }
  203. #btn-mute { font-size: 22px; }
  204. #btn-mute.muted { color: var(--accent); }
  205. #volume-bar-wrap {
  206. -webkit-flex: 1;
  207. flex: 1;
  208. display: -webkit-flex;
  209. display: flex;
  210. -webkit-flex-direction: column;
  211. flex-direction: column;
  212. }
  213. #volume-bar-wrap > * + * { margin-top: 4px; }
  214. #volume-bar {
  215. height: 8px;
  216. background: var(--accent2);
  217. border-radius: 4px;
  218. overflow: hidden;
  219. cursor: pointer;
  220. }
  221. #volume-fill {
  222. height: 100%;
  223. background: #4caf50;
  224. width: 70%;
  225. -webkit-transition: width 0.2s;
  226. transition: width 0.2s;
  227. border-radius: 4px;
  228. }
  229. #volume-pct {
  230. font-size: 11px;
  231. color: var(--text-dim);
  232. text-align: center;
  233. }
  234. #volume-fill.muted { background: var(--accent); }
  235. /* Killist */
  236. #killist-row {
  237. display: -webkit-flex;
  238. display: flex;
  239. }
  240. #killist-row > * + * { margin-left: 8px; }
  241. .btn-kill { -webkit-flex: 1; flex: 1; height: 52px; font-size: 16px; background: #3a1a1a; }
  242. .btn-kill:active { background: var(--accent); }
  243. .btn-kill-list { width: 64px; height: 52px; font-size: 14px; }
  244. .btn-action { width: 52px; height: 52px; font-size: 20px; }
  245. #killist-panel {
  246. background: var(--surface);
  247. border-radius: var(--radius);
  248. padding: 16px;
  249. }
  250. #killist-panel h3 { margin-bottom: 12px; }
  251. #killist-items {
  252. list-style: none;
  253. display: -webkit-flex;
  254. display: flex;
  255. -webkit-flex-direction: column;
  256. flex-direction: column;
  257. }
  258. #killist-items li + li { margin-top: 8px; }
  259. #killist-items li {
  260. display: -webkit-flex;
  261. display: flex;
  262. -webkit-justify-content: space-between;
  263. justify-content: space-between;
  264. -webkit-align-items: center;
  265. align-items: center;
  266. background: var(--bg);
  267. border-radius: 8px;
  268. padding: 8px 12px;
  269. font-size: 14px;
  270. }
  271. #killist-items li button {
  272. background: var(--accent);
  273. color: white;
  274. border: none;
  275. border-radius: 6px;
  276. padding: 4px 10px;
  277. cursor: pointer;
  278. }
  279. #btn-close-killist { margin-top: 12px; width: 100%; height: 44px; font-size: 15px; }
  280. /* ── Playlist overlay ────────────────────────────────────────────────────── */
  281. #playlist-overlay {
  282. position: fixed;
  283. /* inset: 0 fallback for browsers without inset support (iOS < 14.5) */
  284. top: 0;
  285. right: 0;
  286. bottom: 0;
  287. left: 0;
  288. z-index: 200;
  289. background: var(--bg);
  290. display: -webkit-flex;
  291. display: flex;
  292. -webkit-flex-direction: column;
  293. flex-direction: column;
  294. }
  295. #playlist-header {
  296. display: -webkit-flex;
  297. display: flex;
  298. -webkit-align-items: center;
  299. align-items: center;
  300. -webkit-justify-content: space-between;
  301. justify-content: space-between;
  302. padding: 16px 20px;
  303. background: var(--surface);
  304. border-bottom: 1px solid #ffffff12;
  305. -webkit-flex-shrink: 0;
  306. flex-shrink: 0;
  307. }
  308. #playlist-title-label {
  309. font-size: 16px;
  310. font-weight: 600;
  311. }
  312. #btn-close-playlist {
  313. background: none;
  314. border: none;
  315. color: var(--text-dim);
  316. font-size: 22px;
  317. cursor: pointer;
  318. padding: 4px 8px;
  319. border-radius: 8px;
  320. line-height: 1;
  321. touch-action: manipulation;
  322. }
  323. #btn-close-playlist:active { background: var(--accent2); color: var(--text); }
  324. #playlist-list {
  325. list-style: none;
  326. overflow-y: auto;
  327. -webkit-flex: 1;
  328. flex: 1;
  329. padding: 8px 0;
  330. -webkit-overflow-scrolling: touch;
  331. }
  332. #playlist-list li {
  333. display: -webkit-flex;
  334. display: flex;
  335. -webkit-align-items: center;
  336. align-items: center;
  337. padding: 12px 20px;
  338. cursor: pointer;
  339. border-radius: 0;
  340. -webkit-transition: background 0.1s;
  341. transition: background 0.1s;
  342. -webkit-tap-highlight-color: transparent;
  343. }
  344. #playlist-list li > * + * { margin-left: 12px; }
  345. #playlist-list li:active { background: var(--accent2); }
  346. #playlist-list li.current {
  347. background: #e9456018;
  348. border-left: 3px solid var(--accent);
  349. padding-left: 17px;
  350. }
  351. .pl-idx {
  352. font-size: 12px;
  353. color: var(--text-dim);
  354. min-width: 32px;
  355. text-align: right;
  356. -webkit-flex-shrink: 0;
  357. flex-shrink: 0;
  358. }
  359. .pl-title {
  360. font-size: 15px;
  361. white-space: nowrap;
  362. overflow: hidden;
  363. text-overflow: ellipsis;
  364. }
  365. li.current .pl-title { color: var(--accent); font-weight: 600; }
  366. #playlist-loading {
  367. text-align: center;
  368. color: var(--text-dim);
  369. padding: 40px;
  370. font-size: 14px;
  371. }
  372. /* ── gap enhancement for all flex containers (iOS 14.5+ / modern browsers) */
  373. @supports (gap: 1px) {
  374. #app { gap: 16px; }
  375. #app > * + * { margin-top: 0; }
  376. #status-bar { gap: 8px; }
  377. #status-bar > * + * { margin-left: 0; }
  378. #progress-wrap { gap: 4px; }
  379. #progress-wrap > * + * { margin-top: 0; }
  380. #volume-row { gap: 10px; }
  381. #volume-row > * + * { margin-left: 0; }
  382. #volume-bar-wrap { gap: 4px; }
  383. #volume-bar-wrap > * + * { margin-top: 0; }
  384. #killist-row { gap: 8px; }
  385. #killist-row > * + * { margin-left: 0; }
  386. #killist-items { gap: 8px; }
  387. #killist-items li + li { margin-top: 0; }
  388. #playlist-list li { gap: 12px; }
  389. #playlist-list li > * + * { margin-left: 0; }
  390. }
  391. .hidden { display: none !important; }