From 9ac6c640e5c3b0d17ca7f3650e908e55f7fe7a8e Mon Sep 17 00:00:00 2001 From: 135e2 <135e2@135e2.tk> Date: Tue, 9 Aug 2022 00:00:55 +0800 Subject: feat(SettingsPage): support HomePage settings - Add support for titleSize and contentSize --- src/App.vue | 27 ++++++++++++--- src/components/HomePage.vue | 2 ++ src/components/SettingsPage.vue | 73 +++++++++++++++++++++++++++++++++++++++-- src/components/SubCard.vue | 4 +-- 4 files changed, 98 insertions(+), 8 deletions(-) diff --git a/src/App.vue b/src/App.vue index 20f769c..67915be 100644 --- a/src/App.vue +++ b/src/App.vue @@ -48,11 +48,22 @@ - - - + + + + + + .v-card-title { font-size: {{ titleSize }}; } + @@ -72,6 +83,8 @@ export default { }, data: () => ({ + titleSize: "35px", + contentSize: "text-h5", drawer: null, atHome: true, atEdit: false, @@ -79,7 +92,7 @@ export default { snackbar: false, snackbarText: "Default snackbar text (End-user shouldn't see this)", bg: { - backgroundColor: "grey", + // backgroundColor: "grey", // backgroundImage: "url(https://wallpapercave.com/wp/wp9649930.jpg)", backgroundPosition: "center", }, @@ -105,6 +118,12 @@ export default { this.snackbarText = text; this.snackbar = true; }, + updateTitleSize(s) { + this.titleSize = `${s}px`; + }, + updateContentSize(s) { + this.contentSize = s; + }, }, }; diff --git a/src/components/HomePage.vue b/src/components/HomePage.vue index 3a50c80..20843b5 100644 --- a/src/components/HomePage.vue +++ b/src/components/HomePage.vue @@ -6,6 +6,7 @@ :key="i" :title="k" :content="markdownToHtml(v)" + :contentSize="contentSize" /> @@ -16,6 +17,7 @@ import { marked } from "marked"; export default { name: "HomePage", + props: ["contentSize"], components: { SubCard, diff --git a/src/components/SettingsPage.vue b/src/components/SettingsPage.vue index b3174bf..da10500 100644 --- a/src/components/SettingsPage.vue +++ b/src/components/SettingsPage.vue @@ -1,13 +1,82 @@ diff --git a/src/components/SubCard.vue b/src/components/SubCard.vue index 5a08e3b..3590fa0 100644 --- a/src/components/SubCard.vue +++ b/src/components/SubCard.vue @@ -2,7 +2,7 @@ {{ title }} -
+
@@ -13,6 +13,6 @@ export default { data: () => ({ // }), - props: ["title", "content"], + props: ["title", "content", "contentSize"], }; -- cgit v1.2.3