Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
yo-goto committed Sep 20, 2021
2 parents 41e08b1 + a7403b7 commit f3e57fa
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 2 deletions.
2 changes: 1 addition & 1 deletion manifest.json
Expand Up @@ -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
}
2 changes: 1 addition & 1 deletion 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": {
Expand Down
1 change: 1 addition & 0 deletions src/main.ts
Expand Up @@ -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});
}
Expand Down
16 changes: 16 additions & 0 deletions src/settings.ts
Expand Up @@ -17,6 +17,7 @@ declare class CardViewModePlugin extends Plugin {
export interface CardViewModeSettings {
disabled: boolean;
cardTitle: boolean;
cardCornerRadius: number;
colorBackGroundLight: string;
colorBackGroundDark: string;
colorActiveCardLight: string;
Expand All @@ -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",
Expand Down Expand Up @@ -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")
Expand Down
20 changes: 20 additions & 0 deletions src/styles.scss
Expand Up @@ -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
*/


Expand Down Expand Up @@ -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;
}
}
}
}


Expand Down
1 change: 1 addition & 0 deletions 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",
Expand Down

0 comments on commit f3e57fa

Please sign in to comment.