Code Monkey home page Code Monkey logo

nuxt-gallery's Introduction

npm npm bundle size npm Lint Library Workflow Status Lint Demo Workflow Status GitHub CodeQL Workflow Status GitHub Demo Deploy Workflow Status GitHub GitHub last commit Maintenance

Nuxt Gallery

A gallery library for nuxt with a modern design and automatic image optimisation.

How it works:

On compile time the images of the gallery get automatically resized and reencoded.

It encodes the images in webp, the modern image standard for the web, and jpg, so everything works on old browsers too. It also creates multiple resolution of the image (in both webp and jpg).

When the client loads the gallery the browser decides wich image resolution best fits.
Brosers decide this by factors like: Screen Resolution, Network Speed, Baterry Level, Data Saving Mode, Data Caps ...

Because of these optimisations the images will look great on PCs, Tablets and Phones regardless of the resolution.

When a image gets clicked the full resolution version gets loaded and displayed as big as possible (depends on the screen size).

If you have to include the author of the image, because of the license you can do that with the data-source parameter.
It will show the author on the bottom of the screen when the user clicks on the image.

Installation:

Run:

npm install nuxt-gallery

And integrate this into your nuxt.config.js:

buildModules: [
  '@aceforth/nuxt-optimized-images'
],

Usage:

<script>
  import Gallery from 'nuxt-gallery/src/Gallery.vue'
  import GalleryImage from 'nuxt-gallery/src/GalleryImage.vue'
  
  export default {
    components: {
      Gallery,
      GalleryImage
    }
  }
</script>
<template>
  <gallery>
    <galleryImage src="demo_1.jpg" alt="Forest" data-source="Made by: ___" />
    <galleryImage src="demo_2.jpg" alt="Flowers" />
  </gallery>
</template>

Screenshots:

nuxt-gallery's People

Contributors

dependabot-preview[bot] avatar dependabot[bot] avatar jonathantreffler avatar kant avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

kant

nuxt-gallery's Issues

Fix position issue of fullscreen preview

Currently, if any parent of the gallery uses transform: translate(...) the position of the fullscreen preview gets messed up, due to an css limitation with position: fixed.

[Security] Workflow publish-library.yml is using vulnerable action actions/checkout

The workflow publish-library.yml is referencing action actions/checkout using references v1. However this reference is missing the commit a6747255bd19d7a757dbdda8c654a9f84db19839 which may contain fix to the some vulnerability.
The vulnerability fix that is missing by actions version could be related to:
(1) CVE fix
(2) upgrade of vulnerable dependency
(3) fix to secret leak and others.
Please consider to update the reference to the action.

Minimize DOM operations

This library was originally developed for plain javascript and evolved into a nuxt library.
There's still some old stuff, that is not implemented like in a typical vue component.

require is not defined

The problem arises from this:

"data-jpg-src": require('~/assets/' + $props.src),
"data-webp-src": require('~/assets/' + $props.src + '?webp')

I'm guessing that's because I'm using Nuxt 3 which uses Vite instead. ๐Ÿค”

Set image sources by array

Currently Image sources are set by child elements in the gallery slot.
That causes a lot of DOM operations and is generally not a good strategy in vue.

related to #24

Add more zoom animations

Currently there's only one animation for the zoomed image/detail view and it can't be changed / disabled.
That could use some improvements.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.