npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@chifi49/vue-slideshow

v1.0.8

Published

content/image slideshow, carousel or swiper made with vuejs

Downloads

5

Readme

vue-slideshow

a slideshow/carousel/swiper made with vuejs

Installation

npm install @chifi49/vue-slideshow

or

<script src="vue-slideshow.umd.min.js"></script>

Usage

Each slide should be wrapped in a div with a class attribute content <div class='content'>

If you wish to add content (text and buttons e.t.c) follow the below format

<div class="content">
    <img src="./images/1.jpg" />
    <div >
        <div>
            <div>
            <!--your content goes here - nested inside 3 divs-->
                <h2>Title</h2>
                <h4>Subtitle</h4>
                <p>paragraph</p>
                <button>Clicked</button>
            </div>
        </div>
    </div>
</div>

full setup

<template>
    <vueslideshow :params="slideshowParams">
        <div class="content">
            <img src="./images/1.jpg" />
        </div>
        <div class="content">
            <img src="./images/2.jpg" />
        </div>
        <div class="content">
            <img src="./images/3.jpg" />
        </div>
    </vueslideshow>
</template>

<script>

import vueslideshow from 'chifi49/vue-slideshow';

export default{
    components:{
        vueslideshow
    },
    data:function(){
        return {
            slideshowParams:{
                fullscreen:true, //shows full screen icon on top right
                dragEnabled:true, //can drag the content to slide to previous or next content
                animation:'fade', //slide or fade
                nav:{
                    visible:true,
                    arrowColor:'#fff',
                    backgroundColor:'transparent',
                    borderColor:'#fff'
                },
                pager:{
                    visible:true,
                    mode:'bullets', //counter or bullets
                    backgroundColor:'#fff',
                    color:'#000',
                    borderColor:'#fff',
                    position:{
                        vertical:'bottom' //top or bottom
                    }
                },
                thumbs:{
                    visible:true,
                    width:100,
                    height:70
                }
            }

        }
    }
}
</script>

Override Content (navigation arrow left and right)

<template>
    <vueslideshow>

        <div class="content">
        </div>

        <!--slots for nav left and nav right-->
        <span slot="nav-left">left</span>
        <span slot="nav-right">right</span>
    </vueslideshow>
</template>

Override full screen icon

<template>
    <vueslideshow>
        <button slot="fullscreen">open full</button>
    </vueslideshow>
</template>

Events

<template>
    <vueslideshow 
        @inited = 'inited'
        @beforeAnimate = 'beforeAnimate'
        @animated = 'animated'
        @firstSlide = 'firstSlide'
        @previousSlide = 'previousSlide'
        @nextSlide = 'nextSlide'
        @lastSlide = 'lastSlide'
        @enterFullScreen = 'enterFullScreen'
        @exitFullScreen = 'exitFullScreen'
        @pageSelected = 'pageSelected'
        @thumbSelected = 'thumbSelected'
        @dragging = 'dragging'
        >
        ...
    </vueslideshow>
</template>
<script>
export default{
    methods:{
        inited:function(params){
            var instance = params.instance;
        },
        animated:function(params){

        },
        beforAnimate:function(params){

        },
        firstSlide:function(params){
            var instance = params.instance;
            var fromIndex = params.index;
            var toIndex = params.newindex;
        },
        nextSlide:function(params){
            var instance = params.instance;
            var fromIndex = params.index;
            var toIndex = params.newindex;
        },
        previousSlide:function(params){
            var instance = params.instance;
            var fromIndex = params.index;
            var toIndex = params.newindex;
        },
        lastSlide:function(params){
            var instance = params.instance;
            var fromIndex = params.index;
            var toIndex = params.newindex;
        },
        enterFullScreen:function(params){
            var instance = params.instance;
        },
        exitFullScreen:function(params){
            var instance = params.instance;
        },
        pageSelected:function(params){
            var instance = params.instance;
            var newindex = params.index;
        },
        thumbSelected:function(params){
            var instance = params.instance;
            var newindex = params.index;
        },
        dragging:function(params){
            var instance = params.instance;
            var startX = params.startX;
            var currentX = params.currentX;
            var index = params.index;
            var toindex = params.newindex; // its -1 if we have not decided to move based on drag ratio 25%
        }
    }
}
</script>

Methods

<vueslideshow ref="slider">
......
</vueslideshow>

var slider = this.$refs['slider'];

nextSlide

slider.nextSlide()

previousSlide

slider.previousSlide()

firstSlide

slider.firstSlide()

lastSlide

slider.lastSlide()

moveTo

slider.moveTo(3) move to 3rd slide

showThumbs

slider.showThumbs()

hideThumbs

slider.hideThumbs()

fullScreen

slider.fullScreen()

getIndex (zero based)

slide.getCurrentIndex

getCurrentContent

slider.getCurrentContent