/** * The credit a canvas carries, and the one switch that removes it. * * A free shader is paid for in links. The badge is how: a small, real, * followed anchor to the shader's own page, drawn in the corner of the canvas * it credits. It is deliberately not clever — no hidden text, no anchor with * no size, no URL smuggled into a comment. A credit that a reader cannot see * is worth nothing to a search engine and is against their policies besides. * * Nothing here checks a licence, and nothing here reaches the network. The * runtime stays MIT and stays offline: `setBadge(false)` is one call, it works * for everybody, and what makes it honest is the LICENSE file that ships beside * a free shader, not a lock in this file. Enforcement in a bundle a reader can * edit is theatre, and theatre is worse than terms. * * The setting is page-wide for the same reason `setQualityTier` is: an app * either credits or it does not, and passing the same prop to forty canvases * is how one gets missed. */ /** * Which corner the credit sits in. * * Four corners and nothing else — no offset, no opacity, no class to style it * with. A badge that collides with a reader's own controls is a reason to strip * it rather than move it, so moving it has to be easy. Every other knob anyone * would ask for is a knob for hiding it while claiming it is on, and there is * already a switch for turning it off honestly. */ export type BadgeCorner = "bottom-right" | "bottom-left" | "top-right" | "top-left"; /** The inset of each corner, in pixels from the two edges it touches. */ export declare const BADGE_CORNERS: Record>; /** * Show or hide the credit on every canvas on the page. * * Call it at module scope, in a module both the server and the browser load. * The badge is rendered, not mounted — setting this inside an effect would * render one on the server and none in the browser, which is a hydration * mismatch rather than a hidden badge. */ export declare function setBadge(shown: boolean): void; /** Whether the page credits shadertown. Defaults to true. */ export declare function badgeShown(): boolean; /** * Put the credit in a different corner of every canvas on the page. Same rule * as `setBadge`: module scope, where the server and the browser both run it. */ export declare function setBadgePosition(corner: BadgeCorner): void; /** The corner the page puts the credit in. Defaults to `bottom-right`. */ export declare function badgePosition(): BadgeCorner; /** * Where a badge points: the page for the shader it is drawn on, not the home * page. One badge per shader spreads the links across the catalogue the way a * hand-written link would, and it takes the reader to the thing they just saw * rather than to a pitch. */ export declare function badgeHref(shader: string): string; /** The anchor text. The brand, and enough words to say what the link is. */ export declare const BADGE_PREFIX = "Shaders by"; export declare const BADGE_NAME = "shadertown"; //# sourceMappingURL=badge.d.ts.map