feat: title in reset menu if mobile viewport

This commit is contained in:
Ali Gator 2024-04-27 14:30:45 +02:00
parent bc19ee1848
commit 69fad85b45
3 changed files with 63 additions and 42 deletions

View File

@ -36,17 +36,17 @@
<template> <template>
<div id="main"> <div id="main">
<h1 id="main-title"> <h1 id="main-title" v-if="store.mainMenu || windowWidth <= 800">
<span id="burger-toggle" @click="toggleMainMenu"> <span id="burger-toggle" @click="toggleMainMenu">
{{ store.mainMenu == true ? "▼" : "☰" }} {{ store.mainMenu == true ? "▼" : "☰" }}
</span> </span>
Cellular Automata Explorer <span >Cellular Automata Explorer</span>
</h1> </h1>
<div id="container"> <div id="container">
<MainMenu v-if="store.mainMenu || windowWidth >= 800" /> <MainMenu v-if="store.mainMenu || windowWidth >= 800" />
<CanvasBoard /> <CanvasBoard />
</div> </div>
<MenuReset row-title="" /> <MenuReset :windowWidth=windowWidth />
</div> </div>
</template> </template>

View File

@ -33,12 +33,12 @@ canvas {
} }
h1, h1,
h2 { h2,
.desktop-title {
font-weight: bold; font-weight: bold;
} }
h1 { h1, .desktop-title {
margin: 10px auto;
font-size: larger; font-size: larger;
text-transform: uppercase; text-transform: uppercase;
} }
@ -64,9 +64,9 @@ a {
padding: 2px; padding: 2px;
} }
a:hover { h2:hover {
cursor: pointer; cursor: pointer;
color: var(--light1); color: var(--light2);
} }
select { select {
@ -74,11 +74,17 @@ select {
padding: 5px; padding: 5px;
} }
input[type="number"] {
width: 100%;
height: 100%;
}
input[type="button"] { input[type="button"] {
min-width: 60px; min-width: 60px;
margin: 0 5px;
padding: 5px; padding: 5px;
font-weight: bold; font-weight: bold;
margin-right: 10px;
} }
.form-field { .form-field {
@ -98,7 +104,6 @@ input[type="button"] {
cursor: pointer; cursor: pointer;
border-bottom: 1px solid var(--dark3); border-bottom: 1px solid var(--dark3);
border-top: 1px solid var(--dark3); border-top: 1px solid var(--dark3);
margin: 0 0 10px 0;
} }
.menu-row a { .menu-row a {
@ -112,6 +117,7 @@ input[type="button"] {
position: absolute; position: absolute;
background: var(--dark1); background: var(--dark1);
width: 100%; width: 100%;
overflow: scroll;
} }
label, label,
@ -145,8 +151,14 @@ label,
.reset-menu { .reset-menu {
display: flex; display: flex;
justify-content: flex-end; justify-content: space-between;
padding: 10px;
vertical-align: center;
}
.reset-menu .loop {
padding: 5px; padding: 5px;
display: inline-block;
} }
@media screen and (max-width: 800px) { @media screen and (max-width: 800px) {
@ -192,4 +204,8 @@ label,
position: relative; position: relative;
width: 100%; width: 100%;
} }
.reset-menu {
justify-content: flex-end;
}
} }

View File

@ -1,12 +1,16 @@
<script setup> <script setup>
import { globalStore } from "../stores/index.js"; import { globalStore } from "../stores/index.js";
import { defineProps } from "vue";
const props = defineProps(['windowWidth']);
const store = globalStore(); const store = globalStore();
</script> </script>
<template> <template>
<div class="reset-menu"> <div class="reset-menu">
<div class="form-field"> <div class="desktop-title" v-if="windowWidth >= 800">Cellular Automata Explorer</div>
<div class="reset-input">
<div class="loop">
<label> <label>
loop loop
<input <input
@ -39,4 +43,5 @@
@click="store.toggleReset()" @click="store.toggleReset()"
/> />
</div> </div>
</div>
</template> </template>