Skip to content

Commit 7bf0f94

Browse files
authored
Add watermark icon to interactive editor (#279)
* Add watermark icon to interactive editor * Move to top and add pulse animation
1 parent bd07279 commit 7bf0f94

2 files changed

Lines changed: 26 additions & 0 deletions

File tree

ggsql-wasm/demo/src/quarto/main.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,13 @@ async function applyEditors(
213213

214214
const editorContainer = document.createElement("div");
215215
editorContainer.className = "ggsql-editor-container";
216+
const watermark = document.createElement("img");
217+
watermark.className = "ggsql-editor-watermark";
218+
watermark.src = SITE_ROOT + "assets/icon.svg";
219+
watermark.alt = "";
220+
watermark.setAttribute("aria-hidden", "true");
221+
editorContainer.appendChild(watermark);
222+
216223
wrapper.appendChild(editorContainer);
217224

218225
const errorDisplay = document.createElement("div");

ggsql-wasm/demo/src/quarto/styles.css

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,28 @@
1414
}
1515

1616
.ggsql-editor-container {
17+
position: relative;
1718
width: 100%;
1819
}
1920

21+
.ggsql-editor-watermark {
22+
position: absolute;
23+
top: 4px;
24+
right: 4px;
25+
width: 32px;
26+
height: 32px;
27+
opacity: 0.5;
28+
filter: grayscale(1);
29+
pointer-events: none;
30+
z-index: 10;
31+
animation: ggsql-pulse 5s linear infinite;
32+
}
33+
34+
@keyframes ggsql-pulse {
35+
0%, 100% { transform: scale(0.95); }
36+
50% { transform: scale(1.1); }
37+
}
38+
2039
.ggsql-error-display {
2140
padding: 6px 10px;
2241
font-size: 12px;

0 commit comments

Comments
 (0)