egenn commited on
Commit
7b11b06
·
1 Parent(s): 8e193a9
Files changed (2) hide show
  1. app.R +0 -16
  2. www/rtemislive.scss +140 -10
app.R CHANGED
@@ -23,12 +23,6 @@ builtin_names <- readLines("data.R") |>
23
  (\(z) grep("<-", x = z, value = TRUE))() |>
24
  (\(z) gsub(" <-.*", "", x = z))()
25
 
26
- # Colors
27
- primary <- "#72CDF4"
28
- secondary <- "#704071"
29
- info <- helpcol <- "#B43880"
30
- success <- "#B4DC55"
31
-
32
  #' Create timeseries visualization shiny
33
  #' Visualize timeseries data using `dplot3_xt()`
34
  #'
@@ -98,21 +92,11 @@ xtlive <- function(
98
  ),
99
  # Theme ----
100
  theme = bslib::bs_theme(
101
- bg = "#fff",
102
- fg = "#000",
103
- primary = primary,
104
- secondary = secondary,
105
- success = success,
106
- info = info,
107
- `tooltip-bg` = "#303030",
108
- `tooltip-color` = helpcol,
109
  `tooltip-opacity` = 1,
110
  `tooltip-border-radius` = "10px",
111
  `tooltip-padding-x` = "1rem",
112
  `tooltip-padding-y` = "1rem",
113
  `tooltip-font-size` = "1rem"
114
- # base_font = bslib::font_google("Inter"), # doesn't work in shinylive
115
- # code_font = bslib::font_google("Fira Code")
116
  ) |>
117
  bs_add_rules(sass::sass_file("www/rtemislive.scss")),
118
  # Window title ----
 
23
  (\(z) grep("<-", x = z, value = TRUE))() |>
24
  (\(z) gsub(" <-.*", "", x = z))()
25
 
 
 
 
 
 
 
26
  #' Create timeseries visualization shiny
27
  #' Visualize timeseries data using `dplot3_xt()`
28
  #'
 
92
  ),
93
  # Theme ----
94
  theme = bslib::bs_theme(
 
 
 
 
 
 
 
 
95
  `tooltip-opacity` = 1,
96
  `tooltip-border-radius` = "10px",
97
  `tooltip-padding-x` = "1rem",
98
  `tooltip-padding-y` = "1rem",
99
  `tooltip-font-size` = "1rem"
 
 
100
  ) |>
101
  bs_add_rules(sass::sass_file("www/rtemislive.scss")),
102
  # Window title ----
www/rtemislive.scss CHANGED
@@ -1,12 +1,63 @@
1
  /* rtemislive.scss */
2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  /* rthelp */
4
  .rthelp {
5
  position: fixed !important;
6
  top: 33% !important;
7
  left: 50% !important;
8
  transform: translate(-50%, -50%);
9
- color: $info !important;
10
  margin: 11px;
11
  border: 0.5px solid transparent;
12
  border-radius: 10px;
@@ -15,7 +66,7 @@
15
 
16
  .rthelp-inline {
17
  display: inline-block;
18
- color: $info !important;
19
  margin: 11px;
20
  border: 0.5px solid transparent;
21
  border-radius: 10px;
@@ -23,16 +74,23 @@
23
  text-align: left;
24
  }
25
 
 
 
 
 
 
 
 
26
  // modify bs link color only for body links
27
  // card-body a {
28
  // color: $primary !important;
29
  // }
30
 
31
- .rt-tooltip {
32
- background-color: #282828aa;
33
- color: orange;
34
- border-radius: 10px;
35
- }
36
 
37
  // Border animation
38
  .rthelp,
@@ -47,15 +105,18 @@
47
 
48
  @keyframes highlight-border {
49
  0% {
50
- border-color: transparent;
 
 
51
  }
52
 
53
  50% {
54
- border-color: $info;
55
  }
56
 
57
  100% {
58
- border-color: transparent;
 
59
  }
60
  }
61
 
@@ -64,3 +125,72 @@
64
  margin-top: auto;
65
  margin-bottom: auto;
66
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  /* rtemislive.scss */
2
 
3
+ // Define your custom colors
4
+ // primary color
5
+ $light-primary: #1295D8;
6
+ $dark-primary: #1295D8;
7
+ $light-primary-rgb: #{red($light-primary)}, #{green($light-primary)}, #{blue($light-primary)};
8
+ $dark-primary-rgb: #{red($dark-primary)}, #{green($dark-primary)}, #{blue($dark-primary)};
9
+ // info color
10
+ $light-info: #E44C9A;
11
+ $light-info-rgb: #{red($light-info)}, #{green($light-info)}, #{blue($light-info)};
12
+ $dark-info: #FEB2E0;
13
+ $dark-info-rgb: #{red($dark-info)}, #{green($dark-info)}, #{blue($dark-info)};
14
+ // tooltip-bg
15
+ $light-tooltipbg: #cdcdcd;
16
+ $dark-tooltipbg: #333333;
17
+
18
+ // Customize the theme colors
19
+ @include color-mode(light) {
20
+ // primary color
21
+ --bs-primary: #{$light-primary};
22
+ --bs-primary-rgb: #{$light-primary-rgb};
23
+ // info color
24
+ --bs-info: #{$light-info};
25
+ --bs-info-rgb: #{$light-info-rgb};
26
+ // button color
27
+ --bs-button: #{$light-primary};
28
+ --bs-button-rgb: #{$light-primary-rgb};
29
+ // link color
30
+ --bs-link-color: #{$light-primary};
31
+ --bs-link-color-rgb: #{$light-primary-rgb};
32
+
33
+
34
+ --rt-tooltipbg: #{$light-tooltipbg};
35
+ }
36
+
37
+ @include color-mode(dark) {
38
+ // primary color
39
+ --bs-primary: #{$dark-primary};
40
+ --bs-primary-rgb: #{$dark-primary-rgb};
41
+ // info color
42
+ --bs-info: #{$dark-info};
43
+ --bs-info-rgb: #{$dark-info-rgb};
44
+ // button color
45
+ --bs-button: #{$dark-primary};
46
+ --bs-button-rgb: #{$dark-primary-rgb};
47
+ // link color
48
+ --bs-link-color: #{$dark-primary};
49
+ --bs-link-color-rgb: #{$dark-primary-rgb};
50
+
51
+ --rt-tooltipbg: #{$dark-tooltipbg};
52
+ }
53
+
54
  /* rthelp */
55
  .rthelp {
56
  position: fixed !important;
57
  top: 33% !important;
58
  left: 50% !important;
59
  transform: translate(-50%, -50%);
60
+ color: var(--bs-info) !important;
61
  margin: 11px;
62
  border: 0.5px solid transparent;
63
  border-radius: 10px;
 
66
 
67
  .rthelp-inline {
68
  display: inline-block;
69
+ color: var(--bs-info) !important;
70
  margin: 11px;
71
  border: 0.5px solid transparent;
72
  border-radius: 10px;
 
74
  text-align: left;
75
  }
76
 
77
+ .rthelplist {
78
+ color: var(--bs-info) !important;
79
+ background-color: var(--rt-tooltipbg) !important;
80
+ text-align: left;
81
+ }
82
+
83
+
84
  // modify bs link color only for body links
85
  // card-body a {
86
  // color: $primary !important;
87
  // }
88
 
89
+ // .rt-tooltip {
90
+ // background-color: #282828aa;
91
+ // color: orange;
92
+ // border-radius: 10px;
93
+ // }
94
 
95
  // Border animation
96
  .rthelp,
 
105
 
106
  @keyframes highlight-border {
107
  0% {
108
+ // border-color: transparent;
109
+ // Make border-color var(--bs-info) at 10% transparency
110
+ border-color: rgba(var(--bs-info-rgb), 0.10);
111
  }
112
 
113
  50% {
114
+ border-color: var(--bs-info);
115
  }
116
 
117
  100% {
118
+ // border-color: transparent;
119
+ border-color: rgba(var(--bs-info-rgb), 0.10);
120
  }
121
  }
122
 
 
125
  margin-top: auto;
126
  margin-bottom: auto;
127
  }
128
+
129
+ // Bootstrap tooltips
130
+ // set tooltip, tooltip-inner and tooltip-arrow colors to rt-tooltipbg
131
+ .tooltip {
132
+ --bs-tooltip-bg: var(--rt-tooltipbg);
133
+ --bs-tooltip-arrow-color: var(--rt-tooltipbg);
134
+ border-radius: 10px;
135
+ }
136
+
137
+ .tooltip-inner {
138
+ background-color: var(--rt-tooltipbg);
139
+ color: var(--bs-info) !important;
140
+ }
141
+
142
+ // Remove underscore from all links
143
+ a {
144
+ text-decoration: none;
145
+ }
146
+
147
+ // Define a SCSS variable that uses the CSS custom property
148
+ $primary-color: var(--bs-primary);
149
+
150
+ // Customize Bootstrap buttons
151
+ .btn-primary {
152
+ background-color: $primary-color;
153
+ border-color: $primary-color;
154
+
155
+ // &:hover,
156
+ // &:focus,
157
+ // &:active {
158
+ // background-color: rgba($primary-color, 0.8);
159
+ // border-color: rgba($primary-color, 0.8);
160
+ // }
161
+ }
162
+
163
+ .btn-outline-primary {
164
+ color: $primary-color;
165
+ border-color: $primary-color;
166
+
167
+ // &:hover,
168
+ // &:focus,
169
+ // &:active {
170
+ // background-color: $primary-color;
171
+ // border-color: $primary-color;
172
+ // }
173
+ }
174
+
175
+ // Customize radio buttons
176
+ .form-check-input {
177
+ &:checked {
178
+ background-color: $primary-color;
179
+ border-color: $primary-color;
180
+ }
181
+
182
+ // &:focus {
183
+ // border-color: $primary-color;
184
+ // box-shadow: 0 0 0 0.25rem rgba($primary-color, 0.25);
185
+ // }
186
+ }
187
+
188
+ // Radio buttons
189
+ .form-check-input:checked,
190
+ .shiny-input-container .checkbox input:checked,
191
+ .shiny-input-container .checkbox-inline input:checked,
192
+ .shiny-input-container .radio input:checked,
193
+ .shiny-input-container .radio-inline input:checked {
194
+ background-color: $primary-color;
195
+ border-color: $primary-color;
196
+ }