From a439b27d2be2b47f13ce7f15cf3553586bd860ce Mon Sep 17 00:00:00 2001 From: Keavon Chambers Date: Mon, 17 May 2021 12:07:54 -0700 Subject: [PATCH] Implement popover component and beginnings of color picker (#128) --- client/web/src/App.vue | 10 +- client/web/src/components/panels/Document.vue | 45 +----- .../src/components/popovers/ColorPicker.vue | 128 ++++++++++++++++++ .../src/components/widgets/PopoverMount.vue | 95 +++++++++++++ .../src/components/widgets/WorkingColors.vue | 96 +++++++++++++ 5 files changed, 330 insertions(+), 44 deletions(-) create mode 100644 client/web/src/components/popovers/ColorPicker.vue create mode 100644 client/web/src/components/widgets/PopoverMount.vue create mode 100644 client/web/src/components/widgets/WorkingColors.vue diff --git a/client/web/src/App.vue b/client/web/src/App.vue index b565891d..026b5ad6 100644 --- a/client/web/src/App.vue +++ b/client/web/src/App.vue @@ -8,12 +8,18 @@ body, #app { margin: 0; height: 100%; + background: #222; + user-select: none; +} + +body, +input, +textarea, +button { font-family: "Source Sans Pro", Arial, sans-serif; font-size: 14px; line-height: 1; color: #ddd; - background: #222; - user-select: none; } diff --git a/client/web/src/components/panels/Document.vue b/client/web/src/components/panels/Document.vue index 11b03486..acb66468 100644 --- a/client/web/src/components/panels/Document.vue +++ b/client/web/src/components/panels/Document.vue @@ -81,20 +81,7 @@
-
-
- - -
-
- - - - - - -
-
+
@@ -129,30 +116,6 @@ .shelf-and-viewport { .shelf { flex: 0 0 32px; - - .swatch-pair { - display: flex; - // Reversed order of elements paired with `column-reverse` allows primary to overlap secondary without relying on `z-index` - flex-direction: column-reverse; - } - - .working-colors { - .swatch { - width: 24px; - height: 24px; - border-radius: 50%; - border: 2px #888 solid; - box-shadow: 0 0 0 2px #333; - margin: 2px; - padding: 0; - box-sizing: unset; - outline: none; - } - - .primary.swatch { - margin-bottom: -8px; - } - } } .viewport { @@ -183,14 +146,13 @@ import { defineComponent } from "vue"; import { ResponseType, registerResponseHandler, Response, UpdateCanvas, SetActiveTool } from "../../response-handler"; import LayoutRow from "../layout/LayoutRow.vue"; import LayoutCol from "../layout/LayoutCol.vue"; +import WorkingColors from "../widgets/WorkingColors.vue"; import ShelfItem from "../widgets/ShelfItem.vue"; import ItemDivider from "../widgets/ItemDivider.vue"; import IconButton from "../widgets/IconButton.vue"; import DropdownButton from "../widgets/DropdownButton.vue"; import RadioPicker from "../widgets/RadioPicker.vue"; import NumberInput from "../widgets/NumberInput.vue"; -import SwapButton from "../../../assets/svg/16x16-bounds-12x12-icon/swap.svg"; -import ResetColorsButton from "../../../assets/svg/16x16-bounds-12x12-icon/reset-colors.svg"; import SelectTool from "../../../assets/svg/24x24-bounds-24x24-icon/document-tool-layout-select.svg"; import CropTool from "../../../assets/svg/24x24-bounds-24x24-icon/document-tool-layout-crop.svg"; import NavigateTool from "../../../assets/svg/24x24-bounds-24x24-icon/document-tool-layout-navigate.svg"; @@ -238,14 +200,13 @@ export default defineComponent({ components: { LayoutRow, LayoutCol, + WorkingColors, ShelfItem, ItemDivider, IconButton, DropdownButton, RadioPicker, NumberInput, - SwapButton, - ResetColorsButton, SelectTool, CropTool, NavigateTool, diff --git a/client/web/src/components/popovers/ColorPicker.vue b/client/web/src/components/popovers/ColorPicker.vue new file mode 100644 index 00000000..922034f2 --- /dev/null +++ b/client/web/src/components/popovers/ColorPicker.vue @@ -0,0 +1,128 @@ + + + + + diff --git a/client/web/src/components/widgets/PopoverMount.vue b/client/web/src/components/widgets/PopoverMount.vue new file mode 100644 index 00000000..1923eb08 --- /dev/null +++ b/client/web/src/components/widgets/PopoverMount.vue @@ -0,0 +1,95 @@ + + + + + diff --git a/client/web/src/components/widgets/WorkingColors.vue b/client/web/src/components/widgets/WorkingColors.vue new file mode 100644 index 00000000..43b6b21b --- /dev/null +++ b/client/web/src/components/widgets/WorkingColors.vue @@ -0,0 +1,96 @@ + + + + +