Comparing version 1.0.2 to 1.0.3
@@ -1,1 +0,1 @@ | ||
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.Galiria=f()}})(function(){var define,module,exports;return function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s}({1:[function(require,module,exports){module.exports=function Galiria(){"use strict";var instance;function _imageOnClick(e){var figure=e.target.parentNode.cloneNode(true);figure.classList.add("galiria__container__figure");if(instance.figure!=null){instance.figure.parentNode.replaceChild(figure,instance.figure)}else{instance.container.appendChild(figure)}instance.container.classList.add("galiria__container--active");instance.figure=figure}function _containerOnClick(e){if(instance.figure){instance.figure.parentNode.removeChild(instance.figure);instance.figure=null}instance.container.classList.remove("galiria__container--active")}function _createInstance(){var docFrag=document.createDocumentFragment(),container=_createContainerElement(),list=document.querySelector(".galiria");docFrag.appendChild(container);document.body.appendChild(docFrag);return{container:container,list:list}}function _createContainerElement(){var container=document.createElement("div");container.classList.add("galiria__container");container.addEventListener("click",_containerOnClick);return container}function _setImageEvents(){for(var i=instance.list.children.length;i--;)instance.list.children[i].children[0].addEventListener("click",_imageOnClick)}function init(){instance=_createInstance();_setImageEvents()}init()}},{}]},{},[1])(1)}); | ||
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.Galiria=f()}})(function(){var define,module,exports;return function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s}({1:[function(require,module,exports){module.exports=function Galiria(){"use strict";var instance;function _imageOnClick(e){var figure=e.target.parentNode.cloneNode(true);figure.classList.add("galiria__container__figure");if(instance.figure!=null){instance.figure.parentNode.replaceChild(figure,instance.figure)}else{instance.container.appendChild(figure)}instance.container.classList.add("galiria__container--active");instance.figure=figure}function _containerOnClick(e){if(instance.figure){instance.figure.parentNode.removeChild(instance.figure);instance.figure=null}instance.container.classList.remove("galiria__container--active")}function _createInstance(){var docFrag=document.createDocumentFragment(),container=_createContainerElement(),list=document.querySelectorAll(".galiria > figure");docFrag.appendChild(container);document.body.appendChild(docFrag);return{container:container,list:list}}function _createContainerElement(){var container=document.createElement("div");container.classList.add("galiria__container");container.addEventListener("click",_containerOnClick);return container}function _setImageEvents(){for(var i=instance.list.children.length;i--;)instance.list.children[i].children[0].addEventListener("click",_imageOnClick)}function init(){instance=_createInstance();_setImageEvents()}init()}},{}]},{},[1])(1)}); |
{ | ||
"name": "galiria", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "minimal image gallery", | ||
@@ -23,6 +23,3 @@ "main": "index.js", | ||
}, | ||
"homepage": "https://github.com/armand1m/galiria#readme", | ||
"devDependencies": { | ||
"grunt": "^0.4.5" | ||
} | ||
"homepage": "https://github.com/armand1m/galiria#readme" | ||
} |
# Galiria | ||
Galiria is a minimal js and css image gallery. | ||
Galiria will not work on legacy browsers, as its css uses flexbox. | ||
Galiria will not work properly on legacy browsers, as it uses flexbox. | ||
# How to use it | ||
Include the css and js file in your .html file, and create a `<div class="galiria">` and for each image, create a `<figure>` element with its `<img>` tag and `<figcaption>` and you should be on the go. | ||
Get the source using: | ||
`npm install galiria --save` | ||
`bower install galiria --save` | ||
Include the minified .css and .js files in your .html file, and create an instance of Galiria with `new Galiria()`. | ||
Create a `<div class="galiria">`, and for each image, create a `<figure>` element with its `<img>` tag and `<figcaption>` and you should be on the go. | ||
Just like this example: | ||
@@ -14,4 +22,4 @@ ``` | ||
<head> | ||
... | ||
<link rel="stylesheet" href="components/galiria/build/galiria.css"> | ||
<title>Example</title> | ||
<link rel="stylesheet" href="components/galiria/build/galiria.min.css"> | ||
</head> | ||
@@ -18,0 +26,0 @@ <body> |
@@ -58,3 +58,3 @@ module.exports = function Galiria() { | ||
, container = _createContainerElement() | ||
, list = document.querySelector('.galiria'); | ||
, list = document.querySelectorAll('.galiria > figure'); | ||
@@ -61,0 +61,0 @@ docFrag.appendChild(container); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
14932
0
12
336
42
4