@dpouris/gswap 0.0.12 → 0.0.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,13 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta http-equiv="X-UA-Compatible" content="IE=edge" />
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
+ <script src="./main.js" defer></script>
8
+ <title>Document</title>
9
+ </head>
10
+ <body>
11
+ <div id="gallery"></div>
12
+ </body>
13
+ </html>
package/dist/src/main.js CHANGED
@@ -16,11 +16,11 @@ class GSwap {
16
16
  nav.classList.add("gallery-swap-nav");
17
17
  const navLeft = document.createElement("button");
18
18
  navLeft.onclick = this.prev;
19
- navLeft.innerHTML = "&rarr;";
19
+ navLeft.innerHTML = "&larr;";
20
20
  navLeft.classList.add("gallery-swap-nav-left");
21
21
  const navRight = document.createElement("button");
22
22
  navRight.onclick = this.next;
23
- navRight.innerHTML = "&larr;";
23
+ navRight.innerHTML = "&rarr;";
24
24
  navRight.classList.add("gallery-swap-nav-right");
25
25
  if (this.options.navigation === "forwardOnly") {
26
26
  nav.appendChild(navRight);
@@ -121,9 +121,7 @@ class GSwap {
121
121
  this.containerElem = containerElem;
122
122
  this.images = images;
123
123
  this.options = options;
124
- this.options.imgDimensions = this.options
125
- .imgDimensions.hasOwnProperty("height")
126
- .hasOwnProperty("width")
124
+ this.options.imgDimensions = this.options.imgDimensions
127
125
  ? this.options.imgDimensions
128
126
  : { width: 300, height: 300 };
129
127
  this.options.direction = this.options.direction;
@@ -0,0 +1,14 @@
1
+ export interface GallerySwap {
2
+ container: HTMLDivElement;
3
+ }
4
+ export declare type Options = {
5
+ animation?: string;
6
+ animationDuration?: number;
7
+ navigation?: boolean | "forwardOnly" | "backOnly";
8
+ repeat?: boolean;
9
+ direction?: "left" | "right" | "top" | "bottom";
10
+ imgDimensions?: {
11
+ height: number;
12
+ width: number;
13
+ };
14
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@dpouris/gswap",
3
- "version": "0.0.12",
3
+ "version": "0.0.15",
4
4
  "description": "A library for swapping between images in a gallery",
5
- "main": "dist/index.js",
6
- "types": "dist/index.d.ts",
5
+ "main": "dist/src/index.js",
6
+ "types": "dist/src/index.d.ts",
7
7
  "files": [
8
8
  "README.md",
9
9
  "dist/"
@@ -16,8 +16,5 @@
16
16
  },
17
17
  "keywords": [],
18
18
  "author": "dpouris",
19
- "license": "ISC",
20
- "dependencies": {
21
- "@dpouris/gswap": "^0.0.3"
22
- }
19
+ "license": "ISC"
23
20
  }