Compare commits
7 Commits
5163a577b3
...
0805d8e9fa
| Author | SHA1 | Date |
|---|---|---|
|
|
0805d8e9fa | |
|
|
c53ee7d82a | |
|
|
dede6fef73 | |
|
|
aeea81fbbf | |
|
|
8f7ce8bc96 | |
|
|
af51f7d6e9 | |
|
|
f68c85f0cd |
|
|
@ -30,7 +30,7 @@
|
|||
(multiple-value-bind (match groups)
|
||||
(cl-ppcre:scan-to-strings "<title>(.*?)</title>" source-section)
|
||||
(if (and match groups)
|
||||
(aref groups 0)
|
||||
(plump:decode-entities (aref groups 0))
|
||||
"Unknown")))
|
||||
"Unknown")))
|
||||
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@
|
|||
;; Color themes for spectrum analyzer
|
||||
(defvar *themes*
|
||||
(ps:create
|
||||
"monotone" (ps:create "top" "#0047ab" "mid" "#002966" "bottom" "#000d1a")
|
||||
"green" (ps:create "top" "#00ff00" "mid" "#00aa00" "bottom" "#005500")
|
||||
"blue" (ps:create "top" "#00ffff" "mid" "#0088ff" "bottom" "#0044aa")
|
||||
"purple" (ps:create "top" "#ff00ff" "mid" "#aa00aa" "bottom" "#550055")
|
||||
|
|
@ -180,10 +181,26 @@
|
|||
(setf *animation-id* nil)))
|
||||
|
||||
(defun set-spectrum-theme (theme-name)
|
||||
"Change the spectrum analyzer color theme"
|
||||
"Change the spectrum analyzer color theme and update dropdown colors"
|
||||
(when (ps:getprop *themes* theme-name)
|
||||
(setf *current-theme* theme-name)
|
||||
(ps:chain local-storage (set-item "spectrum-theme" theme-name))
|
||||
|
||||
(let ((theme (ps:getprop *themes* theme-name)))
|
||||
;; Update canvas border color to match theme
|
||||
(when *canvas*
|
||||
(setf (ps:@ *canvas* style border-color) (ps:@ theme top)))
|
||||
|
||||
;; Update dropdown box colors
|
||||
(let ((theme-selector (ps:chain document (get-element-by-id "spectrum-theme-selector")))
|
||||
(style-selector (ps:chain document (get-element-by-id "spectrum-style-selector"))))
|
||||
(when theme-selector
|
||||
(setf (ps:@ theme-selector style color) (ps:@ theme top))
|
||||
(setf (ps:@ theme-selector style border-color) (ps:@ theme top)))
|
||||
(when style-selector
|
||||
(setf (ps:@ style-selector style color) (ps:@ theme top))
|
||||
(setf (ps:@ style-selector style border-color) (ps:@ theme top)))))
|
||||
|
||||
(ps:chain console (log (+ "Spectrum theme changed to: " theme-name)))))
|
||||
|
||||
(defun get-available-themes ()
|
||||
|
|
@ -212,13 +229,23 @@
|
|||
(when (and saved-style (or (= saved-style "bars") (= saved-style "wave") (= saved-style "dots")))
|
||||
(setf *current-style* saved-style))
|
||||
|
||||
;; Update UI selectors if they exist
|
||||
;; Update UI selectors, canvas border, and dropdown colors
|
||||
(let ((theme-selector (ps:chain document (get-element-by-id "spectrum-theme-selector")))
|
||||
(style-selector (ps:chain document (get-element-by-id "spectrum-style-selector"))))
|
||||
(style-selector (ps:chain document (get-element-by-id "spectrum-style-selector")))
|
||||
(canvas (ps:chain document (get-element-by-id "spectrum-canvas")))
|
||||
(theme (ps:getprop *themes* *current-theme*)))
|
||||
(when theme-selector
|
||||
(setf (ps:@ theme-selector value) *current-theme*))
|
||||
(setf (ps:@ theme-selector value) *current-theme*)
|
||||
(setf (ps:@ theme-selector style color) (ps:@ theme top))
|
||||
(setf (ps:@ theme-selector style border-color) (ps:@ theme top)))
|
||||
(when style-selector
|
||||
(setf (ps:@ style-selector value) *current-style*))))
|
||||
(setf (ps:@ style-selector value) *current-style*)
|
||||
(setf (ps:@ style-selector style color) (ps:@ theme top))
|
||||
(setf (ps:@ style-selector style border-color) (ps:@ theme top)))
|
||||
|
||||
;; Set initial canvas border color
|
||||
(when canvas
|
||||
(setf (ps:@ canvas style border-color) (ps:@ theme top)))))
|
||||
|
||||
(let ((audio-element (or (ps:chain document (get-element-by-id "live-audio"))
|
||||
(ps:chain document (get-element-by-id "persistent-audio")))))
|
||||
|
|
|
|||
1185
static/asteroid.css
1185
static/asteroid.css
File diff suppressed because it is too large
Load Diff
|
|
@ -38,6 +38,7 @@
|
|||
<label>
|
||||
Theme:
|
||||
<select id="spectrum-theme-selector" onchange="setSpectrumTheme(this.value)" style="padding: 3px; background: #000; color: #00ff00; border: 1px solid #00ff00;">
|
||||
<option value="monotone">Monotone</option>
|
||||
<option value="green">Green</option>
|
||||
<option value="blue">Blue</option>
|
||||
<option value="purple">Purple</option>
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@
|
|||
<label>
|
||||
Theme:
|
||||
<select id="spectrum-theme-selector" onchange="setSpectrumTheme(this.value)" style="padding: 3px; background: #000; color: #00ff00; border: 1px solid #00ff00;">
|
||||
<option value="monotone">Monotone</option>
|
||||
<option value="green">Green</option>
|
||||
<option value="blue">Blue</option>
|
||||
<option value="purple">Purple</option>
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@
|
|||
<label>
|
||||
Theme:
|
||||
<select id="spectrum-theme-selector" onchange="setSpectrumTheme(this.value)" style="padding: 3px; background: #000; color: #00ff00; border: 1px solid #00ff00;">
|
||||
<option value="monotone">Monotone</option>
|
||||
<option value="green">Green</option>
|
||||
<option value="blue">Blue</option>
|
||||
<option value="purple">Purple</option>
|
||||
|
|
|
|||
Loading…
Reference in New Issue