Skip to content

Commit b86289d

Browse files
committed
project not rendered server-side
1 parent 518cb2a commit b86289d

1 file changed

Lines changed: 10 additions & 12 deletions

File tree

app.vue

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
<template>
22
<div class="app">
33
<header>
4-
<section class="project">
4+
<div ref="projectMount"></div>
5+
<section v-if="showProject" class="project">
56
<h2 class="credits">
67
Background art by
78
<template v-if="project.author_url">
@@ -12,8 +13,7 @@
1213
</template>
1314
</h2>
1415
<div class="display">
15-
<iframe :style="{ transform: `scale(${project.scale})` }" :src="project.url">
16-
</iframe>
16+
<iframe :style="{ transform: `scale(${project.scale})` }" :src="project.url" />
1717
</div>
1818
</section>
1919
<svg width="49" height="65" viewBox="0 0 49 65" fill="none" xmlns="http://www.w3.org/2000/svg" class="logo">
@@ -34,15 +34,18 @@
3434
import projects from 'assets/projects';
3535
import links from 'assets/links';
3636
37+
const showProject = ref(false)
3738
const projectIndex = useCookie('projectIndex', {
3839
default: () => Math.floor(Math.random() * projects.length),
3940
})
40-
projectIndex.value += 1
41-
projectIndex.value %= projects.length
4241
const project = ref(projects[projectIndex.value])
43-
//project.value = projects[projectIndex.value]
44-
4542
provide('project', project)
43+
onMounted(() => {
44+
projectIndex.value += 1
45+
projectIndex.value %= projects.length
46+
project.value = projects[projectIndex.value]
47+
showProject.value = true
48+
})
4649
4750
const route = useRoute()
4851
onMounted(() => {
@@ -126,11 +129,6 @@ a {
126129
z-index: 0;
127130
min-height: 100vh;
128131
129-
&.black {
130-
--foreground: white;
131-
--background: black;
132-
}
133-
134132
@media screen and (min-width: 800px) {
135133
display: flex;
136134
}

0 commit comments

Comments
 (0)