gancio/pages/embed/_event_id.vue

81 lines
1.6 KiB
Vue
Raw Normal View History

2019-10-26 00:27:12 +02:00
<template lang="pug">
2022-07-01 15:55:09 +02:00
nuxt-link.embed_event(:to='`/event/${event.slug || event.id}`' target='_blank' :class='{ withImg: event.media }')
2019-10-26 00:27:12 +02:00
2022-07-01 15:55:09 +02:00
//- image
img.float-left(:src='event | mediaURL("thumb")')
.event-info
//- title
.date {{event|when}}<br/>
h4 {{event.title}}
2019-10-26 00:27:12 +02:00
2022-07-01 15:55:09 +02:00
//- date / place
.date {{event.place.name}}
2019-10-26 00:27:12 +02:00
</template>
<script>
export default {
2020-01-15 23:56:28 +01:00
layout: 'iframe',
2022-07-01 15:55:09 +02:00
async asyncData ({ $axios, params, error }) {
2019-10-26 00:27:12 +02:00
try {
2023-01-13 22:17:43 +01:00
const event = await $axios.$get(`/event/detail/${params.event_id}`)
2021-04-14 01:30:51 +02:00
return { event }
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 {
2021-03-05 14:21:51 +01:00
settings: { baseurl: '' },
2020-01-15 23:56:28 +01:00
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>
2022-05-03 15:23:55 +02:00
<style lang='scss'>
2019-10-26 00:27:12 +02:00
.embed_event {
2021-03-05 14:21:51 +01:00
display: flex;
2020-01-21 01:24:10 +01:00
transition: margin .1s;
background: url('/logo.png') no-repeat right 5px bottom 5px;
2020-01-21 15:09:01 +01:00
background-size: 32px;
2020-01-21 01:24:10 +01:00
background-color: #1f1f1f;
2021-03-05 14:21:51 +01:00
text-decoration: none;
2020-01-21 01:24:10 +01:00
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;
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>