From 86d6791fabbffe03910af463d5fe158a3c4c59a3 Mon Sep 17 00:00:00 2001 From: yo-goto <50942816+yo-goto@users.noreply.github.com> Date: Mon, 20 Sep 2021 23:53:13 +0900 Subject: [PATCH 1/3] made style compatible with Banner plugin --- src/styles.scss | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/styles.scss b/src/styles.scss index cb87aa4c..d63d53a1 100644 --- a/src/styles.scss +++ b/src/styles.scss @@ -12,6 +12,8 @@ - fixed note title width ## v0.4.6 - fixed note title card width in edit mode +## v0.4.7 +- made style compatible with Banner plugin */ @@ -254,6 +256,24 @@ body.plugin-card-view-mode { /* Background color so PNGs with transparent backgrounds don't look weird */ } + /* ---------------------------------------------- */ + /* banner plugin modification */ + /* ---------------------------------------------- */ + .obsidian-banner-wrapper { + margin-top: calc(var(--banner-height) - 30px); + + &>.obsidian-banner { + // images fit with card size + padding-left: 15px !important; + padding-right: 26px !important; + padding-top: 35px !important; + margin-top: 0px !important; + + img.banner-image { + border-radius: var(--cardview-card-boarder-radius) var(--cardview-card-boarder-radius) 0px 0px !important; + } + } + } } From 2c00aa84b2c723d1b0c53b52a25be9362e297e73 Mon Sep 17 00:00:00 2001 From: yo-goto <50942816+yo-goto@users.noreply.github.com> Date: Tue, 21 Sep 2021 00:28:59 +0900 Subject: [PATCH 2/3] add new setting item --- src/main.ts | 1 + src/settings.ts | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/src/main.ts b/src/main.ts index 0a048cd8..5775de52 100644 --- a/src/main.ts +++ b/src/main.ts @@ -69,6 +69,7 @@ export default class CardViewModePlugin extends Plugin { else { el.textContent = ` body.plugin-card-view-mode { + --cardview-card-boarder-radius: ${this.settings.cardCornerRadius}px; --cardview-embedded-title-border-right-color-edit: rgb(${this.settings.colorTitleCardEdge}); --cardview-embedded-title-border-right-color-preview: rgb(${this.settings.colorTitleCardEdge}); } diff --git a/src/settings.ts b/src/settings.ts index dd65536f..a875c73f 100644 --- a/src/settings.ts +++ b/src/settings.ts @@ -17,6 +17,7 @@ declare class CardViewModePlugin extends Plugin { export interface CardViewModeSettings { disabled: boolean; cardTitle: boolean; + cardCornerRadius: number; colorBackGroundLight: string; colorBackGroundDark: string; colorActiveCardLight: string; @@ -32,6 +33,7 @@ export interface CardViewModeSettings { export const DEFAULT_SETTINGS: CardViewModeSettings = { disabled: true, cardTitle: false, + cardCornerRadius: 10, colorBackGroundLight: "255, 255, 255", colorBackGroundDark: "145, 145, 145", colorActiveCardLight: "255, 255, 255", @@ -85,6 +87,20 @@ export class CardViewModeSettingTab extends PluginSettingTab { ) ); + new Setting(containerEl) + .setName('Card Corner Radius') + .setDesc('Set number to adjust card corner radius. Default radius is 8px.') + .addText(text => text.setPlaceholder('Default: 8px') + .setValue((this.plugin.settings.cardCornerRadius || '') + '') + .setPlaceholder('defalut: 8') + .onChange((value) => { + let nu = Number(value) + this.plugin.settings.cardCornerRadius = nu; + this.plugin.saveData(this.plugin.settings); + this.plugin.refresh(); + }) + ); + new Setting(containerEl) .setName("Background Color in Light Mode") From a7403b79fc11781c4ab3bbd9979cd29ef2849553 Mon Sep 17 00:00:00 2001 From: yo-goto <50942816+yo-goto@users.noreply.github.com> Date: Tue, 21 Sep 2021 00:30:14 +0900 Subject: [PATCH 3/3] update version info --- manifest.json | 2 +- package.json | 2 +- versions.json | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/manifest.json b/manifest.json index 69f96d89..6ceea37e 100644 --- a/manifest.json +++ b/manifest.json @@ -5,6 +5,6 @@ "minAppVersion": "0.12.13", "authorUrl": "https://github.com/yo-goto", "description": "Enable to view your notes as cards.", - "version": "0.4.6", + "version": "0.4.7", "isDesktopOnly": false } diff --git a/package.json b/package.json index efbe4946..3adcc249 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "obsidian-card-view-mode", - "version": "0.4.6", + "version": "0.4.7", "description": "Card View Mode & Attention Pane. View notes as cards!", "main": "main.js", "scripts": { diff --git a/versions.json b/versions.json index 9bb60d7a..6a7b4fb9 100644 --- a/versions.json +++ b/versions.json @@ -1,4 +1,5 @@ { + "0.4.7": "0.12.13", "0.4.6": "0.12.13", "0.4.5": "0.12.13", "0.4.4": "0.12.13",