Delete gradio_sidebar.py
Browse files- gradio_sidebar.py +0 -194
gradio_sidebar.py
DELETED
@@ -1,194 +0,0 @@
|
|
1 |
-
head="""
|
2 |
-
<script>
|
3 |
-
function top_open_control() {
|
4 |
-
var panel = document.querySelector('#gs_top_control_panel');
|
5 |
-
if (panel.classList.value.includes("open") === false) {
|
6 |
-
panel.classList = '#gs_top_control_panel'
|
7 |
-
panel.classList.toggle('open');
|
8 |
-
console.log('clicked')
|
9 |
-
} else {
|
10 |
-
panel.classList = '#gs_top_control_panel'
|
11 |
-
console.log('panel is open, closing')
|
12 |
-
};
|
13 |
-
};
|
14 |
-
function left_open_control() {
|
15 |
-
var panel = document.querySelector('#gs_left_control_panel');
|
16 |
-
var left_bar = document.querySelector('#gs_left_bar');
|
17 |
-
var left_btn = document.querySelector('#left_control_btn');
|
18 |
-
var split_json = []
|
19 |
-
var out_json = []
|
20 |
-
split_json = panel.classList.value.split(' ')
|
21 |
-
console.log(split_json.length)
|
22 |
-
if (panel.classList.value.includes("open") === false) {
|
23 |
-
panel.classList = '#gs_left_control_panel'
|
24 |
-
left_bar.classList = '#gs_left_bar'
|
25 |
-
left_btn.classList = '#left_control_btn'
|
26 |
-
panel.classList.toggle('open');
|
27 |
-
left_bar.classList.toggle('open');
|
28 |
-
left_btn.classList.toggle('open');
|
29 |
-
console.log('clicked')
|
30 |
-
} else {
|
31 |
-
panel.classList = '#gs_left_control_panel'
|
32 |
-
left_bar.classList = '#gs_left_bar'
|
33 |
-
left_btn.classList = '#left_control_btn'
|
34 |
-
console.log('panel is open, closing')
|
35 |
-
};
|
36 |
-
};
|
37 |
-
function right_open_control() {
|
38 |
-
var panel = document.querySelector('#gs_right_control_panel');
|
39 |
-
var right_bar = document.querySelector('#gs_right_bar');
|
40 |
-
var right_btn = document.querySelector('#right_control_btn');
|
41 |
-
var split_json = []
|
42 |
-
var out_json = []
|
43 |
-
split_json = panel.classList.value.split(' ')
|
44 |
-
console.log(split_json.length)
|
45 |
-
if (panel.classList.value.includes("open") === false) {
|
46 |
-
panel.classList = '#gs_right_control_panel'
|
47 |
-
right_bar.classList = '#gs_right_bar'
|
48 |
-
right_btn.classList = '#right_control_btn'
|
49 |
-
panel.classList.toggle('open');
|
50 |
-
right_bar.classList.toggle('open');
|
51 |
-
right_btn.classList.toggle('open');
|
52 |
-
console.log('clicked')
|
53 |
-
} else {
|
54 |
-
panel.classList = '#gs_right_control_panel'
|
55 |
-
right_bar.classList = '#gs_right_bar'
|
56 |
-
right_btn.classList = '#right_control_btn'
|
57 |
-
console.log('panel is open, closing')
|
58 |
-
};
|
59 |
-
};
|
60 |
-
|
61 |
-
</script>
|
62 |
-
"""
|
63 |
-
css="""
|
64 |
-
#gs_top_control_panel {
|
65 |
-
position: fixed;
|
66 |
-
right: 100%;
|
67 |
-
z-index: 999999;
|
68 |
-
width: 40%;
|
69 |
-
top: 50px;
|
70 |
-
box-shadow: 0 0 12px 0px black;
|
71 |
-
transition: right 0.5s ease;
|
72 |
-
}
|
73 |
-
#gs_top_control_panel.open {
|
74 |
-
right: 60%;
|
75 |
-
}
|
76 |
-
#gs_left_control_panel {
|
77 |
-
position: fixed;
|
78 |
-
left: -110%;
|
79 |
-
z-index: 9999;
|
80 |
-
width: 330px;
|
81 |
-
top: 50px;
|
82 |
-
box-shadow: black 0px 0px 12px 0px;
|
83 |
-
transition: left 0.5s cubic-bezier(0.4, 0, 1, 1);
|
84 |
-
}
|
85 |
-
#gs_left_control_panel.open {
|
86 |
-
left: 0%;
|
87 |
-
}
|
88 |
-
#gs_right_control_panel {
|
89 |
-
position: fixed;
|
90 |
-
right: -110%;
|
91 |
-
z-index: 9999;
|
92 |
-
width: 330px;
|
93 |
-
top: 50px;
|
94 |
-
box-shadow: black 0px 0px 12px 0px;
|
95 |
-
transition: right 0.5s linear;
|
96 |
-
|
97 |
-
}
|
98 |
-
#gs_right_control_panel.open {
|
99 |
-
right: 0%;
|
100 |
-
}
|
101 |
-
#top_control_btn {
|
102 |
-
height: 20px;
|
103 |
-
padding: 10px;
|
104 |
-
cursor: pointer;
|
105 |
-
border-radius: 5px;
|
106 |
-
color: white;
|
107 |
-
position: fixed;
|
108 |
-
z-index: 9999999999999999;
|
109 |
-
top: 5px;
|
110 |
-
left: 10px;
|
111 |
-
background: #1e293b;
|
112 |
-
height: fit-content;
|
113 |
-
width: fit-content;
|
114 |
-
}
|
115 |
-
#left_control_btn {
|
116 |
-
padding: 10px;
|
117 |
-
cursor: pointer;
|
118 |
-
border-radius: 5px;
|
119 |
-
color: white;
|
120 |
-
position: fixed;
|
121 |
-
z-index: 2147483647;
|
122 |
-
top: 70px;
|
123 |
-
left: -20px;
|
124 |
-
background: rgb(30, 41, 59);
|
125 |
-
height: fit-content;
|
126 |
-
width: fit-content;
|
127 |
-
transition: left 0.5s linear;
|
128 |
-
transform: rotate(90deg);
|
129 |
-
|
130 |
-
}
|
131 |
-
#left_control_btn.open{
|
132 |
-
left:340px;
|
133 |
-
}
|
134 |
-
#right_control_btn {
|
135 |
-
padding: 10px;
|
136 |
-
cursor: pointer;
|
137 |
-
border-radius: 5px;
|
138 |
-
color: white;
|
139 |
-
position: fixed;
|
140 |
-
z-index: 2147483647;
|
141 |
-
top: 70px;
|
142 |
-
right: -20px;
|
143 |
-
background: rgb(30, 41, 59);
|
144 |
-
height: fit-content;
|
145 |
-
width: fit-content;
|
146 |
-
transition: right 0.5s linear;
|
147 |
-
transform: rotate(270deg);
|
148 |
-
|
149 |
-
}
|
150 |
-
#right_control_btn.open{
|
151 |
-
right:340px;
|
152 |
-
}
|
153 |
-
#gs_top_bar {
|
154 |
-
height: 50px;
|
155 |
-
width: 100%;
|
156 |
-
position: fixed;
|
157 |
-
background: #185991;
|
158 |
-
top: 0px;
|
159 |
-
left: 0px;
|
160 |
-
z-index: 99999;
|
161 |
-
}
|
162 |
-
#gs_top_bar.open {
|
163 |
-
left:350px;
|
164 |
-
}
|
165 |
-
#gs_left_bar {
|
166 |
-
height: 100%;
|
167 |
-
width: 360px;
|
168 |
-
position: fixed;
|
169 |
-
background: rgb(24, 89, 145);
|
170 |
-
top: 0px;
|
171 |
-
left: -370px;
|
172 |
-
z-index: 9999;
|
173 |
-
transition: left 0.5s linear;
|
174 |
-
}
|
175 |
-
#gs_left_bar.open {
|
176 |
-
left: 0px;
|
177 |
-
}
|
178 |
-
#gs_right_bar {
|
179 |
-
height: 100%;
|
180 |
-
width: 360px;
|
181 |
-
position: fixed;
|
182 |
-
background: rgb(24, 89, 145);
|
183 |
-
top: 0px;
|
184 |
-
right: -360px;
|
185 |
-
z-index: 9999;
|
186 |
-
transition: right 0.5s linear;
|
187 |
-
}
|
188 |
-
#gs_right_bar.open {
|
189 |
-
right: 0px;
|
190 |
-
}
|
191 |
-
"""
|
192 |
-
topbar="""<div id='gs_top_bar'><div id='top_control_btn' onclick='top_open_control()'>Controls</div></div>"""
|
193 |
-
leftbar="""<div id='gs_left_bar'><div id='left_control_btn' onclick='left_open_control()'>Controls</div></div>"""
|
194 |
-
rightbar="""<div id='gs_right_bar'><div id='right_control_btn' onclick='right_open_control()'>Controls</div></div>"""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|