2022-03-29 13:18:25 +02:00
|
|
|
export const defaultSettings: CustomFramesSettings = {
|
|
|
|
frames: [],
|
|
|
|
padding: 5
|
|
|
|
};
|
2022-04-13 21:21:48 +02:00
|
|
|
export const presets: Record<string, CustomFrameSettings> = {
|
2022-03-29 13:18:25 +02:00
|
|
|
"obsidian": {
|
|
|
|
url: "https://forum.obsidian.md/",
|
|
|
|
displayName: "Obsidian Forum",
|
|
|
|
icon: "edit",
|
|
|
|
hideOnMobile: true,
|
2022-04-15 13:22:09 +02:00
|
|
|
addRibbonIcon: true,
|
2022-04-15 13:34:24 +02:00
|
|
|
openInCenter: true,
|
2022-04-02 15:16:01 +02:00
|
|
|
zoomLevel: 1,
|
2022-04-26 13:05:22 +02:00
|
|
|
forceIframe: false,
|
2022-03-29 13:18:25 +02:00
|
|
|
customCss: ""
|
2022-03-29 17:00:16 +02:00
|
|
|
},
|
2022-08-21 17:59:12 +02:00
|
|
|
"detexify": {
|
|
|
|
url: "https://detexify.kirelabs.org/classify.html",
|
|
|
|
displayName: "Detexify",
|
|
|
|
icon: "type",
|
|
|
|
hideOnMobile: true,
|
|
|
|
addRibbonIcon: true,
|
|
|
|
openInCenter: false,
|
|
|
|
zoomLevel: .95,
|
|
|
|
forceIframe: false,
|
|
|
|
customCss: `/* hide info clutter and ad banner */
|
|
|
|
#classify--info-area,
|
2022-08-21 17:52:04 +02:00
|
|
|
.adsbygoogle {
|
|
|
|
display: none !important
|
|
|
|
}`
|
2022-08-21 17:59:12 +02:00
|
|
|
},
|
2022-04-02 14:50:55 +02:00
|
|
|
"calendar": {
|
2022-09-17 17:34:41 +02:00
|
|
|
url: "https://calendar.google.com/calendar",
|
2022-03-29 17:00:16 +02:00
|
|
|
displayName: "Google Calendar",
|
|
|
|
icon: "calendar",
|
|
|
|
hideOnMobile: true,
|
2022-04-15 13:22:09 +02:00
|
|
|
addRibbonIcon: true,
|
2022-04-15 13:34:24 +02:00
|
|
|
openInCenter: true,
|
2022-04-02 15:16:01 +02:00
|
|
|
zoomLevel: 1,
|
2022-04-26 13:05:22 +02:00
|
|
|
forceIframe: false,
|
2022-09-17 17:37:23 +02:00
|
|
|
customCss: `/* hide the menu bar, "Keep" text, and logo */
|
|
|
|
html > body > div:nth-child(2) > div:nth-child(2) > div:first-child[class*=" "],
|
|
|
|
html > body > div:first-child > header:first-child > div > div:first-child > div > div:first-child,
|
|
|
|
html > body > div:nth-child(2) > div:nth-child(2) > div:first-child > div:first-child {
|
|
|
|
display: none !important;
|
2022-03-29 17:00:16 +02:00
|
|
|
}`
|
2022-03-29 13:18:25 +02:00
|
|
|
},
|
|
|
|
"keep": {
|
|
|
|
url: "https://keep.google.com",
|
|
|
|
displayName: "Google Keep",
|
|
|
|
icon: "files",
|
|
|
|
hideOnMobile: true,
|
2022-04-15 13:22:09 +02:00
|
|
|
addRibbonIcon: false,
|
2022-04-15 13:34:24 +02:00
|
|
|
openInCenter: false,
|
2022-04-02 15:16:01 +02:00
|
|
|
zoomLevel: 1,
|
2022-04-26 13:05:22 +02:00
|
|
|
forceIframe: false,
|
2022-03-29 13:18:25 +02:00
|
|
|
customCss: `/* hide the menu bar and the "Keep" text */
|
2022-08-21 17:37:20 +02:00
|
|
|
html > body > div:nth-child(2) > div:nth-child(2) > div:first-child,
|
|
|
|
html > body > div:first-child > header:first-child > div > div:first-child > div > div:first-child > a:first-child > span {
|
|
|
|
display: none !important;
|
2022-03-29 13:18:25 +02:00
|
|
|
}`
|
|
|
|
},
|
2022-04-02 15:19:27 +02:00
|
|
|
"todoist": {
|
|
|
|
url: "https://todoist.com",
|
|
|
|
displayName: "Todoist",
|
|
|
|
icon: "list-checks",
|
|
|
|
hideOnMobile: true,
|
2022-04-15 13:22:09 +02:00
|
|
|
addRibbonIcon: false,
|
2022-04-15 13:34:24 +02:00
|
|
|
openInCenter: false,
|
2022-04-02 15:19:27 +02:00
|
|
|
zoomLevel: 1,
|
2022-04-26 13:05:22 +02:00
|
|
|
forceIframe: false,
|
2022-04-02 15:19:27 +02:00
|
|
|
customCss: `/* hide the help, home, search, and productivity overview buttons, create extra space, and prevent toast pop-up from acting weird */
|
2022-04-02 15:18:38 +02:00
|
|
|
[aria-label="Go to Home view"], #quick_find, [aria-label="Productivity"], [aria-label="Help & Feedback"] {
|
|
|
|
display: none !important;
|
|
|
|
}
|
|
|
|
|
|
|
|
.view_content {
|
|
|
|
padding-left: 15px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.view_header {
|
|
|
|
padding-left: 15px;
|
|
|
|
padding-top: 10px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.undo_toast {
|
|
|
|
width: 95%;
|
2022-04-02 15:19:27 +02:00
|
|
|
}`
|
|
|
|
},
|
2022-03-29 13:18:25 +02:00
|
|
|
"notion": {
|
|
|
|
url: "https://www.notion.so/",
|
|
|
|
displayName: "Notion",
|
|
|
|
icon: "box",
|
|
|
|
hideOnMobile: true,
|
2022-04-15 13:22:09 +02:00
|
|
|
addRibbonIcon: true,
|
2022-04-15 13:34:24 +02:00
|
|
|
openInCenter: true,
|
2022-04-02 15:16:01 +02:00
|
|
|
zoomLevel: 1,
|
2022-04-26 13:05:22 +02:00
|
|
|
forceIframe: false,
|
2022-03-29 13:18:25 +02:00
|
|
|
customCss: ""
|
2022-03-29 14:07:25 +02:00
|
|
|
},
|
|
|
|
"twitter": {
|
|
|
|
url: "https://twitter.com",
|
|
|
|
displayName: "Twitter",
|
|
|
|
icon: "twitter",
|
|
|
|
hideOnMobile: true,
|
2022-04-15 13:22:09 +02:00
|
|
|
addRibbonIcon: false,
|
2022-04-15 13:34:24 +02:00
|
|
|
openInCenter: false,
|
2022-04-02 15:16:01 +02:00
|
|
|
zoomLevel: 1,
|
2022-04-26 13:05:22 +02:00
|
|
|
forceIframe: false,
|
2022-03-29 14:07:25 +02:00
|
|
|
customCss: ""
|
2023-01-30 12:12:14 +01:00
|
|
|
},
|
2023-01-30 12:12:56 +01:00
|
|
|
"tasks": {
|
|
|
|
url: "https://tasks.google.com/embed/?origin=https://calendar.google.com&fullWidth=1",
|
|
|
|
displayName: "Google Tasks",
|
|
|
|
icon: "list-checks",
|
2023-01-30 12:12:14 +01:00
|
|
|
hideOnMobile: true,
|
|
|
|
addRibbonIcon: false,
|
|
|
|
openInCenter: false,
|
|
|
|
zoomLevel: 1,
|
|
|
|
forceIframe: false,
|
2023-01-30 12:12:56 +01:00
|
|
|
customCss: ""
|
|
|
|
}
|
2022-03-29 13:18:25 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
export interface CustomFramesSettings {
|
2022-04-13 21:21:48 +02:00
|
|
|
frames: CustomFrameSettings[];
|
2022-03-29 13:18:25 +02:00
|
|
|
padding: number;
|
|
|
|
}
|
|
|
|
|
2022-04-13 21:21:48 +02:00
|
|
|
export interface CustomFrameSettings {
|
2022-03-29 13:18:25 +02:00
|
|
|
url: string;
|
|
|
|
displayName: string;
|
|
|
|
icon: string;
|
|
|
|
hideOnMobile: boolean;
|
2022-04-15 13:22:09 +02:00
|
|
|
addRibbonIcon: boolean;
|
2022-04-15 13:34:24 +02:00
|
|
|
openInCenter: boolean;
|
2022-04-02 15:16:01 +02:00
|
|
|
zoomLevel: number;
|
2022-04-26 13:05:22 +02:00
|
|
|
forceIframe: boolean;
|
2022-03-29 13:18:25 +02:00
|
|
|
customCss: string;
|
2022-03-29 17:00:16 +02:00
|
|
|
}
|
2022-04-15 13:22:09 +02:00
|
|
|
|
|
|
|
export function getIcon(settings: CustomFrameSettings) {
|
|
|
|
return settings.icon ? `lucide-${settings.icon}` : "documents";
|
2022-08-21 17:37:20 +02:00
|
|
|
}
|
2022-08-21 17:59:12 +02:00
|
|
|
|
|
|
|
export function getId(settings: CustomFrameSettings) {
|
|
|
|
return settings.displayName.toLowerCase().replace(/\s/g, "-");
|
|
|
|
}
|