From 718d9e2700caa9c0390ddc7f3bea199c9bbb075d Mon Sep 17 00:00:00 2001 From: Justin Ferrari Date: Fri, 10 Feb 2023 22:42:53 +0200 Subject: [PATCH] Continued UI styling of gifs --- qortal-ui-core/font/switch-theme.css | 2 + qortal-ui-core/src/styles/switch-theme.css | 2 + .../core/components/ChatGifs/ChatGifs-css.js | 12 +- .../core/components/ChatGifs/ChatGifs.js | 100 +++++------ .../ChatGifs/ChatGifsExplore-css.js | 64 +++++++ .../components/ChatGifs/ChatGifsExplore.js | 160 +++++++++--------- .../plugins/core/components/ImageComponent.js | 39 ++++- .../plugins/utils/publish-image.js | 2 - 8 files changed, 227 insertions(+), 154 deletions(-) create mode 100644 qortal-ui-plugins/plugins/core/components/ChatGifs/ChatGifsExplore-css.js diff --git a/qortal-ui-core/font/switch-theme.css b/qortal-ui-core/font/switch-theme.css index 8e56fbea..290e1940 100644 --- a/qortal-ui-core/font/switch-theme.css +++ b/qortal-ui-core/font/switch-theme.css @@ -58,6 +58,7 @@ html { --gif-search-icon: #ffffff; --gif-button-row-bg: #eaeaef; --gif-button-row-color: #464040; + --gif-collection-hover-bg: #eaeaefa3; } html[theme="dark"] { @@ -120,4 +121,5 @@ html[theme="dark"] { --gif-search-icon: #586b8d; --gif-button-row-bg: #82899c; --gif-button-row-color: #151212; + --gif-collection-hover-bg: #ffffff26; } \ No newline at end of file diff --git a/qortal-ui-core/src/styles/switch-theme.css b/qortal-ui-core/src/styles/switch-theme.css index 20ed00ef..564b0a35 100644 --- a/qortal-ui-core/src/styles/switch-theme.css +++ b/qortal-ui-core/src/styles/switch-theme.css @@ -55,6 +55,7 @@ html { --gif-search-icon: #ffffff; --gif-button-row-bg: #eaeaef; --gif-button-row-color: #464040; + --gif-collection-hover-bg: #eaeaefa3; } html[theme="dark"] { @@ -114,4 +115,5 @@ html[theme="dark"] { --gif-search-icon: #586b8d; --gif-button-row-bg: #82899c; --gif-button-row-color: #151212; + --gif-collection-hover-bg: #ffffff26; } \ No newline at end of file diff --git a/qortal-ui-plugins/plugins/core/components/ChatGifs/ChatGifs-css.js b/qortal-ui-plugins/plugins/core/components/ChatGifs/ChatGifs-css.js index b4607b9f..5a9fd29a 100644 --- a/qortal-ui-plugins/plugins/core/components/ChatGifs/ChatGifs-css.js +++ b/qortal-ui-plugins/plugins/core/components/ChatGifs/ChatGifs-css.js @@ -47,7 +47,6 @@ user-select: none; } .explore-collections-icon { -margin-left: auto; text-align: right; font-size: 20px; color: var(--chat-group); @@ -346,7 +345,7 @@ color: var(--chat-bubble-msg-color); align-items: center; transition: box-shadow 0.2s ease-in-out; background-color: var(--gif-button-row-bg); - border-radius: 10px; + border-radius: 3px; box-shadow: rgb(0 0 0 / 20%) 0px 0px 0px; padding: 8px 10px; cursor: pointer; @@ -383,7 +382,7 @@ color: var(--chat-bubble-msg-color); color: var(--chat-bubble-msg-color); flex-direction: row; align-items: center; - transition: box-shadow 0.2s ease-in-out; + transition: all 0.3s ease-in-out; box-shadow: none; padding: 10px; cursor: pointer; @@ -391,9 +390,8 @@ color: var(--chat-bubble-msg-color); .collection-card:hover { border: none; - border-radius: 4px; - box-sizing: border-box; - box-shadow: rgb(0 0 0 / 14%) 0px 4px 5px 0px, rgb(0 0 0 / 12%) 0px 1px 10px 0px, rgb(0 0 0 / 20%) 0px 2px 4px -1px; + border-radius: 5px; + background-color: var(--gif-collection-hover-bg); } .upload-button { @@ -404,7 +402,7 @@ background-color: transparent; padding: 8px 10px; border-radius: 5px; border: none; -transition: all 0.3s ease-in-out; +transition: all 0.4s ease-in-out; } .upload-back-button { diff --git a/qortal-ui-plugins/plugins/core/components/ChatGifs/ChatGifs.js b/qortal-ui-plugins/plugins/core/components/ChatGifs/ChatGifs.js index b6ae1475..28fa84ea 100644 --- a/qortal-ui-plugins/plugins/core/components/ChatGifs/ChatGifs.js +++ b/qortal-ui-plugins/plugins/core/components/ChatGifs/ChatGifs.js @@ -67,8 +67,6 @@ editor: {type: Object}, url: `/arbitrary/metadata/GIF_REPOSITORY/${this.myAccountName}/${collection.identifier}`, }); - console.log({metaData}); - collectionObj = { ...collection, gifUrls: [], @@ -429,7 +427,7 @@ editor: {type: Object}, }; interval = setInterval(getAnswer, 5000); }); - // saveAs(zipFileBlob, 'zipfile'); + saveAs(zipFileBlob, 'zipfile'); this.isLoading = false; this.setGifsLoading(false); this.mode = 'myCollection'; @@ -452,7 +450,7 @@ editor: {type: Object}, render() { console.log('this.currentCollection', this.currentCollection); - console.log(27, 'chat gifs here'); + console.log(31, 'chat gifs here'); return html`
@@ -472,12 +470,31 @@ editor: {type: Object}, slot="icon">
-

${translate( - 'chatpage.cchange80' - )}

+
{ + if (this.mode === 'explore' && !this.currentCollection) { + this.mode = 'myCollection'; + this.currentCollection = null; + } else if (this.mode === 'explore' && this.currentCollection) { + this.mode = 'explore'; + this.currentCollection = null; + } else { + this.currentCollection = null; + } + }} + > + +
+

+ ${translate( + 'chatpage.cchange80' + )} +

-
-
+
+
{ + @click=${() => { if (this.isLoading) return; if (this.mode === 'myCollection') return; this.mode = 'myCollection'; this.currentCollection = null; - }} - > + }}> ${translate('chatpage.cchange82')}
{ - this.currentCollection = null; - }} - > - - ${translate('general.back')} -
${this.currentCollection.gifUrls.map((gif) => { - console.log({gif}); return html` @@ -650,26 +647,14 @@ editor: {type: Object}, ${this.currentCollection && this.mode === 'subscribedCollection' ? html` -
{ - this.currentCollection = null; - }} - > - - - ${translate('general.back')} -
${this.currentCollection.gifUrls.map((gif) => { return html` - { - e.target.src = gif; - }} - src=${gif} - /> + + `; })}
@@ -678,13 +663,6 @@ editor: {type: Object}, } ${this.currentCollection && this.mode === 'explore' ? html` -