neon_arch commited on
Commit
fb46d2c
β€’
1 Parent(s): a66362b

πŸ“ docs: update the theme example & add a new animation section (#439)

Browse files
Files changed (1) hide show
  1. docs/theming.md +247 -96
docs/theming.md CHANGED
@@ -1,17 +1,25 @@
1
- # Colorschemes
2
 
3
- ## Built-in
4
 
5
- By default `websurfx` comes with 9 colorschemes to choose from which can be easily chosen using the config file. To how to change colorschemes please view the [Configuration](https://github.com/neon-mmd/websurfx/wiki/configuration) section of the wiki.
6
 
7
- ## Custom
8
 
9
- Creating coloschemes is as easy as it gets it requires the user to have a theme file name with the colorscheme in which every space should be replaced with a `-` (dash) and it should end with a `.css` file extension. After creating the file you need to add the following code with the `colors` you want:
 
 
 
 
 
 
10
 
11
  ```css
12
  :root {
13
  --background-color: <background color>;
14
  --foreground-color: <foreground color (text color on the website) >;
 
 
15
  --color-one: <color 1>;
16
  --color-two: <color 2>;
17
  --color-three: <color 3>;
@@ -22,7 +30,7 @@ Creating coloschemes is as easy as it gets it requires the user to have a theme
22
  }
23
  ```
24
 
25
- > **Note**
26
  > Please infer the theme file located under `public/static/themes` to better understand where each color is being used.
27
 
28
  **Example of `catppuccin-mocha` colorscheme:**
@@ -31,6 +39,7 @@ Creating coloschemes is as easy as it gets it requires the user to have a theme
31
  :root {
32
  --background-color: #1e1e2e;
33
  --foreground-color: #cdd6f4;
 
34
  --color-one: #45475a;
35
  --color-two: #f38ba8;
36
  --color-three: #a6e3a1;
@@ -41,21 +50,31 @@ Creating coloschemes is as easy as it gets it requires the user to have a theme
41
  }
42
  ```
43
 
44
- # Themes
 
 
 
 
45
 
46
- ## Built-in
47
 
48
- By default `websurfx` comes with 1 theme to choose from which can be easily chosen using the config file. To how to change themes please view the [Configuration](https://github.com/neon-mmd/websurfx/wiki/configuration) section of the wiki.
49
 
50
- ## Custom
51
 
52
- To write custom color scheme, it requires the user to have some knowledge of `css stylesheets`.
53
 
54
- **Here is an example of `simple theme` (which we provide by default with the app) which will give the user a better idea on how to create a custom theme using it as a template:**
55
 
56
- ### General
57
 
58
  ```css
 
 
 
 
 
 
59
  * {
60
  padding: 0;
61
  margin: 0;
@@ -72,11 +91,17 @@ body {
72
  justify-content: space-between;
73
  align-items: center;
74
  height: 100vh;
75
- background: var(--color-one);
 
 
 
 
 
 
76
  }
77
  ```
78
 
79
- ### Styles for the index page
80
 
81
  ```css
82
  .search-container {
@@ -87,44 +112,69 @@ body {
87
  align-items: center;
88
  }
89
 
 
 
 
 
90
  .search-container div {
91
  display: flex;
92
  }
93
  ```
94
 
95
- ### Styles for the search box and search button
96
 
97
  ```css
98
  .search_bar {
99
  display: flex;
 
 
100
  }
101
 
102
  .search_bar input {
103
- padding: 1rem;
 
104
  width: 50rem;
105
  height: 3rem;
106
  outline: none;
107
  border: none;
108
- box-shadow: rgba(0, 0, 0, 1);
109
- background: var(--foreground-color);
 
 
 
 
 
 
 
 
 
 
 
 
110
  }
111
 
112
  .search_bar button {
113
- padding: 1rem;
114
- border-radius: 0;
115
  height: 3rem;
116
  display: flex;
117
  justify-content: center;
118
  align-items: center;
119
- outline: none;
 
120
  border: none;
 
121
  gap: 0;
122
- background: var(--background-color);
123
- color: var(--color-three);
124
  font-weight: 600;
125
  letter-spacing: 0.1rem;
126
  }
127
 
 
 
 
 
128
  .search_bar button:active,
129
  .search_bar button:hover {
130
  filter: brightness(1.2);
@@ -141,13 +191,19 @@ body {
141
  width: 20rem;
142
  background-color: var(--color-one);
143
  color: var(--foreground-color);
144
- padding: 1rem 2rem;
145
  border-radius: 0.5rem;
146
- outline: none;
 
147
  border: none;
148
  text-transform: capitalize;
149
  }
150
 
 
 
 
 
 
151
  .search_area .search_options option:hover {
152
  background-color: var(--color-one);
153
  }
@@ -170,9 +226,7 @@ body {
170
  .result_not_found img {
171
  width: 40rem;
172
  }
173
- ```
174
 
175
- ```css
176
  /* styles for the error box */
177
  .error_box .error_box_toggle_button {
178
  background: var(--foreground-color);
@@ -188,9 +242,11 @@ body {
188
  min-height: 20rem;
189
  min-width: 22rem;
190
  }
 
191
  .error_box .dropdown_error_box.show {
192
  display: flex;
193
  }
 
194
  .error_box .dropdown_error_box .error_item,
195
  .error_box .dropdown_error_box .no_errors {
196
  display: flex;
@@ -200,22 +256,25 @@ body {
200
  padding: 1rem;
201
  font-size: 1.2rem;
202
  }
 
203
  .error_box .dropdown_error_box .error_item {
204
  justify-content: space-between;
205
  }
 
206
  .error_box .dropdown_error_box .no_errors {
207
  min-height: 18rem;
208
  justify-content: center;
209
  }
210
 
211
  .error_box .dropdown_error_box .error_item:hover {
212
- box-shadow: inset 0 0 100px 100px rgba(255, 255, 255, 0.1);
213
  }
214
 
215
  .error_box .error_item .severity_color {
216
  width: 1.2rem;
217
  height: 1.2rem;
218
  }
 
219
  .results .result_disallowed,
220
  .results .result_filtered,
221
  .results .result_engine_not_selected {
@@ -225,7 +284,7 @@ body {
225
  gap: 10rem;
226
  font-size: 2rem;
227
  color: var(--foreground-color);
228
- margin: 0rem 7rem;
229
  }
230
 
231
  .results .result_disallowed .user_query,
@@ -251,16 +310,34 @@ body {
251
  }
252
  ```
253
 
254
- ### Styles for the footer and header
255
 
256
  ```css
257
  header {
 
258
  background: var(--background-color);
 
 
 
 
 
 
 
259
  width: 100%;
 
260
  display: flex;
261
- justify-content: right;
262
  align-items: center;
263
- padding: 1rem;
 
 
 
 
 
 
 
 
 
 
264
  }
265
 
266
  header ul,
@@ -301,39 +378,9 @@ footer div {
301
  display: flex;
302
  gap: 1rem;
303
  }
304
-
305
- footer {
306
- background: var(--background-color);
307
- width: 100%;
308
- padding: 1rem;
309
- display: flex;
310
- flex-direction: column;
311
- justify-content: center;
312
- align-items: center;
313
- }
314
-
315
- footer div span {
316
- font-size: 1.5rem;
317
- color: var(--4);
318
- }
319
-
320
- footer div {
321
- display: flex;
322
- gap: 1rem;
323
- }
324
-
325
- footer {
326
- background: var(--bg);
327
- width: 100%;
328
- padding: 1rem;
329
- display: flex;
330
- flex-direction: column;
331
- justify-content: center;
332
- align-items: center;
333
- }
334
  ```
335
 
336
- ### Styles for the search page
337
 
338
  ```css
339
  .results {
@@ -341,6 +388,11 @@ footer {
341
  display: flex;
342
  flex-direction: column;
343
  justify-content: space-around;
 
 
 
 
 
344
  }
345
 
346
  .results .search_bar {
@@ -352,6 +404,7 @@ footer {
352
  flex-direction: column;
353
  justify-content: space-between;
354
  margin: 2rem 0;
 
355
  }
356
 
357
  .results_aggregated .result {
@@ -361,10 +414,10 @@ footer {
361
  }
362
 
363
  .results_aggregated .result h1 a {
364
- font-size: 1.5rem;
 
365
  color: var(--color-two);
366
  text-decoration: none;
367
- letter-spacing: 0.1rem;
368
  }
369
 
370
  .results_aggregated .result h1 a:hover {
@@ -377,14 +430,15 @@ footer {
377
 
378
  .results_aggregated .result small {
379
  color: var(--color-three);
380
- font-size: 1.1rem;
381
  word-wrap: break-word;
382
  line-break: anywhere;
383
  }
384
 
385
  .results_aggregated .result p {
386
  color: var(--foreground-color);
387
- font-size: 1.2rem;
 
388
  margin-top: 0.3rem;
389
  word-wrap: break-word;
390
  line-break: anywhere;
@@ -395,10 +449,13 @@ footer {
395
  font-size: 1.2rem;
396
  padding: 1rem;
397
  color: var(--color-five);
 
 
 
398
  }
399
  ```
400
 
401
- ### Styles for the 404 page
402
 
403
  ```css
404
  .error_container {
@@ -448,11 +505,11 @@ footer {
448
  }
449
  ```
450
 
451
- ### Styles for the previous and next button on the search page
452
 
453
  ```css
454
  .page_navigation {
455
- padding: 0 0 2rem 0;
456
  display: flex;
457
  justify-content: space-between;
458
  align-items: center;
@@ -472,7 +529,7 @@ footer {
472
  }
473
  ```
474
 
475
- ### Styles for the about page
476
 
477
  This part is only available right now in the **rolling/edge/unstable** version
478
 
@@ -517,7 +574,7 @@ This part is only available right now in the **rolling/edge/unstable** version
517
  }
518
  ```
519
 
520
- ### Styles for the Settings Page
521
 
522
  This part is only available right now in the **rolling/edge/unstable** version
523
 
@@ -526,6 +583,7 @@ This part is only available right now in the **rolling/edge/unstable** version
526
  display: flex;
527
  justify-content: space-around;
528
  width: 80dvw;
 
529
  }
530
 
531
  .settings h1 {
@@ -533,9 +591,18 @@ This part is only available right now in the **rolling/edge/unstable** version
533
  font-size: 2.5rem;
534
  }
535
 
 
 
 
 
 
536
  .settings hr {
537
  border-color: var(--color-three);
538
- margin: 0.3rem 0 1rem 0;
 
 
 
 
539
  }
540
 
541
  .settings_container .sidebar {
@@ -548,7 +615,6 @@ This part is only available right now in the **rolling/edge/unstable** version
548
  margin-left: -0.7rem;
549
  padding: 0.7rem;
550
  border-radius: 5px;
551
- font-weight: bold;
552
  margin-bottom: 0.5rem;
553
  color: var(--foreground-color);
554
  text-transform: capitalize;
@@ -556,18 +622,30 @@ This part is only available right now in the **rolling/edge/unstable** version
556
  }
557
 
558
  .settings_container .sidebar .btn {
559
- padding: 0.5rem;
560
  border-radius: 0.5rem;
 
 
 
 
 
 
 
 
 
 
561
  }
562
 
563
  .settings_container .sidebar .btn.active {
564
  background-color: var(--color-two);
 
565
  }
566
 
567
  .settings_container .main_container {
568
  width: 70%;
569
  border-left: 1.5px solid var(--color-three);
570
  padding-left: 3rem;
 
571
  }
572
 
573
  .settings_container .tab {
@@ -576,6 +654,7 @@ This part is only available right now in the **rolling/edge/unstable** version
576
 
577
  .settings_container .tab.active {
578
  display: flex;
 
579
  flex-direction: column;
580
  justify-content: space-around;
581
  }
@@ -623,7 +702,7 @@ This part is only available right now in the **rolling/edge/unstable** version
623
  .settings_container .general select {
624
  margin: 0.7rem 0;
625
  width: 20rem;
626
- background-color: var(--background-color);
627
  color: var(--foreground-color);
628
  padding: 1rem 2rem;
629
  border-radius: 0.5rem;
@@ -641,16 +720,19 @@ This part is only available right now in the **rolling/edge/unstable** version
641
  display: flex;
642
  flex-direction: column;
643
  justify-content: center;
644
- gap: 1rem;
645
  padding: 1rem 0;
 
 
646
  }
647
 
648
  .settings_container .engines .toggle_btn {
649
  color: var(--foreground-color);
650
  font-size: 1.5rem;
651
  display: flex;
652
- gap: 0.5rem;
653
  align-items: center;
 
 
 
654
  }
655
 
656
  .settings_container .engines hr {
@@ -658,11 +740,11 @@ This part is only available right now in the **rolling/edge/unstable** version
658
  }
659
 
660
  .settings_container .cookies input {
661
- margin: 1rem 0rem;
662
  }
663
  ```
664
 
665
- ### Styles for the Toggle Button
666
 
667
  This part is only available right now in the **rolling/edge/unstable** version
668
 
@@ -686,25 +768,26 @@ This part is only available right now in the **rolling/edge/unstable** version
686
  .slider {
687
  position: absolute;
688
  cursor: pointer;
689
- top: 0;
690
- left: 0;
691
- right: 0;
692
- bottom: 0;
693
- background-color: var(--background-color);
694
- -webkit-transition: 0.4s;
695
- transition: 0.4s;
 
 
696
  }
697
 
698
- .slider:before {
699
  position: absolute;
700
  content: '';
701
  height: 2.6rem;
702
  width: 2.6rem;
703
  left: 0.4rem;
704
  bottom: 0.4rem;
705
- background-color: var(--foreground-color);
706
- -webkit-transition: 0.4s;
707
- transition: 0.4s;
708
  }
709
 
710
  input:checked + .slider {
@@ -715,9 +798,7 @@ input:focus + .slider {
715
  box-shadow: 0 0 1px var(--color-three);
716
  }
717
 
718
- input:checked + .slider:before {
719
- -webkit-transform: translateX(2.6rem);
720
- -ms-transform: translateX(2.6rem);
721
  transform: translateX(2.6rem);
722
  }
723
 
@@ -726,9 +807,79 @@ input:checked + .slider:before {
726
  border-radius: 3.4rem;
727
  }
728
 
729
- .slider.round:before {
730
  border-radius: 50%;
731
  }
732
  ```
733
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
734
  [⬅️ Go back to Home](./README.md)
 
1
+ # Theming
2
 
3
+ ## Colorschemes
4
 
5
+ ### Built-in
6
 
7
+ By default `websurfx` comes with 12 colorschemes to choose from which can be easily chosen using the config file or via the settings page on the website.
8
 
9
+ > To how to change colorschemes using the config file. See: [**Configuration**](https://github.com/neon-mmd/websurfx/wiki/configuration)
10
+
11
+ ### Custom
12
+
13
+ To write a custom theme for the website, you will first need to create a new file under the `public/static/themes` folder with name of the theme containing each word seperated with a hyphen (**-**). Then after that edit the newly created file as required with new css code.
14
+
15
+ Creating coloschemes is as easy as it gets it requires the user to have a colorscheme file name with the name of the colorscheme that is to be provided in which every space should be replaced with a `-` (dash) and it should end with a `.css` file extension. After creating the file you need to add the following code with the `colors` you want to include:
16
 
17
  ```css
18
  :root {
19
  --background-color: <background color>;
20
  --foreground-color: <foreground color (text color on the website) >;
21
+ --logo-color: <logo color
22
+ (the color of the logo svg image on the website homepage) >;
23
  --color-one: <color 1>;
24
  --color-two: <color 2>;
25
  --color-three: <color 3>;
 
30
  }
31
  ```
32
 
33
+ > [!Note]
34
  > Please infer the theme file located under `public/static/themes` to better understand where each color is being used.
35
 
36
  **Example of `catppuccin-mocha` colorscheme:**
 
39
  :root {
40
  --background-color: #1e1e2e;
41
  --foreground-color: #cdd6f4;
42
+ --logo-color: #f5c2e7;
43
  --color-one: #45475a;
44
  --color-two: #f38ba8;
45
  --color-three: #a6e3a1;
 
50
  }
51
  ```
52
 
53
+ ## Themes
54
+
55
+ ### Built-in
56
+
57
+ By default `websurfx` comes with 1 theme to choose from which can be easily chosen using the config file or via the settings page on the website.
58
 
59
+ > To how to change themes using the config file. See: [**Configuration**](https://github.com/neon-mmd/websurfx/wiki/configuration)
60
 
61
+ ### Custom
62
 
63
+ > This section expects the user to have some knowledge of `css`.
64
 
65
+ To write a custom theme for the website, you will first need to create a new file under the `public/static/themes` folder with name of the theme containing each word seperated with a hyphen (**-**). Then after that edit the newly created file as required with new css code.
66
 
67
+ Here is an example of `simple theme` (which we provide by default with the app) which will give you a better idea on how you can create your own custom theme for the website:
68
 
69
+ #### General
70
 
71
  ```css
72
+ @font-face {
73
+ font-family: Rubik;
74
+ src: url('https://fonts.googleapis.com/css2?family=Rubik:wght@400;500;600;700;800&display=swap');
75
+ fallback: sans-serif;
76
+ }
77
+
78
  * {
79
  padding: 0;
80
  margin: 0;
 
91
  justify-content: space-between;
92
  align-items: center;
93
  height: 100vh;
94
+ font-family: Rubik, sans-serif;
95
+ background-color: var(--background-color);
96
+ }
97
+
98
+ /* enforce font for buttons */
99
+ button {
100
+ font-family: Rubik, sans-serif;
101
  }
102
  ```
103
 
104
+ #### Styles for the index page
105
 
106
  ```css
107
  .search-container {
 
112
  align-items: center;
113
  }
114
 
115
+ .search-container svg {
116
+ color: var(--logo-color);
117
+ }
118
+
119
  .search-container div {
120
  display: flex;
121
  }
122
  ```
123
 
124
+ #### Styles for the search box and search button
125
 
126
  ```css
127
  .search_bar {
128
  display: flex;
129
+ gap: 10px;
130
+ align-items: center;
131
  }
132
 
133
  .search_bar input {
134
+ border-radius: 6px;
135
+ padding: 2.6rem 2.2rem;
136
  width: 50rem;
137
  height: 3rem;
138
  outline: none;
139
  border: none;
140
+ box-shadow: rgb(0 0 0 / 1);
141
+ background-color: var(--color-one);
142
+ color: var(--foreground-color);
143
+ outline-offset: 3px;
144
+ font-size: 1.6rem;
145
+ }
146
+
147
+ .search_bar input:focus {
148
+ outline: 2px solid var(--foreground-color);
149
+ }
150
+
151
+ .search_bar input::placeholder {
152
+ color: var(--foreground-color);
153
+ opacity: 1;
154
  }
155
 
156
  .search_bar button {
157
+ padding: 2.6rem 3.2rem;
158
+ border-radius: 6px;
159
  height: 3rem;
160
  display: flex;
161
  justify-content: center;
162
  align-items: center;
163
+ outline-offset: 3px;
164
+ outline: 2px solid transparent;
165
  border: none;
166
+ transition: 0.1s;
167
  gap: 0;
168
+ background-color: var(--color-six);
169
+ color: var(--background-color);
170
  font-weight: 600;
171
  letter-spacing: 0.1rem;
172
  }
173
 
174
+ .search_bar button:active {
175
+ outline: 2px solid var(--color-three);
176
+ }
177
+
178
  .search_bar button:active,
179
  .search_bar button:hover {
180
  filter: brightness(1.2);
 
191
  width: 20rem;
192
  background-color: var(--color-one);
193
  color: var(--foreground-color);
194
+ padding: 1.2rem 2rem;
195
  border-radius: 0.5rem;
196
+ outline-offset: 3px;
197
+ outline: 2px solid transparent;
198
  border: none;
199
  text-transform: capitalize;
200
  }
201
 
202
+ .search_area .search_options select:active,
203
+ .search_area .search_options select:hover {
204
+ outline: 2px solid var(--color-three);
205
+ }
206
+
207
  .search_area .search_options option:hover {
208
  background-color: var(--color-one);
209
  }
 
226
  .result_not_found img {
227
  width: 40rem;
228
  }
 
229
 
 
230
  /* styles for the error box */
231
  .error_box .error_box_toggle_button {
232
  background: var(--foreground-color);
 
242
  min-height: 20rem;
243
  min-width: 22rem;
244
  }
245
+
246
  .error_box .dropdown_error_box.show {
247
  display: flex;
248
  }
249
+
250
  .error_box .dropdown_error_box .error_item,
251
  .error_box .dropdown_error_box .no_errors {
252
  display: flex;
 
256
  padding: 1rem;
257
  font-size: 1.2rem;
258
  }
259
+
260
  .error_box .dropdown_error_box .error_item {
261
  justify-content: space-between;
262
  }
263
+
264
  .error_box .dropdown_error_box .no_errors {
265
  min-height: 18rem;
266
  justify-content: center;
267
  }
268
 
269
  .error_box .dropdown_error_box .error_item:hover {
270
+ box-shadow: inset 0 0 100px 100px rgb(255 255 255 / 0.1);
271
  }
272
 
273
  .error_box .error_item .severity_color {
274
  width: 1.2rem;
275
  height: 1.2rem;
276
  }
277
+
278
  .results .result_disallowed,
279
  .results .result_filtered,
280
  .results .result_engine_not_selected {
 
284
  gap: 10rem;
285
  font-size: 2rem;
286
  color: var(--foreground-color);
287
+ margin: 0 7rem;
288
  }
289
 
290
  .results .result_disallowed .user_query,
 
310
  }
311
  ```
312
 
313
+ #### Styles for the footer and header
314
 
315
  ```css
316
  header {
317
+ width: 100%;
318
  background: var(--background-color);
319
+ display: flex;
320
+ align-items: center;
321
+ justify-content: space-between;
322
+ padding: 2rem 3rem;
323
+ }
324
+
325
+ footer {
326
  width: 100%;
327
+ background: var(--background-color);
328
  display: flex;
 
329
  align-items: center;
330
+ padding: 1.7rem 1.7rem 4rem;
331
+ gap: 1.8rem;
332
+ flex-direction: column;
333
+ justify-content: center;
334
+ }
335
+
336
+ header h1 a {
337
+ text-transform: capitalize;
338
+ text-decoration: none;
339
+ color: var(--foreground-color);
340
+ letter-spacing: 0.1rem;
341
  }
342
 
343
  header ul,
 
378
  display: flex;
379
  gap: 1rem;
380
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
381
  ```
382
 
383
+ #### Styles for the search page
384
 
385
  ```css
386
  .results {
 
388
  display: flex;
389
  flex-direction: column;
390
  justify-content: space-around;
391
+ gap: 1rem;
392
+ }
393
+
394
+ .result {
395
+ gap: 1rem;
396
  }
397
 
398
  .results .search_bar {
 
404
  flex-direction: column;
405
  justify-content: space-between;
406
  margin: 2rem 0;
407
+ content-visibility: auto;
408
  }
409
 
410
  .results_aggregated .result {
 
414
  }
415
 
416
  .results_aggregated .result h1 a {
417
+ font-size: 1.7rem;
418
+ font-weight: normal;
419
  color: var(--color-two);
420
  text-decoration: none;
 
421
  }
422
 
423
  .results_aggregated .result h1 a:hover {
 
430
 
431
  .results_aggregated .result small {
432
  color: var(--color-three);
433
+ font-size: 1.3rem;
434
  word-wrap: break-word;
435
  line-break: anywhere;
436
  }
437
 
438
  .results_aggregated .result p {
439
  color: var(--foreground-color);
440
+ font-size: 1.4rem;
441
+ line-height: 2.4rem;
442
  margin-top: 0.3rem;
443
  word-wrap: break-word;
444
  line-break: anywhere;
 
449
  font-size: 1.2rem;
450
  padding: 1rem;
451
  color: var(--color-five);
452
+ display: flex;
453
+ gap: 1rem;
454
+ justify-content: right;
455
  }
456
  ```
457
 
458
+ #### Styles for the 404 page
459
 
460
  ```css
461
  .error_container {
 
505
  }
506
  ```
507
 
508
+ #### Styles for the previous and next button on the search page
509
 
510
  ```css
511
  .page_navigation {
512
+ padding: 0 0 2rem;
513
  display: flex;
514
  justify-content: space-between;
515
  align-items: center;
 
529
  }
530
  ```
531
 
532
+ #### Styles for the about page
533
 
534
  This part is only available right now in the **rolling/edge/unstable** version
535
 
 
574
  }
575
  ```
576
 
577
+ #### Styles for the Settings Page
578
 
579
  This part is only available right now in the **rolling/edge/unstable** version
580
 
 
583
  display: flex;
584
  justify-content: space-around;
585
  width: 80dvw;
586
+ margin: 5rem 0;
587
  }
588
 
589
  .settings h1 {
 
591
  font-size: 2.5rem;
592
  }
593
 
594
+ .settings > h1 {
595
+ margin-bottom: 4rem;
596
+ margin-left: 2rem;
597
+ }
598
+
599
  .settings hr {
600
  border-color: var(--color-three);
601
+ margin: 0.3rem 0 1rem;
602
+ }
603
+
604
+ .settings > hr {
605
+ margin-left: 2rem;
606
  }
607
 
608
  .settings_container .sidebar {
 
615
  margin-left: -0.7rem;
616
  padding: 0.7rem;
617
  border-radius: 5px;
 
618
  margin-bottom: 0.5rem;
619
  color: var(--foreground-color);
620
  text-transform: capitalize;
 
622
  }
623
 
624
  .settings_container .sidebar .btn {
625
+ padding: 2rem;
626
  border-radius: 0.5rem;
627
+ outline-offset: 3px;
628
+ outline: 2px solid transparent;
629
+ }
630
+
631
+ .settings_container .sidebar .btn:active {
632
+ outline: 2px solid var(--color-two);
633
+ }
634
+
635
+ .settings_container .sidebar .btn:not(.active):hover {
636
+ color: var(--color-two);
637
  }
638
 
639
  .settings_container .sidebar .btn.active {
640
  background-color: var(--color-two);
641
+ color: var(--background-color);
642
  }
643
 
644
  .settings_container .main_container {
645
  width: 70%;
646
  border-left: 1.5px solid var(--color-three);
647
  padding-left: 3rem;
648
+ border: none;
649
  }
650
 
651
  .settings_container .tab {
 
654
 
655
  .settings_container .tab.active {
656
  display: flex;
657
+ gap: 1.2rem;
658
  flex-direction: column;
659
  justify-content: space-around;
660
  }
 
702
  .settings_container .general select {
703
  margin: 0.7rem 0;
704
  width: 20rem;
705
+ background-color: var(--color-one);
706
  color: var(--foreground-color);
707
  padding: 1rem 2rem;
708
  border-radius: 0.5rem;
 
720
  display: flex;
721
  flex-direction: column;
722
  justify-content: center;
 
723
  padding: 1rem 0;
724
+ margin-bottom: 2rem;
725
+ gap: 2rem;
726
  }
727
 
728
  .settings_container .engines .toggle_btn {
729
  color: var(--foreground-color);
730
  font-size: 1.5rem;
731
  display: flex;
 
732
  align-items: center;
733
+ border-radius: 100px;
734
+ gap: 1.5rem;
735
+ letter-spacing: 1px;
736
  }
737
 
738
  .settings_container .engines hr {
 
740
  }
741
 
742
  .settings_container .cookies input {
743
+ margin: 1rem 0;
744
  }
745
  ```
746
 
747
+ #### Styles for the Toggle Button
748
 
749
  This part is only available right now in the **rolling/edge/unstable** version
750
 
 
768
  .slider {
769
  position: absolute;
770
  cursor: pointer;
771
+ inset: 0;
772
+ background-color: var(--foreground-color);
773
+ transition: 0.2s;
774
+ outline-offset: 3px;
775
+ outline: 2px solid transparent;
776
+ }
777
+
778
+ .slider:active {
779
+ outline: 2px solid var(--foreground-color);
780
  }
781
 
782
+ .slider::before {
783
  position: absolute;
784
  content: '';
785
  height: 2.6rem;
786
  width: 2.6rem;
787
  left: 0.4rem;
788
  bottom: 0.4rem;
789
+ background-color: var(--background-color);
790
+ transition: 0.2s;
 
791
  }
792
 
793
  input:checked + .slider {
 
798
  box-shadow: 0 0 1px var(--color-three);
799
  }
800
 
801
+ input:checked + .slider::before {
 
 
802
  transform: translateX(2.6rem);
803
  }
804
 
 
807
  border-radius: 3.4rem;
808
  }
809
 
810
+ .slider.round::before {
811
  border-radius: 50%;
812
  }
813
  ```
814
 
815
+ ## Animations
816
+
817
+ ### Built-in
818
+
819
+ By default `websurfx` comes with 1 animation to choose from which can be easily chosen using the config file or via the settings page on the website.
820
+
821
+ > To how to change animations using the config file. See: [**Configuration**](https://github.com/neon-mmd/websurfx/wiki/configuration)
822
+
823
+ ### Custom
824
+
825
+ To write custom animation, it requires the user to have some knowledge of `themes` and the `HTML of the page for which the animation is being provided for`.
826
+
827
+ The animations can be of 2 categories:
828
+
829
+ - Theme specific animations
830
+ - Universal animations
831
+
832
+ #### Theme Specific Animations
833
+
834
+ These animations can only be used with a specific theme and should not be used with other themes otherwise it either won't look good or won't work at all or would work partially.
835
+
836
+ Here is an example of `simple-frosted-glow` animation for the `simple theme` (which we provide by default with the app) which will give you a better idea on how to create a custom animation for a specific theme:
837
+
838
+ ```css
839
+ .results_aggregated .result {
840
+ margin: 1rem;
841
+ padding: 1rem;
842
+ border-radius: 1rem;
843
+ }
844
+
845
+ .results_aggregated .result:hover {
846
+ box-shadow:
847
+ inset 0 0 3rem var(--color-two),
848
+ inset 0 0 6rem var(--color-five),
849
+ inset 0 0 9rem var(--color-three),
850
+ 0 0 0.25rem var(--color-two),
851
+ 0 0 0.5rem var(--color-five),
852
+ 0 0 0.75rem var(--color-three);
853
+ }
854
+ ```
855
+
856
+ #### Universal Animations
857
+
858
+ These animations are independent of the theme being used and can be used with all the themes.
859
+
860
+ Here is an example of `text-tilt` animation which will give you an idea on how to create universal animations for the search engine website.
861
+
862
+ ```css
863
+ .results_aggregated .result:hover {
864
+ transform: skewX(10deg);
865
+ }
866
+ ```
867
+
868
+ > [!Note]
869
+ > 1. The above-mentioned examples of animations was covered for the search page of the search engine website. While the same way of creating custom animations can also be done for other pages also.
870
+ > 2. While the naming the file for the new theme file. Follow the following naming conventions:
871
+ > 1. If the animation is theme specfic then name of the animation file should look like this:
872
+ > `<name of the theme which these animation is for><seperated by a hyphen or dash><name of the animation with whitespaces replaced with hyphens>`
873
+ > **For example:**
874
+ > If the animation to make search results frosty glow on hover was to be created for the `simple` theme then the name of the file would look something like this:
875
+ > `simple-frosted-glow`
876
+ > Where `simple` is the name of the theme the animation targets and `frosted-glow` is the name of the animation where each word has been seperated by a hyphen.
877
+ > 2. If the animation is not theme specfic (univeral theme) then name of the animation file should look like this:
878
+ > `<name of the animation with whitespaces replaced with hyphens>`
879
+ > **For example:**
880
+ > If the animation to make search results text tilt on hover was to be created then the name of the file would look something like this:
881
+ > `text-tilt`
882
+ > Where `text-tilt` is the name of the animation where each word has been seperated by a hyphen. (While naming the files for these types of themes, You do not need to add a theme name in frontend of the file name.).
883
+
884
+
885
  [⬅️ Go back to Home](./README.md)