settings.html 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746
  1. {% extends "base.html" %} {% block title %}Settings - {{ app_name or 'Dune Weaver' }}{%
  2. endblock %}
  3. {% block additional_styles %}
  4. /* Dark mode styles for settings page */
  5. .dark .bg-white {
  6. background-color: #262626;
  7. }
  8. .dark .text-slate-900 {
  9. color: #e5e5e5;
  10. }
  11. .dark .text-slate-800 {
  12. color: #e5e5e5;
  13. }
  14. .dark .text-slate-700 {
  15. color: #d1d5db;
  16. }
  17. .dark .text-slate-600 {
  18. color: #9ca3af;
  19. }
  20. .dark .text-slate-500 {
  21. color: #9ca3af;
  22. }
  23. .dark .border-slate-200 {
  24. border-color: #404040;
  25. }
  26. .dark .border-slate-300 {
  27. border-color: #404040;
  28. }
  29. .dark .divide-slate-100 {
  30. border-color: #404040;
  31. }
  32. .dark .bg-slate-50 {
  33. background-color: #262626;
  34. }
  35. .dark .hover\:bg-slate-50:hover {
  36. background-color: #404040;
  37. }
  38. .dark .bg-slate-100 {
  39. background-color: #404040;
  40. }
  41. .dark .form-input {
  42. background-color: #262626;
  43. border-color: #404040;
  44. color: #e5e5e5;
  45. }
  46. .dark .form-input::placeholder {
  47. color: #9ca3af;
  48. }
  49. .dark .form-input:focus {
  50. border-color: #0c7ff2;
  51. ring-color: #0c7ff2;
  52. }
  53. .dark .form-select {
  54. background-color: #262626;
  55. border-color: #404040;
  56. color: #e5e5e5;
  57. }
  58. .dark .form-select:focus {
  59. border-color: #0c7ff2;
  60. ring-color: #0c7ff2;
  61. }
  62. .dark .focus\:ring-sky-500:focus {
  63. ring-color: #0c7ff2;
  64. }
  65. .dark .focus\:border-sky-500:focus {
  66. border-color: #0c7ff2;
  67. }
  68. .dark .hover\:text-gray-700:hover {
  69. color: #e5e5e5;
  70. }
  71. .dark .text-gray-400 {
  72. color: #9ca3af;
  73. }
  74. /* Autocomplete suggestions dark mode */
  75. .dark #clearFromInSuggestions,
  76. .dark #clearFromOutSuggestions {
  77. background-color: #262626;
  78. border-color: #404040;
  79. }
  80. .dark .suggestion-item {
  81. color: #e5e5e5;
  82. }
  83. .dark .suggestion-item:hover {
  84. background-color: #404040;
  85. }
  86. .dark .suggestion-item.selected {
  87. background-color: #0c7ff2;
  88. color: white;
  89. }
  90. /* Light mode autocomplete styles */
  91. .suggestion-item {
  92. padding: 8px 12px;
  93. cursor: pointer;
  94. color: #1f2937;
  95. transition: background-color 0.15s;
  96. }
  97. .suggestion-item:hover {
  98. background-color: #f3f4f6;
  99. }
  100. .suggestion-item.selected {
  101. background-color: #0c7ff2;
  102. color: white;
  103. }
  104. .suggestion-item mark {
  105. background-color: #fef3c7;
  106. font-weight: 600;
  107. }
  108. .dark .suggestion-item mark {
  109. background-color: #92400e;
  110. color: #fef3c7;
  111. }
  112. /* Toggle switch styles */
  113. .switch {
  114. position: relative;
  115. display: inline-block;
  116. width: 60px;
  117. height: 34px;
  118. }
  119. .switch input {
  120. opacity: 0;
  121. width: 0;
  122. height: 0;
  123. }
  124. .slider {
  125. position: absolute;
  126. cursor: pointer;
  127. top: 0;
  128. left: 0;
  129. right: 0;
  130. bottom: 0;
  131. background-color: #ccc;
  132. transition: .4s;
  133. }
  134. .slider:before {
  135. position: absolute;
  136. content: "";
  137. height: 26px;
  138. width: 26px;
  139. left: 4px;
  140. bottom: 4px;
  141. background-color: white;
  142. transition: .4s;
  143. }
  144. input:checked + .slider {
  145. background-color: #0c7ff2;
  146. }
  147. input:focus + .slider {
  148. box-shadow: 0 0 1px #0c7ff2;
  149. }
  150. input:checked + .slider:before {
  151. transform: translateX(26px);
  152. }
  153. .slider.round {
  154. border-radius: 34px;
  155. }
  156. .slider.round:before {
  157. border-radius: 50%;
  158. }
  159. /* Dark mode for switches */
  160. .dark .slider {
  161. background-color: #404040;
  162. }
  163. .dark input:checked + .slider {
  164. background-color: #0c7ff2;
  165. }
  166. /* Spin animation for loading states */
  167. @keyframes spin {
  168. from {
  169. transform: rotate(0deg);
  170. }
  171. to {
  172. transform: rotate(360deg);
  173. }
  174. }
  175. .animate-spin {
  176. animation: spin 1s linear infinite;
  177. }
  178. /* Time slot specific styles */
  179. .time-slot-item {
  180. background-color: #f8fafc;
  181. border: 1px solid #e2e8f0;
  182. border-radius: 8px;
  183. padding: 16px;
  184. transition: all 0.15s;
  185. }
  186. .dark .time-slot-item {
  187. background-color: #1e293b;
  188. border-color: #475569;
  189. }
  190. .time-slot-item:hover {
  191. border-color: #cbd5e1;
  192. }
  193. .dark .time-slot-item:hover {
  194. border-color: #64748b;
  195. }
  196. /* Info box dark mode */
  197. .dark .bg-blue-50 {
  198. background-color: #1e3a8a;
  199. }
  200. .dark .border-blue-200 {
  201. border-color: #1e40af;
  202. }
  203. .dark .text-blue-600 {
  204. color: #60a5fa;
  205. }
  206. .dark .text-blue-800 {
  207. color: #dbeafe;
  208. }
  209. .dark .text-blue-700 {
  210. color: #bfdbfe;
  211. }
  212. {% endblock %}
  213. {% block content %}
  214. <div class="layout-content-container flex flex-col w-full max-w-4xl gap-8 pt-2 pb-[75px]">
  215. <div
  216. class="flex flex-wrap justify-between items-center p-4 bg-white rounded-xl shadow-sm mt-2 sm:mt-8"
  217. >
  218. <h1
  219. class="text-slate-900 tracking-tight text-2xl sm:text-3xl font-bold leading-tight"
  220. >
  221. Settings
  222. </h1>
  223. </div>
  224. <section class="bg-white rounded-xl shadow-sm overflow-hidden">
  225. <h2
  226. class="text-slate-800 text-xl sm:text-2xl font-semibold leading-tight tracking-[-0.01em] px-6 py-4 border-b border-slate-200"
  227. >
  228. Device Connection
  229. </h2>
  230. <div class="divide-y divide-slate-100">
  231. <div
  232. class="flex items-center gap-4 px-6 py-5 hover:bg-slate-50 transition-colors"
  233. >
  234. <div
  235. class="text-slate-600 flex items-center justify-center rounded-lg bg-slate-100 shrink-0 size-12"
  236. >
  237. <span class="material-icons text-3xl">usb_off</span>
  238. </div>
  239. <div class="flex-1">
  240. <p class="text-slate-800 text-base font-medium leading-normal">
  241. Status
  242. </p>
  243. <p
  244. id="serialStatus"
  245. class="text-red-500 text-sm font-medium leading-normal"
  246. >
  247. Disconnected
  248. </p>
  249. </div>
  250. <button
  251. id="disconnectButton"
  252. class="text-xs font-medium text-slate-600 bg-red-100 hover:bg-red-200 text-red-700 px-3 py-1.5 rounded-md transition-colors"
  253. hidden
  254. >
  255. Disconnect
  256. </button>
  257. </div>
  258. <div id="portSelectionDiv" class="px-6 py-5 space-y-4">
  259. <label class="flex flex-col gap-1.5">
  260. <span class="text-slate-700 text-sm font-medium leading-normal"
  261. >Available Serial Ports</span
  262. >
  263. <div class="flex gap-3 items-center">
  264. <select
  265. id="portSelect"
  266. class="form-select flex-1 resize-none overflow-hidden rounded-lg text-slate-900 focus:outline-0 focus:ring-2 focus:ring-sky-500 border border-slate-300 bg-white focus:border-sky-500 h-10 placeholder:text-slate-400 px-4 text-base font-medium leading-normal transition-colors "
  267. >
  268. <option value="">Select a port...</option>
  269. </select>
  270. <button
  271. id="connectButton"
  272. class="flex items-center justify-center gap-2 min-w-[100px] cursor-pointer rounded-lg h-10 px-4 bg-sky-600 hover:bg-sky-700 text-white text-sm font-medium leading-normal tracking-[0.015em] transition-colors flex-shrink-0"
  273. >
  274. <span class="material-icons text-lg">cable</span>
  275. <span class="truncate">Connect</span>
  276. </button>
  277. </div>
  278. <p class="text-xs text-slate-500 mt-2">
  279. Select a port and click 'Connect' to establish a connection.
  280. </p>
  281. </label>
  282. </div>
  283. </div>
  284. </section>
  285. <section class="bg-white rounded-xl shadow-sm overflow-hidden">
  286. <h2
  287. class="text-slate-800 text-xl sm:text-2xl font-semibold leading-tight tracking-[-0.01em] px-6 py-4 border-b border-slate-200"
  288. >
  289. Application Settings
  290. </h2>
  291. <div class="px-6 py-5 space-y-6">
  292. <label class="flex flex-col gap-1.5">
  293. <span class="text-slate-700 text-sm font-medium leading-normal"
  294. >Application Name</span
  295. >
  296. <div class="flex gap-3 items-center">
  297. <div class="relative flex-1">
  298. <input
  299. id="appNameInput"
  300. class="form-input flex w-full min-w-0 resize-none overflow-hidden rounded-lg text-slate-900 focus:outline-0 focus:ring-2 focus:ring-sky-500 border border-slate-300 bg-white focus:border-sky-500 h-10 placeholder:text-slate-400 px-4 pr-10 text-base font-normal leading-normal transition-colors"
  301. placeholder="e.g., Dune Weaver"
  302. value="Dune Weaver"
  303. />
  304. <button
  305. type="button"
  306. onclick="document.getElementById('appNameInput').value='Dune Weaver';"
  307. class="absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-700"
  308. aria-label="Reset to default"
  309. title="Reset to default"
  310. >
  311. <span class="material-icons">restart_alt</span>
  312. </button>
  313. </div>
  314. <button
  315. id="saveAppName"
  316. class="flex items-center justify-center gap-2 min-w-[140px] cursor-pointer rounded-lg h-10 px-4 bg-sky-600 hover:bg-sky-700 text-white text-sm font-medium leading-normal tracking-[0.015em] transition-colors flex-shrink-0"
  317. >
  318. <span class="material-icons text-lg">save</span>
  319. <span class="truncate">Save Name</span>
  320. </button>
  321. </div>
  322. <p class="text-xs text-slate-500 mt-2">
  323. This name will appear in the browser tab and at the top of every page.
  324. </p>
  325. </label>
  326. </div>
  327. </section>
  328. <section class="bg-white rounded-xl shadow-sm overflow-hidden">
  329. <h2
  330. class="text-slate-800 text-xl sm:text-2xl font-semibold leading-tight tracking-[-0.01em] px-6 py-4 border-b border-slate-200"
  331. >
  332. Pattern Clearing
  333. </h2>
  334. <div class="px-6 py-5 space-y-6">
  335. <p class="text-sm text-slate-600">
  336. Customize the clearing behavior used when transitioning between patterns. Set custom patterns and speed to control how sand is distributed.
  337. </p>
  338. <!-- Clearing Speed Section -->
  339. <div class="bg-slate-50 rounded-lg p-4 space-y-4">
  340. <h3 class="text-slate-800 text-base font-semibold">Clearing Speed</h3>
  341. <p class="text-sm text-slate-600">
  342. Set a custom speed for clearing patterns. Leave empty to use the default pattern speed. This allows clearing patterns to run at a different speed than regular patterns.
  343. </p>
  344. <div class="flex flex-col gap-1.5">
  345. <label for="clearPatternSpeedInput" class="text-slate-700 text-sm font-medium leading-normal">
  346. Speed (steps per minute)
  347. </label>
  348. <div class="flex gap-3 items-center">
  349. <input
  350. id="clearPatternSpeedInput"
  351. type="number"
  352. min="50"
  353. max="2000"
  354. step="50"
  355. class="form-input flex-1 resize-none overflow-hidden rounded-lg text-slate-900 focus:outline-0 focus:ring-2 focus:ring-sky-500 border border-slate-300 bg-white focus:border-sky-500 h-10 placeholder:text-slate-400 px-4 text-base font-normal leading-normal transition-colors"
  356. placeholder="Default (use pattern speed)"
  357. value=""
  358. />
  359. <button
  360. id="saveClearSpeed"
  361. class="flex items-center justify-center gap-2 min-w-[120px] cursor-pointer rounded-lg h-10 px-4 bg-sky-600 hover:bg-sky-700 text-white text-sm font-medium leading-normal tracking-[0.015em] transition-colors"
  362. >
  363. <span class="material-icons text-lg">save</span>
  364. <span class="truncate">Save Speed</span>
  365. </button>
  366. </div>
  367. <div id="effectiveClearSpeed" class="text-xs text-slate-500 mt-1"></div>
  368. </div>
  369. </div>
  370. <!-- Custom Patterns Section -->
  371. <div class="bg-slate-50 rounded-lg p-4 space-y-4">
  372. <h3 class="text-slate-800 text-base font-semibold">Custom Clear Patterns</h3>
  373. <p class="text-sm text-slate-600">
  374. Choose specific patterns to use when clearing. Leave empty to use the default clearing behavior.
  375. </p>
  376. <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
  377. <div class="flex flex-col gap-1.5">
  378. <label for="customClearFromInInput" class="text-slate-700 text-sm font-medium leading-normal">Clear From Center Pattern</label>
  379. <div class="relative">
  380. <input
  381. id="customClearFromInInput"
  382. type="text"
  383. class="form-input w-full resize-none overflow-hidden rounded-lg text-slate-900 focus:outline-0 focus:ring-2 focus:ring-sky-500 border border-slate-300 bg-white focus:border-sky-500 h-10 placeholder:text-slate-400 px-4 pr-10 text-base font-normal leading-normal transition-colors"
  384. placeholder="Type to search patterns or leave empty for default"
  385. autocomplete="off"
  386. />
  387. <button
  388. type="button"
  389. id="clearFromInClear"
  390. class="absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-700 dark:hover:text-gray-300 hidden"
  391. aria-label="Clear selection"
  392. title="Clear selection"
  393. >
  394. <span class="material-icons text-xl">close</span>
  395. </button>
  396. <div id="clearFromInSuggestions" class="absolute z-10 w-full mt-1 bg-white border border-slate-300 rounded-lg shadow-lg max-h-60 overflow-y-auto hidden"></div>
  397. </div>
  398. <p class="text-xs text-slate-500 mt-1">
  399. Pattern to use when clearing from the center outward.
  400. </p>
  401. </div>
  402. <div class="flex flex-col gap-1.5">
  403. <label for="customClearFromOutInput" class="text-slate-700 text-sm font-medium leading-normal">Clear From Perimeter Pattern</label>
  404. <div class="relative">
  405. <input
  406. id="customClearFromOutInput"
  407. type="text"
  408. class="form-input w-full resize-none overflow-hidden rounded-lg text-slate-900 focus:outline-0 focus:ring-2 focus:ring-sky-500 border border-slate-300 bg-white focus:border-sky-500 h-10 placeholder:text-slate-400 px-4 pr-10 text-base font-normal leading-normal transition-colors"
  409. placeholder="Type to search patterns or leave empty for default"
  410. autocomplete="off"
  411. />
  412. <button
  413. type="button"
  414. id="clearFromOutClear"
  415. class="absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-700 dark:hover:text-gray-300 hidden"
  416. aria-label="Clear selection"
  417. title="Clear selection"
  418. >
  419. <span class="material-icons text-xl">close</span>
  420. </button>
  421. <div id="clearFromOutSuggestions" class="absolute z-10 w-full mt-1 bg-white border border-slate-300 rounded-lg shadow-lg max-h-60 overflow-y-auto hidden"></div>
  422. </div>
  423. <p class="text-xs text-slate-500 mt-1">
  424. Pattern to use when clearing from the perimeter inward.
  425. </p>
  426. </div>
  427. </div>
  428. <div class="flex justify-end">
  429. <button
  430. id="saveClearPatterns"
  431. class="flex items-center justify-center gap-2 min-w-[140px] cursor-pointer rounded-lg h-10 px-4 bg-sky-600 hover:bg-sky-700 text-white text-sm font-medium leading-normal tracking-[0.015em] transition-colors"
  432. >
  433. <span class="material-icons text-lg">save</span>
  434. <span class="truncate">Save Patterns</span>
  435. </button>
  436. </div>
  437. </div>
  438. </div>
  439. </section>
  440. <section class="bg-white rounded-xl shadow-sm overflow-hidden">
  441. <h2
  442. class="text-slate-800 text-xl sm:text-2xl font-semibold leading-tight tracking-[-0.01em] px-6 py-4 border-b border-slate-200"
  443. >
  444. WLED Configuration
  445. </h2>
  446. <div class="px-6 py-5 space-y-6">
  447. <label class="flex flex-col gap-1.5">
  448. <span class="text-slate-700 text-sm font-medium leading-normal"
  449. >IP Address</span
  450. >
  451. <div class="flex gap-3 items-center">
  452. <div class="relative flex-1">
  453. <input
  454. id="wledIpInput"
  455. class="form-input flex w-full min-w-0 resize-none overflow-hidden rounded-lg text-slate-900 focus:outline-0 focus:ring-2 focus:ring-sky-500 border border-slate-300 bg-white focus:border-sky-500 h-10 placeholder:text-slate-400 px-4 pr-10 text-base font-normal leading-normal transition-colors"
  456. placeholder="e.g., 192.168.1.100"
  457. value=""
  458. />
  459. <button
  460. type="button"
  461. onclick="document.getElementById('wledIpInput').value='';"
  462. class="absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-700"
  463. aria-label="Clear WLED IP"
  464. >
  465. <span class="material-icons">close</span>
  466. </button>
  467. </div>
  468. <button
  469. id="saveWledConfig"
  470. class="flex items-center justify-center gap-2 min-w-[140px] cursor-pointer rounded-lg h-10 px-4 bg-sky-600 hover:bg-sky-700 text-white text-sm font-medium leading-normal tracking-[0.015em] transition-colors flex-shrink-0"
  471. >
  472. <span class="material-icons text-lg">save</span>
  473. <span class="truncate">Save Configuration</span>
  474. </button>
  475. </div>
  476. <p class="text-xs text-slate-500 mt-2">
  477. Enter the IP address of your WLED controller.
  478. </p>
  479. </label>
  480. </div>
  481. </section>
  482. <section class="bg-white rounded-xl shadow-sm overflow-hidden">
  483. <h2
  484. class="text-slate-800 text-xl sm:text-2xl font-semibold leading-tight tracking-[-0.01em] px-6 py-4 border-b border-slate-200"
  485. >
  486. Auto-play on Boot
  487. </h2>
  488. <div class="px-6 py-5 space-y-6">
  489. <div class="flex items-center justify-between">
  490. <div class="flex-1">
  491. <h3 class="text-slate-700 text-base font-medium leading-normal">Enable Auto-play on Boot</h3>
  492. <p class="text-xs text-slate-500 mt-1">
  493. Automatically start playing a selected playlist when the system boots up.
  494. </p>
  495. </div>
  496. <label class="switch">
  497. <input type="checkbox" id="auto_playModeToggle">
  498. <span class="slider round"></span>
  499. </label>
  500. </div>
  501. <div id="auto_playSettings" class="space-y-4" style="display: none;">
  502. <label class="flex flex-col gap-1.5">
  503. <span class="text-slate-700 text-sm font-medium leading-normal">Startup Playlist</span>
  504. <select
  505. id="auto_playPlaylistSelect"
  506. class="form-select flex-1 resize-none overflow-hidden rounded-lg text-slate-900 focus:outline-0 focus:ring-2 focus:ring-sky-500 border border-slate-300 bg-white focus:border-sky-500 h-10 placeholder:text-slate-400 px-4 text-base font-medium leading-normal transition-colors"
  507. >
  508. <option value="">Select a playlist...</option>
  509. </select>
  510. <p class="text-xs text-slate-500 mt-1">
  511. Choose which playlist to automatically play when the system starts.
  512. </p>
  513. </label>
  514. <div class="grid grid-cols-1 md:grid-cols-2 gap-4">
  515. <label class="flex flex-col gap-1.5">
  516. <span class="text-slate-700 text-sm font-medium leading-normal">Run Mode</span>
  517. <select
  518. id="auto_playRunModeSelect"
  519. class="form-select resize-none overflow-hidden rounded-lg text-slate-900 focus:outline-0 focus:ring-2 focus:ring-sky-500 border border-slate-300 bg-white focus:border-sky-500 h-10 placeholder:text-slate-400 px-4 text-base font-medium leading-normal transition-colors"
  520. >
  521. <option value="single">Single (play once)</option>
  522. <option value="loop">Loop (repeat forever)</option>
  523. </select>
  524. <p class="text-xs text-slate-500 mt-1">
  525. How to run the playlist when it finishes.
  526. </p>
  527. </label>
  528. <label class="flex flex-col gap-1.5">
  529. <span class="text-slate-700 text-sm font-medium leading-normal">Pause Between Patterns (seconds)</span>
  530. <input
  531. id="auto_playPauseTimeInput"
  532. type="number"
  533. min="0"
  534. step="0.5"
  535. class="form-input resize-none overflow-hidden rounded-lg text-slate-900 focus:outline-0 focus:ring-2 focus:ring-sky-500 border border-slate-300 bg-white focus:border-sky-500 h-10 placeholder:text-slate-400 px-4 text-base font-normal leading-normal transition-colors"
  536. placeholder="5.0"
  537. />
  538. <p class="text-xs text-slate-500 mt-1">
  539. Time to wait between each pattern (0 or more seconds).
  540. </p>
  541. </label>
  542. </div>
  543. <div class="grid grid-cols-1 md:grid-cols-2 gap-4">
  544. <label class="flex flex-col gap-1.5">
  545. <span class="text-slate-700 text-sm font-medium leading-normal">Clear Pattern</span>
  546. <select
  547. id="auto_playClearPatternSelect"
  548. class="form-select resize-none overflow-hidden rounded-lg text-slate-900 focus:outline-0 focus:ring-2 focus:ring-sky-500 border border-slate-300 bg-white focus:border-sky-500 h-10 placeholder:text-slate-400 px-4 text-base font-medium leading-normal transition-colors"
  549. >
  550. <option value="none">None</option>
  551. <option value="adaptive">Adaptive</option>
  552. <option value="clear_from_in">Clear From Center</option>
  553. <option value="clear_from_out">Clear From Perimeter</option>
  554. <option value="clear_sideway">Clear Sideway</option>
  555. <option value="random">Random</option>
  556. </select>
  557. <p class="text-xs text-slate-500 mt-1">
  558. Pattern to run before each main pattern.
  559. </p>
  560. </label>
  561. <div class="flex items-center justify-between">
  562. <div class="flex-1">
  563. <h4 class="text-slate-700 text-sm font-medium leading-normal">Shuffle Playlist</h4>
  564. <p class="text-xs text-slate-500 mt-1">
  565. Randomize the order of patterns in the playlist.
  566. </p>
  567. </div>
  568. <label class="switch">
  569. <input type="checkbox" id="auto_playShuffleToggle">
  570. <span class="slider round"></span>
  571. </label>
  572. </div>
  573. </div>
  574. </div>
  575. </div>
  576. </section>
  577. <section class="bg-white rounded-xl shadow-sm overflow-hidden">
  578. <h2
  579. class="text-slate-800 text-xl sm:text-2xl font-semibold leading-tight tracking-[-0.01em] px-6 py-4 border-b border-slate-200"
  580. >
  581. Still Sands
  582. </h2>
  583. <div class="px-6 py-5 space-y-6">
  584. <div class="flex items-center justify-between">
  585. <div class="flex-1">
  586. <h3 class="text-slate-700 text-base font-medium leading-normal">Enable Still Sands</h3>
  587. <p class="text-xs text-slate-500 mt-1">
  588. Automatically bring the sands to rest during specified time periods.
  589. </p>
  590. </div>
  591. <label class="switch">
  592. <input type="checkbox" id="scheduledPauseToggle">
  593. <span class="slider round"></span>
  594. </label>
  595. </div>
  596. <div id="scheduledPauseSettings" class="space-y-4" style="display: none;">
  597. <!-- WLED Control Option -->
  598. <div class="bg-amber-50 rounded-lg p-4 border border-amber-200">
  599. <div class="flex items-center justify-between">
  600. <div class="flex-1">
  601. <h4 class="text-slate-800 text-sm font-medium flex items-center gap-2">
  602. <span class="material-icons text-amber-600 text-base">lightbulb</span>
  603. Control WLED Lights
  604. </h4>
  605. <p class="text-xs text-slate-600 mt-1">
  606. Turn off WLED lights during still periods for complete rest
  607. </p>
  608. </div>
  609. <label class="switch">
  610. <input type="checkbox" id="stillSandsWledControl">
  611. <span class="slider round"></span>
  612. </label>
  613. </div>
  614. </div>
  615. <div class="bg-slate-50 rounded-lg p-4 space-y-4">
  616. <div class="flex items-center justify-between">
  617. <h4 class="text-slate-800 text-base font-semibold">Still Periods</h4>
  618. <button
  619. id="addTimeSlotButton"
  620. class="flex items-center justify-center gap-2 cursor-pointer rounded-lg h-9 px-3 bg-sky-600 hover:bg-sky-700 text-white text-xs font-medium leading-normal tracking-[0.015em] transition-colors"
  621. >
  622. <span class="material-icons text-base">add</span>
  623. <span>Add Still Period</span>
  624. </button>
  625. </div>
  626. <p class="text-sm text-slate-600">
  627. Define time periods when the sands should rest in stillness. Patterns will resume automatically when still periods end.
  628. </p>
  629. <div id="timeSlotsContainer" class="space-y-3">
  630. <!-- Time slots will be dynamically added here -->
  631. </div>
  632. <div class="text-xs text-slate-500 bg-blue-50 border border-blue-200 rounded-lg p-3">
  633. <div class="flex items-start gap-2">
  634. <span class="material-icons text-blue-600 text-base">info</span>
  635. <div>
  636. <p class="font-medium text-blue-800">Important Notes:</p>
  637. <ul class="mt-1 space-y-1 text-blue-700">
  638. <li>• Times are based on your system's local time zone</li>
  639. <li>• Currently running patterns will pause immediately when entering a still period</li>
  640. <li>• Patterns will resume automatically when exiting a still period</li>
  641. <li>• Still periods that span midnight (e.g., 22:00 to 06:00) are supported</li>
  642. </ul>
  643. </div>
  644. </div>
  645. </div>
  646. </div>
  647. <div class="flex justify-end">
  648. <button
  649. id="savePauseSettings"
  650. class="flex items-center justify-center gap-2 min-w-[140px] cursor-pointer rounded-lg h-10 px-4 bg-sky-600 hover:bg-sky-700 text-white text-sm font-medium leading-normal tracking-[0.015em] transition-colors"
  651. >
  652. <span class="material-icons text-lg">save</span>
  653. <span class="truncate">Save Still Sands</span>
  654. </button>
  655. </div>
  656. </div>
  657. </div>
  658. </section>
  659. <section class="bg-white rounded-xl shadow-sm overflow-hidden">
  660. <h2
  661. class="text-slate-800 text-xl sm:text-2xl font-semibold leading-tight tracking-[-0.01em] px-6 py-4 border-b border-slate-200"
  662. >
  663. Software Version
  664. </h2>
  665. <div class="divide-y divide-slate-100">
  666. <div class="flex items-center gap-4 px-6 py-5">
  667. <div
  668. class="text-slate-600 flex items-center justify-center rounded-lg bg-slate-100 shrink-0 size-12"
  669. >
  670. <span class="material-icons text-3xl">terminal</span>
  671. </div>
  672. <div class="flex-1">
  673. <p class="text-slate-800 text-base font-medium leading-normal">
  674. Current Version
  675. </p>
  676. <p id="currentVersionText" class="text-slate-500 text-sm font-normal leading-normal">Loading...</p>
  677. </div>
  678. </div>
  679. <div class="flex items-center gap-4 px-6 py-5">
  680. <div
  681. class="text-slate-600 flex items-center justify-center rounded-lg bg-slate-100 shrink-0 size-12"
  682. >
  683. <span class="material-icons text-3xl">system_update</span>
  684. </div>
  685. <div class="flex-1">
  686. <p class="text-slate-800 text-base font-medium leading-normal">
  687. Latest Version
  688. </p>
  689. <p id="latestVersionText" class="text-slate-500 text-sm font-normal leading-normal">Checking...</p>
  690. </div>
  691. <button
  692. id="updateSoftware"
  693. class="flex items-center justify-center gap-1.5 min-w-[84px] cursor-pointer rounded-lg h-9 px-3 bg-gray-400 text-white text-xs font-medium leading-normal tracking-[0.015em] transition-colors disabled:opacity-50 disabled:cursor-not-allowed"
  694. disabled
  695. >
  696. <span id="updateIcon" class="material-icons text-base">download</span>
  697. <span id="updateText" class="truncate">Update</span>
  698. </button>
  699. </div>
  700. </div>
  701. </section>
  702. </div>
  703. {% endblock %} {% block scripts %}
  704. <script src="/static/js/settings.js"></script>
  705. {% endblock %}