Skip to content

Commit bb163f8

Browse files
committed
feat: text to describe what the open icon is for
1 parent a77e1d5 commit bb163f8

File tree

3 files changed

+49
-21
lines changed

3 files changed

+49
-21
lines changed

index.html

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -351,15 +351,18 @@ <h2>
351351
</video>
352352
</section>
353353
<section id="generator">
354-
<div class="open-sidebar">
355-
<iconify-icon
356-
inline
357-
icon="lucide:sidebar-open"
358-
style="color: white; cursor: pointer"
359-
width="28"
360-
height="28"
361-
></iconify-icon>
362-
<span class="tooltip">Open</span>
354+
<div class="open">
355+
<p>Open Previous Results➡️</p>
356+
<div class="open-sidebar">
357+
<iconify-icon
358+
inline
359+
icon="lucide:sidebar-open"
360+
style="color: white; cursor: pointer"
361+
width="28"
362+
height="28"
363+
></iconify-icon>
364+
<span class="tooltip">Open</span>
365+
</div>
363366
</div>
364367
<div class="generators">
365368
<!-- Pic Text -->

src/main.ts

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ const FINAL_WIDTH = 300;
5151
let attributeValue: string | null = null;
5252
let imageSRC: string;
5353
let imageHeight: number;
54+
5455
const sideBarSlide = [
5556
{left: '30%', opacity: '0'},
5657
{left: '0%', opacity: '1'},
@@ -90,6 +91,9 @@ const getResultsButton = document.querySelectorAll('[data-button]');
9091
const getResultIcon = document.querySelector('.open-sidebar');
9192
const getHomePage = document.getElementById('home-page');
9293
const getGeneratorSection = document.getElementById('generator');
94+
const getOpenPreviousResult = document.querySelector(
95+
'.open > p'
96+
) as HTMLElement;
9397
const results = document.querySelectorAll('[data-result]');
9498
const closeBar = document.getElementById('close-side-bar');
9599
const getImageEntryElement = document.getElementById(
@@ -295,6 +299,14 @@ function openOrCloseNavigationBar(state: 'open' | 'close') {
295299
}
296300
}
297301

302+
function showOpenPreviousResultText() {
303+
getOpenPreviousResult.style.display = 'block';
304+
getOpenPreviousResult.style.animationName = 'showOpenPreviousResultText';
305+
getOpenPreviousResult.style.animationDuration = '1500ms';
306+
getOpenPreviousResult.style.animationTimingFunction = 'ease-in';
307+
getOpenPreviousResult.style.animationFillMode = 'backwards';
308+
}
309+
298310
document.addEventListener('click', (e: Event) => {
299311
const event = e.target as HTMLElement;
300312

@@ -351,12 +363,17 @@ closeBar?.addEventListener('click', () => {
351363
setTimeout(() => {
352364
sidebar.style.display = 'none';
353365
}, 600);
366+
367+
setTimeout(() => {
368+
showOpenPreviousResultText();
369+
}, 200);
354370
});
355371

356372
generators.forEach((generator) => {
357373
generator?.addEventListener('click', (): void => {
358374
const checking = generator.getAttribute('data-gen');
359375
openSidePanelButton.style.display = 'none';
376+
360377
if (
361378
checking === null ||
362379
getHomePage === null ||
@@ -377,7 +394,7 @@ generators.forEach((generator) => {
377394

378395
getResultsButton.forEach((getResult) => {
379396
getResult?.addEventListener('click', () => {
380-
openSidePanelButton.style.display = 'block';
397+
openSidePanelButton.style.display = 'flex';
381398

382399
showResult(getResult.getAttribute('data-button'), 'newResults');
383400
sidebar.animate(sideBarSlide, sideBarTiming);

src/style.css

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
--gradient-border-color-1: red;
99
--gradient-border-color-2: blue;
1010

11-
/* Heights */
12-
1311
/* Widths */
1412
--generator-width: clamp(300px, 80%, 50vw);
1513
--content-container: 100%;
@@ -237,14 +235,21 @@ main > section:first-of-type video {
237235

238236
main > section:last-of-type {
239237
display: none;
238+
position: relative;
240239
}
241240

242-
.open-sidebar {
241+
.open {
242+
display: flex;
243+
align-items: center;
243244
position: absolute;
244-
top: 20px;
245+
top: 10px;
245246
right: 50px;
246247
}
247248

249+
.open p {
250+
opacity: 0;
251+
}
252+
248253
.generators {
249254
min-height: var(--content-container);
250255
min-width: var(--content-container);
@@ -651,7 +656,7 @@ input[type='number']::-webkit-outer-spin-button {
651656

652657
.open-sidebar > span.tooltip {
653658
position: relative;
654-
bottom: -20px;
659+
bottom: -35px;
655660
right: 40px;
656661
padding: 5px;
657662
width: 50px;
@@ -664,12 +669,6 @@ input[type='number']::-webkit-outer-spin-button {
664669
border-radius: 5px;
665670
display: none;
666671
}
667-
668-
.open-sidebar > span.tooltip {
669-
top: 5%;
670-
left: -10px;
671-
}
672-
673672
.close-sideBar .tooltip::before {
674673
content: '';
675674
position: absolute;
@@ -997,6 +996,15 @@ a {
997996
z-index: 10;
998997
}
999998

999+
@keyframes showOpenPreviousResultText {
1000+
from {
1001+
opacity: 0;
1002+
}
1003+
to {
1004+
opacity: 1;
1005+
}
1006+
}
1007+
10001008
@media screen and (max-width: 1010px) {
10011009
:root {
10021010
--input-width: 100%;

0 commit comments

Comments
 (0)