Spaces:
Running
Running
Commit
•
ab77dc3
1
Parent(s):
19ba03f
show input
Browse files- src/routes/Vote.svelte +7 -0
- src/routes/viewers/BabylonViewer.ts +2 -0
- static/global.css +14 -9
src/routes/Vote.svelte
CHANGED
@@ -168,6 +168,13 @@
|
|
168 |
{:else if statusMessage}
|
169 |
<p class="center-title muted">{statusMessage}</p>
|
170 |
{:else}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
171 |
<h2 class="center-title">Which is better?</h2>
|
172 |
<p class="center-subtitle">Use mouse/touch to change the view.</p>
|
173 |
<div class="voting-container">
|
|
|
168 |
{:else if statusMessage}
|
169 |
<p class="center-title muted">{statusMessage}</p>
|
170 |
{:else}
|
171 |
+
<div class="vote-input">
|
172 |
+
<img
|
173 |
+
src={`https://huggingface.co/datasets/dylanebert/3d-arena/resolve/main/${data.input_path}`}
|
174 |
+
class="input-image"
|
175 |
+
alt="Input"
|
176 |
+
/>
|
177 |
+
</div>
|
178 |
<h2 class="center-title">Which is better?</h2>
|
179 |
<p class="center-subtitle">Use mouse/touch to change the view.</p>
|
180 |
<div class="voting-container">
|
src/routes/viewers/BabylonViewer.ts
CHANGED
@@ -53,6 +53,7 @@ export class BabylonViewer implements IViewer {
|
|
53 |
|
54 |
this.handleResize = this.handleResize.bind(this);
|
55 |
window.addEventListener("resize", this.handleResize);
|
|
|
56 |
}
|
57 |
|
58 |
handleResize() {
|
@@ -134,6 +135,7 @@ export class BabylonViewer implements IViewer {
|
|
134 |
}
|
135 |
this._originalColors.clear();
|
136 |
window.removeEventListener("resize", this.handleResize);
|
|
|
137 |
}
|
138 |
|
139 |
async capture(): Promise<string | null> {
|
|
|
53 |
|
54 |
this.handleResize = this.handleResize.bind(this);
|
55 |
window.addEventListener("resize", this.handleResize);
|
56 |
+
this.canvas.addEventListener("wheel", (e) => e.preventDefault());
|
57 |
}
|
58 |
|
59 |
handleResize() {
|
|
|
135 |
}
|
136 |
this._originalColors.clear();
|
137 |
window.removeEventListener("resize", this.handleResize);
|
138 |
+
this.canvas.removeEventListener("wheel", (e) => e.preventDefault());
|
139 |
}
|
140 |
|
141 |
async capture(): Promise<string | null> {
|
static/global.css
CHANGED
@@ -5,9 +5,8 @@ body {
|
|
5 |
color: white;
|
6 |
margin: 0;
|
7 |
padding: 0;
|
8 |
-
height: 100%;
|
9 |
width: 100%;
|
10 |
-
overflow:
|
11 |
}
|
12 |
|
13 |
.banner {
|
@@ -77,8 +76,6 @@ body {
|
|
77 |
margin-left: auto;
|
78 |
margin-right: auto;
|
79 |
padding: 10px;
|
80 |
-
height: 100vh;
|
81 |
-
overflow: hidden;
|
82 |
position: relative;
|
83 |
box-sizing: border-box;
|
84 |
|
@@ -103,11 +100,6 @@ body {
|
|
103 |
overflow-x: auto;
|
104 |
}
|
105 |
|
106 |
-
.content {
|
107 |
-
max-height: 100%;
|
108 |
-
overflow: auto;
|
109 |
-
}
|
110 |
-
|
111 |
.canvas-container {
|
112 |
position: relative;
|
113 |
width: 100%;
|
@@ -305,6 +297,19 @@ body {
|
|
305 |
width: 100%;
|
306 |
}
|
307 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
308 |
.stats {
|
309 |
position: absolute;
|
310 |
top: 0;
|
|
|
5 |
color: white;
|
6 |
margin: 0;
|
7 |
padding: 0;
|
|
|
8 |
width: 100%;
|
9 |
+
overflow: auto;
|
10 |
}
|
11 |
|
12 |
.banner {
|
|
|
76 |
margin-left: auto;
|
77 |
margin-right: auto;
|
78 |
padding: 10px;
|
|
|
|
|
79 |
position: relative;
|
80 |
box-sizing: border-box;
|
81 |
|
|
|
100 |
overflow-x: auto;
|
101 |
}
|
102 |
|
|
|
|
|
|
|
|
|
|
|
103 |
.canvas-container {
|
104 |
position: relative;
|
105 |
width: 100%;
|
|
|
297 |
width: 100%;
|
298 |
}
|
299 |
|
300 |
+
.vote-input {
|
301 |
+
display: flex;
|
302 |
+
flex-direction: column;
|
303 |
+
gap: 10px;
|
304 |
+
align-items: center;
|
305 |
+
}
|
306 |
+
|
307 |
+
.input-image {
|
308 |
+
width: 128px;
|
309 |
+
height: 128px;
|
310 |
+
padding: 10px;
|
311 |
+
}
|
312 |
+
|
313 |
.stats {
|
314 |
position: absolute;
|
315 |
top: 0;
|