settings.html 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732
  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. /* Time slot specific styles */
  167. .time-slot-item {
  168. background-color: #f8fafc;
  169. border: 1px solid #e2e8f0;
  170. border-radius: 8px;
  171. padding: 16px;
  172. transition: all 0.15s;
  173. }
  174. .dark .time-slot-item {
  175. background-color: #1e293b;
  176. border-color: #475569;
  177. }
  178. .time-slot-item:hover {
  179. border-color: #cbd5e1;
  180. }
  181. .dark .time-slot-item:hover {
  182. border-color: #64748b;
  183. }
  184. /* Info box dark mode */
  185. .dark .bg-blue-50 {
  186. background-color: #1e3a8a;
  187. }
  188. .dark .border-blue-200 {
  189. border-color: #1e40af;
  190. }
  191. .dark .text-blue-600 {
  192. color: #60a5fa;
  193. }
  194. .dark .text-blue-800 {
  195. color: #dbeafe;
  196. }
  197. .dark .text-blue-700 {
  198. color: #bfdbfe;
  199. }
  200. {% endblock %}
  201. {% block content %}
  202. <div class="layout-content-container flex flex-col w-full max-w-4xl gap-8 pt-2 pb-[75px]">
  203. <div
  204. class="flex flex-wrap justify-between items-center p-4 bg-white rounded-xl shadow-sm mt-2 sm:mt-8"
  205. >
  206. <h1
  207. class="text-slate-900 tracking-tight text-2xl sm:text-3xl font-bold leading-tight"
  208. >
  209. Settings
  210. </h1>
  211. </div>
  212. <section class="bg-white rounded-xl shadow-sm overflow-hidden">
  213. <h2
  214. 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"
  215. >
  216. Device Connection
  217. </h2>
  218. <div class="divide-y divide-slate-100">
  219. <div
  220. class="flex items-center gap-4 px-6 py-5 hover:bg-slate-50 transition-colors"
  221. >
  222. <div
  223. class="text-slate-600 flex items-center justify-center rounded-lg bg-slate-100 shrink-0 size-12"
  224. >
  225. <span class="material-icons text-3xl">usb_off</span>
  226. </div>
  227. <div class="flex-1">
  228. <p class="text-slate-800 text-base font-medium leading-normal">
  229. Status
  230. </p>
  231. <p
  232. id="serialStatus"
  233. class="text-red-500 text-sm font-medium leading-normal"
  234. >
  235. Disconnected
  236. </p>
  237. </div>
  238. <button
  239. id="disconnectButton"
  240. 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"
  241. hidden
  242. >
  243. Disconnect
  244. </button>
  245. </div>
  246. <div id="portSelectionDiv" class="px-6 py-5 space-y-4">
  247. <label class="flex flex-col gap-1.5">
  248. <span class="text-slate-700 text-sm font-medium leading-normal"
  249. >Available Serial Ports</span
  250. >
  251. <div class="flex gap-3 items-center">
  252. <select
  253. id="portSelect"
  254. 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 "
  255. >
  256. <option value="">Select a port...</option>
  257. </select>
  258. <button
  259. id="connectButton"
  260. 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"
  261. >
  262. <span class="material-icons text-lg">cable</span>
  263. <span class="truncate">Connect</span>
  264. </button>
  265. </div>
  266. <p class="text-xs text-slate-500 mt-2">
  267. Select a port and click 'Connect' to establish a connection.
  268. </p>
  269. </label>
  270. </div>
  271. </div>
  272. </section>
  273. <section class="bg-white rounded-xl shadow-sm overflow-hidden">
  274. <h2
  275. 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"
  276. >
  277. Application Settings
  278. </h2>
  279. <div class="px-6 py-5 space-y-6">
  280. <label class="flex flex-col gap-1.5">
  281. <span class="text-slate-700 text-sm font-medium leading-normal"
  282. >Application Name</span
  283. >
  284. <div class="flex gap-3 items-center">
  285. <div class="relative flex-1">
  286. <input
  287. id="appNameInput"
  288. 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"
  289. placeholder="e.g., Dune Weaver"
  290. value="Dune Weaver"
  291. />
  292. <button
  293. type="button"
  294. onclick="document.getElementById('appNameInput').value='Dune Weaver';"
  295. class="absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-700"
  296. aria-label="Reset to default"
  297. title="Reset to default"
  298. >
  299. <span class="material-icons">restart_alt</span>
  300. </button>
  301. </div>
  302. <button
  303. id="saveAppName"
  304. 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"
  305. >
  306. <span class="material-icons text-lg">save</span>
  307. <span class="truncate">Save Name</span>
  308. </button>
  309. </div>
  310. <p class="text-xs text-slate-500 mt-2">
  311. This name will appear in the browser tab and at the top of every page.
  312. </p>
  313. </label>
  314. </div>
  315. </section>
  316. <section class="bg-white rounded-xl shadow-sm overflow-hidden">
  317. <h2
  318. 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"
  319. >
  320. Pattern Clearing
  321. </h2>
  322. <div class="px-6 py-5 space-y-6">
  323. <p class="text-sm text-slate-600">
  324. Customize the clearing behavior used when transitioning between patterns. Set custom patterns and speed to control how sand is distributed.
  325. </p>
  326. <!-- Clearing Speed Section -->
  327. <div class="bg-slate-50 rounded-lg p-4 space-y-4">
  328. <h3 class="text-slate-800 text-base font-semibold">Clearing Speed</h3>
  329. <p class="text-sm text-slate-600">
  330. 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.
  331. </p>
  332. <div class="flex flex-col gap-1.5">
  333. <label for="clearPatternSpeedInput" class="text-slate-700 text-sm font-medium leading-normal">
  334. Speed (steps per minute)
  335. </label>
  336. <div class="flex gap-3 items-center">
  337. <input
  338. id="clearPatternSpeedInput"
  339. type="number"
  340. min="50"
  341. max="2000"
  342. step="50"
  343. 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"
  344. placeholder="Default (use pattern speed)"
  345. value=""
  346. />
  347. <button
  348. id="saveClearSpeed"
  349. 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"
  350. >
  351. <span class="material-icons text-lg">save</span>
  352. <span class="truncate">Save Speed</span>
  353. </button>
  354. </div>
  355. <div id="effectiveClearSpeed" class="text-xs text-slate-500 mt-1"></div>
  356. </div>
  357. </div>
  358. <!-- Custom Patterns Section -->
  359. <div class="bg-slate-50 rounded-lg p-4 space-y-4">
  360. <h3 class="text-slate-800 text-base font-semibold">Custom Clear Patterns</h3>
  361. <p class="text-sm text-slate-600">
  362. Choose specific patterns to use when clearing. Leave empty to use the default clearing behavior.
  363. </p>
  364. <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
  365. <div class="flex flex-col gap-1.5">
  366. <label for="customClearFromInInput" class="text-slate-700 text-sm font-medium leading-normal">Clear From Center Pattern</label>
  367. <div class="relative">
  368. <input
  369. id="customClearFromInInput"
  370. type="text"
  371. 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"
  372. placeholder="Type to search patterns or leave empty for default"
  373. autocomplete="off"
  374. />
  375. <button
  376. type="button"
  377. id="clearFromInClear"
  378. class="absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-700 dark:hover:text-gray-300 hidden"
  379. aria-label="Clear selection"
  380. title="Clear selection"
  381. >
  382. <span class="material-icons text-xl">close</span>
  383. </button>
  384. <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>
  385. </div>
  386. <p class="text-xs text-slate-500 mt-1">
  387. Pattern to use when clearing from the center outward.
  388. </p>
  389. </div>
  390. <div class="flex flex-col gap-1.5">
  391. <label for="customClearFromOutInput" class="text-slate-700 text-sm font-medium leading-normal">Clear From Perimeter Pattern</label>
  392. <div class="relative">
  393. <input
  394. id="customClearFromOutInput"
  395. type="text"
  396. 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"
  397. placeholder="Type to search patterns or leave empty for default"
  398. autocomplete="off"
  399. />
  400. <button
  401. type="button"
  402. id="clearFromOutClear"
  403. class="absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-700 dark:hover:text-gray-300 hidden"
  404. aria-label="Clear selection"
  405. title="Clear selection"
  406. >
  407. <span class="material-icons text-xl">close</span>
  408. </button>
  409. <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>
  410. </div>
  411. <p class="text-xs text-slate-500 mt-1">
  412. Pattern to use when clearing from the perimeter inward.
  413. </p>
  414. </div>
  415. </div>
  416. <div class="flex justify-end">
  417. <button
  418. id="saveClearPatterns"
  419. 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"
  420. >
  421. <span class="material-icons text-lg">save</span>
  422. <span class="truncate">Save Patterns</span>
  423. </button>
  424. </div>
  425. </div>
  426. </div>
  427. </section>
  428. <section class="bg-white rounded-xl shadow-sm overflow-hidden">
  429. <h2
  430. 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"
  431. >
  432. WLED Configuration
  433. </h2>
  434. <div class="px-6 py-5 space-y-6">
  435. <label class="flex flex-col gap-1.5">
  436. <span class="text-slate-700 text-sm font-medium leading-normal"
  437. >IP Address</span
  438. >
  439. <div class="flex gap-3 items-center">
  440. <div class="relative flex-1">
  441. <input
  442. id="wledIpInput"
  443. 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"
  444. placeholder="e.g., 192.168.1.100"
  445. value=""
  446. />
  447. <button
  448. type="button"
  449. onclick="document.getElementById('wledIpInput').value='';"
  450. class="absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-700"
  451. aria-label="Clear WLED IP"
  452. >
  453. <span class="material-icons">close</span>
  454. </button>
  455. </div>
  456. <button
  457. id="saveWledConfig"
  458. 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"
  459. >
  460. <span class="material-icons text-lg">save</span>
  461. <span class="truncate">Save Configuration</span>
  462. </button>
  463. </div>
  464. <p class="text-xs text-slate-500 mt-2">
  465. Enter the IP address of your WLED controller.
  466. </p>
  467. </label>
  468. </div>
  469. </section>
  470. <section class="bg-white rounded-xl shadow-sm overflow-hidden">
  471. <h2
  472. 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"
  473. >
  474. Auto-play on Boot
  475. </h2>
  476. <div class="px-6 py-5 space-y-6">
  477. <div class="flex items-center justify-between">
  478. <div class="flex-1">
  479. <h3 class="text-slate-700 text-base font-medium leading-normal">Enable Auto-play on Boot</h3>
  480. <p class="text-xs text-slate-500 mt-1">
  481. Automatically start playing a selected playlist when the system boots up.
  482. </p>
  483. </div>
  484. <label class="switch">
  485. <input type="checkbox" id="auto_playModeToggle">
  486. <span class="slider round"></span>
  487. </label>
  488. </div>
  489. <div id="auto_playSettings" class="space-y-4" style="display: none;">
  490. <label class="flex flex-col gap-1.5">
  491. <span class="text-slate-700 text-sm font-medium leading-normal">Startup Playlist</span>
  492. <select
  493. id="auto_playPlaylistSelect"
  494. 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"
  495. >
  496. <option value="">Select a playlist...</option>
  497. </select>
  498. <p class="text-xs text-slate-500 mt-1">
  499. Choose which playlist to automatically play when the system starts.
  500. </p>
  501. </label>
  502. <div class="grid grid-cols-1 md:grid-cols-2 gap-4">
  503. <label class="flex flex-col gap-1.5">
  504. <span class="text-slate-700 text-sm font-medium leading-normal">Run Mode</span>
  505. <select
  506. id="auto_playRunModeSelect"
  507. 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"
  508. >
  509. <option value="single">Single (play once)</option>
  510. <option value="loop">Loop (repeat forever)</option>
  511. </select>
  512. <p class="text-xs text-slate-500 mt-1">
  513. How to run the playlist when it finishes.
  514. </p>
  515. </label>
  516. <label class="flex flex-col gap-1.5">
  517. <span class="text-slate-700 text-sm font-medium leading-normal">Pause Between Patterns (seconds)</span>
  518. <input
  519. id="auto_playPauseTimeInput"
  520. type="number"
  521. min="0"
  522. step="0.5"
  523. 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"
  524. placeholder="5.0"
  525. />
  526. <p class="text-xs text-slate-500 mt-1">
  527. Time to wait between each pattern (0 or more seconds).
  528. </p>
  529. </label>
  530. </div>
  531. <div class="grid grid-cols-1 md:grid-cols-2 gap-4">
  532. <label class="flex flex-col gap-1.5">
  533. <span class="text-slate-700 text-sm font-medium leading-normal">Clear Pattern</span>
  534. <select
  535. id="auto_playClearPatternSelect"
  536. 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"
  537. >
  538. <option value="none">None</option>
  539. <option value="adaptive">Adaptive</option>
  540. <option value="clear_from_in">Clear From Center</option>
  541. <option value="clear_from_out">Clear From Perimeter</option>
  542. <option value="clear_sideway">Clear Sideway</option>
  543. <option value="random">Random</option>
  544. </select>
  545. <p class="text-xs text-slate-500 mt-1">
  546. Pattern to run before each main pattern.
  547. </p>
  548. </label>
  549. <div class="flex items-center justify-between">
  550. <div class="flex-1">
  551. <h4 class="text-slate-700 text-sm font-medium leading-normal">Shuffle Playlist</h4>
  552. <p class="text-xs text-slate-500 mt-1">
  553. Randomize the order of patterns in the playlist.
  554. </p>
  555. </div>
  556. <label class="switch">
  557. <input type="checkbox" id="auto_playShuffleToggle">
  558. <span class="slider round"></span>
  559. </label>
  560. </div>
  561. </div>
  562. </div>
  563. </div>
  564. </section>
  565. <section class="bg-white rounded-xl shadow-sm overflow-hidden">
  566. <h2
  567. 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"
  568. >
  569. Still Sands
  570. </h2>
  571. <div class="px-6 py-5 space-y-6">
  572. <div class="flex items-center justify-between">
  573. <div class="flex-1">
  574. <h3 class="text-slate-700 text-base font-medium leading-normal">Enable Still Sands</h3>
  575. <p class="text-xs text-slate-500 mt-1">
  576. Automatically bring the sands to rest during specified time periods.
  577. </p>
  578. </div>
  579. <label class="switch">
  580. <input type="checkbox" id="scheduledPauseToggle">
  581. <span class="slider round"></span>
  582. </label>
  583. </div>
  584. <div id="scheduledPauseSettings" class="space-y-4" style="display: none;">
  585. <!-- WLED Control Option -->
  586. <div class="bg-amber-50 rounded-lg p-4 border border-amber-200">
  587. <div class="flex items-center justify-between">
  588. <div class="flex-1">
  589. <h4 class="text-slate-800 text-sm font-medium flex items-center gap-2">
  590. <span class="material-icons text-amber-600 text-base">lightbulb</span>
  591. Control WLED Lights
  592. </h4>
  593. <p class="text-xs text-slate-600 mt-1">
  594. Turn off WLED lights during still periods for complete rest
  595. </p>
  596. </div>
  597. <label class="switch">
  598. <input type="checkbox" id="stillSandsWledControl">
  599. <span class="slider round"></span>
  600. </label>
  601. </div>
  602. </div>
  603. <div class="bg-slate-50 rounded-lg p-4 space-y-4">
  604. <div class="flex items-center justify-between">
  605. <h4 class="text-slate-800 text-base font-semibold">Still Periods</h4>
  606. <button
  607. id="addTimeSlotButton"
  608. 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"
  609. >
  610. <span class="material-icons text-base">add</span>
  611. <span>Add Still Period</span>
  612. </button>
  613. </div>
  614. <p class="text-sm text-slate-600">
  615. Define time periods when the sands should rest in stillness. Patterns will resume automatically when still periods end.
  616. </p>
  617. <div id="timeSlotsContainer" class="space-y-3">
  618. <!-- Time slots will be dynamically added here -->
  619. </div>
  620. <div class="text-xs text-slate-500 bg-blue-50 border border-blue-200 rounded-lg p-3">
  621. <div class="flex items-start gap-2">
  622. <span class="material-icons text-blue-600 text-base">info</span>
  623. <div>
  624. <p class="font-medium text-blue-800">Important Notes:</p>
  625. <ul class="mt-1 space-y-1 text-blue-700">
  626. <li>• Times are based on your system's local time zone</li>
  627. <li>• Currently running patterns will pause immediately when entering a still period</li>
  628. <li>• Patterns will resume automatically when exiting a still period</li>
  629. <li>• Still periods that span midnight (e.g., 22:00 to 06:00) are supported</li>
  630. </ul>
  631. </div>
  632. </div>
  633. </div>
  634. </div>
  635. <div class="flex justify-end">
  636. <button
  637. id="savePauseSettings"
  638. 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"
  639. >
  640. <span class="material-icons text-lg">save</span>
  641. <span class="truncate">Save Still Sands</span>
  642. </button>
  643. </div>
  644. </div>
  645. </div>
  646. </section>
  647. <section class="bg-white rounded-xl shadow-sm overflow-hidden">
  648. <h2
  649. 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"
  650. >
  651. Software Version
  652. </h2>
  653. <div class="divide-y divide-slate-100">
  654. <div class="flex items-center gap-4 px-6 py-5">
  655. <div
  656. class="text-slate-600 flex items-center justify-center rounded-lg bg-slate-100 shrink-0 size-12"
  657. >
  658. <span class="material-icons text-3xl">terminal</span>
  659. </div>
  660. <div class="flex-1">
  661. <p class="text-slate-800 text-base font-medium leading-normal">
  662. Current Version
  663. </p>
  664. <p id="currentVersionText" class="text-slate-500 text-sm font-normal leading-normal">Loading...</p>
  665. </div>
  666. </div>
  667. <div class="flex items-center gap-4 px-6 py-5">
  668. <div
  669. class="text-slate-600 flex items-center justify-center rounded-lg bg-slate-100 shrink-0 size-12"
  670. >
  671. <span class="material-icons text-3xl">system_update</span>
  672. </div>
  673. <div class="flex-1">
  674. <p class="text-slate-800 text-base font-medium leading-normal">
  675. Latest Version
  676. </p>
  677. <p id="latestVersionText" class="text-slate-500 text-sm font-normal leading-normal">Checking...</p>
  678. </div>
  679. <button
  680. id="updateSoftware"
  681. 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"
  682. disabled
  683. >
  684. <span id="updateIcon" class="material-icons text-base">download</span>
  685. <span id="updateText" class="truncate">Update</span>
  686. </button>
  687. </div>
  688. </div>
  689. </section>
  690. </div>
  691. {% endblock %} {% block scripts %}
  692. <script src="/static/js/settings.js"></script>
  693. {% endblock %}