Skip to content

Commit

Permalink
start frontend proj
Browse files Browse the repository at this point in the history
added new components and changed the route
  • Loading branch information
mabasian committed Dec 1, 2021
1 parent 460f664 commit 46101ca
Show file tree
Hide file tree
Showing 5 changed files with 179 additions and 5 deletions.
27 changes: 27 additions & 0 deletions launcher/src/components/UI/LangButton.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<template>
<img :src="flag" />
</template>

<script>
export default {
name: "LangButton",
props: ["flag"],
};
</script>

<style scoped>
button {
background-image: inherit;
}
img {
display: block;
position: absolute;
top: 10%;
left: 10%;
width: 55%;
min-height: 10%;
min-width: 10%;
transform: translate(-50%, -50%);
resize: both;
}
</style>
40 changes: 40 additions & 0 deletions launcher/src/components/UI/LangDialog.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<template>
<dialog open v-if="open">
<!-- @link="setLink" -->
<slot></slot>
</dialog>
</template>

<script>
export default {
name: "LangDialog",
props: ["open"],
// data(){
// return{
// links:''
// }
// },
// methods: {
// setLink(linkUrl){
// links=linkUrl
// }
// },
};
</script>

<style scoped>
dialog {
position: fixed;
top: 30vh;
width: 30rem;
left: calc(50% - 15rem);
margin: 0;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.26);
border-radius: 12px;
padding: 1rem;
background-color: white;
z-index: 100;
border: none;
/* animation: modal 0.3s ease-out forwards; */
}
</style>
26 changes: 26 additions & 0 deletions launcher/src/components/layers/BaseLogo.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<template>
<div>
<img :src="link" />
</div>
</template>

<script>
export default {
name: "BaseLogo",
props: ["link"],
};
</script>

<style scoped>
img {
display: block;
position: absolute;
top: 50%;
left: 50%;
width: 52%;
min-height: 20%;
min-width: 20%;
transform: translate(-50%, -50%);
resize: both;
}
</style>
75 changes: 75 additions & 0 deletions launcher/src/components/layers/TheFirst.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
<template>
<div>
<div id="container">
<base-logo :link="link"> </base-logo>
<!-- <lang-dialog @click="$emit('open')" v-if="dialogIsVisible"></lang-dialog> -->
<lang-dialog @close="hideDialog" :open="dialogIsVisible">
<ul>
<li v-for="link in linkFlags" :key="link" @click="hideDialog">
<img :src="link" />
</li>
</ul>
</lang-dialog>
<section @click="showDialog">
<lang-button :flag="flag" class="lang"></lang-button>
</section>
</div>
</div>
</template>

<script>
import BaseLogo from "./BaseLogo.vue";
import LangButton from "../UI/LangButton.vue";
import LangDialog from "../UI/LangDialog.vue";
export default {
name: "TheFirst",
components: { BaseLogo, LangButton, LangDialog },
name: "TheFirst",
emit: ["open"],
data() {
return {
link: "stereumLogoExtern.png",
flag: "SelectLang.png",
dialogIsVisible: false,
linkFlags: ["Img/Flag/ENGLISH.png", "Img/Flag/ENGLISH.png"],
};
},
methods: {
showDialog() {
this.dialogIsVisible = true;
},
hideDialog() {
this.dialogIsVisible = false;
},
},
};
</script>

<style scoped>
#container {
border-radius: 40px;
padding: 1rem;
margin: 2rem auto;
width: 95vw;
height: 95vh;
background-color: #336666;
}
div {
background-color: #000;
justify-content: center;
align-items: center;
height: 100vh;
display: flex;
}
.lang {
position: fixed;
top: 81vh;
left: 86%;
width: 4em;
z-index: 100;
resize: both;
}
</style>
16 changes: 11 additions & 5 deletions launcher/src/router/index.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,25 @@
import Vue from "vue";
import VueRouter from "vue-router";
import Setup from "../views/Setup.vue";
//import Setup from "../views/Setup.vue";
import TheFirst from "../components/layers/TheFirst.vue";

Vue.use(VueRouter);

const routes = [
// {
// path: "/",
// name: "Setup",
// component: Setup,
// },
{
path: "/",
name: "Setup",
component: Setup,
},
name: "TheFirst",
component: TheFirst,
},
];

const router = new VueRouter({
mode: 'hash',
mode: "hash",
base: process.env.BASE_URL,
routes,
});
Expand Down

0 comments on commit 46101ca

Please sign in to comment.