chore(tweaks): add tweaks + descriptions to updated mod.json

This commit is contained in:
dragonwocky 2024-04-21 19:08:38 +10:00
parent 3d7efbef54
commit 607fcee4f8
Signed by: dragonwocky
GPG Key ID: 7998D08F7D7BD7A8
5 changed files with 89 additions and 90 deletions

View File

@ -18,11 +18,12 @@ function TopbarButton({ icon, ...props }, ...children) {
[&>i]:size-[20px]`, [&>i]:size-[20px]`,
}); });
return html`<button ...${props}> // [role="button"] == `-webkit-app-region: no-drag`
return html`<div role="button" ...${props}>
${props.innerHTML || children.length ${props.innerHTML || children.length
? children ? children
: html`<i class="i-${icon}" />`} : html`<i class="i-${icon}" />`}
</button>`; </div>`;
} }
export { TopbarButton }; export { TopbarButton };

View File

@ -8,11 +8,11 @@
import { FloatingButton } from "../../core/islands/FloatingButton.mjs"; import { FloatingButton } from "../../core/islands/FloatingButton.mjs";
export default async (api, db) => { export default async (api, db) => {
const { html, addFloatingButton, removeFloatingButton } = api, const { html, addMutationListener } = api,
{ addMutationListener, removeMutationListener } = api, { addFloatingButton, removeFloatingButton } = api,
showScrollToBottom = await db.get("showScrollToBottom"), showScrollToBottom = await db.get("showScrollToBottom"),
distanceUntilShown = await db.get("distanceUntilScrollToTopShown"), distanceUntilShown = await db.get("distanceUntilScrollToTopShown"),
scrollUnits = await db.get("scrollDistanceUnits"), scrollUnit = await db.get("scrollDistanceUnit"),
behavior = (await db.get("smoothScrolling")) ? "smooth" : "auto", behavior = (await db.get("smoothScrolling")) ? "smooth" : "auto",
scroller = ".notion-frame > .notion-scroller"; scroller = ".notion-frame > .notion-scroller";
@ -32,7 +32,7 @@ export default async (api, db) => {
if (!$scroller) return; if (!$scroller) return;
const { scrollTop, scrollHeight, clientHeight } = $scroller; const { scrollTop, scrollHeight, clientHeight } = $scroller;
let scrollDist = scrollTop; let scrollDist = scrollTop;
if (scrollUnits === "Percent") { if (scrollUnit === "Percent") {
scrollDist = (scrollTop / (scrollHeight - clientHeight)) * 100; scrollDist = (scrollTop / (scrollHeight - clientHeight)) * 100;
if (isNaN(scrollDist)) scrollDist = 0; if (isNaN(scrollDist)) scrollDist = 0;
} }

View File

@ -39,7 +39,7 @@
}, },
{ {
"type": "select", "type": "select",
"key": "scrollDistanceUnits", "key": "scrollDistanceUnit",
"description": "The unit to measure the above distance in, e.g. you may wish the button to appear at 90% down any page or only on pages that scroll down further than a certain number of pixels.", "description": "The unit to measure the above distance in, e.g. you may wish the button to appear at 90% down any page or only on pages that scroll down further than a certain number of pixels.",
"values": ["Percent", "Pixels"] "values": ["Percent", "Pixels"]
} }

View File

@ -1,131 +1,128 @@
{ {
"name": "tweaks", "name": "Tweaks",
"id": "5174a483-c88d-4bf8-a95f-35cd330b76e2", "id": "5174a483-c88d-4bf8-a95f-35cd330b76e2",
"version": "0.3.0", "version": "0.3.0",
"description": "common style/layout changes and custom code insertion. check out the [tweaks page](https://notion-enhancer.github.io/advanced/tweaks) for more.", "description": "A collection of common layout and style changes: hiding nonessential elements, making formatted text more readable, and handling page resizing more fluidly.",
"tags": ["extension", "customisation"], "tags": ["customisation"],
"authors": [ "authors": [
{ {
"name": "dragonwocky", "name": "dragonwocky",
"email": "thedragonring.bod@gmail.com",
"homepage": "https://dragonwocky.me/", "homepage": "https://dragonwocky.me/",
"avatar": "https://dragonwocky.me/avatar.jpg" "avatar": "https://dragonwocky.me/avatar.jpg"
} }
], ],
"css": {
"client": ["client.css"]
},
"js": {
"client": ["client.mjs"]
},
"options": [ "options": [
{ "type": "heading", "label": "Interface" },
{ {
"type": "toggle", "type": "toggle",
"key": "remember_last_open", "key": "hideHelp",
"label": "remember last open tabs", "description": "Hide the help button floating at the bottom right of the interface.",
"tooltip": "**a continue-where-you-left-off experience** (reopens recently active tabs after an app relaunch)", "value": false
"value": true },
{
"type": "toggle",
"key": "HidelashMenu",
"description": "Hide the commands popup when typing '/'.",
"value": false
},
{
"type": "toggle",
"label": "Hide Notion AI",
"key": "hideNotionAI",
"description": "Hide the 'Ask AI' and 'Write ... with AI' prompts.",
"value": false
},
{
"type": "toggle",
"key": "hideDefaultIcons",
"description": "Hide the default <i class='i-file -mb-px'></i> page icons.",
"value": false
},
{
"type": "toggle",
"key": "snappyTransitions",
"description": "Disables style animations for a snappier experience across the board. This will not affect JavaScript-powered animations, e.g. the left sidebar popping out.",
"value": false
},
{ "type": "heading", "label": "Pages" },
{
"type": "toggle",
"key": "fullWidthPages",
"description": "Decreases page padding so every page fills the available space either side (a global toggle for the 'full width' option under page settings).",
"value": false
},
{
"type": "toggle",
"key": "normalisedTableScrolling",
"description": "Forces horizontally scrollable inline tables to respect the width and padding of a page when they overflow.",
"value": false
}, },
{ {
"type": "number", "type": "number",
"key": "tweak.responsive_breakpoint_px", "key": "responsiveColumnsBreakpoint",
"label": "responsive columns breakpoint (px)", "description": "The width of the window below which in-page columns are made full width to avoid squishing column contents.",
"tooltip": "the **width in pixels below which in-page columns are resized** to appear full-width to reduce content squishing", "value": 640
"value": 600
}, },
{ {
"type": "number", "type": "select",
"key": "tweak.responsive_breakpoint_percent", "key": "responsiveColumnsUnit",
"label": "responsive columns breakpoint (%)", "description": "The unit to measure the above width in, e.g. you may wish the button to appear when the window occupies <= 20% of the screen or is less than a certain number of pixels wide.",
"tooltip": "the **percentage of the screen below which in-page columns are resized to appear full-width** to reduce content squishing", "values": ["Pixels", "Percent"]
"value": 30
}, },
{ {
"type": "toggle", "type": "toggle",
"key": "tweak.full_width_pages", "key": "hidePageDiscussions",
"label": "full width pages", "description": "Hide the comments section at the top of pages within databases.",
"tooltip": "**decreases padding so every page appears full width**", "value": false
},
{ "type": "heading", "label": "Typography" },
{
"type": "toggle",
"key": "increasedLineSpacing",
"description": "Increases spacing between text blocks (paragraphs) to improve readability.",
"value": false "value": false
}, },
{ {
"type": "toggle", "type": "toggle",
"key": "tweak.normalise_table_scroll", "key": "condensedBulletedLists",
"label": "wrap tables to page width", "description": "Tightened line spacing between bulleted list items.",
"tooltip": "**force horizontally scrollable tables to respect the width and padding of a page when they overflow**", "value": false
},
{
"type": "toggle",
"key": "thickerBoldText",
"description": "Increases the weight of bolded text from 600 (semibold) to 700 (bold), making it stand out more obviously against regular text.",
"value": true "value": true
}, },
{ {
"type": "toggle", "type": "toggle",
"key": "tweak.snappy_transitions", "key": "bracketedLinks",
"label": "snappy transitions", "description": "Renders links Obsidian-style, surrounded with [[square brackets]] instead of <span class='underline'>underlined</span>.",
"tooltip": "enabling this **eliminates css animation time**, but will not prevent motion e.g. the sidebar popping out",
"value": false "value": false
}, },
{ {
"type": "toggle", "type": "toggle",
"key": "tweak.hide_help", "key": "accentedLinks",
"label": "hide help button", "description": "Colours links with Notion's blue colour or a theme's equivalent.",
"value": false "value": false
}, },
{ {
"type": "toggle", "type": "toggle",
"key": "tweak.hide_slash_for_commands", "key": "quoteBlockQuotationMarks",
"label": "hide \"Type '/' for commands\"", "description": "Wraps quote block content in large, decorative serif quotation marks.",
"value": false "value": false
}, },
{ {
"type": "toggle", "type": "toggle",
"key": "tweak.hide_default_page_icons", "key": "compactCodeBlocks",
"label": "hide default page icons", "description": "Decreases code block padding to fit more naturally into the flow of text down a page.",
"tooltip": "hide **default (svg.page)** page icons, both in sidebar and opened pages, to save some space",
"value": true
},
{
"type": "toggle",
"key": "tweak.thicker_bold",
"label": "thicker bold text",
"value": true
},
{
"type": "toggle",
"key": "tweak.spaced_lines",
"label": "readable line spacing",
"tooltip": "**greater line spacing between text blocks**",
"value": false
},
{
"type": "toggle",
"key": "tweak.condensed_bullets",
"label": "condense bullet points",
"tooltip": "**tighter line spacing between bullet point blocks**",
"value": false
},
{
"type": "toggle",
"key": "tweak.bracketed_links",
"label": "bracketed links",
"tooltip": "**render links surrounded with [[brackets]] instead of __underlined__**",
"value": false
},
{
"type": "toggle",
"key": "tweak.accented_links",
"label": "accented links",
"tooltip": "**links are shown by default with notion's blue colour or a theme's equivalent**",
"value": false
},
{
"type": "toggle",
"key": "tweak.quotation_marks",
"label": "quote block quotation marks",
"tooltip": "**wrap quote block content in large, decorative serif quotation marks**",
"value": false "value": false
}, },
{ {
"type": "select", "type": "select",
"key": "tweak.img_alignment", "key": "defaultImageAlignment",
"label": "image alignment", "description": "Changes the default horizontal alignment of images embedded within pages. Note that this replaces Notion's built-in central alignment, i.e. setting this to left or right will remove the option to centre images entirely.",
"values": ["center", "left", "right"] "values": ["Centre", "Left", "Right"]
} }
] ]
} }

View File

@ -1,6 +1,7 @@
[ [
"core", "core",
"extensions/topbar", "extensions/topbar",
"extensions/tweaks",
"extensions/scroller", "extensions/scroller",
"extensions/outliner", "extensions/outliner",
"extensions/word-counter", "extensions/word-counter",