From c4ef6ccce4fda4bd082ae3b79d83146f3da7612d Mon Sep 17 00:00:00 2001 From: Victor Seiji Hariki Date: Fri, 27 Jan 2023 01:39:08 -0300 Subject: [PATCH] Workspaces now fully functional (using indexedDB) Signed-off-by: Victor Seiji Hariki --- css/colors.css | 1 + css/icons.css | 33 ++++++ css/ui/workspace.css | 59 ++++++++++ index.html | 47 +++++++- js/index.js | 15 +-- js/initalize/workspace.populate.js | 179 +++++++++++++++++++++++++++++ js/lib/commands.js | 15 +++ js/lib/db.js | 36 ++++++ js/lib/ui.js | 1 - js/ui/floating/history.js | 2 +- js/ui/tool/stamp.js | 35 +----- res/icons/more-horizontal.svg | 6 + res/icons/pencil.svg | 5 + res/icons/save.svg | 6 + res/icons/upload.svg | 6 + 15 files changed, 397 insertions(+), 49 deletions(-) create mode 100644 css/ui/workspace.css create mode 100644 js/initalize/workspace.populate.js create mode 100644 js/lib/db.js create mode 100644 res/icons/more-horizontal.svg create mode 100644 res/icons/pencil.svg create mode 100644 res/icons/save.svg create mode 100644 res/icons/upload.svg diff --git a/css/colors.css b/css/colors.css index 984592d..3034b86 100644 --- a/css/colors.css +++ b/css/colors.css @@ -1,5 +1,6 @@ :root { --c-primary: #2c3333; + --c-disabled: rgb(81, 81, 81); --c-hover: hsl(180, 7%, 30%); --c-active: hsl(180, 7%, 25%); --c-primary-accent: hsl(180, 7%, 40%); diff --git a/css/icons.css b/css/icons.css index a1a80ee..2cc159e 100644 --- a/css/icons.css +++ b/css/icons.css @@ -105,6 +105,39 @@ mask-image: url("../res/icons/paintbrush.svg"); } +.ui.inline-icon.icon-save::after, +.ui.icon > .icon-save { + -webkit-mask-image: url("../res/icons/save.svg"); + mask-image: url("../res/icons/save.svg"); +} + +.ui.inline-icon.icon-pencil::after, +.ui.icon > .icon-pencil { + -webkit-mask-image: url("../res/icons/pencil.svg"); + mask-image: url("../res/icons/pencil.svg"); +} + +.ui.inline-icon.icon-download::after, +.ui.icon > .icon-download { + -webkit-mask-image: url("../res/icons/download.svg"); + mask-image: url("../res/icons/download.svg"); +} +.ui.inline-icon.icon-upload::after, +.ui.icon > .icon-upload { + -webkit-mask-image: url("../res/icons/upload.svg"); + mask-image: url("../res/icons/upload.svg"); +} +.ui.inline-icon.icon-more-horizontal::after, +.ui.icon > .icon-more-horizontal { + -webkit-mask-image: url("../res/icons/more-horizontal.svg"); + mask-image: url("../res/icons/more-horizontal.svg"); +} +.ui.inline-icon.icon-trash::after, +.ui.icon > .icon-trash { + -webkit-mask-image: url("../res/icons/trash.svg"); + mask-image: url("../res/icons/trash.svg"); +} + .ui.inline-icon.icon-expand::after, .ui.icon > .icon-expand { -webkit-mask-image: url("../res/icons/expand.svg"); diff --git a/css/ui/workspace.css b/css/ui/workspace.css new file mode 100644 index 0000000..159a75e --- /dev/null +++ b/css/ui/workspace.css @@ -0,0 +1,59 @@ +#workspace-select input.autocomplete-text { + border-top-right-radius: 0; + border-bottom-right-radius: 0; + + padding-left: 5px; + + border: none; + + text-overflow: ellipsis; +} + +#workspace-select-area .buttons > *:last-child { + border-top-right-radius: 5px; + border-bottom-right-radius: 5px; +} + +.workspace-btn { + cursor: pointer; + + border: 0; + width: 21px; + height: 21px; + + background-color: var(--c-primary); +} + +.workspace-btn:disabled { + cursor: default; + background-color: var(--c-disabled) !important; +} + +.workspace-btn:hover { + background-color: var(--c-hover); +} + +.workspace-btn:active { + background-color: var(--c-active); +} + +.workspace-collapsible { + position: relative; + + width: 0; + overflow: visible; +} + +.workspace-collapsible > *:first-child { + display: flex; + + width: fit-content; + height: 21px; + + transition-duration: 50ms; +} + +.workspace-collapsible.collapsed > *:first-child { + width: 0 !important; + overflow: hidden !important; +} diff --git a/index.html b/index.html index 59fd7f4..6e55da8 100644 --- a/index.html +++ b/index.html @@ -12,6 +12,7 @@ + @@ -38,6 +39,46 @@