Skip to content

Commit

Permalink
chore(viewer): 播放失败时添加抬头提示, close #229
Browse files Browse the repository at this point in the history
  • Loading branch information
mark9804 committed Feb 14, 2024
1 parent 506ed2e commit ff18023
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 21 deletions.
3 changes: 2 additions & 1 deletion apps/blue-archive-story-viewer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@
"xxhashjs": "^0.2.2",
"tailwindcss": "~3.3.5",
"autoprefixer": "~10.4.16",
"dayjs": "~1.11.9"
"dayjs": "~1.11.9",
"element-plus": "^2.3.7"
},
"devDependencies": {
"@babel/preset-env": "^7.22.5",
Expand Down
10 changes: 10 additions & 0 deletions apps/blue-archive-story-viewer/src/components/StoryViewer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
:use-super-sampling="useSuperSampling"
:exit-fullscreen-time-out="5000"
@end="handleStoryEnd"
@error="handleError()"
/>
<img
:src="useSuperSamplingImgPath"
Expand Down Expand Up @@ -157,6 +158,7 @@ import {
StoryContent,
StoryIndex,
} from "@/types/StoryJson";
import { ElMessage } from "element-plus";
import { getI18nString } from "@i18n/getI18nString";
import { stories } from "@index/mainStoryIndex";
import { stories as OtherStories } from "@index/otherStoryIndex";
Expand Down Expand Up @@ -461,6 +463,14 @@ async function handleReplay() {
function handleGoBack() {
router.go(-1);
}
function handleError(message = "播放可能失败,请刷新页面重试") {
ElMessage.error({
message: message,
center: true,
showClose: true,
});
}
</script>

<style scoped lang="scss">
Expand Down
13 changes: 13 additions & 0 deletions apps/blue-archive-story-viewer/src/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ html {
--color-pallete-arona-blue: #3f88f2;
--color-pallete-warning: #ffa00c;
--color-pallete-danger: #ff3a30;
--color-eden-danger-1: 255, 240, 232;
--color-eden-danger-6: 233, 88, 59;
--color-eden-danger-7: 194, 58, 37;

--color-card-background: #fff;

Expand Down Expand Up @@ -108,6 +111,9 @@ html[data-theme="dark"] {
--color-pallete-arona-blue: #b2cffa;
--color-pallete-warning: #cc820a;
--color-pallete-danger: #cc2f27;
--color-eden-danger-1: 77, 3, 0;
--color-eden-danger-6: 237, 125, 96;
--color-eden-danger-7: 242, 155, 129;

--color-card-background: #2f2f2f;
--color-glass-panel-border: #4b93dc;
Expand Down Expand Up @@ -281,6 +287,13 @@ a {
transition: color 0.375s ease-in-out;
}

.el-message--error {
--el-message-border-color: rgb(var(--color-eden-danger-7)) !important;
--el-message-bg-color: rgb(var(--color-eden-danger-1)) !important;
--el-message-text-color: rgb(var(--color-eden-danger-6)) !important;
box-shadow: 0 0 10px rgba(var(--color-eden-danger-7), 0.1);
}

.fluent-tag {
border-radius: 4px;
background-color: var(--color-tag-fluent);
Expand Down
25 changes: 5 additions & 20 deletions common/config/rush/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit ff18023

Please sign in to comment.