Sebastiankay commited on
Commit
58d6a1c
·
1 Parent(s): aa053eb

29. Sept. 2024, 05:24

Browse files
Files changed (1) hide show
  1. _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
- // MARK: Catppuccin colors
38
- const usedColor = "rgb(166, 227, 161)"
39
- body.style.setProperty("--cat-rosewater", "rgb(245, 224, 220)")
40
- body.style.setProperty("--cat-flamingo", "rgb(242, 205, 205)")
41
- body.style.setProperty("--cat-pink", "rgb(245, 194, 231)")
42
- body.style.setProperty("--cat-mauve", "rgb(203, 166, 247)")
43
- body.style.setProperty("--cat-red", "rgb(243, 139, 168)")
44
- body.style.setProperty("--cat-maroon", "rgb(235, 160, 172)")
45
- body.style.setProperty("--cat-peach", "rgb(250, 179, 135)")
46
- body.style.setProperty("--cat-yellow", "rgb(249, 226, 175)")
47
- body.style.setProperty("--cat-green", "rgb(166, 227, 161)")
48
- body.style.setProperty("--cat-teal", "rgb(148, 226, 213)")
49
- body.style.setProperty("--cat-sky", "rgb(137, 220, 235)")
50
- body.style.setProperty("--cat-sapphire", "rgb(116, 199, 236)")
51
- body.style.setProperty("--cat-blue", "rgb(137, 180, 250)")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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)")