
After Width: | Height: | Size: 6.7 MiB |
After Width: | Height: | Size: 5.6 MiB |
After Width: | Height: | Size: 2.9 MiB |
After Width: | Height: | Size: 6.7 KiB |
After Width: | Height: | Size: 4.1 MiB |
@ -1,28 +1,138 @@ |
|||
<template> |
|||
|
|||
<div id="app"> |
|||
<img alt="Vue logo" src="./assets/logo.png"> |
|||
<HelloWorld msg="Welcome to Your Vue.js App"/> |
|||
<h1>Kolotoč</h1> |
|||
<div class="kolotoc"> |
|||
<button v-on:click="dopredu">(====</button> |
|||
<button v-on:click="dozadu">===)</button> |
|||
<br> |
|||
<div class="obraz"> |
|||
<img :src="images[index].src" alt="" /> |
|||
<br> |
|||
<h1><span>{{ images[index].title }}</span></h1> |
|||
|
|||
<h1><span>{{ images[index].text }}</span></h1> |
|||
</div> |
|||
|
|||
|
|||
|
|||
</div> |
|||
</div> |
|||
|
|||
</template> |
|||
|
|||
<script> |
|||
import HelloWorld from './components/HelloWorld.vue' |
|||
|
|||
|
|||
export default { |
|||
|
|||
name: 'App', |
|||
components: { |
|||
HelloWorld |
|||
data: function() { |
|||
return { |
|||
images: [ |
|||
{ |
|||
src: "/img/jedna.jpg", |
|||
title: "nadpis 1", |
|||
text: "koral" |
|||
}, |
|||
{ |
|||
src: "/img/dva.jpg", |
|||
title: "nadpis 2", |
|||
text: "pisek" |
|||
}, |
|||
{ |
|||
src: "/img/tri.jpg", |
|||
title: "nadpi 3", |
|||
text: "voda", |
|||
} |
|||
|
|||
], |
|||
index: 0 |
|||
} |
|||
|
|||
}, |
|||
methods: { |
|||
|
|||
dozadu: function () { |
|||
this.index -= 1; |
|||
if (this.index < 0) { |
|||
this.index = this.images.length - 1; |
|||
} |
|||
}, |
|||
dopredu: function () { |
|||
this.index += 1; |
|||
if (this.index > this.images.length - 1) { |
|||
this.index = 0; |
|||
} |
|||
}, |
|||
}, |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
} |
|||
|
|||
</script> |
|||
|
|||
<style> |
|||
img { |
|||
width: 60%; |
|||
display: block; |
|||
margin: 0px auto; |
|||
|
|||
} |
|||
span{ |
|||
font-family: 'Courier New', Courier, monospace; |
|||
} |
|||
button{ |
|||
background-color: rgb(86, 166, 219); |
|||
width: 20%; |
|||
height: 30px; |
|||
display: block; |
|||
margin: 0px auto; |
|||
|
|||
|
|||
} |
|||
#app{ |
|||
margin: 0 auto; |
|||
width: 50%; |
|||
background-color: chocolate; |
|||
|
|||
} |
|||
h1{ |
|||
text-align: center; |
|||
} |
|||
@media (max-width: 500px) { |
|||
img { |
|||
width: 100%; |
|||
display: block; |
|||
margin: 0px auto; |
|||
|
|||
} |
|||
span{ |
|||
font-family: 'Courier New', Courier, monospace; |
|||
} |
|||
button{ |
|||
background-color: rgb(86, 166, 219); |
|||
width: 50%; |
|||
height: 30px; |
|||
display: block; |
|||
margin: 0px auto; |
|||
|
|||
|
|||
} |
|||
#app{ |
|||
font-family: Avenir, Helvetica, Arial, sans-serif; |
|||
-webkit-font-smoothing: antialiased; |
|||
-moz-osx-font-smoothing: grayscale; |
|||
margin: 0 auto; |
|||
width: 50%; |
|||
background-color: chocolate; |
|||
|
|||
} |
|||
h1{ |
|||
text-align: center; |
|||
color: #2c3e50; |
|||
margin-top: 60px; |
|||
} |
|||
|
|||
} |
|||
|
|||
|
|||
</style> |
|||
|
After Width: | Height: | Size: 6.7 MiB |
After Width: | Height: | Size: 5.6 MiB |
After Width: | Height: | Size: 2.9 MiB |
After Width: | Height: | Size: 4.1 MiB |