Commit
·
58d6a1c
1
Parent(s):
aa053eb
29. Sept. 2024, 05:24
Browse files- _res/_custom.js +31 -15
_res/_custom.js
CHANGED
|
@@ -34,21 +34,37 @@ function gradioCustomJS() {
|
|
| 34 |
const body = document.querySelector("body")
|
| 35 |
body.className = "dark"
|
| 36 |
|
| 37 |
-
//
|
| 38 |
-
const
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 52 |
|
| 53 |
body.style.setProperty("--primary-600", usedColor)
|
| 54 |
body.style.setProperty("--primary-50", "color-mix(in srgb, var(--primary-600) 5%, white)")
|
|
|
|
| 34 |
const body = document.querySelector("body")
|
| 35 |
body.className = "dark"
|
| 36 |
|
| 37 |
+
// Catppuccin colors
|
| 38 |
+
const rosewater = "245, 224, 220"
|
| 39 |
+
const flamingo = "242, 205, 205"
|
| 40 |
+
const pink = "245, 194, 231"
|
| 41 |
+
const mauve = "203, 166, 247"
|
| 42 |
+
const red = "243, 139, 168"
|
| 43 |
+
const maroon = "235, 160, 172"
|
| 44 |
+
const peach = "250, 179, 135"
|
| 45 |
+
const yellow = "249, 226, 175"
|
| 46 |
+
const green = "166, 227, 161"
|
| 47 |
+
const teal = "148, 226, 213"
|
| 48 |
+
const sky = "137, 220, 235"
|
| 49 |
+
const sapphire = "116, 199, 236"
|
| 50 |
+
const blue = "137, 180, 250"
|
| 51 |
+
|
| 52 |
+
let colors = [rosewater, flamingo, pink, mauve, red, maroon, peach, yellow, green, teal, sky, sapphire, blue]
|
| 53 |
+
let usedColor = `rgb(${colors[Math.floor(Math.random() * colors.length)]})`
|
| 54 |
+
|
| 55 |
+
body.style.setProperty("--cat-rosewater", "rgb(" + rosewater + ")")
|
| 56 |
+
body.style.setProperty("--cat-flamingo", "rgb(" + flamingo + ")")
|
| 57 |
+
body.style.setProperty("--cat-pink", "rgb(" + pink + ")")
|
| 58 |
+
body.style.setProperty("--cat-mauve", "rgb(" + mauve + ")")
|
| 59 |
+
body.style.setProperty("--cat-red", "rgb(" + red + ")")
|
| 60 |
+
body.style.setProperty("--cat-maroon", "rgb(" + maroon + ")")
|
| 61 |
+
body.style.setProperty("--cat-peach", "rgb(" + peach + ")")
|
| 62 |
+
body.style.setProperty("--cat-yellow", "rgb(" + yellow + ")")
|
| 63 |
+
body.style.setProperty("--cat-green", "rgb(" + green + ")")
|
| 64 |
+
body.style.setProperty("--cat-teal", "rgb(" + teal + ")")
|
| 65 |
+
body.style.setProperty("--cat-sky", "rgb(" + sky + ")")
|
| 66 |
+
body.style.setProperty("--cat-sapphire", "rgb(" + sapphire + ")")
|
| 67 |
+
body.style.setProperty("--cat-blue", "rgb(" + blue + ")")
|
| 68 |
|
| 69 |
body.style.setProperty("--primary-600", usedColor)
|
| 70 |
body.style.setProperty("--primary-50", "color-mix(in srgb, var(--primary-600) 5%, white)")
|