explorata/src/App.vue

121 lines
2.1 KiB
Vue
Raw Normal View History

2022-01-08 13:12:15 +01:00
<template>
<div id="main">
<h1 id="main-title">
<span id="burger-toggle" @click="toggleMainMenu">{{
mainMenu == true ? "▼" : "☰"
}}</span>
Cellular Automata Explorer
</h1>
<div id="container">
<MainMenu v-if="mainMenu || windowWidth >= 800" />
<CanvasBoard />
</div>
2022-01-08 13:12:15 +01:00
</div>
</template>
<script>
2022-12-02 15:53:49 +01:00
import MainMenu from "./components/MainMenu.vue";
import CanvasBoard from "./components/CanvasBoard.vue";
2022-01-08 13:12:15 +01:00
2022-12-02 15:53:49 +01:00
export default {
name: "App",
components: {
MainMenu,
CanvasBoard,
},
data() {
return {
mainMenu: false,
windowWidth: window.innerWidth,
};
},
methods: {
toggleMainMenu() {
this.mainMenu = !this.mainMenu;
},
onResize() {
this.windowWidth = window.innerWidth;
},
},
mounted() {
this.$nextTick(() => {
window.addEventListener("resize", this.onResize);
});
},
beforeDestroy() {
window.removeEventListener("resize", this.onResize);
},
2022-12-02 15:53:49 +01:00
};
2022-01-08 13:12:15 +01:00
</script>
<style scope>
2022-12-02 15:53:49 +01:00
#app {
font-family: Avenir, Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-align: center;
/* color: #2c3e50; */
}
2022-01-08 13:12:15 +01:00
2022-12-02 15:53:49 +01:00
* {
margin: 0;
padding: 0;
}
2022-01-08 13:12:15 +01:00
2022-12-02 15:53:49 +01:00
body {
background: black;
color: white;
font-family: Courier New;
}
2022-01-08 13:12:15 +01:00
2022-12-02 15:53:49 +01:00
canvas {
flex: auto;
background: #110812;
margin-right: 10px;
}
2022-01-08 13:12:15 +01:00
2022-12-02 15:53:49 +01:00
h1,
h2 {
font-weight: bold;
}
2022-01-08 13:12:15 +01:00
2022-12-02 15:53:49 +01:00
h1 {
margin: 10px auto;
font-size: larger;
text-transform: uppercase;
2022-12-02 15:53:49 +01:00
}
2022-01-08 13:12:15 +01:00
2022-12-02 15:53:49 +01:00
#container {
display: flex;
height: calc(100vh - 100px);
overflow: hidden;
flex-direction: column;
}
#burger-toggle {
display: none;
cursor: pointer;
font-size: 1.5em;
vertical-align: middle;
color: #c6c6c6;
}
@media screen and (max-width: 800px) {
h1 {
font-size: medium;
display: flex;
justify-content: space-around;
align-items: center;
}
#burger-toggle {
display: inline;
}
#main-menu {
background: black;
margin: 0 auto;
}
2022-12-02 15:53:49 +01:00
}
2022-01-08 13:12:15 +01:00
</style>