Skip to content

Commit 9f04336

Browse files
authored
Merge pull request #17 from COSCUP/dev
feat: make user to fill out the attendee survey
2 parents 991f111 + 598f041 commit 9f04336

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

src/components/PhaserGame.vue

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import StartGame from '../game/main'
1010
import { get_hextiles_booth } from '../api/get_hextiles.ts'
1111
import { post_msg } from '../api/post_msg.ts'
1212
import Tutorial from './Tutorial.vue'
13+
import { useRoute } from 'vue-router'
1314
1415
const emit = defineEmits(['current-active-scene'])
1516
// Save the current scene instance
@@ -21,6 +22,8 @@ const comments = ref()
2122
const newMessage = ref('')
2223
const renderer = new marked.Renderer()
2324
const tutorialRef = ref()
25+
const route = useRoute()
26+
const token = computed(() => route.query.token)
2427
renderer.link = function ({href, title, text}) {
2528
return `<a href="${href}" target="_blank">${text}</a>`
2629
}
@@ -147,6 +150,10 @@ watch([showPopup, popupData], async ([isOpen, data]) => {
147150
</script>
148151

149152
<template>
153+
<div v-if="!token" class="no-token-message">
154+
<p>尚未登入,請先填寫參與者大調查</p>
155+
<a href="https://coscup.org/2025-survey/" target="_blank" class="survey-button">點此前往問卷</a>
156+
</div>
150157
<Tutorial ref="tutorialRef" v-if="scene" :scene="scene" />
151158
<div id="game-container" :style="{ bottom: `${GameData.bottomBarHeight}px` }" />
152159
<div class="popup-overlay" id="popup" v-if="showPopup">
@@ -365,4 +372,46 @@ img {
365372
.comment-form button:disabled {
366373
background-color: #aaa;
367374
}
375+
376+
.no-token-message {
377+
position: absolute;
378+
width: 100%;
379+
height: 100%;
380+
background-color: #111;
381+
display: flex;
382+
flex-direction: column;
383+
justify-content: center;
384+
align-items: center;
385+
z-index: 101;
386+
color: white;
387+
text-align: center;
388+
}
389+
390+
.no-token-message p {
391+
font-size: 1.2em;
392+
margin-bottom: 20px;
393+
}
394+
395+
.no-token-message a {
396+
color: white;;
397+
text-decoration: underline;
398+
font-size: 1.1em;
399+
}
400+
401+
.survey-button {
402+
background-color: gray;
403+
color: white;
404+
border: none;
405+
padding: 10px 25px;
406+
border-radius: 20px;
407+
cursor: pointer;
408+
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
409+
transition: background-color 0.3s ease;
410+
display: inline-block;
411+
text-decoration: none;
412+
font-size: 1em;
413+
gap: 5px;
414+
-webkit-tap-highlight-color: transparent;
415+
416+
}
368417
</style>

0 commit comments

Comments
 (0)