Tabs are cool
This commit is contained in:
		
							
								
								
									
										86
									
								
								src/components/AdminPage.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										86
									
								
								src/components/AdminPage.vue
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,86 @@
 | 
				
			|||||||
 | 
					<template>
 | 
				
			||||||
 | 
					  <div>
 | 
				
			||||||
 | 
					    <h1>Admin-side</h1>
 | 
				
			||||||
 | 
					    <div class="tab-container">
 | 
				
			||||||
 | 
					      <div
 | 
				
			||||||
 | 
					        class="tab"
 | 
				
			||||||
 | 
					        @click="changeTab(0)"
 | 
				
			||||||
 | 
					        :class="chosenTab == 0 ? 'active' : null"
 | 
				
			||||||
 | 
					      >
 | 
				
			||||||
 | 
					        Registrering
 | 
				
			||||||
 | 
					      </div>
 | 
				
			||||||
 | 
					      <div
 | 
				
			||||||
 | 
					        class="tab"
 | 
				
			||||||
 | 
					        @click="changeTab(1)"
 | 
				
			||||||
 | 
					        :class="chosenTab == 1 ? 'active' : null"
 | 
				
			||||||
 | 
					      >
 | 
				
			||||||
 | 
					        Virtuelt lotteri
 | 
				
			||||||
 | 
					      </div>
 | 
				
			||||||
 | 
					    </div>
 | 
				
			||||||
 | 
					    <div class="tab-elements">
 | 
				
			||||||
 | 
					      <RegisterPage :class="chosenTab == 0 ? null : 'hide'" />
 | 
				
			||||||
 | 
					      <VirtualLotteryRegistrationPage :class="chosenTab == 1 ? null : 'hide'" />
 | 
				
			||||||
 | 
					    </div>
 | 
				
			||||||
 | 
					  </div>
 | 
				
			||||||
 | 
					</template>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					<script>
 | 
				
			||||||
 | 
					import RegisterPage from "@/components/RegisterPage";
 | 
				
			||||||
 | 
					import VirtualLotteryRegistrationPage from "@/components/VirtualLotteryRegistrationPage";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export default {
 | 
				
			||||||
 | 
					  components: {
 | 
				
			||||||
 | 
					    RegisterPage,
 | 
				
			||||||
 | 
					    VirtualLotteryRegistrationPage
 | 
				
			||||||
 | 
					  },
 | 
				
			||||||
 | 
					  data() {
 | 
				
			||||||
 | 
					    return {
 | 
				
			||||||
 | 
					      chosenTab: 0
 | 
				
			||||||
 | 
					    };
 | 
				
			||||||
 | 
					  },
 | 
				
			||||||
 | 
					  methods: {
 | 
				
			||||||
 | 
					    changeTab: function(num) {
 | 
				
			||||||
 | 
					      this.chosenTab = num;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					</script>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					<style lang="scss" scoped>
 | 
				
			||||||
 | 
					h1 {
 | 
				
			||||||
 | 
					  text-align: center;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					.hide {
 | 
				
			||||||
 | 
					  display: none;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					.tab-container {
 | 
				
			||||||
 | 
					  display: flex;
 | 
				
			||||||
 | 
					  flex-direction: row;
 | 
				
			||||||
 | 
					  justify-content: center;
 | 
				
			||||||
 | 
					  margin-top: 25px;
 | 
				
			||||||
 | 
					  border-bottom: 1px solid #333333;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					.tab {
 | 
				
			||||||
 | 
					  cursor: pointer;
 | 
				
			||||||
 | 
					  /* height: 60px; */
 | 
				
			||||||
 | 
					  font-size: 1.2rem;
 | 
				
			||||||
 | 
					  display: flex;
 | 
				
			||||||
 | 
					  justify-content: center;
 | 
				
			||||||
 | 
					  align-items: center;
 | 
				
			||||||
 | 
					  padding: 20px;
 | 
				
			||||||
 | 
					  margin: 0 15px;
 | 
				
			||||||
 | 
					  border: 1px solid #333333;
 | 
				
			||||||
 | 
					  border-top-left-radius: 5px;
 | 
				
			||||||
 | 
					  border-top-right-radius: 5px;
 | 
				
			||||||
 | 
					  background: #00000008;
 | 
				
			||||||
 | 
					  border-bottom: 1px solid #333333;
 | 
				
			||||||
 | 
					  margin-bottom: -1px;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  &.active {
 | 
				
			||||||
 | 
					    border-bottom: 1px solid white;
 | 
				
			||||||
 | 
					    background: white;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					</style>
 | 
				
			||||||
@@ -8,12 +8,12 @@
 | 
				
			|||||||
          >Trekker {{ currentWinners }} av {{ numberOfWinners }} vinnere.
 | 
					          >Trekker {{ currentWinners }} av {{ numberOfWinners }} vinnere.
 | 
				
			||||||
          {{ secondsLeft }} sekunder av {{ drawTime }} igjen</span
 | 
					          {{ secondsLeft }} sekunder av {{ drawTime }} igjen</span
 | 
				
			||||||
        >
 | 
					        >
 | 
				
			||||||
        <button class="vin-button" @click="stopDraw">
 | 
					        <button class="vin-button no-margin" @click="stopDraw">
 | 
				
			||||||
          Stopp trekning
 | 
					          Stopp trekning
 | 
				
			||||||
        </button>
 | 
					        </button>
 | 
				
			||||||
      </div>
 | 
					      </div>
 | 
				
			||||||
      <div class="draw-container" v-if="!drawingWinner">
 | 
					      <div class="draw-container" v-if="!drawingWinner">
 | 
				
			||||||
        <button class="vin-button" @click="drawWinner">
 | 
					        <button class="vin-button no-margin" @click="drawWinner">
 | 
				
			||||||
          Trekk vinnere
 | 
					          Trekk vinnere
 | 
				
			||||||
        </button>
 | 
					        </button>
 | 
				
			||||||
        <input type="number" v-model="numberOfWinners" />
 | 
					        <input type="number" v-model="numberOfWinners" />
 | 
				
			||||||
@@ -268,6 +268,7 @@ export default {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
.draw-container {
 | 
					.draw-container {
 | 
				
			||||||
  display: flex;
 | 
					  display: flex;
 | 
				
			||||||
 | 
					  justify-content: space-around;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
.draw-winner-container,
 | 
					.draw-winner-container,
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -7,6 +7,8 @@ import LoginPage from "@/components/LoginPage";
 | 
				
			|||||||
import RegisterPage from "@/components/RegisterPage";
 | 
					import RegisterPage from "@/components/RegisterPage";
 | 
				
			||||||
import CreatePage from "@/components/CreatePage";
 | 
					import CreatePage from "@/components/CreatePage";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import AdminPage from "@/components/AdminPage";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import VirtualLotteryRegistrationPage from "@/components/VirtualLotteryRegistrationPage";
 | 
					import VirtualLotteryRegistrationPage from "@/components/VirtualLotteryRegistrationPage";
 | 
				
			||||||
import VirtualLotteryPage from "@/components/VirtualLotteryPage";
 | 
					import VirtualLotteryPage from "@/components/VirtualLotteryPage";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -31,17 +33,13 @@ const routes = [
 | 
				
			|||||||
    path: "/login",
 | 
					    path: "/login",
 | 
				
			||||||
    component: LoginPage
 | 
					    component: LoginPage
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
  {
 | 
					 | 
				
			||||||
    path: "/update",
 | 
					 | 
				
			||||||
    component: RegisterPage
 | 
					 | 
				
			||||||
  },
 | 
					 | 
				
			||||||
  {
 | 
					  {
 | 
				
			||||||
    path: "/create",
 | 
					    path: "/create",
 | 
				
			||||||
    component: CreatePage
 | 
					    component: CreatePage
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
  {
 | 
					  {
 | 
				
			||||||
    path: "/virtual-register",
 | 
					    path: "/admin",
 | 
				
			||||||
    component: VirtualLotteryRegistrationPage
 | 
					    component: AdminPage
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
  {
 | 
					  {
 | 
				
			||||||
    path: "/virtual",
 | 
					    path: "/virtual",
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -140,6 +140,10 @@ textarea {
 | 
				
			|||||||
  }
 | 
					  }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					.no-margin {
 | 
				
			||||||
 | 
					  margin: 0 !important;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
.ballot-element {
 | 
					.ballot-element {
 | 
				
			||||||
  margin: 20px 0;
 | 
					  margin: 20px 0;
 | 
				
			||||||
  -webkit-mask-image: url(/../../public/assets/images/lodd.svg);
 | 
					  -webkit-mask-image: url(/../../public/assets/images/lodd.svg);
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user