mobile-friendly #3

Merged
gator merged 22 commits from mobile-friendly into dev 2022-12-04 18:49:16 +01:00
4 changed files with 46 additions and 32 deletions
Showing only changes of commit 2c69840d6f - Show all commits

View File

@ -10,17 +10,20 @@
<MainMenu v-if="mainMenu || windowWidth >= 800" />
<CanvasBoard />
</div>
<MenuReset row-title="" />
</div>
</template>
<script>
import MainMenu from "./components/MainMenu.vue";
import CanvasBoard from "./components/CanvasBoard.vue";
import MenuReset from "./components/MenuReset.vue";
export default {
name: "App",
components: {
MainMenu,
MenuReset,
CanvasBoard,
},
data() {

View File

@ -1,30 +1,17 @@
<template>
<MenuRow row-title="2D Cellular Automata">
<div class="form-field">
<label>Start from last result</label>
<input type="button" value="start" @click="toggleDraw2dLast()" />
</div>
<div class="form-field">
<label>Start from empty board</label>
<input
type="button"
name="start2d"
value="start"
@click="toggleDraw2d()"
/>
<input
type="button"
name="stop"
class="stop"
value="stop"
@click="toggleStop()"
/>
<input
type="button"
name="reset"
class="reset"
value="reset"
@click="toggleReset()"
/>
</div>
<div class="form-field">
<label>Start from last result</label>
<input type="button" value="start" @click="toggleDraw2dLast()" />
</div>
</MenuRow>
</template>
@ -40,12 +27,7 @@
MenuRow,
},
methods: {
...mapActions(globalStore, [
"toggleDraw2d",
"toggleDraw2dLast",
"toggleReset",
"toggleStop",
]),
...mapActions(globalStore, ["toggleDraw2dLast", "toggleDraw2d"]),
},
};
</script>

View File

@ -64,13 +64,6 @@
</form>
<div class="form-field">
<input type="button" name="start" value="start" @click="toggleDraw1d()" />
<input
type="button"
name="reset"
class="reset"
value="reset"
@click="toggleReset"
/>
</div>
</MenuRow>
</template>
@ -108,7 +101,7 @@
},
},
methods: {
...mapActions(globalStore, ["toggleDraw1d", "toggleReset"]),
...mapActions(globalStore, ["toggleDraw1d"]),
copyRules() {
const rules = JSON.stringify(this.rules);
navigator.clipboard.writeText(rules);

View File

@ -0,0 +1,36 @@
<template>
<div class="form-field">
<input
type="button"
name="stop"
class="stop"
value="stop"
@click="toggleStop()"
/>
<input
type="button"
name="reset"
class="reset"
value="reset"
@click="toggleReset()"
/>
</div>
</template>
<script>
import { mapActions } from "pinia";
import { globalStore } from "../stores/index.js";
export default {
name: "MenuReset",
methods: {
...mapActions(globalStore, ["toggleReset", "toggleStop"]),
},
};
</script>
<style scoped>
.form-field {
display: flex;
margin: 0;
justify-content: flex-end;
}
</style>