Skip to content

Commit

Permalink
Feat: emoji - Sticker
Browse files Browse the repository at this point in the history
  • Loading branch information
fs5m8 committed Jan 2, 2023
1 parent 5fa1db5 commit 4a2f225
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 5 deletions.
1 change: 1 addition & 0 deletions locales/en-US.yml
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ common:
reduce-motion: "Reduce motion in UI"
this-setting-is-this-device-only: "Only for this device"
make-custom-emojis-bigger: "Make custom emojis bigger"
use-sticker: "Use Sticker"
use-os-default-emojis: "Use the OS default Emojis"
line-width: "Line thickness"
line-width-thin: "Thin"
Expand Down
1 change: 1 addition & 0 deletions locales/ja-JP.yml
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ common:
reduce-motion: "UI の動きを減らす"
this-setting-is-this-device-only: "このデバイスのみ"
make-custom-emojis-bigger: "カスタム絵文字を大きく表示する"
use-sticker: "スタンプを使用する"
use-os-default-emojis: "OS 標準の絵文字を使用"
line-width: "線の太さ"
line-width-thin: "細い"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<mfm-core v-bind="$attrs" class="havbbuyv" :class="{ nowrap: $attrs['nowrap'] }" v-once/>
<mfm-core v-bind="$attrs" class="havbbuyv" :class="{ nowrap: $attrs['nowrap'], sticker: !$attrs['no-sticker'] && $store.state.device.useSticker }" v-once/>
</template>

<script lang="ts">
Expand All @@ -21,6 +21,10 @@ export default Vue.extend({
white-space pre
word-wrap normal
&:not(.nowrap).sticker
>>> .fvgwvorwhxigeolkkrcderjzcawqrscl:only-child
font-size 4em
>>> .title
display block
margin-bottom 4px
Expand Down
6 changes: 6 additions & 0 deletions src/client/app/common/views/components/settings/settings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
<ui-switch v-model="showFullAcct">{{ $t('@._settings.show-full-acct') }}</ui-switch>
<ui-switch v-model="showVia">{{ $t('@._settings.show-via') }}</ui-switch>
<ui-switch v-model="makeCustomEmojisBigger">{{ $t('@._settings.make-custom-emojis-bigger') }}</ui-switch>
<ui-switch v-model="useSticker">{{ $t('@._settings.use-sticker') }}</ui-switch>
<ui-switch v-model="useOsDefaultEmojis">{{ $t('@._settings.use-os-default-emojis') }}</ui-switch>
<ui-switch v-model="iLikeSushi">{{ $t('@._settings.i-like-sushi') }}</ui-switch>
</section>
Expand Down Expand Up @@ -396,6 +397,11 @@ export default Vue.extend({
set(value) { this.$store.commit('device/set', { key: 'makeCustomEmojisBigger', value }); }
},
useSticker: {
get() { return this.$store.state.device.useSticker; },
set(value) { this.$store.commit('device/set', { key: 'useSticker', value }); }
},
reduceMotion: {
get() { return this.$store.state.device.reduceMotion; },
set(value) { this.$store.commit('device/set', { key: 'reduceMotion', value }); }
Expand Down
2 changes: 1 addition & 1 deletion src/client/app/desktop/views/components/note-detail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
</header>
<div class="body">
<p v-if="appearNote.cw != null" class="cw">
<mfm v-if="appearNote.cw != ''" class="text" :text="appearNote.cw" :author="appearNote.user" :i="$store.state.i" :custom-emojis="appearNote.emojis" />
<mfm v-if="appearNote.cw != ''" class="text" :text="appearNote.cw" :author="appearNote.user" :i="$store.state.i" :custom-emojis="appearNote.emojis" :no-sticker="true"/>
<mk-cw-button v-model="showContent" :note="appearNote"/>
</p>
<div class="content" v-show="appearNote.cw == null || showContent">
Expand Down
2 changes: 1 addition & 1 deletion src/client/app/desktop/views/components/note.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<mk-note-header class="header" :note="appearNote" :mini="narrow"/>
<div class="body" v-if="appearNote.deletedAt == null">
<p v-if="appearNote.cw != null" class="cw">
<mfm v-if="appearNote.cw != ''" class="text" :text="appearNote.cw" :author="appearNote.user" :i="$store.state.i" :custom-emojis="appearNote.emojis" />
<mfm v-if="appearNote.cw != ''" class="text" :text="appearNote.cw" :author="appearNote.user" :i="$store.state.i" :custom-emojis="appearNote.emojis" :no-sticker="true"/>
<mk-cw-button v-model="showContent" :note="appearNote"/>
</p>
<div class="content" v-show="appearNote.cw == null || showContent">
Expand Down
2 changes: 1 addition & 1 deletion src/client/app/mobile/views/components/note-detail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
</header>
<div class="body">
<p v-if="appearNote.cw != null" class="cw">
<mfm v-if="appearNote.cw != ''" class="text" :text="appearNote.cw" :author="appearNote.user" :i="$store.state.i" :custom-emojis="appearNote.emojis" />
<mfm v-if="appearNote.cw != ''" class="text" :text="appearNote.cw" :author="appearNote.user" :i="$store.state.i" :custom-emojis="appearNote.emojis" :no-sticker="true"/>
<mk-cw-button v-model="showContent" :note="appearNote"/>
</p>
<div class="content" v-show="appearNote.cw == null || showContent">
Expand Down
2 changes: 1 addition & 1 deletion src/client/app/mobile/views/components/note.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<mk-note-header class="header" :note="appearNote" :mini="true"/>
<div class="body" v-if="appearNote.deletedAt == null">
<p v-if="appearNote.cw != null" class="cw">
<mfm v-if="appearNote.cw != ''" class="text" :text="appearNote.cw" :author="appearNote.user" :i="$store.state.i" :custom-emojis="appearNote.emojis" />
<mfm v-if="appearNote.cw != ''" class="text" :text="appearNote.cw" :author="appearNote.user" :i="$store.state.i" :custom-emojis="appearNote.emojis" :no-sticker="true"/>
<mk-cw-button v-model="showContent" :note="appearNote"/>
</p>
<div class="content" v-show="appearNote.cw == null || showContent">
Expand Down
1 change: 1 addition & 0 deletions src/client/app/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ const defaultDeviceSettings = {
roundedCorners: true,
reduceMotion: false,
makeCustomEmojisBigger: true,
useSticker: false,
darkmode: true,
darkTheme: 'bb5a8287-a072-4b0a-8ae5-ea2a0d33f4f2',
lightTheme: 'light',
Expand Down

0 comments on commit 4a2f225

Please sign in to comment.