From 732ff1ad6ab16d00fa4ba32e1d0052be9ca9ffb4 Mon Sep 17 00:00:00 2001 From: Abdullah Alfaraj Date: Thu, 26 Jan 2023 06:08:00 +0300 Subject: [PATCH] change to viewer tab on hover button to sp-action-button --- icon/ftcopy.svg | 153 ++++++++++++++++++++++++++++++++++++++++++++++++ index.html | 30 ++++++++-- viewer.js | 18 +++++- 3 files changed, 194 insertions(+), 7 deletions(-) create mode 100644 icon/ftcopy.svg diff --git a/icon/ftcopy.svg b/icon/ftcopy.svg new file mode 100644 index 0000000..c6da22d --- /dev/null +++ b/icon/ftcopy.svg @@ -0,0 +1,153 @@ + + + + + + + + + + + image/svg+xml + + + + + Openclipart + + + ftcopy + 2011-01-31T02:01:26 + Originally uploaded by Danny Allen for OCAL 0.18 this icon is part of the flat theme + https://openclipart.org/detail/112297/ftcopy-by-anonymous + + + Anonymous + + + + + flat + icon + theme + + + + + + + + + + + diff --git a/index.html b/index.html index 192dea7..42a904e 100644 --- a/index.html +++ b/index.html @@ -89,7 +89,7 @@ } .viewer-image-button { display: none; - background-color: #6db579; + background-color: #495b79; color: white; border: none; cursor: pointer; @@ -97,13 +97,13 @@ bottom: 0; left: 0; width: 100%; - height: 20px; + /* height: 20px; */ margin: 0; max-height:100%; max-width:100%; } .viewer-image-button:hover { - background-color: #407c5e; + background-color: #333f52; } .viewer-image-container { position: relative; @@ -112,7 +112,7 @@ margin: 0; } .viewer-image-container:hover .viewer-image-button { - display: block; + display: flex; } .viewer-container { display: flex; @@ -430,6 +430,10 @@ background: #f0f0f0 url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCA background-repeat: no-repeat; } + + #btnGenerate{ + opacity: 50% + } @@ -668,6 +672,19 @@ background: #f0f0f0 url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCA Progress... prompt shortcut + +
+ + + +
@@ -726,9 +743,12 @@ background: #f0f0f0 url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCA + +
-
+
+
diff --git a/viewer.js b/viewer.js index c063147..63edcf7 100644 --- a/viewer.js +++ b/viewer.js @@ -152,19 +152,33 @@ class ViewerImage { } } + addButtonHtml(){ // Create new container element const container = document.createElement('div'); + + container.className = "viewer-image-container"; + + + const elem = document.getElementById('svg_sp_btn'); + + // Create a copy of it + const clone = elem.cloneNode(true); + const button = clone + button.style.display = null + // Create button element - const button = document.createElement('button'); + // const button = document.createElement('sp-button'); button.className = "viewer-image-button"; - button.innerHTML = "Button"; + // button.innerHTML = "Button"; // Append elements to container container.appendChild(this.img_html); container.appendChild(button); + + this.img_html = container; }