Skip to content

Commit d050440

Browse files
Adjusted capitalization and styling
1 parent 366f44e commit d050440

File tree

14 files changed

+484
-447
lines changed

14 files changed

+484
-447
lines changed

src/renderer/src/components/CoordMap.vue

Lines changed: 25 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,27 +9,30 @@
99
<p class="py-4">Be sure to backup your code if you still need any of it.</p>
1010
<div class="flex justify-between">
1111
<div class="btn">Abort</div>
12-
<div class="btn btn-warning" @click="flashCoordMapping({overwrite: true})">Flash POG</div>
12+
<div class="btn btn-warning" @click="flashCoordMapping({ overwrite: true })">Flash POG</div>
1313
</div>
1414
</div>
1515
<form method="dialog" class="modal-backdrop">
1616
<button>close</button>
1717
</form>
1818
</dialog>
1919
<div>
20-
<p class="py-4">1. install the debug code on the keyboard</p>
20+
<p class="py-4">1. Install the debug code on the keyboard</p>
2121
<button class="btn btn-primary btn-sm" @click="promptFlashing">
2222
Flash CoordMap Finder to keyboard
2323
</button>
2424
<div>
2525
<p class="py-4">2. Click the text area and follow the guide below</p>
2626

2727
<p class="mb-4">
28-
3. Now press each key starting in the top left corner in the first row and moving to the right
29-
when you reached the end press the last key once again to start with the next row
28+
3. Now press each key starting in the top left corner in the first row and moving to the
29+
right when you reached the end press the last key once again to start with the next row
3030
</p>
3131

32-
<p class="py-4">if nothing is happening first replug the board in case it hasnt started and wait 5 seconds. if this did not help check the diode direction or pins.</p>
32+
<p class="py-4">
33+
If nothing is happening first replug the board in case it hasnt started and wait 5 seconds.
34+
If this did not help check the diode direction or pins.
35+
</p>
3336
<textarea
3437
id="keycapture"
3538
v-model="coordmap"
@@ -58,7 +61,7 @@
5861
<button class="btn btn-primary mt-2" @click="done">
5962
{{ initialSetup ? 'next' : 'save Coord Maping & create keyboard layout' }}
6063
</button>
61-
<button class="btn-primary btn mt-2" @click="onlySave" v-if="!initialSetup">
64+
<button class="btn btn-primary mt-2" @click="onlySave" v-if="!initialSetup">
6265
only save Coord Maping
6366
</button>
6467
</div>
@@ -86,12 +89,12 @@ coordmap.value = keyboardStore.coordMap
8689
.join(' row ')
8790
8891
const addRow = () => {
89-
coordmap.value = coordmap.value + '\n';
90-
(document.querySelector('#keycapture') as HTMLInputElement).focus()
92+
coordmap.value = coordmap.value + '\n'
93+
;(document.querySelector('#keycapture') as HTMLInputElement).focus()
9194
}
9295
const addSpc = () => {
93-
coordmap.value += 'spc ';
94-
(document.querySelector('#keycapture') as HTMLInputElement).focus()
96+
coordmap.value += 'spc '
97+
;(document.querySelector('#keycapture') as HTMLInputElement).focus()
9598
}
9699
const done = () => {
97100
keyboardStore.setKeys(keyboardlayout.value as KeyInfo[])
@@ -102,20 +105,24 @@ const onlySave = () => {
102105
keyboardStore.coordMap = keys.value
103106
}
104107
const promptFlashing = () => {
105-
if(props.initialSetup){
108+
if (props.initialSetup) {
106109
// after valid ok then flash file with overwrite on
107-
(document.getElementById("flash_modal") as HTMLDialogElement).showModal()
110+
;(document.getElementById('flash_modal') as HTMLDialogElement).showModal()
108111
} else {
109-
flashCoordMapping({overwrite: false})
112+
flashCoordMapping({ overwrite: false })
110113
}
111114
}
112-
const flashCoordMapping = async ({ overwrite } : {overwrite: boolean}) => {
115+
const flashCoordMapping = async ({ overwrite }: { overwrite: boolean }) => {
113116
console.log('flashCoordMapping with overwrite:', overwrite)
114-
keyboardStore.coordMapSetup = true;
115-
(document.getElementById("flash_modal") as HTMLDialogElement).close()
117+
keyboardStore.coordMapSetup = true
118+
;(document.getElementById('flash_modal') as HTMLDialogElement).close()
116119
overwrite = Boolean(overwrite)
117120
await window.api.saveConfiguration(
118-
JSON.stringify({ pogConfig: keyboardStore.serialize(), writeFirmware: overwrite, writeCoordMapHelper: true })
121+
JSON.stringify({
122+
pogConfig: keyboardStore.serialize(),
123+
writeFirmware: overwrite,
124+
writeCoordMapHelper: true
125+
})
119126
)
120127
}
121128
const keys = computed(() => {
@@ -152,7 +159,7 @@ const coordmapstring = computed(() => {
152159
return str.replaceAll(/spc,/gi, ' ')
153160
})
154161
const keyboardlayout = computed(() => {
155-
const realKeys :Key[]= []
162+
const realKeys: Key[] = []
156163
let globalkeyindex = 0
157164
keys.value.forEach((row, rowindex) => {
158165
row.forEach((key, kindex) => {

src/renderer/src/components/EncoderLayer.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@
33
v-if="keyboardStore.encoderKeymap[lindex] && keyboardStore.encoderKeymap[lindex][eindex]"
44
class="mb-4 flex items-center gap-4"
55
>
6-
<p class="w-24">layer {{ lindex }}</p>
6+
<p class="w-24">Layer {{ lindex }}</p>
77
<input
88
v-model="keyboardStore.encoderKeymap[lindex][eindex][0]"
99
type="text"
10-
class="input-bordered input input-sm"
10+
class="input input-bordered input-sm"
1111
/>
1212
<input
1313
v-model="keyboardStore.encoderKeymap[lindex][eindex][1]"
1414
type="text"
15-
class="input-bordered input input-sm"
15+
class="input input-bordered input-sm"
1616
/>
1717
</div>
1818
</template>

src/renderer/src/components/KeyCap.vue

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@
122122
</template>
123123

124124
<script lang="ts" setup>
125-
import {computed, nextTick, onMounted, ref, VNodeRef, watch} from 'vue'
125+
import { computed, nextTick, onMounted, ref, VNodeRef, watch } from 'vue'
126126
import { selectedLayer, selectedKeys, userSettings } from '../store'
127127
import { renderLabel } from '../helpers'
128128
import chroma from 'chroma-js'
@@ -144,7 +144,7 @@ const action = computed(() => {
144144
let keyIndex = 0
145145
146146
keyIndex = props.keyData.coordMapIndex
147-
if (!props.keymap[selectedLayer.value]) return 'l missing'
147+
if (!props.keymap[selectedLayer.value]) return 'No layer'
148148
const keyCode = props.keymap[selectedLayer.value][keyIndex]
149149
// resolve readable character
150150
if (!keyCode || keyCode === 'KC.TRNS') return ''
@@ -340,19 +340,19 @@ const isSimple = computed(() => {
340340
const keyElem = ref<VNodeRef | null>(null)
341341
const fixLabelWidth = () => {
342342
// key is eventually hidden with a layout variant
343-
if(!keyElem.value) return
343+
if (!keyElem.value) return
344344
const label = keyElem.value.querySelector('.keylabel-main')
345345
const labels = keyElem.value.querySelector('.keylabels')
346346
if (label) {
347-
console.log("fixing label width")
347+
console.log('fixing label width')
348348
label.style.transform = `scale(1)`
349349
const labelWidth = label.getBoundingClientRect().width
350350
const wrapperWidth = labels.getBoundingClientRect().width
351351
const scaling = Math.min(wrapperWidth / labelWidth, 1)
352352
label.style.transform = `scale(${scaling})`
353353
}
354354
}
355-
watch(mainLabel,async ()=>{
355+
watch(mainLabel, async () => {
356356
console.log('watching cap layer')
357357
await nextTick()
358358
fixLabelWidth()

src/renderer/src/components/KeyLayoutInfo.vue

Lines changed: 10 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
2-
<p class="font-bold">Key Info for key #{{ [...selectedKeys][0] }}</p>
3-
<p>selected {{ selectedKeys.size }} keys</p>
2+
<p class="font-bold">Key info for key #{{ [...selectedKeys][0] }}</p>
3+
<p>{{ selectedKeys.size }} {{ selectedKeys.size == 1 ? 'key' : 'keys' }} selected:</p>
44
<p class="mt-2 text-sm">Basics</p>
55
<div class="flex flex-col gap-2">
66
<div class="grid grid-cols-4 gap-2 text-right">
@@ -88,7 +88,7 @@
8888
</div>
8989
</div>
9090
</div>
91-
<template v-if="keyboardStore.wiringMethod === 'matrix' && false ">
91+
<template v-if="keyboardStore.wiringMethod === 'matrix' && false">
9292
<p class="mt-2 text-sm" :class="{ 'text-error': matrixValid }">Matrix</p>
9393
<div class="flex gap-2">
9494
<div class="keydata-input-group">
@@ -123,15 +123,15 @@
123123
</div>
124124
<div v-if="keyboardStore.layouts.length !== 0" class="flex gap-1">
125125
<label>
126-
<span>variant</span>
126+
<span>Variant</span>
127127
<input v-model="tmpKey.variant[0]" type="text" class="keyinfo-input" @change="updateKey" />
128128
</label>
129129
<label>
130-
<span>variant option</span>
130+
<span>Variant option</span>
131131
<input v-model="tmpKey.variant[1]" type="text" class="keyinfo-input" @change="updateKey" />
132132
</label>
133133
</div>
134-
<span>rotation</span>
134+
<span>Rotation</span>
135135
<div class="flex gap-1">
136136
<input
137137
v-model="tmpKey.r"
@@ -208,22 +208,9 @@ const isAttrSame = (keys, attr) => {
208208
const getSameKeyAttrs = (keys) => {
209209
console.log(keys)
210210
const sameAttrs = new Map()
211-
;[
212-
'y',
213-
'y2',
214-
'x',
215-
'x2',
216-
'w',
217-
'w2',
218-
'h',
219-
'h2',
220-
'r',
221-
'ry',
222-
'rx',
223-
'encoderIndex'
224-
].forEach((attr) => {
211+
;['y', 'y2', 'x', 'x2', 'w', 'w2', 'h', 'h2', 'r', 'ry', 'rx', 'encoderIndex'].forEach((attr) => {
225212
if (isAttrSame(keys, attr) && keys[0][attr] !== undefined) {
226-
console.log('attr is same',attr)
213+
console.log('attr is same', attr)
227214
sameAttrs.set(attr, keys[0][attr])
228215
}
229216
})
@@ -295,7 +282,7 @@ const updateKey = () => {
295282
if (tmpKey.value.ry !== '') props.layout[keyIndex].ry = Number(tmpKey.value.ry)
296283
if (tmpKey.value.coordMapIndex !== '' && !isNaN(tmpKey.value.coordMapIndex as any))
297284
props.layout[keyIndex].coordMapIndex = Number(tmpKey.value.coordMapIndex)
298-
else props.layout[keyIndex].coordMapIndex = ""
285+
else props.layout[keyIndex].coordMapIndex = ''
299286
if (tmpKey.value.encoderIndex !== '' && !isNaN(Number(tmpKey.value.encoderIndex)))
300287
props.layout[keyIndex].encoderIndex = Number(tmpKey.value.encoderIndex)
301288
else props.layout[keyIndex].encoderIndex = undefined
@@ -342,7 +329,7 @@ const matrixValid = computed(() => {
342329

343330
<style lang="scss" scoped>
344331
.keyinfo-input {
345-
@apply input-bordered input input-sm w-full flex-shrink;
332+
@apply input input-bordered input-sm w-full flex-shrink;
346333
padding-left: 3px;
347334
padding-right: 3px;
348335
}

0 commit comments

Comments
 (0)