2022-01-09 11:47:18 +01:00
|
|
|
<template>
|
|
|
|
<MenuRow row-title="Cell Properties">
|
|
|
|
<form>
|
|
|
|
<div class="form-field">
|
|
|
|
<label for="live">Living cell color</label>
|
|
|
|
<input
|
2022-01-10 11:13:44 +01:00
|
|
|
name="liveColor"
|
2022-01-09 11:47:18 +01:00
|
|
|
type="color"
|
2022-01-10 11:13:44 +01:00
|
|
|
@value="cellProperties.liveColor"
|
|
|
|
@input="updateCellProperties"
|
2022-11-29 17:31:01 +01:00
|
|
|
/>
|
2022-01-09 11:47:18 +01:00
|
|
|
</div>
|
|
|
|
<div class="form-field">
|
|
|
|
<label for="dead">Dead cell color</label>
|
|
|
|
<input
|
2022-01-10 11:13:44 +01:00
|
|
|
name="deadColor"
|
2022-01-09 11:47:18 +01:00
|
|
|
type="color"
|
2022-01-10 11:13:44 +01:00
|
|
|
:value="cellProperties.deadColor"
|
|
|
|
@input="updateCellProperties"
|
2022-11-29 17:31:01 +01:00
|
|
|
/>
|
2022-01-09 11:47:18 +01:00
|
|
|
</div>
|
|
|
|
<div class="form-field">
|
|
|
|
<label>Cell size</label>
|
|
|
|
<input
|
2022-01-10 11:13:44 +01:00
|
|
|
name="size"
|
2022-01-09 11:47:18 +01:00
|
|
|
type="number"
|
2022-01-10 21:01:39 +01:00
|
|
|
min="1"
|
2022-01-10 11:13:44 +01:00
|
|
|
:value="cellProperties.size"
|
|
|
|
@input="updateCellProperties"
|
2022-11-29 17:31:01 +01:00
|
|
|
/>
|
2022-01-09 11:47:18 +01:00
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
</MenuRow>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2022-12-02 17:10:21 +01:00
|
|
|
import { mapWritableState } from 'pinia'
|
|
|
|
import { globalStore } from "../stores/index.js";
|
|
|
|
import MenuRow from "./MenuRow.vue";
|
|
|
|
export default {
|
|
|
|
name: "MainMenu",
|
|
|
|
components: {
|
|
|
|
MenuRow,
|
2022-01-10 11:13:44 +01:00
|
|
|
},
|
2022-12-02 17:10:21 +01:00
|
|
|
computed: {
|
|
|
|
...mapWritableState(globalStore, ["cellProperties"])
|
2022-11-29 17:31:01 +01:00
|
|
|
},
|
2022-12-02 17:10:21 +01:00
|
|
|
methods: {
|
|
|
|
getCellProperties(event) {
|
|
|
|
const elem = event.target;
|
|
|
|
const prop = this.cellProperties;
|
|
|
|
return prop[elem.name];
|
|
|
|
},
|
|
|
|
updateCellProperties(event) {
|
|
|
|
const elem = event.target;
|
|
|
|
this.cellProperties[elem.name] = elem.value;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
2022-01-09 11:47:18 +01:00
|
|
|
</script>
|