ChenyuRabbitLove commited on
Commit
fc3a5ac
1 Parent(s): 7fe7fc9

feat: add new css style

Browse files
Files changed (2) hide show
  1. app.py +2 -2
  2. css/style.css +155 -5
app.py CHANGED
@@ -21,7 +21,7 @@ def get_player_info(player_backend_user_id):
21
 
22
  # start of gradio interface
23
  with gr.Blocks(theme=seafoam, css=get_content("css/style.css")) as demo:
24
- player_info = gr.State(get_player_info("http://id.junyiacademy.org/d6317d299321450191dd5da599a48b3d"))
25
 
26
  with gr.Row():
27
  with gr.Column(
@@ -97,7 +97,7 @@ with gr.Blocks(theme=seafoam, css=get_content("css/style.css")) as demo:
97
  # handling player info
98
  with gr.Row():
99
  player_backend_id = gr.Textbox(
100
- "http://id.junyiacademy.org/d6317d299321450191dd5da599a48b3d", visible=False, elem_id="player_backend_id"
101
  )
102
  player_info_query_btn = gr.Button("Query", elem_id="trigger_button")
103
 
 
21
 
22
  # start of gradio interface
23
  with gr.Blocks(theme=seafoam, css=get_content("css/style.css")) as demo:
24
+ player_info = gr.State(get_player_info)
25
 
26
  with gr.Row():
27
  with gr.Column(
 
97
  # handling player info
98
  with gr.Row():
99
  player_backend_id = gr.Textbox(
100
+ "", visible=False, elem_id="player_backend_id"
101
  )
102
  player_info_query_btn = gr.Button("Query", elem_id="trigger_button")
103
 
css/style.css CHANGED
@@ -1,9 +1,9 @@
1
- .gradio-container {
2
  background: url('https://storage.googleapis.com/wpassets.junyiacademy.org/1/2023/11/background-scaled.jpg');
3
  background-size: cover;
4
  background-position: center center;
5
  background-repeat: no-repeat;
6
- }
7
 
8
  #player_avatar_container {
9
  place-items: center;
@@ -18,12 +18,69 @@
18
  border-color: #fff !important;
19
  }
20
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
21
  #player_avatar_description h1{
22
  font-size: 2.5rem;
23
  text-align: center;
24
  }
25
 
26
- #pet_avatar_description h1{
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
27
  font-size: 2rem;
28
  text-align: center;
29
  }
@@ -38,10 +95,15 @@
38
  text-align: center;
39
  }
40
 
41
- #achievement_log {
42
  margin: 2.5rem auto 0 auto;
43
  }
44
 
 
 
 
 
 
45
  #pet_gallery .grid-wrap button {
46
  margin: .5vh;
47
  background: transparent !important;
@@ -66,6 +128,10 @@
66
  box-shadow: 0 0 10px rgba(0,0,0,0.3);
67
  backdrop-filter: blur(10px);
68
  }
 
 
 
 
69
 
70
  ::-webkit-scrollbar {
71
  width: 5px;
@@ -76,6 +142,90 @@
76
  opacity: 0;
77
  }
78
 
 
 
 
 
 
 
 
 
79
  [aria-label="Share"] {
80
  opacity: 0;
81
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* .gradio-container {
2
  background: url('https://storage.googleapis.com/wpassets.junyiacademy.org/1/2023/11/background-scaled.jpg');
3
  background-size: cover;
4
  background-position: center center;
5
  background-repeat: no-repeat;
6
+ } */
7
 
8
  #player_avatar_container {
9
  place-items: center;
 
18
  border-color: #fff !important;
19
  }
20
 
21
+ .achievements{
22
+ margin: 0 auto;
23
+ width: 80%;
24
+ height: 200px !important;
25
+ overflow: auto !important;
26
+
27
+ }
28
+
29
+ .achievements [data-testid="block-label"] {
30
+ display: none;
31
+ }
32
+
33
+ [data-testid="number-input"] {
34
+ display: None !important;
35
+ }
36
+
37
+ #adventure_slider {
38
+ overflow: auto !important;
39
+ height: 200px;
40
+ }
41
+
42
+ #adventure_slider div{
43
+ color: #232323 !important;
44
+ font-size: large;
45
+ }
46
+
47
+ .textfield > * {
48
+ border-radius: 8px !important;
49
+ display: block;
50
+ padding-left: .75rem !important;
51
+ margin: 0.3rem auto;
52
+ margin-left: 0px !important;
53
+ }
54
+
55
+ #adventure_container {
56
+ height: 200px;
57
+ }
58
+
59
  #player_avatar_description h1{
60
  font-size: 2.5rem;
61
  text-align: center;
62
  }
63
 
64
+ h1{
65
+ font-size: 2rem;
66
+ text-align: center;
67
+ font-weight: 100 !important;
68
+ }
69
+
70
+ h1::after {
71
+ content: '';
72
+ display: block;
73
+ width: 25%; /* Adjust this value to control the width of the line */
74
+ height: 4px; /* Thickness of the line */
75
+ border-radius: 4px;
76
+ background: #12d2ab; /* Color of the line */
77
+ position: absolute;
78
+ bottom: -7px;
79
+ left: 50%;
80
+ transform: translateX(-50%); /* This centers the line */
81
+ }
82
+
83
+ #achievements_description h1{
84
  font-size: 2rem;
85
  text-align: center;
86
  }
 
95
  text-align: center;
96
  }
97
 
98
+ #adventure_log {
99
  margin: 2.5rem auto 0 auto;
100
  }
101
 
102
+ #achievement_log {
103
+ overflow: auto !important;
104
+ height: 200px;
105
+ }
106
+
107
  #pet_gallery .grid-wrap button {
108
  margin: .5vh;
109
  background: transparent !important;
 
128
  box-shadow: 0 0 10px rgba(0,0,0,0.3);
129
  backdrop-filter: blur(10px);
130
  }
131
+
132
+ .preview button {
133
+ color: #000;
134
+ }
135
 
136
  ::-webkit-scrollbar {
137
  width: 5px;
 
142
  opacity: 0;
143
  }
144
 
145
+ [for="range_id_0"] div{
146
+ background: #e4e4e48a;
147
+ border-radius: 20px;
148
+ padding: 5%;
149
+ margin: 5%;
150
+ line-height: 1.8;
151
+ }
152
+
153
  [aria-label="Share"] {
154
  opacity: 0;
155
+ }
156
+
157
+ #adventure_slider {
158
+ display: flex;
159
+ flex-direction: column;
160
+ }
161
+
162
+ input[type="range"]{
163
+ order: -1;
164
+ }
165
+
166
+ input[type="range"] {
167
+ -webkit-appearance: none; /* Removes default styling for Webkit browsers */
168
+ height: 20px; /* Makes the track thicker */
169
+ background: linear-gradient(#12d2ab, #16a1b1);
170
+ box-shadow: 0 0 10px #16a1b1;
171
+ border-radius: 20px; /* Round corners of the track */
172
+ padding: 20px;
173
+ margin: 10px 0;
174
+ order: -1;
175
+
176
+ }
177
+
178
+ /* Styles for the slider thumb for Webkit browsers like Chrome and Safari */
179
+ input[type="range"]::-webkit-slider-thumb {
180
+ -webkit-appearance: none; /* Overrides default webkit styles */
181
+ appearance: none;
182
+ height: 24px; /* Height of the thumb */
183
+ width: 24px; /* Width of the thumb */
184
+ border-radius: 50%; /* Rounded corners of the thumb */
185
+ background: #f3b968; /* Background color of the thumb */
186
+ margin-top: -6px; /* Ensures the thumb aligns with the track */
187
+ box-shadow: 0px -2px 5px #eb6584 inset, 0px 2px 5px #b7456e;
188
+ }
189
+
190
+ /* Styles for the slider thumb for Firefox */
191
+ input[type="range"]::-moz-range-thumb {
192
+ width: 20px; /* Width of the thumb */
193
+ height: 28px; /* Height of the thumb */
194
+ border-radius: 5px; /* Rounded corners of the thumb */
195
+ background: #4CAF50; /* Background color of the thumb */
196
+ }
197
+
198
+ /* Styles for the slider thumb for IE */
199
+ input[type="range"]::-ms-thumb {
200
+ width: 20px; /* Width of the thumb */
201
+ height: 28px; /* Height of the thumb */
202
+ border-radius: 5px; /* Rounded corners of the thumb */
203
+ background: #4CAF50; /* Background color of the thumb */
204
+ }
205
+
206
+ /* Styles for the track (progress) for Webkit browsers */
207
+ input[type="range"]::-webkit-slider-runnable-track {
208
+ width: 100%;
209
+ height: 10px; /* Height of the track */
210
+ background: #eee;
211
+ box-shadow: 2px 2px 2px 0px rgba(0,0,0,0.75) inset;
212
+ border-radius: 10px; /* Rounded corners of the track */
213
+ }
214
+
215
+ /* Styles for the track for Firefox */
216
+ input[type="range"]::-moz-range-track {
217
+ width: 100%;
218
+ height: 30px; /* Height of the track */
219
+ background: #eee;
220
+ border-radius: 10px; /* Rounded corners of the track */
221
+ }
222
+
223
+ /* Styles for the track for IE */
224
+ input[type="range"]::-ms-track {
225
+ width: 100%;
226
+ height: 30px; /* Height of the track */
227
+ background: #eee;
228
+ border-radius: 10px; /* Rounded corners of the track */
229
+ border: none; /* IE may require removing the border */
230
+ }
231
+