dylanebert
commited on
Commit
·
f4c31a8
1
Parent(s):
b1aa559
quarter width grid
Browse files- src/routes/+page.svelte +16 -22
- src/routes/Vote.svelte +0 -2
- static/global.css +9 -4
src/routes/+page.svelte
CHANGED
|
@@ -48,26 +48,20 @@
|
|
| 48 |
</div>
|
| 49 |
{/if}
|
| 50 |
|
| 51 |
-
|
| 52 |
-
{
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
{
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
onBack={() => (currentView = "ModelDetails")}
|
| 68 |
-
/>
|
| 69 |
-
{:else if currentView === "About"}
|
| 70 |
-
<About />
|
| 71 |
-
{/if}
|
| 72 |
-
</div>
|
| 73 |
</div>
|
|
|
|
| 48 |
</div>
|
| 49 |
{/if}
|
| 50 |
|
| 51 |
+
{#if currentView === "Leaderboard"}
|
| 52 |
+
<Leaderboard onEntryClick={showModelDetails} />
|
| 53 |
+
{:else if currentView === "Vote"}
|
| 54 |
+
<Vote />
|
| 55 |
+
{:else if currentView === "ModelDetails" && selectedEntry}
|
| 56 |
+
<ModelDetails
|
| 57 |
+
modelName={selectedEntry.name}
|
| 58 |
+
modelPath={selectedEntry.path}
|
| 59 |
+
onBack={() => (currentView = "Leaderboard")}
|
| 60 |
+
onSceneClick={showScene}
|
| 61 |
+
/>
|
| 62 |
+
{:else if currentView === "Viewer" && selectedScene && selectedEntry}
|
| 63 |
+
<Viewer modelName={selectedEntry.name} scene={selectedScene} onBack={() => (currentView = "ModelDetails")} />
|
| 64 |
+
{:else if currentView === "About"}
|
| 65 |
+
<About />
|
| 66 |
+
{/if}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 67 |
</div>
|
src/routes/Vote.svelte
CHANGED
|
@@ -69,7 +69,6 @@
|
|
| 69 |
}
|
| 70 |
|
| 71 |
async function loadScenes() {
|
| 72 |
-
const scrollPosition = window.scrollY;
|
| 73 |
const success = await fetchScenes();
|
| 74 |
if (!success) return;
|
| 75 |
|
|
@@ -98,7 +97,6 @@
|
|
| 98 |
|
| 99 |
overlayA.style.display = "none";
|
| 100 |
overlayB.style.display = "none";
|
| 101 |
-
window.scrollTo(0, scrollPosition);
|
| 102 |
}
|
| 103 |
|
| 104 |
async function vote(option: "A" | "B") {
|
|
|
|
| 69 |
}
|
| 70 |
|
| 71 |
async function loadScenes() {
|
|
|
|
| 72 |
const success = await fetchScenes();
|
| 73 |
if (!success) return;
|
| 74 |
|
|
|
|
| 97 |
|
| 98 |
overlayA.style.display = "none";
|
| 99 |
overlayB.style.display = "none";
|
|
|
|
| 100 |
}
|
| 101 |
|
| 102 |
async function vote(option: "A" | "B") {
|
static/global.css
CHANGED
|
@@ -76,22 +76,23 @@ body {
|
|
| 76 |
margin-left: auto;
|
| 77 |
margin-right: auto;
|
| 78 |
padding: 10px;
|
|
|
|
| 79 |
position: relative;
|
| 80 |
box-sizing: border-box;
|
| 81 |
|
| 82 |
-
@media (min-width: 576px) {
|
| 83 |
max-width: 320px;
|
| 84 |
}
|
| 85 |
|
| 86 |
-
@media (min-width: 768px) {
|
| 87 |
max-width: 480px;
|
| 88 |
}
|
| 89 |
|
| 90 |
-
@media (min-width: 992px) {
|
| 91 |
max-width: 600px;
|
| 92 |
}
|
| 93 |
|
| 94 |
-
@media (min-width: 1200px) {
|
| 95 |
max-width: 800px;
|
| 96 |
}
|
| 97 |
}
|
|
@@ -222,6 +223,10 @@ body {
|
|
| 222 |
@media (min-width: 992px) {
|
| 223 |
width: calc(33.333% - 10px);
|
| 224 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
| 225 |
}
|
| 226 |
|
| 227 |
.grid-item::before {
|
|
|
|
| 76 |
margin-left: auto;
|
| 77 |
margin-right: auto;
|
| 78 |
padding: 10px;
|
| 79 |
+
min-height: 1200px;
|
| 80 |
position: relative;
|
| 81 |
box-sizing: border-box;
|
| 82 |
|
| 83 |
+
@media (min-width: 576px) and (min-height: 720px) {
|
| 84 |
max-width: 320px;
|
| 85 |
}
|
| 86 |
|
| 87 |
+
@media (min-width: 768px) and (min-height: 860px) {
|
| 88 |
max-width: 480px;
|
| 89 |
}
|
| 90 |
|
| 91 |
+
@media (min-width: 992px) and (min-height: 880px) {
|
| 92 |
max-width: 600px;
|
| 93 |
}
|
| 94 |
|
| 95 |
+
@media (min-width: 1200px) and (min-height: 960px) {
|
| 96 |
max-width: 800px;
|
| 97 |
}
|
| 98 |
}
|
|
|
|
| 223 |
@media (min-width: 992px) {
|
| 224 |
width: calc(33.333% - 10px);
|
| 225 |
}
|
| 226 |
+
|
| 227 |
+
@media (min-width: 1200px) {
|
| 228 |
+
width: calc(25% - 10px);
|
| 229 |
+
}
|
| 230 |
}
|
| 231 |
|
| 232 |
.grid-item::before {
|