Socket
Socket
Sign inDemoInstall

1gallery

Package Overview
Dependencies
0
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    1gallery

a modern SEO friendly ejs web banner gallery for any kind of slides (photos, html...)


Version published
Weekly downloads
22
increased by144.44%
Maintainers
1
Install size
40.7 kB
Created
Weekly downloads
 

Readme

Source

1gallery

Online Demo

Usage :

For examples, see demo source code.

Require node.js.

In your project root, in cli :

npm install --save-dev 1gallery ejs

In your ejs parsed files when you want insert a 1gallery :

<%
const galleryOptions = 'banner zoomable autoplay-5s'
const exampleCards = [];
exampleCards.push(`<section class="card cover"><h1><center>A full size card/slide</center></h1></section>`);
exampleCards.push(`<img class="card" src="img/1forma-tic-fond-ecran.png"/>`);
%>
<%- include('../PATH_TO/node_modules/1gallery/1gallery.ejs',{cards:exampleCards,classes:galleryOptions}); %>

<link rel="stylesheet" href="../PATH_TO/node_modules/1gallery/1gallery.css"/>
<script src="../PATH_TO/node_modules/1gallery/1gallery.js"></script>

You can use css class to customize 1gallery behavior on gallery scope or card scope.

  • zoomable : add fullscreen mode and related icon.

  • autoplay-[1-999]s : automatically go to next slide every [0-999] seconds

  • banner : banner style gallery (height : 150px)

  • splash : splash style gallery (height : 100vh)

PS : you can use css to override any default 1gallery css.

Card class :

  • card : required to let the gallery engine detect each card/slide
  • auto : default resize the card to match screen ratio.
  • cover : extend the card to the gallery size like css object-fit: cover;
  • ratio-[1-9999]-[1-9999] : force card ratio to [1-9999]/[1-9999]. Usefull for photo.

PS : you can use ratio and cover on the same card for some strange html slide use-case.

Keywords

FAQs

Last updated on 15 Jan 2021

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc