-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
48 lines (47 loc) · 2.06 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Vue.js Slider</title>
<link rel="stylesheet" href="slider.css">
<link href="https://fonts.googleapis.com/css?family=Raleway" rel="stylesheet">
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
</head>
<body>
<div id="app">
<div class="slider">
<div class="slider__container" :style="styleSliderPos" ref="slideContainer">
<div class="slide" ref="slide">
<div class="slide__image">
<img src="images/slider-1.jpg" alt="Photo by Jared Rice on Unsplash">
</div>
</div>
<div class="slide" ref="slide">
<div class="slide__image">
<img src="images/slider-2.jpg" alt="Photo by Trevor Cole on Unsplash">
</div>
</div>
<div class="slide" ref="slide">
<div class="slide__image">
<img src="images/slider-3.jpg" alt="Photo by Boris Smokrovic on Unsplash">
</div>
</div>
</div>
<div class="slider__controls" aria-hidden="true">
<button type="button" @click="prev()">Previous</button>
<span>Item {{ currentSlide + 1 }} of {{ totalSlides }}</span>
<button type="button" @click="next()" :disabled="currentSlide >= totalSlides - 1">Next</button>
<!-- Please notice, this button is disabled once the max is reached. Just to show off. -->
<div class="bullets">
<button @click="goToSlide(0)">1</button>
<button @click="goToSlide(1)">2</button>
<button @click="goToSlide(2)">3</button>
</div>
</div>
</div>
</div>
<script src="slider.js"></script>
</body>
</html>