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