zoomwall.js
Advanced tools
Comparing version 1.1.0 to 1.1.4
@@ -6,2 +6,6 @@ { | ||
"extends": "eslint:recommended", | ||
"parserOptions": { | ||
"ecmaVersion": 6, | ||
"sourceType": "module" | ||
}, | ||
"rules": { | ||
@@ -8,0 +12,0 @@ "indent": [ |
{ | ||
"name": "zoomwall.js", | ||
"version": "1.1.0", | ||
"version": "1.1.4", | ||
"description": "A content-focused photo gallery using a horizontal masonry layout that scales up in lightbox mode.", | ||
"main": "zoomwall.js", | ||
"scripts": { | ||
"lint": "eslint zoomwall.js", | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
@@ -25,4 +26,4 @@ }, | ||
"devDependencies": { | ||
"eslint": "^3.5.0" | ||
"eslint": "^7.3.1" | ||
} | ||
} |
@@ -7,7 +7,9 @@ zoomwall.js | ||
![Node.js CI](https://github.com/ericleong/zoomwall.js/workflows/Node.js%20CI/badge.svg?branch=master) | ||
install | ||
------- | ||
For those using [bower](http://bower.io/) | ||
For those using [npm](https://www.npmjs.com/) | ||
```bash | ||
$ bower install zoomwall | ||
$ npm install zoomwall.js | ||
``` | ||
@@ -14,0 +16,0 @@ |
@@ -27,5 +27,5 @@ /* | ||
var zoomwall = { | ||
export var zoomwall = { | ||
create: function(blocks, enableKeys) { | ||
create: function (blocks, enableKeys) { | ||
zoomwall.resize(blocks.children); | ||
@@ -35,3 +35,3 @@ | ||
// shrink blocks if an empty space is clicked | ||
blocks.addEventListener('click', function() { | ||
blocks.addEventListener('click', function () { | ||
if (this.children && this.children.length > 0) { | ||
@@ -52,5 +52,5 @@ zoomwall.shrink(this.children[0]); | ||
}, | ||
keys: function(blocks) { | ||
var keyPager = function(e) { | ||
keys: function (blocks) { | ||
var keyPager = function (e) { | ||
if (e.defaultPrevented) { | ||
@@ -89,7 +89,7 @@ return; | ||
document.addEventListener('keydown', keyPager); | ||
return keyPager; | ||
}, | ||
resizeRow: function(row, width) { | ||
resizeRow: function (row, width) { | ||
if (row && row.length > 1) { | ||
@@ -103,3 +103,3 @@ for (var i in row) { | ||
calcRowWidth: function(row) { | ||
calcRowWidth: function (row) { | ||
var width = 0; | ||
@@ -114,3 +114,3 @@ | ||
resize: function(blocks) { | ||
resize: function (blocks) { | ||
var row = []; | ||
@@ -125,3 +125,3 @@ var top = -1; | ||
top = block.offsetTop; | ||
} else if (block.offsetTop != top) { | ||
@@ -141,3 +141,3 @@ zoomwall.resizeRow(row, zoomwall.calcRowWidth(row)); | ||
reset: function(block) { | ||
reset: function (block) { | ||
block.style.transform = 'translate(0, 0) scale(1)'; | ||
@@ -148,3 +148,3 @@ block.style.webkitTransform = 'translate(0, 0) scale(1)'; | ||
shrink: function(block) { | ||
shrink: function (block) { | ||
block.parentNode.classList.remove('lightbox'); | ||
@@ -173,3 +173,3 @@ | ||
expand: function(block) { | ||
expand: function (block) { | ||
@@ -209,3 +209,3 @@ block.classList.add('active'); | ||
} | ||
// determine what blocks are on this row | ||
@@ -252,3 +252,3 @@ var row = []; | ||
var leftOffsetX = 0; // shift in current row | ||
for (var i = 0; i < row.length && row[i] != block; i++) { | ||
@@ -274,3 +274,3 @@ leftOffsetX += parseInt(window.getComputedStyle(row[i]).width, 10) * scale; | ||
var prevWidth = 0; | ||
for (var k = 0; k < row.length; k++) { | ||
@@ -361,3 +361,3 @@ itemOffset += (prevWidth * scale - prevWidth); | ||
animate: function(e) { | ||
animate: function (e) { | ||
if (this.classList.contains('active')) { | ||
@@ -378,3 +378,3 @@ zoomwall.shrink(this); | ||
page: function(blocks, isNext) { | ||
page: function (blocks, isNext) { | ||
var actives = blocks.getElementsByClassName('active'); | ||
@@ -381,0 +381,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
19505
9
360
55