All Projects → AlbanCrepel → Vue Displacement Slideshow

AlbanCrepel / Vue Displacement Slideshow

Licence: mit
A Vue.js 2.0 slideshow component working with Three.js

Projects that are alternatives of or similar to Vue Displacement Slideshow

Stickyimageeffect
A sticky image effect for a slideshow inspired by ultanoir's website.
Stars: ✭ 158 (-4.24%)
Mutual labels:  slideshow, webgl, threejs
3d Force Graph
3D force-directed graph component using ThreeJS/WebGL
Stars: ✭ 2,386 (+1346.06%)
Mutual labels:  webgl, threejs
Interactive Repulsive Effect
🍫 An interactive repulsion effect of grid items as seen in BestServedBold's Dribbble shot "Holographic-Interactions".
Stars: ✭ 141 (-14.55%)
Mutual labels:  webgl, threejs
Andromeda
This is a WebGL recreation of the popular music video Gorillaz - Andromeda.
Stars: ✭ 145 (-12.12%)
Mutual labels:  webgl, threejs
R3f Next Starter
Repo is moving to https://github.com/pmndrs/react-three-next
Stars: ✭ 137 (-16.97%)
Mutual labels:  webgl, threejs
React Globe.gl
React component for Globe Data Visualization using ThreeJS/WebGL
Stars: ✭ 139 (-15.76%)
Mutual labels:  webgl, threejs
Ng Three Template
This is a basic template project to start with Angular 11.x and ThreeJS
Stars: ✭ 144 (-12.73%)
Mutual labels:  webgl, threejs
Ipyvolume
3d plotting for Python in the Jupyter notebook based on IPython widgets using WebGL
Stars: ✭ 1,696 (+927.88%)
Mutual labels:  webgl, threejs
Antipasto
🍽 Juicy starter for three.js
Stars: ✭ 147 (-10.91%)
Mutual labels:  webgl, threejs
Geo Three
Tile based geographic world map visualization library for threejs
Stars: ✭ 146 (-11.52%)
Mutual labels:  webgl, threejs
Interactivelandscape
An exploration of an animated interactive landscape built with three.js.
Stars: ✭ 150 (-9.09%)
Mutual labels:  webgl, threejs
Sketch
Explorations on cross-hatching, engraving, and similar non-photorealistic rendering.
Stars: ✭ 136 (-17.58%)
Mutual labels:  webgl, threejs
Earthjs
D3 Earth JS
Stars: ✭ 128 (-22.42%)
Mutual labels:  webgl, threejs
Vue 3d Model
📷 vue.js 3D model viewer component
Stars: ✭ 1,925 (+1066.67%)
Mutual labels:  webgl, threejs
Patches
Patches is a visual programming editor for building WebVR and WebGL experiences.
Stars: ✭ 164 (-0.61%)
Mutual labels:  webgl, threejs
Ego
A lightweight decision making library for game AI.
Stars: ✭ 145 (-12.12%)
Mutual labels:  webgl, threejs
Lba2remake
A Little Big Adventure 2 / Twinsen's Odyssey reimplementation in JavaScript / Three.js / React
Stars: ✭ 116 (-29.7%)
Mutual labels:  webgl, threejs
Thehallaframe
WebVR demo that displays art
Stars: ✭ 120 (-27.27%)
Mutual labels:  webgl, threejs
Jeelizfacefilter
Javascript/WebGL lightweight face tracking library designed for augmented reality webcam filters. Features : multiple faces detection, rotation, mouth opening. Various integration examples are provided (Three.js, Babylon.js, FaceSwap, Canvas2D, CSS3D...).
Stars: ✭ 2,042 (+1137.58%)
Mutual labels:  webgl, threejs
Wechart
Create all the [ch]arts by cax or three.js - Cax 和 three.js 创造一切图[表]
Stars: ✭ 152 (-7.88%)
Mutual labels:  webgl, threejs

vue-displacement-slideshow

Webgl image displacement transitions made simple. A Vue.js 2.0 slideshow component working with Three.js and GSAP.

Demo

Demo gif

The canvas can be interactive as well by setting the isInteractive props to true. See the props section to find more.

Live demo

DEMO

Installation

NPM

 npm i --save vue-displacement-slideshow

Example

With VueJs 2.0 :

<template>
    <vue-displacement-slideshow
            :images="images"
            displacement="require('../assets/displacement.png')"
            :intensity="0.2"
            :speedIn="1.4"
            :speedOut="1.4"
            ease="expo.out"
            ref="slideshow"></vue-displacement-slideshow>
</template>

<script>
    import VueDisplacementSlideshow from "vue-displacement-slideshow";

    export default {
        components: {
            VueDisplacementSlideshow,
        },
        computed: {
            images() {
                return [
                    require("../assets/images/1.jpg"),
                    require("../assets/images/2.jpg"),
                    require("../assets/images/3.jpg")
                ];
            }
        },
        methods: {
            init() {
                //We loop through all our images by calling the 'next' method of our component every 2 seconds
                setInterval(() => {
                    this.$refs.slideshow.next();
                }, 2000);
            }
        },
        mounted() {
            this.init();
        }
    };
</script>

With Nuxt :

Just wrap the component between a no-ssr tag like so :

<no-ssr>
    <vue-displacement-slideshow />
</no-ssr>

This component is heavily based on this library : https://github.com/robin-dela/hover-effect

Props

name type description required default value
images Array An array containing the paths of the images you wan to use true []
displacement String The path of the displacement image true none
intensity Number The intensity of the displacement false 1
speedIn Number The duration of the animation for the next image, in seconds false 1
speedOut Number The duration of the animation for the previous image, in seconds false 1
ease String The GSAP easing to use false expo.out
preserveAspectRatio Boolean Whether the images keep their aspect ratio (act as background-size : cover (true) or contain (false) false true
isInteractive Boolean Whether the canvas is interactive on mouse move false false
interactionFactor Number The factor of the interaction false 1
interactionDuration Number The duration of the interaction false 1
startAsTransparent Boolean Whether the canvas is initially transparent and the first transition goes to the first picture false false
angle Number The angle of the transition false Math.PI / 4

Methods

Name Description Params Returns
next Transition to the second image. void
previous Transition to the first image. void
pause Pause the current transition void
play Play the current paused animation void
insertImage(path,index) Insert an image at a given index
  • path : the path of the image
  • index : the index of the inserted image, if not provided, the image will be inserted at the end of the array. It has the same behavior as the splice method (negative number allowed)
a Promise resolved when the image is loaded
insertTransparentTexture(index) Insert a transparent texture at a given index
  • index : the index of the inserted image, it has the same behavior as the insertImage index parameter
void
removeImage(index) Remove an image at a given index
  • index : the index of the image to remove (must be different from the current image index)
void
goTo(index) Transition to a given image by its index
  • index : the index of the image to transition to
void

Events emitted

Name Description
loaded Fired when the component is ready
animationEnd Fired when the transition is done.

Behavior

The first image of the array is displayed at first. When we call the next method while currently showing the last image, it will go to the first image. When we call the previous method while currently showing the first image, it will go to the last image.

The images are displayed as we would use background-size:cover in CSS.

If you set the prop startAsTransparent to true, then it adds a texture to your images array. If you want to remove it after, you can just call the removeImage method with 0 as the index parameter value.

Contributing

Contributions are welcome ! Follow the instructions in the contributing file

License

MIT

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].