All Projects → nkoehring → v-lazy-img

nkoehring / v-lazy-img

Licence: other
simplistic vue.js directive for image lazy loading

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to v-lazy-img

Vuebar
(🗃️ Archived) Vue 2 directive for custom scrollbar that uses native scroll behavior. Lightweight, performant, customizable and without dependencies. Used successfully in production on https://ggather.com
Stars: ✭ 650 (+2500%)
Mutual labels:  vuejs2, vue-directive
Draggable Vue Directive
Vue2 directive that handles drag & drop
Stars: ✭ 286 (+1044%)
Mutual labels:  vuejs2, vue-directive
Vue Awesome Swiper
🏆 Swiper component for @vuejs
Stars: ✭ 12,072 (+48188%)
Mutual labels:  vuejs2, vue-directive
Vue.resize
Vue directive to detect resize events with deboucing and throttling capacity.
Stars: ✭ 318 (+1172%)
Mutual labels:  vuejs2, vue-directive
Vue Quill Editor
🍡@quilljs editor component for @vuejs
Stars: ✭ 6,874 (+27396%)
Mutual labels:  vuejs2, vue-directive
Navscroll Js
Lightweight package for highlighting menu items as you scroll the page, also scrolling to target section when item clicked. Use as a vue component/directive or in vanilla js.
Stars: ✭ 41 (+64%)
Mutual labels:  vuejs2, vue-directive
Vue Codemirror
⌨️ @codemirror component for @vuejs
Stars: ✭ 2,115 (+8360%)
Mutual labels:  vuejs2, vue-directive
vue-append
vue-append, like v-html directive, but it can call javascript function.
Stars: ✭ 37 (+48%)
Mutual labels:  vue-directive
remote-pad-gui
Desktop app to start remote pad services to help you get started
Stars: ✭ 17 (-32%)
Mutual labels:  vuejs2
vue-drag-zone
Drag Zone component for @vuejs
Stars: ✭ 127 (+408%)
Mutual labels:  vue-directive
vue-img-orientation-changer
A vue plugin that can help you display image in correct orientation.
Stars: ✭ 38 (+52%)
Mutual labels:  vue-directive
image-loader
Image loading library for Android
Stars: ✭ 19 (-24%)
Mutual labels:  image-loader
vue2-codemirror-lite-js
🎩 Lightweight CodeMirror component for Vue.js 2.x (JS only with linting via JSHINT)
Stars: ✭ 16 (-36%)
Mutual labels:  vuejs2
AppIconLoader
Android app icon loader from AOSP iconloaderlib
Stars: ✭ 112 (+348%)
Mutual labels:  image-loader
vue-startup
A template with webpack 4 + vuejs 2 + + babel 7 setup for projects startup
Stars: ✭ 44 (+76%)
Mutual labels:  vuejs2
shadow
Shadow dom support for Vue
Stars: ✭ 46 (+84%)
Mutual labels:  vue-directive
basic-transport-info-app
A progressive web app to show direct & indirect buses / transport between two places / cities / stops .Show next schedule & travel duration. Algorithm to calculate indirect buses on basis of their schedule time. Voice search . Locate nearest city/stop by gps. Bus timetable.
Stars: ✭ 12 (-52%)
Mutual labels:  vuejs2
jooger.me
👍 My personal website,powered by @nuxt
Stars: ✭ 39 (+56%)
Mutual labels:  vuejs2
vue-filter-date-format
Simple date formatting filter for Vue.js
Stars: ✭ 111 (+344%)
Mutual labels:  vuejs2
RumahSakitJakarta
🏥 Daftar Rumah Sakit Umum, Khusus dan Puskesmas di Jakarta
Stars: ✭ 23 (-8%)
Mutual labels:  vuejs2

Vue Progressive Image

Lazy load images while showing a preview. Super tiny, less than half a kilobyte minified and gzipped.

usage

v-lazy-img adds the directives v-lazy-load and v-lazy-load-bg. The latter changes the background image (css background-image) instead of the src-attribute.

Usage example

<template>
  <img class="lazy-loaded" v-lazy-load='fullimage' src='./assets/previewimage.jpg' />
  <div class="lazy-loaded" v-lazy-load-bg='fullbackground' src='./assets/previewbackground.jpg' />
</template>

<script>
import fullimage from './assets/fullimage.png'
import fullbackground from './assets/fullbackground.png'

export default {
  data () {
    return { fullimage, fullbackground }
  }
}
</script>

<style>
.lazy-loaded {
  /* setting a fixed width is recommended */
  width: 100%;
  /* nice effect as an example */
  transition: opacity .5s ease-in;
  opacity: .5;
}

/* applied as soon as loading starts */
.lazy-loaded.lazy-load-progress {
  filter: blur(5px);
}

/* applied as soon as loading succeeds */
.lazy-loaded.lazy-load-success {
  opacity: 1;
}

/* applied if loading fails */
.lazy-loaded.lazy-load-error {
  filter: blur(3px) sepia(1);
  outline: 4px solid red;
}

</style>

current state

v-lazy-img started as a proof of concept but is simple enough to be usable already. If you are using it in your project, I'm looking forward to hear about your experiences!

todo

Additional features could include

similar projects (as listed at awesome-vue)

So why another one?

I didn't try all of the above but as mentioned under current state I mainly wanted to try it by myself. The result is also incredibly small: Under 500 bytes minimized and gzipped!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].