diff --git a/src/views/NewHome.vue b/src/views/NewHome.vue
index 43b85a5..8de68f3 100644
--- a/src/views/NewHome.vue
+++ b/src/views/NewHome.vue
@@ -16,12 +16,14 @@
Colors
+ @click="e => openPicker(e, c)">
{{i + 1}}
-
+ colors = p[0]"/>
@@ -41,11 +43,12 @@ export default class NewHome extends KeyHandler
range(10).map(_ => '#ffa8a8')
pickerColor = ''
+ initialPos = {x: 0, y: 0}
started = false
created(): void
{
- this.keybinds = {Escape: e => this.pickerColor = ''}
+ this.keybinds = {Escape: _ => this.pickerColor = ''}
}
mounted(): void
@@ -57,13 +60,10 @@ export default class NewHome extends KeyHandler
}
}
- keyListener(e: KeyboardEvent): void
+ openPicker(e: MouseEvent, c: string): void
{
- // Escape key to close color picker
- if (e.key == 'Escape')
- {
- this.pickerColor = ''
- }
+ this.pickerColor = c
+ this.initialPos = {x: e.clientX - 150, y: e.clientY + 50}
}
}