-
Notifications
You must be signed in to change notification settings - Fork 309
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Romot
committed
Jan 24, 2024
1 parent
b5801cc
commit 0b2ab35
Showing
6 changed files
with
155 additions
and
157 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
<template> | ||
<div class="character-portrait-wrap" :class="{ hide: !isShowSinger }"> | ||
<img class="character-portrait" :src="portraitPath" /> | ||
</div> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import { defineComponent, computed } from "vue"; | ||
import { useStore } from "@/store"; | ||
export default defineComponent({ | ||
name: "CharacterPortrait", | ||
setup() { | ||
const store = useStore(); | ||
const isShowSinger = computed(() => store.state.isShowSinger); | ||
const userOrderedCharacterInfos = computed( | ||
() => store.getters.USER_ORDERED_CHARACTER_INFOS | ||
); | ||
const characterInfo = computed(() => { | ||
if (!userOrderedCharacterInfos.value || !store.state.singer) { | ||
return undefined; | ||
} | ||
return store.getters.CHARACTER_INFO( | ||
store.state.singer.engineId, | ||
store.state.singer.styleId | ||
); | ||
}); | ||
const portraitPath = computed(() => characterInfo.value?.portraitPath); | ||
return { | ||
isShowSinger, | ||
userOrderedCharacterInfos, | ||
characterInfo, | ||
portraitPath, | ||
}; | ||
}, | ||
}); | ||
</script> | ||
|
||
<style scoped lang="scss"> | ||
@use '@/styles/variables' as vars; | ||
@use '@/styles/colors' as colors; | ||
// 画面右下に固定表示 | ||
// 幅固定、高さ可変、画像のアスペクト比を保持、wrapのwidthに合わせてheightを調整 | ||
// bottom位置はスクロールバーの上に表示 | ||
.character-portrait-wrap { | ||
opacity: 0.8; | ||
overflow: hidden; | ||
pointer-events: none; | ||
position: fixed; | ||
bottom: 0; | ||
right: 96px; | ||
min-width: 200px; | ||
max-width: 20vw; | ||
z-index: 10; | ||
} | ||
.character-portrait { | ||
width: 100%; | ||
height: auto; | ||
transition: all 0.3s ease; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.