gancio/pages/embed/_event_id.vue

85 lines
1.7 KiB
Vue
Raw Normal View History

2019-10-26 00:27:12 +02:00
<template lang="pug">
nuxt-link.embed_event(:to='`/event/${id}`' target='_blank' :class='{ withImg: event.image_path }')
2019-10-26 00:27:12 +02:00
//- image
img.float-left(v-if='event.image_path' :src='`/media/thumb/${event.image_path}`')
.event-info
2019-10-26 00:27:12 +02:00
//- title
2020-02-11 11:53:32 +01:00
.date {{event|when}}<br/>
h4 {{event.title}}
2019-10-26 00:27:12 +02:00
//- date / place
.date {{event.place.name}}<br/> {{event.place.address}}
2019-10-26 00:27:12 +02:00
</template>
<script>
import Event from '../../components/Event'
export default {
2020-01-15 23:56:28 +01:00
layout: 'iframe',
2019-10-26 00:27:12 +02:00
components: { Event },
async asyncData ({ $axios, params, error, store }) {
try {
const event = await $axios.$get(`/event/${params.event_id}`)
return { event, id: Number(params.event_id) }
2019-10-26 00:27:12 +02:00
} catch (e) {
error({ statusCode: 404, message: 'Event not found' })
}
},
2020-01-15 23:56:28 +01:00
data () {
return {
loading: true
}
2019-10-26 00:27:12 +02:00
}
}
// <iframe src='http://localhost:13120/embed/1' class='embedded_gancio'></iframe>
2019-10-26 00:27:12 +02:00
</script>
<style lang='less'>
.embed_event {
2020-01-21 01:24:10 +01:00
transition: margin .1s;
2020-01-21 15:09:01 +01:00
background: url('/favicon.ico') no-repeat right 5px bottom 5px;
background-size: 32px;
2020-01-21 01:24:10 +01:00
background-color: #1f1f1f;
display: inline-block;
border: 1px solid #b1a3a3;
margin: 0px auto;
padding: 0px;
width: 400px;
height: 210px;
overflow: hidden;
border-radius: 10px;
// transition: all .2s;
margin: 0px;
&:hover {
transform: prospective(10) translateX(10);
margin-left: 5px;
text-decoration: none;
2019-10-26 00:27:12 +02:00
}
.event-info {
height: 100%;
color: #eee !important;
display: flex;
flex-direction: column;
padding: 5px;
.date {
color: #999;
}
}
2020-01-21 01:24:10 +01:00
img {
width: 150px;
object-fit: cover;
object-position: top;
margin-right: 5px;
height: 100%;
}
2020-01-15 23:56:28 +01:00
}
2020-01-21 01:24:10 +01:00
</style>