22
33import {ref } from " vue" ;
44import {useRouter } from " vue-router" ;
5+ import Header from " @/components/Header.vue" ;
56
67let inputRef = ref <HTMLInputElement >();
78
89let status = ref <string >(" " );
910
1011let queueLen = ref <number >(0 );
1112
13+ const hostname = window .location .hostname ;
14+
1215const router = useRouter ()
1316
1417inputRef .value ?.focus ();
@@ -29,7 +32,7 @@ const swipeInput = () => {
2932 }).then (res => {
3033 if (res .ok ) {
3134 refreshQueueLen ()
32- status .value = " You're in the queue! Visit cseoh.com to track your position."
35+ status .value = ` You're in the queue! Visit ${ hostname } to track your position. `
3336 clearStatus ();
3437 } else if (res .status == 400 ) {
3538 status .value = " Bad card read, please try again."
@@ -86,27 +89,36 @@ if (localStorage.getItem("auth-code") === null) {
8689
8790 </script >
8891
89- <template id="welcome" >
92+ <template >
9093
91- <h1 >Welcome to Office Hours!</h1 >
92- <h2 >Swipe your UB Card to join the queue.</h2 >
93- <input id =" swipe" type =" text" ref =" inputRef" autofocus @keydown.enter =" swipeInput" @focusout =" inputRef?.focus()" >
94+ <Header />
9495
95- <div id =" queue-len" class =" circle" >
96- {{ queueLen }}
97- </div >
98- <h3 >Queue Size</h3 >
96+ <div id =" welcome" >
97+ <h1 >Welcome to Office Hours!</h1 >
98+ <h2 >Swipe your UB Card to join the queue.</h2 >
99+ <h2 >Visit {{ hostname }} for updates!</h2 >
100+ <input id =" swipe" type =" text" ref =" inputRef" autofocus @keydown.enter =" swipeInput" @focusout =" inputRef?.focus()" >
99101
102+ <div id =" queue-len" class =" circle pos" >
103+ {{ queueLen }}
104+ </div >
105+ <h2 >Queue Size</h2 >
100106
101- <p >{{ status }}</p >
102107
108+ <p >{{ status }}</p >
109+ </div >
103110
104111</template >
105112
106113<style scoped>
107114
115+ .circle {
116+ height : 256px ;
117+ width : 256px ;
118+ }
119+
108120#welcome {
109- margin : 72 px ;
121+ margin : 32 px ;
110122}
111123
112124h1 , h2 , h3 , p {
@@ -120,6 +132,15 @@ h1, h2, h3, p {
120132
121133#queue-len {
122134 margin : auto ;
135+ font-size : 128px ;
136+ }
137+
138+ br {
139+ margin-top : 32px ;
140+ }
141+
142+ footer {
143+ display : none ;
123144}
124145
125146 </style >
0 commit comments