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]`,
});
return html`<button ...${props}>
// [role="button"] == `-webkit-app-region: no-drag`
return html`<div role="button" ...${props}>
${props.innerHTML || children.length
? children
: html`<i class="i-${icon}" />`}
</button>`;
</div>`;
}
export { TopbarButton };

View File

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

View File

@ -39,7 +39,7 @@
},
{
"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.",
"values": ["Percent", "Pixels"]
}

View File

@ -1,131 +1,128 @@
{
"name": "tweaks",
"name": "Tweaks",
"id": "5174a483-c88d-4bf8-a95f-35cd330b76e2",
"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.",
"tags": ["extension", "customisation"],
"description": "A collection of common layout and style changes: hiding nonessential elements, making formatted text more readable, and handling page resizing more fluidly.",
"tags": ["customisation"],
"authors": [
{
"name": "dragonwocky",
"email": "thedragonring.bod@gmail.com",
"homepage": "https://dragonwocky.me/",
"avatar": "https://dragonwocky.me/avatar.jpg"
}
],
"css": {
"client": ["client.css"]
},
"js": {
"client": ["client.mjs"]
},
"options": [
{ "type": "heading", "label": "Interface" },
{
"type": "toggle",
"key": "remember_last_open",
"label": "remember last open tabs",
"tooltip": "**a continue-where-you-left-off experience** (reopens recently active tabs after an app relaunch)",
"value": true
"key": "hideHelp",
"description": "Hide the help button floating at the bottom right of the interface.",
"value": false
},
{
"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",
"key": "tweak.responsive_breakpoint_px",
"label": "responsive columns breakpoint (px)",
"tooltip": "the **width in pixels below which in-page columns are resized** to appear full-width to reduce content squishing",
"value": 600
"key": "responsiveColumnsBreakpoint",
"description": "The width of the window below which in-page columns are made full width to avoid squishing column contents.",
"value": 640
},
{
"type": "number",
"key": "tweak.responsive_breakpoint_percent",
"label": "responsive columns breakpoint (%)",
"tooltip": "the **percentage of the screen below which in-page columns are resized to appear full-width** to reduce content squishing",
"value": 30
"type": "select",
"key": "responsiveColumnsUnit",
"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.",
"values": ["Pixels", "Percent"]
},
{
"type": "toggle",
"key": "tweak.full_width_pages",
"label": "full width pages",
"tooltip": "**decreases padding so every page appears full width**",
"key": "hidePageDiscussions",
"description": "Hide the comments section at the top of pages within databases.",
"value": false
},
{ "type": "heading", "label": "Typography" },
{
"type": "toggle",
"key": "increasedLineSpacing",
"description": "Increases spacing between text blocks (paragraphs) to improve readability.",
"value": false
},
{
"type": "toggle",
"key": "tweak.normalise_table_scroll",
"label": "wrap tables to page width",
"tooltip": "**force horizontally scrollable tables to respect the width and padding of a page when they overflow**",
"key": "condensedBulletedLists",
"description": "Tightened line spacing between bulleted list items.",
"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
},
{
"type": "toggle",
"key": "tweak.snappy_transitions",
"label": "snappy transitions",
"tooltip": "enabling this **eliminates css animation time**, but will not prevent motion e.g. the sidebar popping out",
"key": "bracketedLinks",
"description": "Renders links Obsidian-style, surrounded with [[square brackets]] instead of <span class='underline'>underlined</span>.",
"value": false
},
{
"type": "toggle",
"key": "tweak.hide_help",
"label": "hide help button",
"key": "accentedLinks",
"description": "Colours links with Notion's blue colour or a theme's equivalent.",
"value": false
},
{
"type": "toggle",
"key": "tweak.hide_slash_for_commands",
"label": "hide \"Type '/' for commands\"",
"key": "quoteBlockQuotationMarks",
"description": "Wraps quote block content in large, decorative serif quotation marks.",
"value": false
},
{
"type": "toggle",
"key": "tweak.hide_default_page_icons",
"label": "hide default page icons",
"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**",
"key": "compactCodeBlocks",
"description": "Decreases code block padding to fit more naturally into the flow of text down a page.",
"value": false
},
{
"type": "select",
"key": "tweak.img_alignment",
"label": "image alignment",
"values": ["center", "left", "right"]
"key": "defaultImageAlignment",
"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": ["Centre", "Left", "Right"]
}
]
}

View File

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