unblur function by contribution

This commit is contained in:
ogerly 2019-11-29 12:14:54 +01:00
parent 7f3f81822e
commit 06fd8a2ce9
3 changed files with 58 additions and 30 deletions

View File

@ -159,7 +159,6 @@ export default {
let slug = null let slug = null
const form = { ...formDefaults } const form = { ...formDefaults }
if (this.contribution && this.contribution.id) { if (this.contribution && this.contribution.id) {
// console.log("edit jaaa")
id = this.contribution.id id = this.contribution.id
slug = this.contribution.slug slug = this.contribution.slug
form.title = this.contribution.title form.title = this.contribution.title
@ -171,9 +170,6 @@ export default {
: null : null
form.categoryIds = this.categoryIds(this.contribution.categories) form.categoryIds = this.categoryIds(this.contribution.categories)
form.checkedBlur = this.contribution.checkedBlur form.checkedBlur = this.contribution.checkedBlur
// console.log(this.contribution.checkedBlur)
// console.log(this.contribution)
} }
return { return {
@ -221,11 +217,6 @@ export default {
}, },
methods: { methods: {
checkedChange() { checkedChange() {
// console.log( 'checkedChange')
// console.log( 'this.checkedBlur old', this.checkedBlur)
// console.log( 'THIS', this.$el)
// console.log( 'THIS.form', this.form)
if (this.$el) { if (this.$el) {
this.elem = this.$el.querySelector('img') this.elem = this.$el.querySelector('img')
} else { } else {
@ -243,7 +234,6 @@ export default {
this.form.checkedBlur = true this.form.checkedBlur = true
this.form.checkbox = true this.form.checkbox = true
} }
// console.log( 'this.checkedBlur new', this.checkedBlur)
}, },
submit() { submit() {
const { const {
@ -329,7 +319,7 @@ export default {
</script> </script>
<style lang="scss"> <style lang="scss">
.img-blur-in .ds-card-image img { .img-blur-in {
-webkit-filter: blur(32px); -webkit-filter: blur(32px);
-moz-filter: blur(32px); -moz-filter: blur(32px);
-ms-filter: blur(32px); -ms-filter: blur(32px);

View File

@ -9,10 +9,6 @@
'images-set-blur': post.checkedBlur, 'images-set-blur': post.checkedBlur,
}" }"
> >
<ds-text v-show="post.checkedBlur" align="center" class="blurbox">
<ds-button class="bluricon" icon="eye-slash" primary></ds-button>
</ds-text>
<!-- Post Link Target --> <!-- Post Link Target -->
<nuxt-link <nuxt-link
class="post-link" class="post-link"
@ -166,18 +162,6 @@ export default {
-o-transition: all ease 0.2s; -o-transition: all ease 0.2s;
transition: all ease 0.2s; transition: all ease 0.2s;
} }
.blurbox {
padding: 13px 0px;
top: 67px;
right: 34px;
left: 25px;
position: absolute;
color: floralwhite;
}
.bluricon {
font-size: xx-large;
}
</style> </style>
<style lang="scss" scoped> <style lang="scss" scoped>

View File

@ -4,9 +4,28 @@
:lang="post.language" :lang="post.language"
v-if="post && ready" v-if="post && ready"
:image="post.image | proxyApiUrl" :image="post.image | proxyApiUrl"
:class="{ 'post-card': true, 'disabled-content': post.disabled }" :class="{
'post-card': true,
'disabled-content': post.disabled,
'images-set-blur': post.checkedBlur,
}"
> >
<ds-space margin-bottom="small" /> <ds-text align="right" class="blurBox">
<ds-button
v-show="post.checkedBlur"
class="bluricon-post"
icon="eye-slash"
primary
@click.prevent="unBlur"
></ds-button>
<img
v-show="post.checkedBlur"
:src="post.image | proxyApiUrl"
class="blurImgPreview"
@click.prevent="unBlur"
/>
</ds-text>
<div style="clear: both" />
<hc-user :user="post.author" :date-time="post.createdAt"> <hc-user :user="post.author" :date-time="post.createdAt">
<template v-slot:dateTime> <template v-slot:dateTime>
<ds-text v-if="post.createdAt !== post.updatedAt">({{ $t('post.edited') }})</ds-text> <ds-text v-if="post.createdAt !== post.updatedAt">({{ $t('post.edited') }})</ds-text>
@ -150,6 +169,11 @@ export default {
}, },
}, },
methods: { methods: {
unBlur() {
if (this.post.checkedBlur) {
this.post.checkedBlur = false
}
},
isAuthor(id) { isAuthor(id) {
return this.$store.getters['auth/user'].id === id return this.$store.getters['auth/user'].id === id
}, },
@ -206,8 +230,38 @@ export default {
}, },
} }
</script> </script>
<style lang="scss"> <style lang="scss">
.images-set-blur .ds-card-image img {
-webkit-filter: blur(22px);
-moz-filter: blur(22px);
-ms-filter: blur(22px);
-o-filter: blur(22px);
filter: blur(22px);
-webkit-transition: all ease 0.2s;
-moz-transition: all ease 0.2s;
-ms-transition: all ease 0.2s;
-o-transition: all ease 0.2s;
transition: all ease 0.2s;
}
.blurBox {
text-align: right;
position: relative;
top: -70px;
float: right;
}
.blurImgPreview {
width: 100px;
}
.bluricon-post {
font-size: xx-large;
/* padding: 13px; */
/* position: absolute; */
background-color: green;
/* top: 131px; */
}
.page-name-post-id-slug { .page-name-post-id-slug {
.content-menu { .content-menu {
float: right; float: right;