Commit
•
8288203
1
Parent(s):
c1f670b
Commit 3: Add 35 file(s)
Browse files- requirements.txt +2 -2
- templates/index.html +92 -33
requirements.txt
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
-
gradio-client @ git+https://github.com/gradio-app/gradio@
|
2 |
-
https://gradio-pypi-previews.s3.amazonaws.com/
|
3 |
pypistats==1.1.0
|
4 |
plotly
|
5 |
matplotlib
|
|
|
1 |
+
gradio-client @ git+https://github.com/gradio-app/gradio@df7c38845cc158296242c9540609200cbecbd2fa#subdirectory=client/python
|
2 |
+
https://gradio-pypi-previews.s3.amazonaws.com/df7c38845cc158296242c9540609200cbecbd2fa/gradio-5.9.1-py3-none-any.whl
|
3 |
pypistats==1.1.0
|
4 |
plotly
|
5 |
matplotlib
|
templates/index.html
CHANGED
@@ -16,83 +16,142 @@
|
|
16 |
overflow-y: hidden;
|
17 |
}
|
18 |
|
|
|
19 |
.sidebar {
|
20 |
-
position:
|
21 |
top: 0;
|
22 |
left: 0;
|
|
|
23 |
height: 100vh;
|
24 |
max-height: calc(100vh - 50px);
|
25 |
-
width: 300px;
|
26 |
overflow-y: scroll;
|
27 |
overflow-x: hidden;
|
28 |
-
font-size: 0.875rem;
|
29 |
-
line-height: 1.25rem;
|
30 |
-
transition:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
}
|
32 |
|
33 |
.sidebar.collapsed {
|
34 |
width: 0;
|
|
|
35 |
}
|
36 |
|
37 |
.sidebar a {
|
38 |
display: block;
|
39 |
-
|
|
|
40 |
text-decoration: none;
|
41 |
-
color:
|
|
|
|
|
|
|
|
|
42 |
}
|
43 |
|
44 |
.sidebar a:hover {
|
45 |
-
color:
|
46 |
-
transform:
|
|
|
47 |
}
|
48 |
|
49 |
-
/* Apply a different style to the selected item in the sidebar */
|
50 |
.sidebar a.active {
|
51 |
-
background
|
52 |
color: white;
|
53 |
-
|
54 |
-
|
55 |
}
|
56 |
|
57 |
-
/*
|
58 |
-
.
|
59 |
-
|
60 |
-
border: none;
|
61 |
-
background-color: white;
|
62 |
-
font-size: xx-large;
|
63 |
-
position: relative;
|
64 |
}
|
65 |
|
66 |
-
/*
|
67 |
.content {
|
68 |
margin-left: 300px;
|
69 |
padding: 20px;
|
70 |
-
display: block;
|
71 |
height: 100vh;
|
72 |
transition: margin-left 0.3s ease;
|
|
|
73 |
}
|
74 |
|
75 |
.content.collapsed {
|
76 |
margin-left: 0;
|
77 |
}
|
78 |
|
79 |
-
/* Make the iframe responsive */
|
80 |
.content iframe {
|
81 |
width: 100%;
|
|
|
82 |
border: 0;
|
83 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
84 |
}
|
85 |
|
86 |
@media only screen and (max-width: 600px) {
|
87 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
88 |
.sidebar {
|
89 |
width: 100%;
|
90 |
-
|
91 |
-
height: auto;
|
92 |
}
|
93 |
|
94 |
.content {
|
95 |
margin-left: 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
96 |
}
|
97 |
}
|
98 |
</style>
|
@@ -100,12 +159,12 @@
|
|
100 |
</head>
|
101 |
<body x-data="{ current_demo: '{{ initial_demo }}', is_collapsed: false }">
|
102 |
<div style="display: flex; flex-direction: column;">
|
103 |
-
<
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
</
|
108 |
-
<div :class="{ 'sidebar': true, 'collapsed': is_collapsed }"
|
109 |
{% for name in names %}
|
110 |
<a @click="current_demo = '{{ name[0] }}'" :class="current_demo == '{{ name[0] }}' ? 'active' : ''">{{ name[0] }} {% if name[1] %}❌{% endif %}</a>
|
111 |
{% endfor %}
|
|
|
16 |
overflow-y: hidden;
|
17 |
}
|
18 |
|
19 |
+
/* Sidebar styling */
|
20 |
.sidebar {
|
21 |
+
position: fixed;
|
22 |
top: 0;
|
23 |
left: 0;
|
24 |
+
width: 300px;
|
25 |
height: 100vh;
|
26 |
max-height: calc(100vh - 50px);
|
|
|
27 |
overflow-y: scroll;
|
28 |
overflow-x: hidden;
|
29 |
+
font-size: 0.875rem;
|
30 |
+
line-height: 1.25rem;
|
31 |
+
transition: all 0.3s ease;
|
32 |
+
background: #f8f9fa;
|
33 |
+
box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
|
34 |
+
padding-top: 50px; /* Add padding for the button */
|
35 |
+
}
|
36 |
+
|
37 |
+
/* Customize scrollbar */
|
38 |
+
.sidebar::-webkit-scrollbar {
|
39 |
+
width: 6px;
|
40 |
+
}
|
41 |
+
|
42 |
+
.sidebar::-webkit-scrollbar-track {
|
43 |
+
background: #f1f1f1;
|
44 |
+
}
|
45 |
+
|
46 |
+
.sidebar::-webkit-scrollbar-thumb {
|
47 |
+
background: #888;
|
48 |
+
border-radius: 3px;
|
49 |
}
|
50 |
|
51 |
.sidebar.collapsed {
|
52 |
width: 0;
|
53 |
+
box-shadow: none;
|
54 |
}
|
55 |
|
56 |
.sidebar a {
|
57 |
display: block;
|
58 |
+
margin: 8px 12px;
|
59 |
+
padding: 12px 16px;
|
60 |
text-decoration: none;
|
61 |
+
color: #424242;
|
62 |
+
background: white;
|
63 |
+
border-radius: 8px;
|
64 |
+
transition: all 0.2s ease;
|
65 |
+
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
|
66 |
}
|
67 |
|
68 |
.sidebar a:hover {
|
69 |
+
color: #1a73e8;
|
70 |
+
transform: translateY(-1px);
|
71 |
+
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
72 |
}
|
73 |
|
|
|
74 |
.sidebar a.active {
|
75 |
+
background: #1a73e8;
|
76 |
color: white;
|
77 |
+
font-weight: 500;
|
78 |
+
box-shadow: 0 4px 8px rgba(26, 115, 232, 0.2);
|
79 |
}
|
80 |
|
81 |
+
/* Error state for demos that don't work */
|
82 |
+
.sidebar a:has(span) {
|
83 |
+
border-left: 3px solid #dc3545;
|
|
|
|
|
|
|
|
|
84 |
}
|
85 |
|
86 |
+
/* Content area styling */
|
87 |
.content {
|
88 |
margin-left: 300px;
|
89 |
padding: 20px;
|
|
|
90 |
height: 100vh;
|
91 |
transition: margin-left 0.3s ease;
|
92 |
+
overflow-y: auto;
|
93 |
}
|
94 |
|
95 |
.content.collapsed {
|
96 |
margin-left: 0;
|
97 |
}
|
98 |
|
|
|
99 |
.content iframe {
|
100 |
width: 100%;
|
101 |
+
height: 80%;
|
102 |
border: 0;
|
103 |
+
}
|
104 |
+
|
105 |
+
/* Toggle button styling */
|
106 |
+
.close-btn {
|
107 |
+
position: fixed;
|
108 |
+
top: 0;
|
109 |
+
left: 0;
|
110 |
+
z-index: 101;
|
111 |
+
cursor: pointer;
|
112 |
+
border: none;
|
113 |
+
background: #f8f9fa;
|
114 |
+
width: 300px;
|
115 |
+
height: 50px;
|
116 |
+
border-radius: 0;
|
117 |
+
display: flex;
|
118 |
+
align-items: center;
|
119 |
+
padding: 0 20px;
|
120 |
+
justify-content: flex-end;
|
121 |
+
transition: all 0.3s ease;
|
122 |
+
}
|
123 |
+
|
124 |
+
.close-btn.collapsed {
|
125 |
+
width: 50px;
|
126 |
+
justify-content: center;
|
127 |
}
|
128 |
|
129 |
@media only screen and (max-width: 600px) {
|
130 |
+
.close-btn {
|
131 |
+
top: 20px;
|
132 |
+
left: 20px;
|
133 |
+
background: white;
|
134 |
+
z-index: 102; /* Ensure it's above the sidebar */
|
135 |
+
}
|
136 |
+
|
137 |
.sidebar {
|
138 |
width: 100%;
|
139 |
+
z-index: 100;
|
|
|
140 |
}
|
141 |
|
142 |
.content {
|
143 |
margin-left: 0;
|
144 |
+
padding: 10px;
|
145 |
+
height: calc(100vh - 70px);
|
146 |
+
margin-top: 70px;
|
147 |
+
}
|
148 |
+
|
149 |
+
.sidebar.collapsed {
|
150 |
+
transform: translateX(-100%);
|
151 |
+
}
|
152 |
+
|
153 |
+
.content.collapsed {
|
154 |
+
margin-top: 70px;
|
155 |
}
|
156 |
}
|
157 |
</style>
|
|
|
159 |
</head>
|
160 |
<body x-data="{ current_demo: '{{ initial_demo }}', is_collapsed: false }">
|
161 |
<div style="display: flex; flex-direction: column;">
|
162 |
+
<button @click="is_collapsed = !is_collapsed"
|
163 |
+
class="close-btn"
|
164 |
+
:class="{ 'collapsed': is_collapsed }">
|
165 |
+
<span x-text="is_collapsed ? '➡️' : '⬅️'"></span>
|
166 |
+
</button>
|
167 |
+
<div :class="{ 'sidebar': true, 'collapsed': is_collapsed }">
|
168 |
{% for name in names %}
|
169 |
<a @click="current_demo = '{{ name[0] }}'" :class="current_demo == '{{ name[0] }}' ? 'active' : ''">{{ name[0] }} {% if name[1] %}❌{% endif %}</a>
|
170 |
{% endfor %}
|