Chocolat : the lightbox so cool horses use it :horse:

Overview
Comments
  • * switch out bitmap icons for css inlined vector icons

    * switch out bitmap icons for css inlined vector icons

    First of all, thank you very much for creating and maintaining chocolat!

    I had some problems importing the chocolat css file in my webpack environment. It would try follow the relative path from my entrypoint.

    I had a look at the icons and decided to try and improve the project whilst possibly fixing my issue.

    • swap out per css variable
    • more crisp
    • lower footprint

    I hope this is a fitting improvement, please let me know any thoughts you have on this.

    opened by thomas-franz 9
  • Everything is fine except when there are more images on a page ... !?

    Everything is fine except when there are more images on a page ... !?

    I don't want to use the script as a gallery or slider but like Chocolat to open (and close) one image at a time. It does open (and close) the first image but it doesn't open the second (etc) one. I'm a noob (front-front-developer) and don't know if it a) is possible at all and 2) how to make it happen. Any help is welcome ... :)

    opened by joopvos 8
  • White border just before images load

    White border just before images load

    Hey nicolas, great plugin, thanks :)

    I'm having a tiny issue: a white border, the exact dimensions of the image, shows up briefly before the image is rendered. For what it's worth, I've attached a screenshot.

    Total noob here, so no idea what this is or how to tackle it... If you could show a way around it, would be awesome, cheers!

    screen shot 2016-07-05 at 23 23 19 1

    opened by afonsogonsalves 8
  • Chocolat not working with IE11

    Chocolat not working with IE11

    Hey,

    I've been using Chocolat and enjoying it so far. Recently I encountered an issue with IE11 throwing a syntax error in the chocolat.js: Line 13, Column 35 as shown below:

    Screen Shot 2021-10-15 at 3 25 32 pm

    I believe this is because IE11 does not support direct arrow function (as per ES6). Can you investigate this?

    Cheers

    opened by PhucNguyen1501 7
  • Change size of fullscreen container

    Change size of fullscreen container

    Hi,

    I'm in the need to dynamically create and place the container used by chocolate.

    1. user clicks chocolat__image
    2. container is created based on header and viewport height
    3. chocolat gallery is drawn into the container

    Is there some hook I can use to do something after an image has been clicked?

    As alternative would it work to change the height of the fullWindow container to abstract the height of a navbar?

    opened by t-book 7
  • jQuery 3

    jQuery 3

    Is this supposed to work with jQuery 3? I get no errors and no action :) Looking at the demo, there's "slightly" more going on than just a HTML / JS lightbox, so I'm sure I've done something wrong :)

    opened by joho1968 7
  • Trying to open lightbox upon click

    Trying to open lightbox upon click

    Came across your chocolat and gave it a try.

    I am adding it in Drupal as a plugin and I tried to have a class per thumbnail so it would open lightbox with images (on node page) as similar to your demo. But when tried to click thumbnail, it only shows the full node page, not lightbox.

    Is there something else that I might be overlooking?

    Example: <a href="node/12" class="thumbnail"><img src="/path/to/image.png"/></a>

    jQuery(document).ready(function($){ $('.thumbnail').Chocolat({ container: window, fullWindow: 'contain', fullScreen: false, loop: true, duration: 300, }); });

    opened by josleow 7
  • Not working for dynamically created container

    Not working for dynamically created container

    Hi, how can I use Chocolat on a div that contains dynamically created (jQuery / .html() function) images? After calling the .Chocolat() function on the div with dynamic content and clicking on a link, the page redirects to the image instead of opening it in the Chocolat lightbox. Thanks!

    opened by skizzo 6
  • Did not appear as expected

    Did not appear as expected

    thank you for all this work. Chocolat is fantastic.

    but something wrong on my layout

    image

    after i clicked seems like undefined class

    my javascript

    latest version of npm

    Chocolat(document.querySelectorAll('.chocolat-image'), {
        container: document.querySelector('body'),
        fullscreen: true,
        imageSize: 'contain'
      })
    
    opened by kevariable 5
  • 'Fitting not defined' error

    'Fitting not defined' error

    Running a Mac with Codekit. With minification on and trying to zoom, getting this error:

    Uncaught ReferenceError: fitting is not defined
    zoomIn @ jquery.chocolat.min.js:1(anonymous function) 
    @ jquery.chocolat.min.js:1dispatch 
    @ jquery.js:4737m.handle 
    @ jquery.js:4549
    
    screen shot 2016-08-05 at 1 30 10 pm

    Works fine if I don't minify, but obviously need to minify.

    opened by dlewand691 5
  • About npm version

    About npm version

    Hi, I'm going to host this project on cdnjs. Can you update this project in npm? Because I saw the version of this project in npm is still 0.4.12

    Thank you for your help.

    question 
    opened by x09326 5
  • Safari Image Opening Issue

    Safari Image Opening Issue

    I currently have my images in a gallery. On Safari iOS, when I tap to open an image after previously closing the image viewer, nothing happens. Below is an example.

    1. I tap on an image
    2. It opens
    3. I close the view
    4. I tap on another image
    5. Nothing happens
    6. I tap again
    7. The viewer opens up but the image is zoomed in

    It's not a very big problem but it would by nice if it didn't keep happening.

    opened by Grey41 0
  • Keyboard Accessibility issues

    Keyboard Accessibility issues

    Playing with the demo, Chocolat doesn't appear to be keyboard accessible at all. Is that the case, or is there an issue with the specific demo?

    Try tabbing through the demo – you can't as it just skips over to the next available link in the page.

    opened by djmtype 1
  • Convert three variable assignments to the usage of compound operators

    Convert three variable assignments to the usage of compound operators

    :eyes: Some source code analysis tools can help to find opportunities for improving software components. :thought_balloon: I propose to increase the usage of compound operators accordingly.

    diff --git a/dist/js/chocolat.cjs.js b/dist/js/chocolat.cjs.js
    index a873b22..7958c66 100644
    --- a/dist/js/chocolat.cjs.js
    +++ b/dist/js/chocolat.cjs.js
    @@ -23,7 +23,7 @@ function _classCallCheck(instance, Constructor) {
     function _defineProperties(target, props) {
       for (var i = 0; i < props.length; i++) {
         var descriptor = props[i];
    -    descriptor.enumerable = descriptor.enumerable || false;
    +    descriptor.enumerable ||= false;
         descriptor.configurable = true;
         if ("value" in descriptor) descriptor.writable = true;
         Object.defineProperty(target, descriptor.key, descriptor);
    diff --git a/dist/js/chocolat.esm.js b/dist/js/chocolat.esm.js
    index 997b43c..653887d 100644
    --- a/dist/js/chocolat.esm.js
    +++ b/dist/js/chocolat.esm.js
    @@ -21,7 +21,7 @@ function _classCallCheck(instance, Constructor) {
     function _defineProperties(target, props) {
       for (var i = 0; i < props.length; i++) {
         var descriptor = props[i];
    -    descriptor.enumerable = descriptor.enumerable || false;
    +    descriptor.enumerable ||= false;
         descriptor.configurable = true;
         if ("value" in descriptor) descriptor.writable = true;
         Object.defineProperty(target, descriptor.key, descriptor);
    diff --git a/dist/js/chocolat.js b/dist/js/chocolat.js
    index 474490e..43847f1 100644
    --- a/dist/js/chocolat.js
    +++ b/dist/js/chocolat.js
    @@ -759,7 +759,7 @@
     	function _defineProperties(target, props) {
     	  for (var i = 0; i < props.length; i++) {
     	    var descriptor = props[i];
    -	    descriptor.enumerable = descriptor.enumerable || false;
    +	    descriptor.enumerable ||= false;
     	    descriptor.configurable = true;
     	    if ("value" in descriptor) descriptor.writable = true;
     	    Object.defineProperty(target, descriptor.key, descriptor);
    
    opened by elfring 0
  • Description issue

    Description issue

    Hello, first of all, thank you for all this work. Chocolat is fantastic.

    I have one doubt.

    I am using the chocolat.js for an image gallery. I use it inside a div with the option: container: document.querySelector

    I would like the description of the image to be extracted from the accompanying text instead of the 'title' attribute.

    Ex:

    <div class = "image">
    
    <a class="chocolat-image" href="https://images.pexels.com/photos/4558481/pexels-photo-4558481.jpeg" title="Lore ipsum.">
    <img src = "https://images.pexels.com/photos/4558481/pexels-photo-4558481.jpeg" />
    </a>
    
    <span class = "caption">
    In non ultricies magna, nec vulputate pain. Aenean sollicitudin ex id lectus fermentum, a tempus lacus cursus.
    <span>
    
    </div>
    

    Many thanks.

    opened by AitorRodriguex 2
  • Not an issue.

    Not an issue.

    Found this after looking around for a while and I must say well done!! Well thought out structure with options and API and without jQuery dependency (which is really hard to find). Not too opinionated but still looks good from the get go. Keep up the good work!

    👏 👏 👏 👏

    opened by jonathan-dejong 0
Releases(v1.1.0)
  • v1.1.0(Jul 11, 2022)

  • 1.0.4(Feb 26, 2021)

  • 1.0.3(Jul 18, 2020)

  • 1.0.2(Jun 12, 2020)

  • 1.0.1(Apr 29, 2020)

  • 1.0.0(Apr 8, 2020)

    Yay !! First major release.

    Upgrade guide here : https://chocolat.gitbook.io/chocolat/upgrading-from-v0.4

    Documentation here : https://chocolat.gitbook.io/chocolat

    Source code(tar.gz)
    Source code(zip)
  • 1.0.0-beta.4(Jan 22, 2020)

    Added support for srcset and sizes attributes: https://github.com/nicolas-t/Chocolat/pull/111 (thanks to @dscafati )

    Upgrade guide here : https://chocolat.gitbook.io/chocolat/upgrading-from-v0.4

    Documentation here : https://chocolat.gitbook.io/chocolat

    Source code(tar.gz)
    Source code(zip)
  • 1.0.0-beta.3(Nov 14, 2019)

  • 1.0.0-beta.1(Nov 10, 2019)

    We are getting closer to the jquery-free release. Documentation here : https://chocolat.gitbook.io/chocolat

    Upgrade guide here : https://chocolat.gitbook.io/chocolat/upgrading-from-v0.4

    Source code(tar.gz)
    Source code(zip)
  • 1.0.0-beta.0(Jan 16, 2019)

    Pre-release of Chocolat v1.0.0-beta.0

    What's new

    Dependencies

    Chocolat is not relying on jQuery anymore

    Build

    Modern build generating :

    • iife module is meant to be imported via script tags.
        <script src="dist/js/chocolat.iife.js"></script>
    
    • esm module is meant to be imported via import thank to bundlers like webpack.
    import Chocolat from 'chocolat'
    

    css import stays the same.

    Breaking changes

    Instanciation

    
    // old
    $('#example1').Chocolat({});
    
    // new
    Chocolat(document.querySelectorAll('#example1 .chocolat-image'), {});
    

    imageSelector option has now been removed

    Options

    imageSelector has been removed separator2 has been removed setTitle is a function returning a string (the title of the set) pagination is a function returning a string (the pagination) description is a function returning a string (the description)

    Source code(tar.gz)
    Source code(zip)
  • 0.4.21(Nov 21, 2018)

    Can be imported as a module :

    import $ from 'jquery'
    import Chocolat from 'chocolat'
    
    $.fn.Chocolat = Chocolat 
    

    Also removed coffeescript, and added prettier.

    Source code(tar.gz)
    Source code(zip)
  • 0.4.20(Jul 25, 2018)

  • 0.4.19(Sep 27, 2017)

  • 0.4.18(Mar 28, 2017)

  • 0.4.17(Mar 22, 2017)

  • 0.4.16(Feb 21, 2017)

  • 0.4.15(Dec 22, 2016)

    New hooks : Added a new hooks :

    • afterInitialize called after chocolat is initialized
    • afterImageLoad called each time an image is loaded (see https://github.com/nicolas-t/Chocolat/issues/47)
    
    $('#example').Chocolat({
        afterInitialize : function () {
            // your code here
        },
        afterImageLoad : function () {
            // your code here
        }
    });
    

    Fixed missing var declarations : Missing var declarations made minifying and concatenating failing on some setups. Thanks to @nicolasbinet (see https://github.com/nicolas-t/Chocolat/pull/52) Related issue : https://github.com/nicolas-t/Chocolat/issues/49

    Source code(tar.gz)
    Source code(zip)
  • 0.4.14(Jun 14, 2016)

    afterMarkup: Added a new setting afterMarkup used to manipulate the layout just after it's created. This will move the caption to the top of the image for example

    
    $('#example').Chocolat({
        afterMarkup: function () {
            this.elems.description.appendTo(this.elems.top)
        }
    });
    

    imageSource: Added the setting imageSource. It specifies which attribute contains the image source. So you can use chocolat on other tags like a div tag (doesn't support the href attribute) too. Thanks to @Airfighter76 see https://github.com/nicolas-t/Chocolat/pull/41

    Source code(tar.gz)
    Source code(zip)
  • 0.4.13(Apr 6, 2016)

    Can now disable zoom thanks to @benbyford (see https://github.com/nicolas-t/Chocolat/pull/31) Removed unused css thanks to @ptrckvzn (see https://github.com/nicolas-t/Chocolat/pull/33)

    Source code(tar.gz)
    Source code(zip)
  • 0.4.12(Mar 15, 2016)

  • 0.4.11(Mar 4, 2016)

  • 0.4.10(Sep 15, 2015)

  • 0.4.9(Jul 20, 2015)

  • 0.4.8(Jul 19, 2015)

  • 0.4.7(Jul 15, 2015)

  • 0.4.6(Jul 12, 2015)

  • 0.4.5(Jul 5, 2015)

  • 0.4.4(Apr 16, 2014)

  • 0.4.3(Apr 16, 2014)

Owner
Nicolas Turlais
qsdqsd
Nicolas Turlais
Responsive no-jQuery pure JS/CSS Lightbox for images, no dependencies, 10kb unminified source code, with demo

img-lightbox Responsive no-jQuery pure JS/CSS Lightbox for images, no dependencies, 10kb unminified source code, with demo Demo codepen jsfiddle jsbin

englishextra 12 Jun 13, 2022
A minimal, pure-CSS Lightbox replacement

CSSBox A simple, pure-CSS Lightbox replacement. An example page is available in the gh-pages branch, or online on GitHub Pages. Why CSSBox? Absolutely

Sylvia van Os 48 Nov 21, 2022
Digispark Overmaster : free IDE TOOL allows to create and edit Digispark Scripts by the drag and drop technique,with cool GUI and easy to use it

Digispark_Overmaster Digispark Overmaster : free IDE TOOL allows to create and edit Digispark Scripts by the drag and drop technique,with cool GUI and

Yehia Elborma 5 Nov 14, 2022
The repository contains the list of awesome✨ & cool web development beginner-friendly✌️ projects!

Web-dev-mini-projects The repository contains the list of awesome ✨ & cool web development beginner-friendly ✌️ projects! Web-dev-mini-projects ADD AN

Ayush Parikh 265 Jan 3, 2023
A pretty cool org-mode -> interactive blog post tool

Radish A kinda-cool org-mode -> interactive blog post tool written with and for Clojure(script). Here are two example posts created with this tool: Ra

adam-james 46 Dec 28, 2021
Pretty Cool Elements

Pretty Cool Elements Social Media Photo by Jamison McAndie on Unsplash This module is a follow up of this Medium post, and it provides element mixins/

Andrea Giammarchi 36 Dec 23, 2022
JavaScript/TypeScript library to run repetitive tasks with throttle control and other cool features

Repeatify JavaScript/TypeScript library to run repetitive tasks with throttle control and other cool features Install npm install repeatify Usage impo

Evert Arias 2 Jan 15, 2022
Team Alpha Super Awesome Cool Dynamite Wolf Squadron - 10 - Project 1

Super Hero Wiki This is a group project for our Interactive Front End Web Site. We created a Super Wiki that uses two (2) APIs to provide users a comi

Vicente Garcia Sepulveda 3 Mar 24, 2022
A cool npm package.

aditya.utils Colorful Console const a = require('aditya.utils') a.logblue("TEXT") // Blue Text a.logred("TEXT") // Red Text a.loggreen("TEXT") // Gree

AD!TYA 2 Apr 8, 2022
A cool npm package.

aditya.utils Colorful Console const a = require('aditya.utils') a.logblue("TEXT") // Blue Text a.logred("TEXT") // Red Text a.loggreen("TEXT") // Gree

AD!TYA 2 Apr 8, 2022
A cool tool that saves you time if you want to remove node_modules before running 'npm i'

rmnpm A cool tool that saves you time if you want to remove your node_modules folder before running the npm install command. How does it do it? By fir

null 4 Jul 16, 2022
Tool Cool Color Picker is a color picker library written in typescript and using web component technologies.

Tool Cool Color Picker Tool Cool Color Picker is a color picker library written in typescript and using web component technologies. Check out the demo

Tool Cool 13 Oct 23, 2022
Tool Cool Range Slider

Responsive range slider library written in typescript and using web component technologies. Pure JavaScript without additional dependencies. It has a rich set of settings, including a vertical slider, touch, mousewheel and keyboard support, local and session storage, and RTL support.

Tool Cool 23 Dec 31, 2022
The official pokemon website is not that cool? Here is the alternative 😉

Pokemon Awesome Pokemon Data All Pokemon data used in this project comes from PokeAPI GraphQL Beta. Playground: https://beta.pokeapi.co/graphql/consol

Muhammad Afifudin 128 Dec 23, 2022
🚀 A small JS no-dependency library for a cool download experience

JS File Downloader ?? Please remember to star this github repo if you like it. Thank you! ❤️ Introduction JS File Downloader is a simple no dependency

AleeeKoi 160 Dec 23, 2022
A devtool improve your pakage manager use experience no more care about what package manager is this repo use; one line, try all.

pi A devtool improve your pakage manager use experience no more care about what package manager is this repo use; one line, try all. Stargazers over t

tick 11 Nov 1, 2022
A NestJS module that allows you use Prisma, set up multiple Prisma services, and use multi-tenancy in each Prisma service.

NestJS Prisma Module Installation To use this package, first install it: npm i @sabinthedev/nestjs-prisma Basic Usage In order to use this package, yo

Sabin Adams 39 Dec 2, 2022
A list of helpful front-end related questions you can use to interview potential candidates, test yourself or completely ignore.

Front-end Developer Interview Questions This repository contains a number of front-end interview questions that can be used when vetting potential can

H5BP 56.1k Jan 4, 2023
An interactive git visualization and tutorial. Aspiring students of git can use this app to educate and challenge themselves towards mastery of git!

LearnGitBranching LearnGitBranching is a git repository visualizer, sandbox, and a series of educational tutorials and challenges. Its primary purpose

Peter Cottle 26.4k Jan 3, 2023