Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
KostasSliazas authored Jan 15, 2025
1 parent 6227995 commit 829d61a
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 69 deletions.
56 changes: 28 additions & 28 deletions src/k7.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,14 @@
this.isAutoPlayOn = true;

// Set the play button active for the first time (playing)
if (this.showButtons) this.play.className = 'but bra brb opa tpo lft atc';
if (this.showButtons) this.play.className = 'b a s o y l q';

if (!this.showButtonsOnPlay) {
// Hide buttons if configured not to show during auto-play
if (this.showButtons) {
this.foot.className = this.onow.className = 'dpn';
this.foot.className = this.onow.className = 'n';
}
this.left.className = this.rigt.className = this.clos.className = 'dpn';
this.left.className = this.rigt.className = this.clos.className = 'n';
}
}
if (this.isAutoPlayOn) {
Expand Down Expand Up @@ -128,28 +128,28 @@
}
this.isAutoPlayOn = false;
//same classes names
const classNames = 'but bra brb opa';
const classNames = 'b a s o';
// if show buttons compiled display them
if (this.showButtons) {
this.foot.className = this.onow.className = '';
this.play.className = classNames + ' tpo lft';
this.play.className = classNames + ' y l';
}
// always show close button on clear
this.clos.className = classNames + ' rtm rtp';
this.clos.className = classNames + ' j p';
this.leftRightButtonsVisibility();
}

leftRightButtonsVisibility() {
// Adjust visibility of left and right buttons based on the current image index
this.left.className = this.indexOfImage === 0 ? 'dpn' : 'but tpo hvr lft';
this.rigt.className = this.indexOfImage === this.imagesArray.length - 1 ? 'dpn' : 'but tpo hvr rgt';
this.left.className = this.indexOfImage === 0 ? 'n' : 'b y l';
this.rigt.className = this.indexOfImage === this.imagesArray.length - 1 ? 'n' : 'b y r';
}

// Close the image viewer
close() {
this.isActive = false;
this.imag.className = 'sca hdi w10 tpo lft';
de.className = de.className.split('fff').join('').trim();
this.imag.className = 'g h w y l';
de.className = de.className.split('f').join('').trim();
}

// Show the current image
Expand All @@ -166,15 +166,15 @@
// Activate the UI if not active
if (!this.isActive) {
this.isActive = true;
de.className = de.className ? de.className + ' fff' : 'fff';
this.imag.className = 'fff w10 tpo lft';
de.className = de.className ? de.className + ' f' : 'f';
this.imag.className = 'f w y l';
}

// Prevent reloading if the current image matches the source
if (this.imgs.src === fullNamePrefixed || this.imgs.src === imageSource) return;

// Update UI state and trigger image loading
this.spin.className = 'bor';
this.spin.className = 'u';

// Remove old image and append the new one
this.insi.removeChild(this.imgs);
Expand All @@ -186,7 +186,7 @@

this.imgs.onload = e => {
// Hide the spinner
this.spin.className = 'dpn';
this.spin.className = 'n';
if (this.isAutoPlayOn) {
this.autoPlayLoop();
}
Expand Down Expand Up @@ -266,28 +266,28 @@

init() {
// Add inline CSS using base64 string dinamicaly (increases file size)
const resource = element('link', 'rel', 'stylesheet', 'href', 'data:text/css;base64,QGtleWZyYW1lcyBye3Rve3RyYW5zZm9ybTpyb3RhdGUoMzYwZGVnKX19I2s3ICosI2s3IDo6YWZ0ZXIsI2s3IDo6YmVmb3Jle2JveC1zaXppbmc6Ym9yZGVyLWJveDtkaXNwbGF5OmlubGluZS1ibG9jaztmb250OjEycHgvNCBzYW5zLXNlcmlmO3Bvc2l0aW9uOmFic29sdXRlfSNrNyAuYnV0ICp7ei1pbmRleDotMTtwb2ludGVyLWV2ZW50czpub25lfSNrN3tiYWNrZ3JvdW5kOnZhcigtLWNvbG9yMiwgIzIyMyk7Y29sb3I6I2FhYTtwb3NpdGlvbjpmaXhlZDt0ZXh0LWFsaWduOmNlbnRlcjt0cmFuc2l0aW9uOnRyYW5zZm9ybSAuMnM7dXNlci1zZWxlY3Q6bm9uZTt6LWluZGV4Ojk5OTk5OX0jazcgI2lucyBpbWd7YmFja2dyb3VuZDp2YXIoLS1jb2xvcjEsICMzMzQpO21heC1oZWlnaHQ6MTAwJTttYXgtd2lkdGg6MTAwJX0jazcgI2ZsbiwjazcgI3BsYXt0ZXh0LWluZGVudDo1MHB4O3doaXRlLXNwYWNlOm5vd3JhcDtib3R0b206MjRweDtoZWlnaHQ6NDhweH0jazcgI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tOnNjYWxlKDApfUBtZWRpYSAobWluLXdpZHRoOjEwMjRweCl7I2s3Om5vdCg6aG92ZXIpICNjbnR+ZGl2LCNrNzpub3QoOmhvdmVyKSAjaW5zfi5ie29wYWNpdHk6MH19');
append(d.getElementsByTagName('head')[0], resource);

// DOM elements setup
/** @type {HTMLElement} */
this.clos = element('button', 'id', 'cls', 'class', 'bra rtp opa but rtm brb', 'aria-label', 'Close', 'title', 'Close (Esc)');
this.clos = element('button', 'id', 'cls', 'class', 'a p o b j s', 'aria-label', 'Close', 'title', 'Close (Esc)');
/** @type {HTMLElement} */
this.ilef = element('span', 'id', 'lft', 'class', 'bra rtm opa trn but');
this.ilef = element('span', 'id', 'lft', 'class', 'a j o t b');
/** @type {HTMLElement} */
this.irig = element('span', 'id', 'rgt', 'class', 'bra rtp opa but trn');
this.irig = element('span', 'id', 'rgt', 'class', 'a p o b t');
/** @type {HTMLElement} */
this.imag = element('div', 'id', 'k7', 'class', 'sca hdi fff w10 tpo lft', 'role', 'dialog', 'aria-label', 'Image Gallery');
this.imag = element('div', 'id', 'k7', 'class', 'g h f w y l', 'role', 'dialog', 'aria-label', 'Image Gallery');
/** @type {HTMLElement} */
this.cent = element('div', 'id', 'cnt', 'class', 'tpo lft w10');
this.cent = element('div', 'id', 'cnt', 'class', 'y l w');
/** @type {HTMLElement} */
this.left = element('button', 'id', 'blt', 'class', 'but tpo lft', 'aria-label', 'Previous (Left Arrow)');
this.left = element('button', 'id', 'blt', 'class', 'b y l', 'aria-label', 'Previous (Left Arrow)');
/** @type {HTMLElement} */
this.rigt = element('button', 'id', 'btr', 'class', 'but tpo rgt', 'aria-label', 'Next (Right Arrow)');
this.rigt = element('button', 'id', 'btr', 'class', 'b y r', 'aria-label', 'Next (Right Arrow)');
/** @type {HTMLElement} */
this.insi = element('div', 'id', 'ins', 'class', 'w10');
this.insi = element('div', 'id', 'ins', 'class', 'w');
/** @type {HTMLElement} */
this.spin = element('div', 'id', 'spn', 'class', 'dpn', 'aria-hidden', 'true');
this.spin = element('div', 'id', 'spn', 'class', 'n', 'aria-hidden', 'true');
/** @type {HTMLElement} */
this.imgs = element('img', 'src', 'data:image/gif;base64,R0lGODlhAQABAPAAAP///wAAACwAAAAAAQABAEACAkQBADs=', 'alt', '', 'loading', 'lazy');

Expand All @@ -300,19 +300,19 @@

if (this.showButtons) {
/** @type {HTMLElement} */
this.wdow = element('button', 'id', 'dlf', 'class', 'tpo rgt bra rtm opa but', 'aria-label', 'download');
this.wdow = element('button', 'id', 'dlf', 'class', 'y r a j o b', 'aria-label', 'download');
/** @type {HTMLElement} */
this.play = element('button', 'id', 'pli', 'class', 'tpo lft bra brb opa but', 'aria-label', 'play');
this.play = element('button', 'id', 'pli', 'class', 'y l a s o b', 'aria-label', 'play');
/** @type {HTMLElement} */
this.foot = element('div', 'id', 'pla');
/** @type {HTMLElement} */
this.onow = element('div', 'id', 'fln');
/** @type {HTMLElement} */
this.alts = element('span', 'id', 'alt', 'class', 'fff');
this.alts = element('span', 'id', 'alt', 'class', 'f');
/** @type {HTMLElement} */
this.fine = element('span', 'id', 'sta');
/** @type {HTMLElement} */
this.down = element('span', 'id', 'dwl', 'class', 'bor');
this.down = element('span', 'id', 'dwl', 'class', 'u');

append(this.onow, this.alts, this.wdow);
append(this.imag, this.onow, this.foot);
Expand Down
Loading

0 comments on commit 829d61a

Please sign in to comment.