diff options
author | 135e2 <[email protected]> | 2022-08-13 21:35:54 +0800 |
---|---|---|
committer | 135e2 <[email protected]> | 2022-08-13 22:35:57 +0800 |
commit | 9b788ccf13a2018a8ff0b6bed1607770bfec314d (patch) | |
tree | 66127a7eed5f169aaec1172f7be66b334fd08cf8 /src/App.vue | |
parent | 131f3b1c6beeb477494a4874f686a18601357887 (diff) | |
download | otonashi-9b788ccf13a2018a8ff0b6bed1607770bfec314d.tar.gz otonashi-9b788ccf13a2018a8ff0b6bed1607770bfec314d.tar.bz2 otonashi-9b788ccf13a2018a8ff0b6bed1607770bfec314d.zip |
feat(SettingsPage): reimplement backgroundImage customization
A pretty basic implementation to change bgImage dynamically, which was formerly reverted.
Ref: ffd55641317ebd6344e92eb8a3204981846b5e05
Diffstat (limited to 'src/App.vue')
-rw-r--r-- | src/App.vue | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/App.vue b/src/App.vue index 24f5b83..0641b2a 100644 --- a/src/App.vue +++ b/src/App.vue @@ -54,6 +54,7 @@ v-else-if="atSettings" @update-title-size="updateTitleSize" @update-content-size="updateContentSize" + @update-background-image-u-r-l="updateBackgroundImageURL" :realTitleSize="parseInt(titleSize)" :realContentSize="contentSize" /> @@ -93,7 +94,7 @@ export default { snackbarText: "Default snackbar text (End-user shouldn't see this)", bg: { // backgroundColor: "grey", - // backgroundImage: "url(https://wallpapercave.com/wp/wp9649930.jpg)", + backgroundImage: "", backgroundPosition: "center", }, }), @@ -110,6 +111,12 @@ export default { }; }, + mounted() { + let backgroundImageURL = + JSON.parse(localStorage.getItem("backgroundImageURL")) || ""; + this.updateBackgroundImageURL(backgroundImageURL); + }, + methods: { toggleDrawer() { this.drawer = !this.drawer; @@ -124,6 +131,9 @@ export default { updateContentSize(s) { this.contentSize = s; }, + updateBackgroundImageURL(s) { + this.bg.backgroundImage = s ? `url(${s})` : ""; + }, }, }; </script> |