style.css 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849
  1. :root {
  2. --background-primary: #f9f9f9;
  3. --background-secondary: #fff;
  4. --background-tertiary: #ddd;
  5. --background-accent: rgba(74, 144, 226, 0.75);
  6. --background-info: var(--background-accent);
  7. --background-success: rgba(76, 175, 80, 0.8);
  8. --background-warning: rgba(255, 152, 0, 0.8);
  9. --background-error: rgba(229, 57, 53, 0.8);
  10. --theme-primary: #6A9AD9;
  11. --theme-primary-hover: #A0CCF2;
  12. --theme-secondary: #C4B4A0;
  13. --theme-secondary-hover: #4E453F;
  14. --color-info: var(--theme-primary);
  15. --color-success: #4CAF50CC;
  16. --color-warning: #FF9800CC;
  17. --color-error: #E53935CC;
  18. --text-primary: #333;
  19. --text-secondary: #fff;
  20. --border-primary: var(--background-tertiary);
  21. --border-secondary: grey;
  22. --border-accent: var(--theme-primary);
  23. --border-hover: var(--theme-primary-hover);
  24. --shadow-primary: 0 0 20px var(--border-secondary);
  25. --transition-fast: 0.1s ease-in-out;
  26. --transition-medium: 0.250s ease;
  27. --transition-slow: 1s ease;
  28. }
  29. /* General
  30. /* General Styling */
  31. body {
  32. margin: 0;
  33. font-family: 'Roboto', sans-serif;
  34. background: var(--background-primary);
  35. display: flex;
  36. flex-direction: column;
  37. position: relative;
  38. }
  39. body * {
  40. box-sizing: border-box;
  41. }
  42. h1, h2 {
  43. margin: 0;
  44. }
  45. header {
  46. position: sticky;
  47. height: 50px;
  48. top: 0;
  49. z-index: 10;
  50. background: var(--background-primary);
  51. display: flex;
  52. justify-content: center;
  53. align-items: center;
  54. }
  55. h1, h2 {
  56. color: var(--theme-secondary-hover);
  57. transition: var(--transition-slow) color;
  58. }
  59. h3 {
  60. margin: 10px 0;
  61. }
  62. /* Inputs */
  63. input, select {
  64. display: block;
  65. width: 100%;
  66. padding: 10px;
  67. margin-bottom: 10px;
  68. border: 1px solid var(--border-primary);
  69. border-radius: 5px;
  70. font-size: 1rem;
  71. }
  72. /* Custom Input Wrapper */
  73. .custom-input {
  74. display: flex;
  75. align-items: center;
  76. gap: 10px;
  77. font-size: 1rem;
  78. color: var(--text-primary);
  79. cursor: pointer;
  80. flex: 1 1 auto;
  81. }
  82. /* Hide the Native Input */
  83. .custom-input input {
  84. display: none;
  85. }
  86. /* Checkbox and Radio Styles */
  87. .custom-checkbox,
  88. .custom-radio {
  89. display: inline-block;
  90. width: 20px;
  91. height: 20px;
  92. border: 2px solid var(--theme-primary);
  93. background-color: var(--background-secondary);
  94. position: relative;
  95. transition: background-color 0.3s ease, border-color 0.3s ease;
  96. }
  97. /* Checkbox Specific */
  98. .custom-checkbox {
  99. border-radius: 4px;
  100. }
  101. .custom-checkbox::after {
  102. content: '';
  103. width: 10px;
  104. height: 10px;
  105. background-color: var(--theme-primary);
  106. position: absolute;
  107. top: 50%;
  108. left: 50%;
  109. transform: translate(-50%, -50%) scale(0);
  110. transition: transform 0.2s ease-in-out;
  111. }
  112. /* Radio Specific */
  113. .custom-radio {
  114. border-radius: 50%;
  115. }
  116. .custom-radio::after {
  117. content: '';
  118. width: 10px;
  119. height: 10px;
  120. background-color: var(--theme-primary);
  121. position: absolute;
  122. top: 50%;
  123. left: 50%;
  124. transform: translate(-50%, -50%) scale(0);
  125. border-radius: 50%;
  126. transition: transform 0.2s ease-in-out;
  127. }
  128. /* Checked State */
  129. .custom-input input:checked + .custom-checkbox::after,
  130. .custom-input input:checked + .custom-radio::after {
  131. transform: translate(-50%, -50%) scale(1);
  132. }
  133. .custom-input input:checked + .custom-checkbox,
  134. .custom-input input:checked + .custom-radio {
  135. background-color: var(--theme-primary);
  136. border-color: var(--theme-primary-hover);
  137. }
  138. /* Focus State */
  139. .custom-input input:focus-visible + .custom-checkbox,
  140. .custom-input input:focus-visible + .custom-radio {
  141. outline: 2px dashed var(--theme-primary);
  142. outline-offset: 2px;
  143. }
  144. /* Hover Effects */
  145. .custom-checkbox:hover,
  146. .custom-radio:hover {
  147. border-color: var(--theme-primary-hover);
  148. }
  149. /* Buttons */
  150. button {
  151. background: var(--theme-primary);
  152. color: var(--text-secondary);
  153. padding: 10px 15px;
  154. border: none;
  155. font-weight: bold;
  156. border-radius: 5px;
  157. cursor: pointer;
  158. font-size: 1rem;
  159. transition: background 0.3s ease,color 0.3s ease;
  160. }
  161. button:not(.close-button, .fullscreen-button, .move-button, .remove-button):hover {
  162. background: var(--background-info);
  163. }
  164. button.cancel {
  165. flex-grow: 0;
  166. }
  167. button.cancel:hover {
  168. background: var(--color-error);
  169. }
  170. button.cta:hover {
  171. background: var(--color-success);
  172. }
  173. button.warn:hover {
  174. background: var(--color-warning);
  175. }
  176. button.warning:hover{}
  177. /* App Layout */
  178. .app {
  179. min-height: calc(100vh - 110px);
  180. display: flex;
  181. flex-direction: column;
  182. }
  183. .hidden:not(.sticky) {
  184. display: none !important;
  185. }
  186. /* Tabs */
  187. .tab-content {
  188. display: none;
  189. flex: 1;
  190. overflow-y: auto;
  191. background: var(--background-secondary);
  192. }
  193. .tab-content.active {
  194. display: flex;
  195. position: relative;
  196. flex-direction: column;
  197. }
  198. section {
  199. padding: 15px;
  200. display: flex;
  201. flex-direction: column;
  202. }
  203. section.main {
  204. flex-grow: 1;
  205. }
  206. section.debug {
  207. flex-direction: row;
  208. align-items: center;
  209. justify-content: space-between;
  210. }
  211. section.sticky {
  212. position: fixed;
  213. background-color: rgba(255, 255, 255, 0.5);
  214. backdrop-filter: blur(10px);
  215. bottom: 60px;
  216. border-top: 1px solid var(--border-primary);
  217. box-shadow: var(--shadow-primary);
  218. transform: translateY(0);
  219. transition: 250ms transform, 250ms height;
  220. visibility: visible;
  221. max-height: 60vh;
  222. width: 100%;
  223. z-index: 10;
  224. }
  225. section.sticky.fullscreen {
  226. position: fixed;
  227. top: 0;
  228. left: 0;
  229. width: 100vw;
  230. max-height: none;
  231. }
  232. section.sticky.hidden {
  233. transform: translateY(100%);
  234. visibility: hidden;
  235. width: 100%;
  236. position: absolute;
  237. overflow:hidden;
  238. height: 0;
  239. padding: 0;
  240. }
  241. section .header {
  242. position: relative;
  243. display: flex;
  244. justify-content: space-between;
  245. align-items: center;
  246. margin-bottom: 10px;
  247. }
  248. section .header h2 {
  249. flex-grow: 1;
  250. }
  251. /* Close Button Styling */
  252. .close-button,
  253. .fullscreen-button {
  254. background: none;
  255. border: none;
  256. font-size: 1.5rem;
  257. font-weight: bold;
  258. color: var(--text-primary);
  259. cursor: pointer;
  260. line-height: 1;
  261. padding: 0;
  262. height: 100%;
  263. width: auto;
  264. aspect-ratio: 1 / 1;
  265. display: flex;
  266. justify-content: center;
  267. align-items: center;
  268. margin-left: 10px;
  269. }
  270. .close-button:hover {
  271. color: var(--color-error);
  272. }
  273. .fullscreen-button:hover {
  274. color: var(--color-warning);
  275. }
  276. section .header .add-button {
  277. height: 35px;
  278. width: 35px;
  279. font-size: 1.5rem;
  280. padding: 0;
  281. }
  282. /* Playlist */
  283. .add-to-playlist {
  284. margin-top: 15px;
  285. }
  286. .add-to-playlist button {
  287. margin-bottom: 10px;
  288. }
  289. .add-to-container {
  290. display: flex;
  291. flex-wrap: wrap;
  292. margin-bottom: 20px;
  293. }
  294. #add-to-playlist-container select,
  295. #add-to-playlist-container button {
  296. margin-top: 10px;
  297. display: block;
  298. width: 100%;
  299. }
  300. .playlist-parameters {
  301. display: flex;
  302. flex-direction: column;
  303. gap: 10px;
  304. }
  305. .playlist-parameters .row {
  306. display: flex;
  307. gap: 10px;
  308. }
  309. #clear_pattern {
  310. margin: 0;
  311. }
  312. .playlist-parameters .input-group input,
  313. .playlist-parameters .input-group select {
  314. width: 100%; /* Ensure inputs/selects stretch to full width */
  315. padding: 10px;
  316. border: 1px solid var(--border-primary);
  317. border-radius: 5px;
  318. font-size: 1rem;
  319. }
  320. .empty-placeholder {
  321. color: gray;
  322. font-style: italic;
  323. text-align: center;
  324. padding: 10px;
  325. }
  326. /* Style for the filename span */
  327. .filename {
  328. flex-grow: 1; /* Use available space */
  329. font-size: 1rem;
  330. color: var(--text-primary);
  331. margin-right: 10px; /* Space between filename and buttons */
  332. word-wrap: break-word;
  333. width: 100%;
  334. display: flex;
  335. align-items: center;
  336. }
  337. /* File List */
  338. .file-list {
  339. list-style: none;
  340. padding: 0;
  341. margin: 0;
  342. border: 1px solid var(--border-primary);
  343. border-radius: 5px;
  344. overflow-y: auto;
  345. background: var(--background-primary);
  346. flex-grow: 1;
  347. }
  348. .file-list li {
  349. display: flex;
  350. padding: 10px;
  351. border-bottom: 1px solid var(--border-primary);
  352. cursor: pointer;
  353. transition: background-color 0.3s ease;
  354. }
  355. .file-list li:hover {
  356. background-color: #f1f1f1;
  357. }
  358. .file-list li.selected {
  359. background: var(--theme-primary);
  360. color: var(--text-secondary);
  361. font-weight: bold;
  362. }
  363. .file-list li.selected .filename {
  364. font-weight: bold;
  365. color: var(--text-secondary);
  366. }
  367. .file-list button {
  368. margin-left: 5px;
  369. background: none;
  370. color: black;
  371. font-weight: bold;
  372. height: 40px;
  373. width: 40px;
  374. flex: 0 0 auto;
  375. display: flex;
  376. justify-content: center;
  377. align-items: center;
  378. }
  379. .file-list button:hover:not(:focus) {
  380. background: var(--background-primary);
  381. box-shadow: inset 0 0 4px var(--border-secondary);
  382. }
  383. .file-list button.remove-button {
  384. color: var(--color-error);
  385. }
  386. .title-container {
  387. display: flex;
  388. justify-content: space-between;
  389. align-items: center;
  390. }
  391. .rename-button {
  392. margin-left: 10px;
  393. background: var(--theme-primary-hover);
  394. color: var(--text-secondary);
  395. border: none;
  396. border-radius: 5px;
  397. padding: 5px 10px;
  398. cursor: pointer;
  399. transition: background 0.3s ease;
  400. }
  401. .rename-button:hover {
  402. background: #285A8E;
  403. }
  404. /* Bottom Navigation */
  405. .bottom-nav {
  406. display: flex;
  407. position: sticky;
  408. justify-content: space-around;
  409. bottom: 0;
  410. height: 60px;
  411. width: 100%;
  412. border-top: 1px solid var(--theme-primary);
  413. flex-wrap: wrap;
  414. z-index: 10;
  415. }
  416. .tab-button {
  417. flex: 1;
  418. padding: 20px 10px;
  419. text-align: center;
  420. font-size: 1rem;
  421. font-weight: bold;
  422. color: var(--text-secondary);
  423. background: none;
  424. border: none;
  425. cursor: pointer;
  426. transition: background 0.3s ease;
  427. background: var(--background-info);
  428. backdrop-filter: blur(2px);
  429. border-radius: 0;
  430. }
  431. .bottom-nav .tab-button.active {
  432. background: rgba(255, 255, 255, 0.75);
  433. color: var(--theme-primary);
  434. }
  435. /* Quick Action Buttons */
  436. .action-buttons {
  437. display: flex;
  438. gap: 10px;
  439. flex-wrap: wrap;
  440. width: 100%;
  441. }
  442. .action-buttons button {
  443. flex: 1;
  444. }
  445. .action-buttons button.cta {
  446. flex-grow: 1;
  447. }
  448. button#debug_button {
  449. width: 40px;
  450. padding: 0;
  451. height: 40px;
  452. background: transparent;
  453. font-size: 1.5rem;
  454. margin-left: 40px;
  455. flex: 0 0 auto;
  456. transition: 250ms all;
  457. }
  458. button#debug_button:hover,
  459. button#debug_button.active {
  460. box-shadow: inset 0 0 4px var(--border-secondary);
  461. }
  462. #settings-tab button.cancel {
  463. flex-basis: 100%;
  464. }
  465. /* Preview Canvas */
  466. #patternPreviewCanvas {
  467. width: 100%;
  468. max-width: 300px;
  469. aspect-ratio: 1/1;
  470. border: 1px solid var(--border-primary);
  471. background: var(--theme-secondary);
  472. border-radius: 100%;
  473. padding: 30px;
  474. }
  475. #pattern-preview {
  476. display: flex;
  477. flex-direction: column;
  478. align-items: center;
  479. margin-bottom: 20px;
  480. }
  481. #pattern-preview-container.fullscreen #patternPreviewCanvas {
  482. width: initial;
  483. max-width: calc(100vw - 30px);
  484. }
  485. /* Debug Log */
  486. #status_log {
  487. background: #000;
  488. color: var(--text-secondary);
  489. font-family: monospace;
  490. font-size: 0.9rem;
  491. border-top: 1px solid var(--border-primary);
  492. padding: 10px;
  493. max-height: 200px;
  494. overflow-y: scroll;
  495. display: none;
  496. width: 100%;
  497. }
  498. #status_log p {
  499. margin: 0;
  500. }
  501. .control-group {
  502. display: flex;
  503. margin-bottom: 10px;
  504. flex-wrap: wrap;
  505. width: 100%;
  506. align-items: center;
  507. justify-content: space-between;
  508. gap: 0 10px;
  509. }
  510. .control-group input {
  511. margin-bottom: 0;
  512. }
  513. .control-group h3 {
  514. width: 100%;
  515. }
  516. .control-group .item {
  517. display: flex;
  518. align-items: center;
  519. flex: 1;
  520. }
  521. .control-group .item.cta {
  522. justify-content: flex-end;
  523. }
  524. .control-group .item.column {
  525. flex-direction: column;
  526. text-align: center;
  527. }
  528. .control-group .item label {
  529. padding: 5px;
  530. }
  531. #serial_ports_container > * {
  532. display: inline-block;
  533. }
  534. #serial_ports_container select {
  535. margin: 10px;
  536. flex-basis: 100px;
  537. flex-grow: 0;
  538. }
  539. #serial_ports {
  540. width: auto;
  541. min-width: 200px;
  542. }
  543. #serial_status_container {
  544. margin-bottom: 10px;
  545. }
  546. #serial_status_header::before {
  547. content: '';
  548. width: 20px;
  549. height: 20px;
  550. border-radius: 50%;
  551. margin-right: 8px;
  552. background-color: var(--text-primary);
  553. display: inline-block;
  554. transition: var(--transition-slow) background-color;
  555. }
  556. #serial_status_header.connected::before {
  557. background-color: var(--color-success);
  558. }
  559. #serial_status_header.not-connected::before {
  560. background-color: var(--color-error);
  561. }
  562. #serial_ports_buttons {
  563. display: inline-block;
  564. }
  565. .status.connected {
  566. color: var(--color-success);
  567. font-weight: bold;
  568. }
  569. .status.not-connected {
  570. color: var(--color-error);
  571. font-weight: bold;
  572. }
  573. /* Speed Control Section */
  574. .speed-control {
  575. display: flex;
  576. }
  577. .speed-control label {
  578. font-weight: bold;
  579. font-size: 1rem;
  580. color: var(--text-primary);
  581. flex-shrink: 0;
  582. }
  583. .speed-control input[type="number"] {
  584. width: 100px; /* Consistent input width */
  585. padding: 8px;
  586. font-size: 1rem;
  587. border: 1px solid var(--border-primary);
  588. border-radius: 5px;
  589. outline: none;
  590. transition: all 0.3s ease;
  591. }
  592. input[type="number"]:focus {
  593. border-color: var(--theme-primary);
  594. box-shadow: 0 0 4px var(--background-info);
  595. }
  596. #speed_status {
  597. margin-top: 10px;
  598. font-size: 0.9rem;
  599. }
  600. #serial_ports_container > * {
  601. display: inline-block;
  602. }
  603. #serial_ports_container select {
  604. margin: 10px;
  605. flex-basis: 100px;
  606. flex-grow: 0;
  607. }
  608. #serial_ports {
  609. width: auto;
  610. min-width: 200px;
  611. }
  612. #serial_status_container,
  613. #serial_ports_buttons {
  614. display: inline-block;
  615. }
  616. /* Notification Styles */
  617. .notification {
  618. display: flex;
  619. position: absolute;
  620. top: 0;
  621. left: 0;
  622. font-weight: bold;
  623. z-index: 1000;
  624. color: var(--text-secondary);
  625. width: 100%;
  626. height: 100%;
  627. justify-content: center;
  628. align-items: center;
  629. backdrop-filter: blur(2px);
  630. opacity: 0;
  631. transition: opacity 250ms ease-in-out;
  632. }
  633. .notification.show {
  634. opacity: 1; /* Fully visible */
  635. }
  636. .notification .close-button {
  637. color: var(--text-secondary);
  638. font-size: 2rem;
  639. top: 0;
  640. right: 0;
  641. }
  642. /* Notification Types */
  643. .notification.success { background-color: var(--background-success); }
  644. .notification.warning { background-color: var(--background-warning); }
  645. .notification.error { background-color: var(--background-error); }
  646. .notification.info { background-color: var(--background-info); }
  647. .footer {
  648. align-items: center;
  649. display: flex;
  650. flex-wrap: wrap;
  651. justify-content: space-between;
  652. margin-bottom: 20px;
  653. width: 100%;
  654. }
  655. #github {
  656. align-content: center;
  657. display: flex;
  658. font-size: 0.8em;
  659. }
  660. #github img {
  661. margin: 0 5px
  662. }
  663. /* Responsive Design */
  664. @media (max-width: 1023px) {
  665. body {
  666. font-size: 0.9rem;
  667. }
  668. .tab-button {
  669. font-size: 0.9rem;
  670. }
  671. .footer {
  672. display: none;
  673. }
  674. button.cancel {
  675. background: var(--color-error);
  676. }
  677. button.cta {
  678. background: var(--color-success);
  679. }
  680. button.warn {
  681. background: var(--color-warning);
  682. }
  683. button.cancel:hover,
  684. button.warn:hover,
  685. button.cta:hover {
  686. background: var(--theme-primary);
  687. }
  688. }
  689. /* On larger screens, display all tabs in a 3-column grid */
  690. @media screen and (min-width: 1024px) {
  691. .app {
  692. display: grid;
  693. grid-template-columns: repeat(3, 1fr);
  694. gap: 0 16px;
  695. height: calc(100vh - 60px);
  696. }
  697. .bottom-nav {
  698. display: none;
  699. }
  700. #status_log {
  701. grid-column: span 3;
  702. align-self: flex-end;
  703. height: 100%;
  704. }
  705. section.sticky {
  706. position: sticky;
  707. bottom: 0;
  708. }
  709. /* Show all tabs in grid layout */
  710. .tab-content {
  711. display: flex !important; /* Always display tab-content */
  712. flex-direction: column;
  713. border: 1px solid var(--border-primary);
  714. background-color: var(--background-primary);
  715. border-radius: 8px;
  716. overflow-y: auto;
  717. overflow-x: hidden;
  718. position: relative;
  719. }
  720. }