2021-03-29 05:10:31 +00:00
|
|
|
<template>
|
2021-08-04 23:09:29 +00:00
|
|
|
<div>
|
2021-03-29 05:10:31 +00:00
|
|
|
<t-button
|
|
|
|
type="button"
|
2021-08-03 03:00:32 +00:00
|
|
|
:style="`background-color: ${mircColours[currentFg]} !important;`"
|
2021-08-05 00:54:40 +00:00
|
|
|
class="border-gray-200 w-12 h-12 text-2xl"
|
2021-03-29 05:10:31 +00:00
|
|
|
id="currentColourFg"
|
|
|
|
@click="$store.commit('changeIsUpdatingFg', true)"
|
|
|
|
>
|
2021-08-04 03:21:06 +00:00
|
|
|
FG
|
|
|
|
</t-button>
|
2021-03-29 05:10:31 +00:00
|
|
|
|
|
|
|
<t-button
|
|
|
|
type="button"
|
2021-08-03 03:00:32 +00:00
|
|
|
:style="`background-color: ${mircColours[currentBg]} !important;`"
|
2021-08-05 00:54:40 +00:00
|
|
|
class="border-gray-200 w-12 h-12 text-2xl ml-2"
|
2021-03-29 05:10:31 +00:00
|
|
|
id="currentColourBg"
|
|
|
|
@click="$store.commit('changeIsUpdatingBg', true)"
|
|
|
|
>
|
2021-08-04 03:21:06 +00:00
|
|
|
BG
|
|
|
|
</t-button>
|
2021-03-29 05:10:31 +00:00
|
|
|
|
|
|
|
<t-button
|
|
|
|
type="button"
|
2021-08-05 00:54:40 +00:00
|
|
|
class="bg-white absolute rounded-3xl"
|
|
|
|
style="margin-left: -62px; margin-top: 12px"
|
2021-03-29 05:10:31 +00:00
|
|
|
id="swapColour"
|
|
|
|
@click="swapColours()"
|
|
|
|
>
|
2021-08-05 00:54:40 +00:00
|
|
|
<font-awesome-icon :icon="['fas', 'sync']" />
|
2021-03-29 05:10:31 +00:00
|
|
|
</t-button>
|
2021-03-29 08:21:23 +00:00
|
|
|
|
|
|
|
<t-button
|
|
|
|
type="button"
|
2021-08-03 03:00:32 +00:00
|
|
|
:style="`background-color: ${mircColours[currentBg]} !important;color: ${mircColours[currentFg]};`"
|
2021-08-05 00:54:40 +00:00
|
|
|
class="border-gray-200 w-12 h-12 text-2xl ml-2"
|
2021-03-29 08:21:23 +00:00
|
|
|
id="currentChar"
|
|
|
|
@click="$store.commit('changeIsUpdatingChar', true)"
|
|
|
|
>
|
2021-08-04 23:09:29 +00:00
|
|
|
{{ toolbarState.selectedChar === " " ? "SP" : toolbarState.selectedChar }}
|
2021-08-04 03:21:06 +00:00
|
|
|
</t-button>
|
2021-08-04 23:09:29 +00:00
|
|
|
</div>
|
2021-03-29 05:10:31 +00:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2021-08-04 23:09:29 +00:00
|
|
|
import { mircColours99 } from "../ascii";
|
2021-08-03 07:33:25 +00:00
|
|
|
|
2021-03-29 05:10:31 +00:00
|
|
|
export default {
|
2021-08-04 23:09:29 +00:00
|
|
|
name: "Colours",
|
2021-03-29 05:10:31 +00:00
|
|
|
data: () => ({}),
|
2021-08-03 03:00:32 +00:00
|
|
|
computed: {
|
|
|
|
mircColours() {
|
2021-08-03 07:33:25 +00:00
|
|
|
return mircColours99;
|
2021-08-03 03:00:32 +00:00
|
|
|
},
|
|
|
|
toolbarState() {
|
|
|
|
return this.$store.getters.toolbarState;
|
|
|
|
},
|
|
|
|
currentFg() {
|
|
|
|
return this.$store.getters.currentFg;
|
|
|
|
},
|
|
|
|
currentBg() {
|
|
|
|
return this.$store.getters.currentBg;
|
|
|
|
},
|
|
|
|
},
|
2021-03-29 05:10:31 +00:00
|
|
|
methods: {
|
|
|
|
swapColours() {
|
2021-08-04 03:21:06 +00:00
|
|
|
const bg = this.currentBg;
|
|
|
|
const fg = this.currentFg;
|
2021-03-29 05:10:31 +00:00
|
|
|
|
2021-08-04 23:09:29 +00:00
|
|
|
this.$store.commit("changeColourFg", bg);
|
|
|
|
this.$store.commit("changeColourBg", fg);
|
2021-03-29 05:10:31 +00:00
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
</script>
|