more formatting

This commit is contained in:
emma 2023-02-15 00:12:10 +00:00
parent 5476a2794d
commit 3cee6c5934
8 changed files with 71 additions and 69 deletions

View file

@ -6,61 +6,59 @@
</template> </template>
<script> <script>
import { decode } from "blurhash"; import { decode } from 'blurhash'
export default { export default {
name: 'Blurhash', name: 'Blurhash',
props: { props: {
hash: { hash: {
type: String, type: String,
required: true, required: true
}, },
width: { width: {
type: Number, type: Number,
required: true, required: true
}, },
height: { height: {
type: Number, type: Number,
required: true, required: true
}, },
punch: { punch: {
type: Number, type: Number,
default: null, default: null
}, }
}, },
data() { data() {
return { return {
canvas: null, canvas: null,
ctx: null, ctx: null
}; }
}, },
mounted() { mounted() {
this.canvas = this.$refs.canvas; this.canvas = this.$refs.canvas
this.ctx = this.canvas.getContext('2d'); this.ctx = this.canvas.getContext('2d')
this.canvas.width = 1024; this.canvas.width = 1024
this.canvas.height = 512; this.canvas.height = 512
this.draw(); this.draw()
}, },
methods: { methods: {
draw() { draw() {
const pixels = decode(this.hash, this.width, this.height, this.punch); const pixels = decode(this.hash, this.width, this.height, this.punch)
const imageData = this.ctx.createImageData(this.width, this.height); const imageData = this.ctx.createImageData(this.width, this.height)
imageData.data.set(pixels); imageData.data.set(pixels)
this.ctx.putImageData(imageData, 0, 0); this.ctx.putImageData(imageData, 0, 0)
fetch("/static/blurhash-overlay.png") fetch('/static/blurhash-overlay.png')
.then((response) => response.blob()) .then((response) => response.blob())
.then((blob) => { .then((blob) => {
const img = new Image(); const img = new Image()
img.src = URL.createObjectURL(blob); img.src = URL.createObjectURL(blob)
img.onload = () => { img.onload = () => {
this.ctx.drawImage(img, 0, 0, this.width, this.height); this.ctx.drawImage(img, 0, 0, this.width, this.height)
}; }
}); })
}, }
} }
} }
</script> </script>
<style scoped> <style scoped></style>
</style>

View file

@ -7,7 +7,7 @@
> >
<div <div
:style="{ :style="{
height: `${gridHeight}px`, height: `${gridHeight}px`
}" }"
> >
<template v-for="item in visibleItems"> <template v-for="item in visibleItems">
@ -37,7 +37,7 @@
<img <img
v-else v-else
:src="item.emoji.imageUrl" :src="item.emoji.imageUrl"
> />
</span> </span>
</template> </template>
</div> </div>

View file

@ -87,7 +87,9 @@ const FollowRequestCard = {
return this.mergedConfig.modalOnDenyFollow return this.mergedConfig.modalOnDenyFollow
}, },
show() { 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 return notifId !== undefined
} }

View file

@ -1,5 +1,8 @@
<template> <template>
<basic-user-card :user="user" v-if="show"> <basic-user-card
v-if="show"
:user="user"
>
<div class="follow-request-card-content-container"> <div class="follow-request-card-content-container">
<button <button
class="btn button-default" class="btn button-default"

View file

@ -33,7 +33,7 @@ export default {
tag: { tag: {
type: Object, type: Object,
required: true required: true
}, }
}, },
// this is a hack to update the state of the button // this is a hack to update the state of the button
// for some reason, List does not update on changes to the tag object // for some reason, List does not update on changes to the tag object
@ -71,7 +71,8 @@ export default {
font-size: large; font-size: large;
} }
.unfollow-tag-button, .follow-tag-button { .unfollow-tag-button,
.follow-tag-button {
font-size: medium; font-size: medium;
} }
</style> </style>

View file

@ -212,9 +212,7 @@
:on-scope-change="changeVis" :on-scope-change="changeVis"
/> />
<div <div class="language-selector">
class="language-selector"
>
<Select <Select
id="post-language" id="post-language"
v-model="newStatus.language" v-model="newStatus.language"

View file

@ -118,7 +118,7 @@ export const defaultState = {
translationLanguage: undefined, // instance default, translationLanguage: undefined, // instance default,
supportedTranslationLanguages: {}, // instance default supportedTranslationLanguages: {}, // instance default
userProfileDefaultTab: 'statuses', userProfileDefaultTab: 'statuses',
useBlurhash: true, useBlurhash: true
} }
// caching the instance default properties // caching the instance default properties