Some checks failed
ci / Validate workspace (push) Successful in 12m32s
landing-page-ci / Validate landing page (push) Successful in 9m41s
landing-page-deploy / Deploy landing page (push) Failing after 5m23s
github-metrics / Generate repository metrics SVG (push) Failing after 2m3s
refresh-contributors-wall / Refresh contributors wall cache bust (push) Failing after 11s
This repository contains the open-design daemon CLI source code, built and packaged at https://helix-mind.ai/cli/open-design/latest.tgz for use by the HelixMind /design slash command. Licenses: Apache-2.0 (root) + MIT (skills/*)
20 lines
653 B
TypeScript
20 lines
653 B
TypeScript
const R2_PUBLIC_ORIGIN = 'https://static.open-design.ai';
|
|
const IMAGE_RESIZING_ORIGIN = R2_PUBLIC_ORIGIN;
|
|
const ASSET_PREFIX = 'landing/assets';
|
|
|
|
type ImageOptions = {
|
|
width: number;
|
|
quality?: number;
|
|
};
|
|
|
|
export function r2Asset(name: string): string {
|
|
return `${R2_PUBLIC_ORIGIN}/${ASSET_PREFIX}/${name}`;
|
|
}
|
|
|
|
export function imageAsset(name: string, { width, quality = 85 }: ImageOptions): string {
|
|
const options = `width=${width},quality=${quality},format=auto`;
|
|
return `${IMAGE_RESIZING_ORIGIN}/cdn-cgi/image/${options}/${r2Asset(name)}`;
|
|
}
|
|
|
|
export const heroImage = imageAsset('hero.png', { width: 1024, quality: 82 });
|