home page api calls

This commit is contained in:
ManjaroOne666 2019-02-12 11:45:22 +00:00
parent c8565cbb76
commit 08f9ba6bf7
2 changed files with 29 additions and 25 deletions

23
TODO.md
View File

@ -5,6 +5,7 @@
* Galleries - sort thumbs by sort_order
* API
* mailer
* remove testing/dev mode or whatever its called from axios in nuxt.config.js
## Maybes
* gallery page - featured images in same style as on services page with the
@ -18,3 +19,25 @@
* galleries - click on thumb, click on different gallery, click on original gallery
and the thumb list doesn't scroll to correct position to show thumb 0,
it is still showing the thumb that was clicked on first
## Data for Backend
```javascript
//home
bgImages: [
'https://marcleopold.isnet.uk/wp-content/uploads/2017/07/slider.jpg',
'https://marcleopold.isnet.uk/wp-content/uploads/2017/07/slider-2.jpeg',
'https://marcleopold.isnet.uk/wp-content/uploads/2017/07/slider-3.jpeg',
'https://marcleopold.isnet.uk/wp-content/uploads/2017/07/4-edit-3.jpg',
'https://marcleopold.isnet.uk/wp-content/uploads/2017/07/4-edit.jpg',
'https://marcleopold.isnet.uk/wp-content/uploads/2017/07/image-1.png',
'https://marcleopold.isnet.uk/wp-content/uploads/2017/07/slider-4.jpeg',
],
taglines: [
'the essence of the image',
'an image of the essential',
'a solitary instance',
'an eternal instance',
'a fleeting eternity',
'I imagine myself',
],
```

View File

@ -15,7 +15,7 @@
<transition name="fade" mode="out-in">
<p class="tagline"
:key="currentTaglineIndex">
{{ taglines[currentTaglineIndex] }}
{{ tagline }}
</p>
</transition>
</div>
@ -51,8 +51,8 @@ export default {
return url
},
tagLine () {
return this.currentTaglineIndex > -1 ? this.taglines[this.currentTaglineIndex] : ''
tagline () {
return this.currentTaglineIndex > -1 ? this.taglines[this.currentTaglineIndex].text : ''
}
},
@ -74,28 +74,9 @@ export default {
}
},
asyncData({ store }) {
return new Promise ((resolve, reject) => {
resolve({
bgImages: [
'https://marcleopold.isnet.uk/wp-content/uploads/2017/07/slider.jpg',
'https://marcleopold.isnet.uk/wp-content/uploads/2017/07/slider-2.jpeg',
'https://marcleopold.isnet.uk/wp-content/uploads/2017/07/slider-3.jpeg',
'https://marcleopold.isnet.uk/wp-content/uploads/2017/07/4-edit-3.jpg',
'https://marcleopold.isnet.uk/wp-content/uploads/2017/07/4-edit.jpg',
'https://marcleopold.isnet.uk/wp-content/uploads/2017/07/image-1.png',
'https://marcleopold.isnet.uk/wp-content/uploads/2017/07/slider-4.jpeg',
],
taglines: [
'the essence of the image',
'an image of the essential',
'a solitary instance',
'an eternal instance',
'a fleeting eternity',
'I imagine myself',
],
})
})
async asyncData({ $axios }) {
let { bgImages, taglines } = await $axios.$get('/api/v1/home')
return { bgImages, taglines}
},
methods: {