Przeglądaj źródła

Update scripts

customisations
alemart 10 miesięcy temu
rodzic
commit
a293858a40
2 zmienionych plików z 10 dodań i 14 usunięć
  1. 8
    12
      dist/encantar.js
  2. 2
    2
      dist/encantar.min.js

+ 8
- 12
dist/encantar.js Wyświetl plik

5
  * https://github.com/alemart/encantar-js
5
  * https://github.com/alemart/encantar-js
6
  *
6
  *
7
  * @license LGPL-3.0-or-later
7
  * @license LGPL-3.0-or-later
8
- * Date: 2024-10-20T05:43:39.143Z
8
+ * Date: 2024-10-20T06:24:13.488Z
9
  */
9
  */
10
 (function webpackUniversalModuleDefinition(root, factory) {
10
 (function webpackUniversalModuleDefinition(root, factory) {
11
 	if(typeof exports === 'object' && typeof module === 'object')
11
 	if(typeof exports === 'object' && typeof module === 'object')
25415
      */
25415
      */
25416
     _createButton() {
25416
     _createButton() {
25417
         const button = document.createElement('button');
25417
         const button = document.createElement('button');
25418
-        const icon = document.createElement('img');
25419
         button.style.position = 'absolute';
25418
         button.style.position = 'absolute';
25420
         button.style.bottom = BUTTON_MARGIN + 'px';
25419
         button.style.bottom = BUTTON_MARGIN + 'px';
25421
         button.style.right = BUTTON_MARGIN + 'px';
25420
         button.style.right = BUTTON_MARGIN + 'px';
25425
         button.style.alignItems = 'center';
25424
         button.style.alignItems = 'center';
25426
         button.style.padding = '2px';
25425
         button.style.padding = '2px';
25427
         button.style.opacity = '0.5';
25426
         button.style.opacity = '0.5';
25428
-        button.style.outline = 'none';
25429
         button.style.cursor = 'pointer';
25427
         button.style.cursor = 'pointer';
25428
+        button.style.outline = 'none';
25429
+        button.style['-webkit-tap-highlight-color'] = 'transparent';
25430
         button.draggable = false;
25430
         button.draggable = false;
25431
         button.style.backgroundColor = 'transparent';
25431
         button.style.backgroundColor = 'transparent';
25432
+        button.style.backgroundImage = 'url(' + BUTTON_ICON_OFF + ')';
25433
+        button.style.backgroundSize = 'cover';
25434
+        button.style.imageRendering = 'pixelated';
25432
         button.style.borderColor = 'white';
25435
         button.style.borderColor = 'white';
25433
         button.style.borderStyle = 'solid';
25436
         button.style.borderStyle = 'solid';
25434
         button.style.borderWidth = '2px';
25437
         button.style.borderWidth = '2px';
25435
         button.style.borderRadius = '8px';
25438
         button.style.borderRadius = '8px';
25436
-        icon.src = BUTTON_ICON_OFF;
25437
-        icon.draggable = false;
25438
-        icon.style.display = 'inline-block';
25439
-        icon.style.width = '100%';
25440
-        icon.style.height = '100%';
25441
-        icon.style.imageRendering = 'pixelated';
25442
-        button.appendChild(icon);
25443
         const highlight = () => {
25439
         const highlight = () => {
25444
             button.style.backgroundColor = '#ffd500';
25440
             button.style.backgroundColor = '#ffd500';
25445
             button.style.borderColor = '#ffd500';
25441
             button.style.borderColor = '#ffd500';
25469
      * Handle a fullscreenchange event
25465
      * Handle a fullscreenchange event
25470
      */
25466
      */
25471
     _handleFullscreenEvent(event) {
25467
     _handleFullscreenEvent(event) {
25472
-        const icon = this._button.querySelector('img');
25473
-        icon.src = this._viewport.fullscreen ? BUTTON_ICON_ON : BUTTON_ICON_OFF;
25468
+        const img = this._viewport.fullscreen ? BUTTON_ICON_ON : BUTTON_ICON_OFF;
25469
+        this._button.style.backgroundImage = 'url(' + img + ')';
25474
     }
25470
     }
25475
 }
25471
 }
25476
 
25472
 

+ 2
- 2
dist/encantar.min.js
Plik diff jest za duży
Wyświetl plik


Ładowanie…
Anuluj
Zapisz