forked from AkkomaGang/akkoma-fe
more formatting
This commit is contained in:
parent
5476a2794d
commit
3cee6c5934
8 changed files with 71 additions and 69 deletions
|
@ -6,61 +6,59 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { decode } from "blurhash";
|
||||
import { decode } from 'blurhash'
|
||||
|
||||
export default {
|
||||
name: 'Blurhash',
|
||||
props: {
|
||||
hash: {
|
||||
type: String,
|
||||
required: true,
|
||||
required: true
|
||||
},
|
||||
width: {
|
||||
type: Number,
|
||||
required: true,
|
||||
required: true
|
||||
},
|
||||
height: {
|
||||
type: Number,
|
||||
required: true,
|
||||
required: true
|
||||
},
|
||||
punch: {
|
||||
type: Number,
|
||||
default: null,
|
||||
},
|
||||
default: null
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
canvas: null,
|
||||
ctx: null,
|
||||
};
|
||||
ctx: null
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.canvas = this.$refs.canvas;
|
||||
this.ctx = this.canvas.getContext('2d');
|
||||
this.canvas.width = 1024;
|
||||
this.canvas.height = 512;
|
||||
this.draw();
|
||||
this.canvas = this.$refs.canvas
|
||||
this.ctx = this.canvas.getContext('2d')
|
||||
this.canvas.width = 1024
|
||||
this.canvas.height = 512
|
||||
this.draw()
|
||||
},
|
||||
methods: {
|
||||
draw() {
|
||||
const pixels = decode(this.hash, this.width, this.height, this.punch);
|
||||
const imageData = this.ctx.createImageData(this.width, this.height);
|
||||
imageData.data.set(pixels);
|
||||
this.ctx.putImageData(imageData, 0, 0);
|
||||
fetch("/static/blurhash-overlay.png")
|
||||
const pixels = decode(this.hash, this.width, this.height, this.punch)
|
||||
const imageData = this.ctx.createImageData(this.width, this.height)
|
||||
imageData.data.set(pixels)
|
||||
this.ctx.putImageData(imageData, 0, 0)
|
||||
fetch('/static/blurhash-overlay.png')
|
||||
.then((response) => response.blob())
|
||||
.then((blob) => {
|
||||
const img = new Image();
|
||||
img.src = URL.createObjectURL(blob);
|
||||
const img = new Image()
|
||||
img.src = URL.createObjectURL(blob)
|
||||
img.onload = () => {
|
||||
this.ctx.drawImage(img, 0, 0, this.width, this.height);
|
||||
};
|
||||
});
|
||||
},
|
||||
this.ctx.drawImage(img, 0, 0, this.width, this.height)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
<style scoped></style>
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
>
|
||||
<div
|
||||
:style="{
|
||||
height: `${gridHeight}px`,
|
||||
height: `${gridHeight}px`
|
||||
}"
|
||||
>
|
||||
<template v-for="item in visibleItems">
|
||||
|
@ -37,7 +37,7 @@
|
|||
<img
|
||||
v-else
|
||||
:src="item.emoji.imageUrl"
|
||||
>
|
||||
/>
|
||||
</span>
|
||||
</template>
|
||||
</div>
|
||||
|
|
|
@ -87,7 +87,9 @@ const FollowRequestCard = {
|
|||
return this.mergedConfig.modalOnDenyFollow
|
||||
},
|
||||
show() {
|
||||
const notifId = this.$store.state.api.followRequests.find(req => req.id === this.user.id)
|
||||
const notifId = this.$store.state.api.followRequests.find(
|
||||
(req) => req.id === this.user.id
|
||||
)
|
||||
|
||||
return notifId !== undefined
|
||||
}
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
<template>
|
||||
<basic-user-card :user="user" v-if="show">
|
||||
<basic-user-card
|
||||
v-if="show"
|
||||
:user="user"
|
||||
>
|
||||
<div class="follow-request-card-content-container">
|
||||
<button
|
||||
class="btn button-default"
|
||||
|
|
|
@ -33,7 +33,7 @@ export default {
|
|||
tag: {
|
||||
type: Object,
|
||||
required: true
|
||||
},
|
||||
}
|
||||
},
|
||||
// this is a hack to update the state of the button
|
||||
// for some reason, List does not update on changes to the tag object
|
||||
|
@ -71,7 +71,8 @@ export default {
|
|||
font-size: large;
|
||||
}
|
||||
|
||||
.unfollow-tag-button, .follow-tag-button {
|
||||
.unfollow-tag-button,
|
||||
.follow-tag-button {
|
||||
font-size: medium;
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -212,9 +212,7 @@
|
|||
:on-scope-change="changeVis"
|
||||
/>
|
||||
|
||||
<div
|
||||
class="language-selector"
|
||||
>
|
||||
<div class="language-selector">
|
||||
<Select
|
||||
id="post-language"
|
||||
v-model="newStatus.language"
|
||||
|
|
|
@ -118,7 +118,7 @@ export const defaultState = {
|
|||
translationLanguage: undefined, // instance default,
|
||||
supportedTranslationLanguages: {}, // instance default
|
||||
userProfileDefaultTab: 'statuses',
|
||||
useBlurhash: true,
|
||||
useBlurhash: true
|
||||
}
|
||||
|
||||
// caching the instance default properties
|
||||
|
|
Loading…
Reference in a new issue