Renamed /src to /frontend.
This commit is contained in:
		
							
								
								
									
										103
									
								
								frontend/Vinlottis.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										103
									
								
								frontend/Vinlottis.vue
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,103 @@
 | 
			
		||||
<template>
 | 
			
		||||
  <div class="app-container">
 | 
			
		||||
    <banner :routes="routes"/>
 | 
			
		||||
    <router-view />
 | 
			
		||||
    <Footer />
 | 
			
		||||
    <UpdateToast
 | 
			
		||||
      v-if="showToast"
 | 
			
		||||
      :text="toastText"
 | 
			
		||||
      :refreshButton="refreshToast"
 | 
			
		||||
      v-on:closeToast="closeToast"
 | 
			
		||||
    />
 | 
			
		||||
  </div>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
import ServiceWorkerMixin from "@/mixins/ServiceWorkerMixin";
 | 
			
		||||
import banner from "@/ui/Banner";
 | 
			
		||||
import Footer from "@/ui/Footer";
 | 
			
		||||
import UpdateToast from "@/ui/UpdateToast";
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
  name: "vinlottis",
 | 
			
		||||
  components: { banner, UpdateToast, Footer },
 | 
			
		||||
  props: {},
 | 
			
		||||
  data() {
 | 
			
		||||
    return {
 | 
			
		||||
      showToast: false,
 | 
			
		||||
      toastText: null,
 | 
			
		||||
      refreshToast: false,
 | 
			
		||||
      routes: [
 | 
			
		||||
        {
 | 
			
		||||
          name: "Dagens viner",
 | 
			
		||||
          route: "/dagens/"
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          name: "Historie",
 | 
			
		||||
          route: "/history/"
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          name: "Lotteriet",
 | 
			
		||||
          route: "/lottery/game/"
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          name: "Foreslå vin",
 | 
			
		||||
          route: "/request"
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          name: "Foreslåtte viner",
 | 
			
		||||
          route: "/requested-wines"
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          name: "Highscore",
 | 
			
		||||
          route: "/highscore"
 | 
			
		||||
        }
 | 
			
		||||
      ]
 | 
			
		||||
    };
 | 
			
		||||
  },
 | 
			
		||||
  mounted() {
 | 
			
		||||
    console.log("SNEAKY PETE!");
 | 
			
		||||
    this.$on("service-worker-updated", () => {
 | 
			
		||||
      this.toastText = "Det er ny oppdatering av siden, vil du oppdatere?";
 | 
			
		||||
      this.showToast = true;
 | 
			
		||||
      this.refreshToast = true;
 | 
			
		||||
    });
 | 
			
		||||
    this.$on("push-allowed", () => {
 | 
			
		||||
      this.toastText = "Push-notifications er skrudd på!";
 | 
			
		||||
      this.refreshToast = false;
 | 
			
		||||
      this.showToast = true;
 | 
			
		||||
    });
 | 
			
		||||
  },
 | 
			
		||||
  computed: {},
 | 
			
		||||
  mixins: [ServiceWorkerMixin],
 | 
			
		||||
  methods: {
 | 
			
		||||
    closeToast: function() {
 | 
			
		||||
      this.showToast = false;
 | 
			
		||||
    },
 | 
			
		||||
  }
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
<style lang="scss">
 | 
			
		||||
@import "styles/global.scss";
 | 
			
		||||
@import "styles/positioning.scss";
 | 
			
		||||
@import "styles/vinlottis-icons";
 | 
			
		||||
 | 
			
		||||
body {
 | 
			
		||||
  background-color: $primary;
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
 | 
			
		||||
<style lang="scss" scoped>
 | 
			
		||||
.app-container {
 | 
			
		||||
  background-color: white;
 | 
			
		||||
  min-height: 100vh;
 | 
			
		||||
  display: grid;
 | 
			
		||||
  grid-template-rows: 80px auto 100px;
 | 
			
		||||
 | 
			
		||||
  .main-container{
 | 
			
		||||
    height: 100%;
 | 
			
		||||
    width: 100%;
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
		Reference in New Issue
	
	Block a user