0.1.1 • Published 4 years ago

ve-simple-slider v0.1.1

Weekly downloads
-
License
-
Repository
-
Last release
4 years ago

Ve Simple Slider

Installation

$ npm install -d ve-simple-slider

Usage

$ Import VeSimpleSlider from 've-simple-slider'
$ components: { VeSimpleSlider }
$ <VeSimpleSlider />

Style

<style>
.image-slider {
	position: relative;
	min-height: 50px;
	overflow: hidden;
}

.image-slider--single .image-slider__dots,
.image-slider--single .image-slider__nav {
	display: none;
}

.image-slider .prev,
.image-slider .next {
	position: absolute;
	top: 50%;
	cursor: pointer;
	width: auto;
	padding: 16px;
	color: white;
	font-weight: bold;
	font-size: 18px;
	transition: 0.7s ease;
	text-decoration: none;
	user-select: none;
	transform: translateY(-50%);
	background-color: rgba(102, 102, 102, 0.2);
	z-index: 3;
}

/* Position the "next button" to the right */
.image-slider .next {
	right: 0;
}
.image-slider .prev {
	left: 0;
}
/* On hover, add a black background color with a little bit see-through */
.image-slider .prev:hover,
.image-slider .next:hover {
	background-color: rgba(0,0,0,0.9);
}

.image-slider-items {
	position: relative;
	overflow: hidden;
}

.slide {
	display: block;
	margin: auto;
	width: 100%;
	transition: .3s all ease-in-out;
	z-index: 1;
	opacity: 0;

}
.slide.active {
	opacity: 1;
	position: relative;
	z-index: 2;
}

.slide img {
	width:100%;
	min-height: 99px;
}

.transition-fade .inactive {
	height: 0;
	opacity: 0;
}

.transition-slide .slide {
	position: absolute;
	top: 0;
	transition: transform .5s, opacity .5s, z-index .5s;

}
.transition-slide .slide.active {
	position: relative;
}

.transition-slide .next-item {
	transform: translateX(100%);
}

.transition-slide .prev-item {
	transform: translateX(-100%);
}

.slide-leave-active,
.slide-enter-active {
	transition: 1s;
}

.slide-enter {
	opacity: 1;
}

.slide-leave {
	opacity: 0;
	height: 0;
}

.slide .loader {
	position: absolute;
	top: 0;
	left: 0;
	bottom: 0;
	right: 0;
	margin: auto;
	min-height: 4rem;
}

.img-slider {
	overflow: hidden;
	position: relative;
	height: 200px;
	width: 100%;
}

.image-slider__dots {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	margin: auto;
	display: flex;
	justify-content: center;
	align-items: center;
	padding-bottom: 1rem;
}

.image-slider__dot {
	background: rgba(193, 193, 193, 0.7);
	border-radius: 50%;
	border: 1px solid #fff;
	width: 12px;
	height: 12px;
	margin-right: 5px;
	cursor: pointer;
	z-index: 3;

}
.image-slider__dot:hover,
.image-slider__dot.active {
	background: #666;
}
</style>
0.1.1

4 years ago

0.1.0

4 years ago