|
@@ -14,7 +14,10 @@ |
|
|
<div class="grid-sizer"></div> |
|
|
<div class="grid-sizer"></div> |
|
|
<div class="gutter-sizer"></div> |
|
|
<div class="gutter-sizer"></div> |
|
|
<div class="pin-card grid-item"> |
|
|
<div class="pin-card grid-item"> |
|
|
<img :src="item.url" alt="item.description"> |
|
|
|
|
|
|
|
|
<img :src="item.url" |
|
|
|
|
|
@click="openPreview(item)" |
|
|
|
|
|
alt="item.description" |
|
|
|
|
|
class="pin-preview-image"> |
|
|
<div class="pin-footer"> |
|
|
<div class="pin-footer"> |
|
|
<div class="description" v-show="item.description"><p>{{ item.description }}</p></div> |
|
|
<div class="description" v-show="item.description"><p>{{ item.description }}</p></div> |
|
|
<div class="details"> |
|
|
<div class="details"> |
|
@@ -49,6 +52,7 @@ |
|
|
<script> |
|
|
<script> |
|
|
import API from './api'; |
|
|
import API from './api'; |
|
|
import pinHandler from './utils/PinHandler'; |
|
|
import pinHandler from './utils/PinHandler'; |
|
|
|
|
|
import PinPreview from './PinPreview.vue'; |
|
|
|
|
|
|
|
|
function createImageItem(pin) { |
|
|
function createImageItem(pin) { |
|
|
const image = {}; |
|
|
const image = {}; |
|
@@ -58,6 +62,8 @@ function createImageItem(pin) { |
|
|
image.tags = pin.tags; |
|
|
image.tags = pin.tags; |
|
|
image.author = pin.submitter.username; |
|
|
image.author = pin.submitter.username; |
|
|
image.avatar = `//gravatar.com/avatar/${pin.submitter.gravatar}`; |
|
|
image.avatar = `//gravatar.com/avatar/${pin.submitter.gravatar}`; |
|
|
|
|
|
image.original_url = pin.image.image; |
|
|
|
|
|
image.orgianl_width = pin.image.width; |
|
|
return image; |
|
|
return image; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@@ -81,6 +87,20 @@ export default { |
|
|
); |
|
|
); |
|
|
return blocks; |
|
|
return blocks; |
|
|
}, |
|
|
}, |
|
|
|
|
|
openPreview(pinItem) { |
|
|
|
|
|
this.$buefy.modal.open( |
|
|
|
|
|
{ |
|
|
|
|
|
parent: this, |
|
|
|
|
|
component: PinPreview, |
|
|
|
|
|
props: { |
|
|
|
|
|
pinItem, |
|
|
|
|
|
}, |
|
|
|
|
|
// width: pinItem.orgianl_width, |
|
|
|
|
|
hasModalCard: true, |
|
|
|
|
|
customClass: 'pin-preview-at-home', |
|
|
|
|
|
}, |
|
|
|
|
|
); |
|
|
|
|
|
}, |
|
|
}, |
|
|
}, |
|
|
created() { |
|
|
created() { |
|
|
API.fetchPins(0).then( |
|
|
API.fetchPins(0).then( |
|
@@ -123,6 +143,9 @@ $avatar-height: 30px; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
.pin-card{ |
|
|
.pin-card{ |
|
|
|
|
|
.pin-preview-image { |
|
|
|
|
|
cursor: pointer; |
|
|
|
|
|
} |
|
|
> img { |
|
|
> img { |
|
|
border-radius: 3px 3px 0 0; |
|
|
border-radius: 3px 3px 0 0; |
|
|
} |
|
|
} |
|
|