loopwind 0.17.0 → 0.18.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/sdk/index.d.ts +2 -2
- package/dist/sdk/index.d.ts.map +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/index.js.map +1 -1
- package/dist/sdk/template.d.ts +97 -0
- package/dist/sdk/template.d.ts.map +1 -1
- package/dist/sdk/template.js +217 -0
- package/dist/sdk/template.js.map +1 -1
- package/examples/code-editor-templates.ts +173 -0
- package/examples/nextjs-template-import.ts +58 -0
- package/examples/visual-builder-templates.ts +336 -0
- package/package.json +3 -1
- package/test-jsx-support.mjs +120 -0
- package/test-sdk-user-templates.mjs +469 -0
- package/website/.astro/integrations/_inox-tools_astro-when/types.d.ts +1 -0
- package/website/.astro/types.d.ts +1 -0
- package/website/DEPLOYMENT.md +142 -0
- package/website/OG_IMAGES.md +141 -0
- package/website/astro.config.mjs +9 -1
- package/website/dist/.gitkeep +1 -0
- package/website/dist/_astro/agents.Yx-L_igG.css +1 -0
- package/website/dist/_routes.json +30 -0
- package/website/dist/_worker.js/_@astrojs-ssr-adapter.mjs +1033 -0
- package/website/dist/_worker.js/_astro-internal_middleware.mjs +40 -0
- package/website/dist/_worker.js/chunks/abap_BTmsHiP5.mjs +1 -0
- package/website/dist/_worker.js/chunks/actionscript-3_DmBelb1E.mjs +1 -0
- package/website/dist/_worker.js/chunks/ada_8-E0ahCN.mjs +1 -0
- package/website/dist/_worker.js/chunks/andromeeda_XI-CXx50.mjs +1 -0
- package/website/dist/_worker.js/chunks/angular-html_DKGh3gGH.mjs +1 -0
- package/website/dist/_worker.js/chunks/angular-ts_-qZGsJoA.mjs +1 -0
- package/website/dist/_worker.js/chunks/apache_ijTUt0Ee.mjs +1 -0
- package/website/dist/_worker.js/chunks/apex_agu1c6Sh.mjs +1 -0
- package/website/dist/_worker.js/chunks/apl_Bj2f7Art.mjs +1 -0
- package/website/dist/_worker.js/chunks/applescript_B_vXrOh3.mjs +1 -0
- package/website/dist/_worker.js/chunks/ara_DCEQ2rnh.mjs +1 -0
- package/website/dist/_worker.js/chunks/asciidoc_CGN_EkYS.mjs +1 -0
- package/website/dist/_worker.js/chunks/asm_BBWZgnDp.mjs +1 -0
- package/website/dist/_worker.js/chunks/astro/assets-service_j52rQLzU.mjs +721 -0
- package/website/dist/_worker.js/chunks/astro/server_Y5_QHO8v.mjs +2401 -0
- package/website/dist/_worker.js/chunks/astro-designed-error-pages_BNTLO-TA.mjs +542 -0
- package/website/dist/_worker.js/chunks/astro_Dr_hht3h.mjs +1 -0
- package/website/dist/_worker.js/chunks/aurora-x_9GHG8nSq.mjs +1 -0
- package/website/dist/_worker.js/chunks/awk_DHRvhXot.mjs +1 -0
- package/website/dist/_worker.js/chunks/ayu-dark_CcvqmEHE.mjs +1 -0
- package/website/dist/_worker.js/chunks/ballerina_C7SdeSZb.mjs +1 -0
- package/website/dist/_worker.js/chunks/bat_Dv4A3u45.mjs +1 -0
- package/website/dist/_worker.js/chunks/beancount_BfPf9Luv.mjs +1 -0
- package/website/dist/_worker.js/chunks/berry_B8rfM3lL.mjs +1 -0
- package/website/dist/_worker.js/chunks/bibtex_TcjYgtJM.mjs +1 -0
- package/website/dist/_worker.js/chunks/bicep_CrlFWCdN.mjs +1 -0
- package/website/dist/_worker.js/chunks/blade_lanKVYID.mjs +1 -0
- package/website/dist/_worker.js/chunks/bsl_BhppzXMB.mjs +1 -0
- package/website/dist/_worker.js/chunks/c_6FBALJTK.mjs +1 -0
- package/website/dist/_worker.js/chunks/cadence_2txU9LVE.mjs +1 -0
- package/website/dist/_worker.js/chunks/cairo_BkrFAIlP.mjs +1 -0
- package/website/dist/_worker.js/chunks/catppuccin-frappe_CkEqIYhU.mjs +1 -0
- package/website/dist/_worker.js/chunks/catppuccin-latte_DG4Gx_-v.mjs +1 -0
- package/website/dist/_worker.js/chunks/catppuccin-macchiato_Cwi3vCXf.mjs +1 -0
- package/website/dist/_worker.js/chunks/catppuccin-mocha_L9_OPlFX.mjs +1 -0
- package/website/dist/_worker.js/chunks/clarity_BEAe4Ulu.mjs +1 -0
- package/website/dist/_worker.js/chunks/clojure_VnUX6p2g.mjs +1 -0
- package/website/dist/_worker.js/chunks/cmake_0-SGkZEj.mjs +1 -0
- package/website/dist/_worker.js/chunks/cobol_92M_KGaE.mjs +1 -0
- package/website/dist/_worker.js/chunks/codeowners_CzMwskBv.mjs +1 -0
- package/website/dist/_worker.js/chunks/codeql_DWJZNHv1.mjs +1 -0
- package/website/dist/_worker.js/chunks/coffee_CQjKU2fh.mjs +1 -0
- package/website/dist/_worker.js/chunks/common-lisp_BBLWDpS5.mjs +1 -0
- package/website/dist/_worker.js/chunks/coq_hedRFV3D.mjs +1 -0
- package/website/dist/_worker.js/chunks/cpp_DlS1i6Zs.mjs +1 -0
- package/website/dist/_worker.js/chunks/crystal_D6n65fKV.mjs +1 -0
- package/website/dist/_worker.js/chunks/csharp_C6FCVFzc.mjs +1 -0
- package/website/dist/_worker.js/chunks/css_C5uJEgmJ.mjs +1 -0
- package/website/dist/_worker.js/chunks/csv_CtMYuuJl.mjs +1 -0
- package/website/dist/_worker.js/chunks/cue_BsPexqx6.mjs +1 -0
- package/website/dist/_worker.js/chunks/cypher_apzf6OBi.mjs +1 -0
- package/website/dist/_worker.js/chunks/d_DcvIRcgm.mjs +1 -0
- package/website/dist/_worker.js/chunks/dark-plus_C01ONtzj.mjs +1 -0
- package/website/dist/_worker.js/chunks/dart_WkzM5WrV.mjs +1 -0
- package/website/dist/_worker.js/chunks/dax_DjXAO5V4.mjs +1 -0
- package/website/dist/_worker.js/chunks/desktop_C92LCxdc.mjs +1 -0
- package/website/dist/_worker.js/chunks/diff_CVwM_9XJ.mjs +1 -0
- package/website/dist/_worker.js/chunks/docker_DPzgJf6Z.mjs +1 -0
- package/website/dist/_worker.js/chunks/dotenv_D_vgANvA.mjs +1 -0
- package/website/dist/_worker.js/chunks/dracula-soft_CLnUBwFm.mjs +1 -0
- package/website/dist/_worker.js/chunks/dracula_lBVpb6Lb.mjs +1 -0
- package/website/dist/_worker.js/chunks/dream-maker_DTLbzd_J.mjs +1 -0
- package/website/dist/_worker.js/chunks/edge_i54JYm3_.mjs +1 -0
- package/website/dist/_worker.js/chunks/elixir_BJCIjTu4.mjs +1 -0
- package/website/dist/_worker.js/chunks/elm_BbXD39-_.mjs +1 -0
- package/website/dist/_worker.js/chunks/emacs-lisp_pxa5cXaN.mjs +1 -0
- package/website/dist/_worker.js/chunks/erb_Ccjijeee.mjs +1 -0
- package/website/dist/_worker.js/chunks/erlang_B2VM_hi7.mjs +1 -0
- package/website/dist/_worker.js/chunks/everforest-dark_BxvIPBim.mjs +1 -0
- package/website/dist/_worker.js/chunks/everforest-light_B7VoyaJM.mjs +1 -0
- package/website/dist/_worker.js/chunks/fennel_D-uo7X6c.mjs +1 -0
- package/website/dist/_worker.js/chunks/fish_BjePoK3m.mjs +1 -0
- package/website/dist/_worker.js/chunks/fluent_C8fgkzLX.mjs +1 -0
- package/website/dist/_worker.js/chunks/fortran-fixed-form_D1pu5zrc.mjs +1 -0
- package/website/dist/_worker.js/chunks/fortran-free-form_CSGOhJD6.mjs +1 -0
- package/website/dist/_worker.js/chunks/fsharp_B0xy-A4Y.mjs +1 -0
- package/website/dist/_worker.js/chunks/gdresource_CWppjlHq.mjs +1 -0
- package/website/dist/_worker.js/chunks/gdscript_eQCHchcS.mjs +1 -0
- package/website/dist/_worker.js/chunks/gdshader_C4kxepX7.mjs +1 -0
- package/website/dist/_worker.js/chunks/genie_ACtQLcDW.mjs +1 -0
- package/website/dist/_worker.js/chunks/gherkin_BFp2uKUd.mjs +1 -0
- package/website/dist/_worker.js/chunks/git-commit_CLg9ZwMV.mjs +1 -0
- package/website/dist/_worker.js/chunks/git-rebase_DG8A80Nt.mjs +1 -0
- package/website/dist/_worker.js/chunks/github-dark-default_BI0EP2Kv.mjs +1 -0
- package/website/dist/_worker.js/chunks/github-dark-dimmed_a_NIC0Xb.mjs +1 -0
- package/website/dist/_worker.js/chunks/github-dark-high-contrast_jZGqT7hk.mjs +1 -0
- package/website/dist/_worker.js/chunks/github-dark_CHCDNd2O.mjs +1 -0
- package/website/dist/_worker.js/chunks/github-light-default_DRbOW5RG.mjs +1 -0
- package/website/dist/_worker.js/chunks/github-light-high-contrast_tn_kWutM.mjs +1 -0
- package/website/dist/_worker.js/chunks/github-light_D9brYzot.mjs +1 -0
- package/website/dist/_worker.js/chunks/gleam_Dmhu1oxW.mjs +1 -0
- package/website/dist/_worker.js/chunks/glimmer-js_BfZbXy8A.mjs +1 -0
- package/website/dist/_worker.js/chunks/glimmer-ts_B9QVICrD.mjs +1 -0
- package/website/dist/_worker.js/chunks/glsl_DD2PPwOs.mjs +1 -0
- package/website/dist/_worker.js/chunks/gnuplot_D2OYChUX.mjs +1 -0
- package/website/dist/_worker.js/chunks/go_DYGFTe3h.mjs +1 -0
- package/website/dist/_worker.js/chunks/graphql_B7XsT3nH.mjs +1 -0
- package/website/dist/_worker.js/chunks/groovy_BO12Uwkl.mjs +1 -0
- package/website/dist/_worker.js/chunks/hack_CB2_ztCP.mjs +1 -0
- package/website/dist/_worker.js/chunks/haml_CyfDcDD3.mjs +1 -0
- package/website/dist/_worker.js/chunks/handlebars_CfpxpWm2.mjs +1 -0
- package/website/dist/_worker.js/chunks/haskell_jUeC5uN5.mjs +1 -0
- package/website/dist/_worker.js/chunks/haxe_B6GxP1WB.mjs +1 -0
- package/website/dist/_worker.js/chunks/hcl_DwoHV2oh.mjs +1 -0
- package/website/dist/_worker.js/chunks/hjson_DV7cJRk4.mjs +1 -0
- package/website/dist/_worker.js/chunks/hlsl_BlFCscPI.mjs +1 -0
- package/website/dist/_worker.js/chunks/houston_COBFG1Mx.mjs +1 -0
- package/website/dist/_worker.js/chunks/html-derivative_C9pJ337h.mjs +1 -0
- package/website/dist/_worker.js/chunks/html_D1OkrZS5.mjs +1 -0
- package/website/dist/_worker.js/chunks/http_DIGXRqvJ.mjs +1 -0
- package/website/dist/_worker.js/chunks/hxml_DEwh9i-c.mjs +1 -0
- package/website/dist/_worker.js/chunks/hy_DDoIgW1K.mjs +1 -0
- package/website/dist/_worker.js/chunks/imba_B00zbHo4.mjs +1 -0
- package/website/dist/_worker.js/chunks/index_C1UTDwYg.mjs +1861 -0
- package/website/dist/_worker.js/chunks/ini_D7XQA_p8.mjs +1 -0
- package/website/dist/_worker.js/chunks/java_B9wdFd8K.mjs +1 -0
- package/website/dist/_worker.js/chunks/javascript_CLsPGOON.mjs +1 -0
- package/website/dist/_worker.js/chunks/jinja_jarBCAN1.mjs +1 -0
- package/website/dist/_worker.js/chunks/jison_oGg3J708.mjs +1 -0
- package/website/dist/_worker.js/chunks/json5_DlZ1Kyaa.mjs +1 -0
- package/website/dist/_worker.js/chunks/json_DaYk_FMp.mjs +1 -0
- package/website/dist/_worker.js/chunks/jsonc_DlwgfSDs.mjs +1 -0
- package/website/dist/_worker.js/chunks/jsonl_BbCCVaZF.mjs +1 -0
- package/website/dist/_worker.js/chunks/jsonnet_Dt-G75xe.mjs +1 -0
- package/website/dist/_worker.js/chunks/jssm_BtKFTj2A.mjs +1 -0
- package/website/dist/_worker.js/chunks/jsx_DDx_xAZ8.mjs +1 -0
- package/website/dist/_worker.js/chunks/julia_CK0lv68l.mjs +1 -0
- package/website/dist/_worker.js/chunks/kanagawa-dragon_BldAK3Oo.mjs +1 -0
- package/website/dist/_worker.js/chunks/kanagawa-lotus_DVM8FX9_.mjs +1 -0
- package/website/dist/_worker.js/chunks/kanagawa-wave_Dpih0AKP.mjs +1 -0
- package/website/dist/_worker.js/chunks/kotlin_kWneB9V_.mjs +1 -0
- package/website/dist/_worker.js/chunks/kusto_BKVATd95.mjs +1 -0
- package/website/dist/_worker.js/chunks/laserwave_BqatxsVl.mjs +1 -0
- package/website/dist/_worker.js/chunks/latex_LVDcGBbc.mjs +1 -0
- package/website/dist/_worker.js/chunks/lean_W7qo-5M2.mjs +1 -0
- package/website/dist/_worker.js/chunks/less_DFNwJnBH.mjs +1 -0
- package/website/dist/_worker.js/chunks/light-plus_Dp0AoWsO.mjs +1 -0
- package/website/dist/_worker.js/chunks/liquid_D24qs0pc.mjs +1 -0
- package/website/dist/_worker.js/chunks/log_IPWMXriF.mjs +1 -0
- package/website/dist/_worker.js/chunks/logo_C6KaatrQ.mjs +1 -0
- package/website/dist/_worker.js/chunks/lua_CwnEf-T7.mjs +1 -0
- package/website/dist/_worker.js/chunks/luau_Br3-CXjS.mjs +1 -0
- package/website/dist/_worker.js/chunks/make_UBNG-kOo.mjs +1 -0
- package/website/dist/_worker.js/chunks/markdown_C7mhJFCm.mjs +1 -0
- package/website/dist/_worker.js/chunks/marko_4tchUvI7.mjs +1 -0
- package/website/dist/_worker.js/chunks/material-theme-darker_SKtaNEPn.mjs +1 -0
- package/website/dist/_worker.js/chunks/material-theme-lighter_zOX_DZCH.mjs +1 -0
- package/website/dist/_worker.js/chunks/material-theme-ocean_BN9WbhdC.mjs +1 -0
- package/website/dist/_worker.js/chunks/material-theme-palenight_DT_covjH.mjs +1 -0
- package/website/dist/_worker.js/chunks/material-theme_6RpeM3kc.mjs +1 -0
- package/website/dist/_worker.js/chunks/matlab_DCOXsPKR.mjs +1 -0
- package/website/dist/_worker.js/chunks/mdc_B9gb2UFP.mjs +1 -0
- package/website/dist/_worker.js/chunks/mdx_DGU7Nu9u.mjs +1 -0
- package/website/dist/_worker.js/chunks/mermaid_B69URzsZ.mjs +1 -0
- package/website/dist/_worker.js/chunks/min-dark_BgxifOMI.mjs +1 -0
- package/website/dist/_worker.js/chunks/min-light_BrPjXxUp.mjs +1 -0
- package/website/dist/_worker.js/chunks/mipsasm_9U-4_t7k.mjs +1 -0
- package/website/dist/_worker.js/chunks/mojo_B0wt7ug3.mjs +1 -0
- package/website/dist/_worker.js/chunks/monokai_B6Pxpoyi.mjs +1 -0
- package/website/dist/_worker.js/chunks/move_1eid4CyR.mjs +1 -0
- package/website/dist/_worker.js/chunks/narrat_Ds6-p5JZ.mjs +1 -0
- package/website/dist/_worker.js/chunks/nextflow_v2N1Qlqa.mjs +1 -0
- package/website/dist/_worker.js/chunks/nginx_Bp9Ab2NH.mjs +1 -0
- package/website/dist/_worker.js/chunks/night-owl_CdwOw_sc.mjs +1 -0
- package/website/dist/_worker.js/chunks/nim_BXGDUe53.mjs +1 -0
- package/website/dist/_worker.js/chunks/nix_CUig1nJH.mjs +1 -0
- package/website/dist/_worker.js/chunks/noop-middleware_DlWGj5t5.mjs +10 -0
- package/website/dist/_worker.js/chunks/nord_SPoG1iae.mjs +1 -0
- package/website/dist/_worker.js/chunks/nushell_DJw1Lca8.mjs +1 -0
- package/website/dist/_worker.js/chunks/objective-c_Bktzl_CO.mjs +1 -0
- package/website/dist/_worker.js/chunks/objective-cpp_CP4DWdDp.mjs +1 -0
- package/website/dist/_worker.js/chunks/ocaml_CeEAs7bZ.mjs +1 -0
- package/website/dist/_worker.js/chunks/one-dark-pro_-hIwCNMi.mjs +1 -0
- package/website/dist/_worker.js/chunks/one-light_DSmYvJ05.mjs +1 -0
- package/website/dist/_worker.js/chunks/pascal_C-S_Ms_o.mjs +1 -0
- package/website/dist/_worker.js/chunks/perl_CKamvo15.mjs +1 -0
- package/website/dist/_worker.js/chunks/php_BlmcX_F3.mjs +1 -0
- package/website/dist/_worker.js/chunks/plastic_Ryt8tVoA.mjs +1 -0
- package/website/dist/_worker.js/chunks/plsql_Cb3v7cBj.mjs +1 -0
- package/website/dist/_worker.js/chunks/po_DZbdNRlo.mjs +1 -0
- package/website/dist/_worker.js/chunks/poimandres_bYmE3_5d.mjs +1 -0
- package/website/dist/_worker.js/chunks/polar_pJkMGwoW.mjs +1 -0
- package/website/dist/_worker.js/chunks/postcss_BAXSOKgk.mjs +1 -0
- package/website/dist/_worker.js/chunks/powerquery_oITMGN4x.mjs +1 -0
- package/website/dist/_worker.js/chunks/powershell_6306-xIF.mjs +1 -0
- package/website/dist/_worker.js/chunks/prisma_DSDxnZGz.mjs +1 -0
- package/website/dist/_worker.js/chunks/prolog_CxG7tjZR.mjs +1 -0
- package/website/dist/_worker.js/chunks/proto_CS9ByXm1.mjs +1 -0
- package/website/dist/_worker.js/chunks/pug_BMtLJo6U.mjs +1 -0
- package/website/dist/_worker.js/chunks/puppet_BfeeSzee.mjs +1 -0
- package/website/dist/_worker.js/chunks/purescript_BFfueNaH.mjs +1 -0
- package/website/dist/_worker.js/chunks/python_Cc4Faapv.mjs +1 -0
- package/website/dist/_worker.js/chunks/qml_C1CTJTK8.mjs +1 -0
- package/website/dist/_worker.js/chunks/qmldir_nG1KaqKR.mjs +1 -0
- package/website/dist/_worker.js/chunks/qss_Cncxk263.mjs +1 -0
- package/website/dist/_worker.js/chunks/r_ChR54Ihi.mjs +1 -0
- package/website/dist/_worker.js/chunks/racket_BDrhptDs.mjs +1 -0
- package/website/dist/_worker.js/chunks/raku_07OUHa0P.mjs +1 -0
- package/website/dist/_worker.js/chunks/razor_DIP3INLa.mjs +1 -0
- package/website/dist/_worker.js/chunks/red_DOPXfj-6.mjs +1 -0
- package/website/dist/_worker.js/chunks/reg_B64SwEDj.mjs +1 -0
- package/website/dist/_worker.js/chunks/regexp_ButFGoB5.mjs +1 -0
- package/website/dist/_worker.js/chunks/rel_BWJAWqZD.mjs +1 -0
- package/website/dist/_worker.js/chunks/riscv_79gXlbsF.mjs +1 -0
- package/website/dist/_worker.js/chunks/rose-pine-dawn_DHIjVGd3.mjs +1 -0
- package/website/dist/_worker.js/chunks/rose-pine-moon_t86aEbs0.mjs +1 -0
- package/website/dist/_worker.js/chunks/rose-pine_BHgrcDCs.mjs +1 -0
- package/website/dist/_worker.js/chunks/rst_D3F4Fcpj.mjs +1 -0
- package/website/dist/_worker.js/chunks/ruby_Cs7vM9iv.mjs +1 -0
- package/website/dist/_worker.js/chunks/rust_DpyRVatH.mjs +1 -0
- package/website/dist/_worker.js/chunks/sas_DW45xZXN.mjs +1 -0
- package/website/dist/_worker.js/chunks/sass_C6SiMwN_.mjs +1 -0
- package/website/dist/_worker.js/chunks/scala_DlZOjNZk.mjs +1 -0
- package/website/dist/_worker.js/chunks/scheme_D2ezSJXu.mjs +1 -0
- package/website/dist/_worker.js/chunks/scss_DG5Spjqu.mjs +1 -0
- package/website/dist/_worker.js/chunks/sdbl_ZCYaj4VN.mjs +1 -0
- package/website/dist/_worker.js/chunks/shaderlab_CAcRkg1_.mjs +1 -0
- package/website/dist/_worker.js/chunks/shellscript_BWwhkDVh.mjs +1 -0
- package/website/dist/_worker.js/chunks/shellsession_BfEA3juK.mjs +1 -0
- package/website/dist/_worker.js/chunks/slack-dark_CL3lSpCc.mjs +1 -0
- package/website/dist/_worker.js/chunks/slack-ochin_DdZKOQVh.mjs +1 -0
- package/website/dist/_worker.js/chunks/smalltalk_DgilzSui.mjs +1 -0
- package/website/dist/_worker.js/chunks/snazzy-light_eJU08Pz_.mjs +1 -0
- package/website/dist/_worker.js/chunks/solarized-dark_Dg_YQywx.mjs +1 -0
- package/website/dist/_worker.js/chunks/solarized-light_BnIsrA6p.mjs +1 -0
- package/website/dist/_worker.js/chunks/solidity_DkseH8pQ.mjs +1 -0
- package/website/dist/_worker.js/chunks/soy_DU7bOYoG.mjs +1 -0
- package/website/dist/_worker.js/chunks/sparql_BuI1DBDH.mjs +1 -0
- package/website/dist/_worker.js/chunks/splunk_B8Ha9Pkg.mjs +1 -0
- package/website/dist/_worker.js/chunks/sql_BniHwea5.mjs +1 -0
- package/website/dist/_worker.js/chunks/ssh-config_CkE1GuVe.mjs +1 -0
- package/website/dist/_worker.js/chunks/stata_Dtqpbd_l.mjs +1 -0
- package/website/dist/_worker.js/chunks/stylus_CXTtglzO.mjs +1 -0
- package/website/dist/_worker.js/chunks/svelte_BjWYcUCN.mjs +1 -0
- package/website/dist/_worker.js/chunks/swift_BzHql_rM.mjs +1 -0
- package/website/dist/_worker.js/chunks/synthwave-84_DLRNhxNA.mjs +1 -0
- package/website/dist/_worker.js/chunks/system-verilog_ChyInPph.mjs +1 -0
- package/website/dist/_worker.js/chunks/systemd_Bi9Qa2qD.mjs +1 -0
- package/website/dist/_worker.js/chunks/talonscript_B3sH_Y-V.mjs +1 -0
- package/website/dist/_worker.js/chunks/tasl_BJ5yipRs.mjs +1 -0
- package/website/dist/_worker.js/chunks/tcl_CoJQjNoP.mjs +1 -0
- package/website/dist/_worker.js/chunks/templ_CrU7Ffil.mjs +1 -0
- package/website/dist/_worker.js/chunks/terraform_DT9JSFpC.mjs +1 -0
- package/website/dist/_worker.js/chunks/tex_5PKu2yA0.mjs +1 -0
- package/website/dist/_worker.js/chunks/tokyo-night_Buo8OK7-.mjs +1 -0
- package/website/dist/_worker.js/chunks/toml_CPuXX3oc.mjs +1 -0
- package/website/dist/_worker.js/chunks/ts-tags_D0M_1VSH.mjs +1 -0
- package/website/dist/_worker.js/chunks/tsv_CuivVNot.mjs +1 -0
- package/website/dist/_worker.js/chunks/tsx_MkuGr8MY.mjs +1 -0
- package/website/dist/_worker.js/chunks/turtle_BqgEPK7f.mjs +1 -0
- package/website/dist/_worker.js/chunks/twig_r1G9rpYJ.mjs +1 -0
- package/website/dist/_worker.js/chunks/typescript_Au5buqzM.mjs +1 -0
- package/website/dist/_worker.js/chunks/typespec_47rhBK_z.mjs +1 -0
- package/website/dist/_worker.js/chunks/typst_BAtuQLh-.mjs +1 -0
- package/website/dist/_worker.js/chunks/v_BIvWImHg.mjs +1 -0
- package/website/dist/_worker.js/chunks/vala_DYEacj30.mjs +1 -0
- package/website/dist/_worker.js/chunks/vb_CikQuqGJ.mjs +1 -0
- package/website/dist/_worker.js/chunks/verilog_BQRENwI-.mjs +1 -0
- package/website/dist/_worker.js/chunks/vesper_DA0kvTmj.mjs +1 -0
- package/website/dist/_worker.js/chunks/vhdl_DHscJIyg.mjs +1 -0
- package/website/dist/_worker.js/chunks/viml_F2pvMwvG.mjs +1 -0
- package/website/dist/_worker.js/chunks/vitesse-black_D9tjNzd0.mjs +1 -0
- package/website/dist/_worker.js/chunks/vitesse-dark_Bnm5d0hd.mjs +1 -0
- package/website/dist/_worker.js/chunks/vitesse-light_CHwbyjNR.mjs +1 -0
- package/website/dist/_worker.js/chunks/vue-html_DyYtbbMK.mjs +1 -0
- package/website/dist/_worker.js/chunks/vue_DofN6juy.mjs +1 -0
- package/website/dist/_worker.js/chunks/vyper_CiR0m-OV.mjs +1 -0
- package/website/dist/_worker.js/chunks/wasm_CwIGgRGf.mjs +1 -0
- package/website/dist/_worker.js/chunks/wasm_jKWhg0J0.mjs +1 -0
- package/website/dist/_worker.js/chunks/wenyan_DKvVZKXW.mjs +1 -0
- package/website/dist/_worker.js/chunks/wgsl_BOWZY7yw.mjs +1 -0
- package/website/dist/_worker.js/chunks/wikitext_CXDhhHPy.mjs +1 -0
- package/website/dist/_worker.js/chunks/wolfram_ChkmGnW0.mjs +1 -0
- package/website/dist/_worker.js/chunks/xml_DXH3hHIu.mjs +1 -0
- package/website/dist/_worker.js/chunks/xsl_DuP2mFjg.mjs +1 -0
- package/website/dist/_worker.js/chunks/yaml_IGiEkTge.mjs +1 -0
- package/website/dist/_worker.js/chunks/zenscript_59iXGyNw.mjs +1 -0
- package/website/dist/_worker.js/chunks/zig_DKzb0zdT.mjs +1 -0
- package/website/dist/_worker.js/index.js +53 -0
- package/website/dist/_worker.js/manifest_BAAoOzaU.mjs +98 -0
- package/website/dist/_worker.js/pages/_image.astro.mjs +24 -0
- package/website/dist/_worker.js/pages/agents.astro.mjs +1 -0
- package/website/dist/_worker.js/pages/animation.astro.mjs +1 -0
- package/website/dist/_worker.js/pages/api/raw-markdown/_---path_.astro.mjs +44 -0
- package/website/dist/_worker.js/pages/config.astro.mjs +1 -0
- package/website/dist/_worker.js/pages/fonts.astro.mjs +1 -0
- package/website/dist/_worker.js/pages/getting-started.astro.mjs +1 -0
- package/website/dist/_worker.js/pages/helpers.astro.mjs +1 -0
- package/website/dist/_worker.js/pages/images.astro.mjs +1 -0
- package/website/dist/_worker.js/pages/index.astro.mjs +1 -0
- package/website/dist/_worker.js/pages/llm.txt.astro.mjs +1 -0
- package/website/dist/_worker.js/pages/preview.astro.mjs +1 -0
- package/website/dist/_worker.js/pages/sdk.astro.mjs +1 -0
- package/website/dist/_worker.js/pages/sitemap.xml.astro.mjs +1 -0
- package/website/dist/_worker.js/pages/styling.astro.mjs +1 -0
- package/website/dist/_worker.js/pages/templates.astro.mjs +1 -0
- package/website/dist/_worker.js/pages/video.astro.mjs +1 -0
- package/website/dist/_worker.js/renderers.mjs +57 -0
- package/website/dist/agents/index.html +3 -2
- package/website/dist/animation/index.html +402 -128
- package/website/dist/config/index.html +184 -0
- package/website/dist/fonts/index.html +56 -52
- package/website/dist/getting-started/index.html +107 -0
- package/website/dist/helpers/index.html +8 -8
- package/website/dist/images/index.html +50 -23
- package/website/dist/index.html +114 -148
- package/website/dist/llm.txt +751 -1055
- package/website/dist/preview/index.html +111 -0
- package/website/dist/robots.txt +35 -0
- package/website/dist/sdk/index.html +390 -52
- package/website/dist/sitemap.xml +76 -0
- package/website/dist/styling/index.html +10 -7
- package/website/dist/templates/index.html +11 -59
- package/website/dist/video/index.html +106 -537
- package/website/package-lock.json +1077 -17
- package/website/templates/og-image.tsx +61 -0
- package/website/dist/_astro/agents.I1-fN38o.css +0 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
<!DOCTYPE html><html lang="en"> <head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><link rel="icon" type="image/svg+xml" href="/favicon.svg"><meta name="generator" content="Astro v4.16.19"><link rel="canonical" href="https://loopwind.dev/sdk/"><!-- Primary Meta Tags --><title></title><meta name="title"><meta name="description" content="CLI-based Image & Video Generator for developers and AI Agents. Generate stunning visuals from React + Tailwind templates."><meta name="keywords" content="loopwind, image generation, video generation, React, Tailwind CSS, Satori, CLI tool, templates, shadcn/ui, AI agents, Cursor, automation"><meta name="author" content="loopwind"><!-- Open Graph / Facebook --><meta property="og:type" content="website"><meta property="og:url" content="https://loopwind.dev/sdk/"><meta property="og:title"><meta property="og:description" content="CLI-based Image & Video Generator for developers and AI Agents. Generate stunning visuals from React + Tailwind templates."><meta property="og:image" content="https://loopwind.dev/og
|
|
1
|
+
<!DOCTYPE html><html lang="en" data-astro-cid-mw7aashj> <head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><link rel="icon" type="image/svg+xml" href="/favicon.svg"><meta name="generator" content="Astro v4.16.19"><link rel="canonical" href="https://loopwind.dev/sdk/"><!-- Primary Meta Tags --><title></title><meta name="title"><meta name="description" content="CLI-based Image & Video Generator for developers and AI Agents. Generate stunning visuals from React + Tailwind templates."><meta name="keywords" content="loopwind, image generation, video generation, React, Tailwind CSS, Satori, CLI tool, templates, shadcn/ui, AI agents, Cursor, automation, serverless, WASM, Open Graph, social media, marketing automation"><meta name="author" content="loopwind"><!-- Open Graph / Facebook --><meta property="og:type" content="website"><meta property="og:url" content="https://loopwind.dev/sdk/"><meta property="og:title"><meta property="og:description" content="CLI-based Image & Video Generator for developers and AI Agents. Generate stunning visuals from React + Tailwind templates."><meta property="og:image" content="https://loopwind.dev/api/og/sdk"><meta property="og:image:width" content="1200"><meta property="og:image:height" content="630"><meta property="og:image:alt"><meta property="og:site_name" content="loopwind"><meta property="og:locale" content="en_US"><!-- Twitter --><meta name="twitter:card" content="summary_large_image"><meta name="twitter:url" content="https://loopwind.dev/sdk/"><meta name="twitter:title"><meta name="twitter:description" content="CLI-based Image & Video Generator for developers and AI Agents. Generate stunning visuals from React + Tailwind templates."><meta name="twitter:image" content="https://loopwind.dev/api/og/sdk"><meta name="twitter:image:alt"><meta name="twitter:creator" content="@loopwind"><meta name="twitter:site" content="@loopwind"><!-- Theme Color --><meta name="theme-color" content="#0a0a0a"><meta name="theme-color" media="(prefers-color-scheme: dark)" content="#0a0a0a"><meta name="theme-color" media="(prefers-color-scheme: light)" content="#fafafa"><!-- Additional SEO --><meta name="robots" content="index, follow"><meta name="googlebot" content="index, follow"><meta name="language" content="English"><meta name="revisit-after" content="7 days"><meta name="rating" content="general"><!-- Mobile Web App --><meta name="mobile-web-app-capable" content="yes"><meta name="apple-mobile-web-app-capable" content="yes"><meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"><meta name="apple-mobile-web-app-title" content="loopwind"><!-- Structured Data (JSON-LD) --><script type="application/ld+json">{"@context":"https://schema.org","@type":"SoftwareApplication","name":"loopwind","applicationCategory":"DeveloperApplication","operatingSystem":"Cross-platform","description":"CLI-based Image & Video Generator for developers and AI Agents. Generate stunning visuals from React + Tailwind templates.","url":"https://loopwind.dev/","author":{"@type":"Organization","name":"loopwind","url":"https://loopwind.dev/"},"offers":{"@type":"Offer","price":"0","priceCurrency":"USD"},"softwareVersion":"0.11.0","releaseNotes":"https://github.com/loopwind/loopwind/releases","screenshot":"https://loopwind.dev/api/og/sdk","featureList":["Image generation from React templates","Video generation with animations","Tailwind CSS support","shadcn/ui design system","CLI-based workflow","Serverless rendering","TypeScript support","AI Agent friendly"]}</script><script type="application/ld+json">{"@context":"https://schema.org","@type":"Organization","name":"loopwind","url":"https://loopwind.dev/","logo":"https://loopwind.dev/favicon.svg","sameAs":["https://github.com/loopwind/loopwind","https://www.npmjs.com/package/loopwind"]}</script><script type="application/ld+json">{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://loopwind.dev/"},{"@type":"ListItem","position":2,"name":"Sdk","item":"https://loopwind.dev/sdk"}]}</script><link rel="stylesheet" href="/_astro/agents.Yx-L_igG.css"><script type="module">const p=document.getElementById("mobile-menu-button"),l=document.getElementById("mobile-menu"),g=document.querySelectorAll(".mobile-menu-link");p?.addEventListener("click",()=>{l?.classList.toggle("hidden")});l?.addEventListener("click",o=>{o.target===l&&l.classList.add("hidden")});g.forEach(o=>{o.addEventListener("click",()=>{l?.classList.add("hidden")})});function m(){const o=document.getElementById("toc-nav");if(!o){console.log("TOC: No toc-nav element found");return}const n=document.querySelector("article");if(!n){console.log("TOC: No article element found");return}const c=n.querySelectorAll("h2, h3");if(c.length===0){console.log("TOC: No headings found");return}console.log(`TOC: Found ${c.length} headings`);const a=document.createElement("ul");a.className="space-y-0 text-sm border-l border-border/50",c.forEach(e=>{const t=e.tagName==="H2"?2:3,r=e.id||e.textContent?.toLowerCase().replace(/[^\w]+/g,"-");!e.id&&r&&(e.id=r);const s=document.createElement("li"),d=document.createElement("a");d.href=`#${r}`,d.textContent=e.textContent,d.className=`toc-link block py-1 px-3 -ml-px border-l-2 border-transparent transition-all no-underline ${t===3?"pl-6 text-xs text-muted-foreground/70":"text-sm text-muted-foreground"} hover:text-foreground hover:border-muted-foreground/50`,s.appendChild(d),a.appendChild(s)}),o.appendChild(a);const i=new IntersectionObserver(e=>{e.forEach(t=>{const r=t.target.id,s=o.querySelector(`a[href="#${r}"]`);t.isIntersecting&&(document.querySelectorAll(".toc-link").forEach(d=>{d.classList.remove("text-foreground","border-accent","font-medium")}),s?.classList.add("text-foreground","border-accent","font-medium"))})},{rootMargin:"-100px 0px -66%",threshold:0});c.forEach(e=>{i.observe(e)})}document.addEventListener("DOMContentLoaded",m);document.addEventListener("astro:page-load",m);function u(){const o=document.getElementById("copy-to-llm-btn"),n=document.getElementById("copy-btn-text");if(!o||!n){console.log("Copy to LLM: Button not found on this page");return}console.log("Copy to LLM: Initialized"),o.addEventListener("click",async()=>{const c=window.location.pathname,a=c.replace(/^\//,"").replace(/\/$/,""),e=`/api/raw-markdown/${a===""?"index":a}`;console.log("Copy to LLM clicked: pathname=",c,"apiUrl=",e);try{n.textContent="Copying...";const t=await fetch(e);if(console.log("Response status:",t.status),!t.ok)throw new Error(`HTTP error! status: ${t.status}`);const r=await t.text();console.log("Got markdown, length:",r.length),await navigator.clipboard.writeText(r),n.textContent="Copied!",setTimeout(()=>{n.textContent="Copy to LLM"},2e3)}catch(t){console.error("Copy failed:",t),n.textContent="Failed",setTimeout(()=>{n.textContent="Copy to LLM"},2e3)}})}document.addEventListener("DOMContentLoaded",u);document.addEventListener("astro:page-load",u);
|
|
2
|
+
</script></head> <body class="antialiased" data-astro-cid-mw7aashj> <div class="min-h-screen" data-astro-cid-mw7aashj> <!-- Mobile Header --> <header class="mobile-header fixed top-0 left-0 right-0 h-16 bg-card border-b border-border z-50 md:hidden" data-astro-cid-mw7aashj> <div class="flex items-center justify-between h-full px-4" data-astro-cid-mw7aashj> <a href="/" class="no-underline"> <h1 class="text-xl flex items-center gap-2 bg-linear-to-r from-brand-from to-brand-to bg-clip-text text-transparent"> <span class="text-2xl">➰</span> <span>loopwind</span> </h1> </a> <button id="mobile-menu-button" class="p-2 text-foreground hover:bg-accent rounded-md transition-colors" aria-label="Toggle menu" data-astro-cid-mw7aashj> <svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24" data-astro-cid-mw7aashj> <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16" data-astro-cid-mw7aashj></path> </svg> </button> </div> </header> <!-- Mobile Menu Overlay --> <div id="mobile-menu" class="mobile-menu fixed inset-0 bg-background/80 backdrop-blur-sm z-40 md:hidden hidden" data-astro-cid-mw7aashj> <div class="fixed top-0 left-0 h-screen w-64 bg-card border-r border-border overflow-y-auto" data-astro-cid-mw7aashj> <div class="p-6 pt-20" data-astro-cid-mw7aashj> <nav data-astro-cid-mw7aashj> <ul class="space-y-1" data-astro-cid-mw7aashj> <li data-astro-cid-mw7aashj> <a href="/" class="mobile-menu-link block px-3 py-2 rounded-md text-sm transition-colors no-underline text-muted-foreground hover:text-foreground hover:bg-accent/50" data-astro-cid-mw7aashj> Home </a> </li><li data-astro-cid-mw7aashj> <a href="/getting-started" class="mobile-menu-link block px-3 py-2 rounded-md text-sm transition-colors no-underline text-muted-foreground hover:text-foreground hover:bg-accent/50" data-astro-cid-mw7aashj> Getting Started </a> </li><li data-astro-cid-mw7aashj> <a href="/templates" class="mobile-menu-link block px-3 py-2 rounded-md text-sm transition-colors no-underline text-muted-foreground hover:text-foreground hover:bg-accent/50" data-astro-cid-mw7aashj> Templates </a> </li><li data-astro-cid-mw7aashj> <a href="/images" class="mobile-menu-link block px-3 py-2 rounded-md text-sm transition-colors no-underline text-muted-foreground hover:text-foreground hover:bg-accent/50" data-astro-cid-mw7aashj> Images </a> </li><li data-astro-cid-mw7aashj> <a href="/video" class="mobile-menu-link block px-3 py-2 rounded-md text-sm transition-colors no-underline text-muted-foreground hover:text-foreground hover:bg-accent/50" data-astro-cid-mw7aashj> Video </a> </li><li data-astro-cid-mw7aashj> <a href="/preview" class="mobile-menu-link block px-3 py-2 rounded-md text-sm transition-colors no-underline text-muted-foreground hover:text-foreground hover:bg-accent/50" data-astro-cid-mw7aashj> Preview </a> </li><li data-astro-cid-mw7aashj> <a href="/animation" class="mobile-menu-link block px-3 py-2 rounded-md text-sm transition-colors no-underline text-muted-foreground hover:text-foreground hover:bg-accent/50" data-astro-cid-mw7aashj> Animation </a> </li><li data-astro-cid-mw7aashj> <a href="/helpers" class="mobile-menu-link block px-3 py-2 rounded-md text-sm transition-colors no-underline text-muted-foreground hover:text-foreground hover:bg-accent/50" data-astro-cid-mw7aashj> Helpers </a> </li><li data-astro-cid-mw7aashj> <a href="/styling" class="mobile-menu-link block px-3 py-2 rounded-md text-sm transition-colors no-underline text-muted-foreground hover:text-foreground hover:bg-accent/50" data-astro-cid-mw7aashj> Styling </a> </li><li data-astro-cid-mw7aashj> <a href="/fonts" class="mobile-menu-link block px-3 py-2 rounded-md text-sm transition-colors no-underline text-muted-foreground hover:text-foreground hover:bg-accent/50" data-astro-cid-mw7aashj> Fonts </a> </li><li data-astro-cid-mw7aashj> <a href="/config" class="mobile-menu-link block px-3 py-2 rounded-md text-sm transition-colors no-underline text-muted-foreground hover:text-foreground hover:bg-accent/50" data-astro-cid-mw7aashj> loopwind.json </a> </li><li data-astro-cid-mw7aashj> <a href="/sdk" class="mobile-menu-link block px-3 py-2 rounded-md text-sm transition-colors no-underline text-muted-foreground hover:text-foreground hover:bg-accent/50" data-astro-cid-mw7aashj> SDK </a> </li><li data-astro-cid-mw7aashj> <a href="/agents" class="mobile-menu-link block px-3 py-2 rounded-md text-sm transition-colors no-underline text-muted-foreground hover:text-foreground hover:bg-accent/50" data-astro-cid-mw7aashj> Use with AI Agents </a> </li><li data-astro-cid-mw7aashj> <a href="/llm.txt" class="mobile-menu-link block px-3 py-2 rounded-md text-sm transition-colors no-underline text-muted-foreground hover:text-foreground hover:bg-accent/50" data-astro-cid-mw7aashj> llm.txt ⇱ </a> </li> </ul> </nav> </div> </div> </div> <!-- Desktop Sidebar --> <aside class="desktop-sidebar fixed top-0 left-0 h-screen w-64 border-r border-border bg-card overflow-y-auto z-10" data-astro-cid-mw7aashj> <div class="p-6" data-astro-cid-mw7aashj> <div class="block mb-3" data-astro-cid-mw7aashj> <a href="/" class="no-underline"> <h1 class="text-3xl flex items-center gap-2 bg-linear-to-r from-brand-from to-brand-to bg-clip-text text-transparent"> <span class="text-4xl">➰</span> <span>loopwind</span> </h1> </a> </div> <nav data-astro-cid-mw7aashj> <ul class="space-y-0" data-astro-cid-mw7aashj> <li data-astro-cid-mw7aashj> <a href="/" class="block px-3 py-1.5 rounded-md text-sm transition-colors no-underline text-muted-foreground hover:text-foreground hover:bg-accent/50" data-astro-cid-mw7aashj> Home </a> </li><li data-astro-cid-mw7aashj> <a href="/getting-started" class="block px-3 py-1.5 rounded-md text-sm transition-colors no-underline text-muted-foreground hover:text-foreground hover:bg-accent/50" data-astro-cid-mw7aashj> Getting Started </a> </li><li data-astro-cid-mw7aashj> <a href="/templates" class="block px-3 py-1.5 rounded-md text-sm transition-colors no-underline text-muted-foreground hover:text-foreground hover:bg-accent/50" data-astro-cid-mw7aashj> Templates </a> </li><li data-astro-cid-mw7aashj> <a href="/images" class="block px-3 py-1.5 rounded-md text-sm transition-colors no-underline text-muted-foreground hover:text-foreground hover:bg-accent/50" data-astro-cid-mw7aashj> Images </a> </li><li data-astro-cid-mw7aashj> <a href="/video" class="block px-3 py-1.5 rounded-md text-sm transition-colors no-underline text-muted-foreground hover:text-foreground hover:bg-accent/50" data-astro-cid-mw7aashj> Video </a> </li><li data-astro-cid-mw7aashj> <a href="/preview" class="block px-3 py-1.5 rounded-md text-sm transition-colors no-underline text-muted-foreground hover:text-foreground hover:bg-accent/50" data-astro-cid-mw7aashj> Preview </a> </li><li data-astro-cid-mw7aashj> <a href="/animation" class="block px-3 py-1.5 rounded-md text-sm transition-colors no-underline text-muted-foreground hover:text-foreground hover:bg-accent/50" data-astro-cid-mw7aashj> Animation </a> </li><li data-astro-cid-mw7aashj> <a href="/helpers" class="block px-3 py-1.5 rounded-md text-sm transition-colors no-underline text-muted-foreground hover:text-foreground hover:bg-accent/50" data-astro-cid-mw7aashj> Helpers </a> </li><li data-astro-cid-mw7aashj> <a href="/styling" class="block px-3 py-1.5 rounded-md text-sm transition-colors no-underline text-muted-foreground hover:text-foreground hover:bg-accent/50" data-astro-cid-mw7aashj> Styling </a> </li><li data-astro-cid-mw7aashj> <a href="/fonts" class="block px-3 py-1.5 rounded-md text-sm transition-colors no-underline text-muted-foreground hover:text-foreground hover:bg-accent/50" data-astro-cid-mw7aashj> Fonts </a> </li><li data-astro-cid-mw7aashj> <a href="/config" class="block px-3 py-1.5 rounded-md text-sm transition-colors no-underline text-muted-foreground hover:text-foreground hover:bg-accent/50" data-astro-cid-mw7aashj> loopwind.json </a> </li><li data-astro-cid-mw7aashj> <a href="/sdk" class="block px-3 py-1.5 rounded-md text-sm transition-colors no-underline text-muted-foreground hover:text-foreground hover:bg-accent/50" data-astro-cid-mw7aashj> SDK </a> </li><li data-astro-cid-mw7aashj> <a href="/agents" class="block px-3 py-1.5 rounded-md text-sm transition-colors no-underline text-muted-foreground hover:text-foreground hover:bg-accent/50" data-astro-cid-mw7aashj> Use with AI Agents </a> </li><li data-astro-cid-mw7aashj> <a href="/llm.txt" class="block px-3 py-1.5 rounded-md text-sm transition-colors no-underline text-muted-foreground hover:text-foreground hover:bg-accent/50" data-astro-cid-mw7aashj> llm.txt ⇱ </a> </li> </ul> </nav> </div> </aside> <!-- Main content --> <main class="ml-64 mr-64" data-astro-cid-mw7aashj> <div class="p-12" data-astro-cid-mw7aashj> <button id="copy-to-llm-btn" class="mb-6 px-4 py-2 bg-accent hover:bg-accent/80 text-accent-foreground rounded-md text-sm font-medium transition-colors flex items-center gap-2" aria-label="Copy raw markdown to clipboard" data-astro-cid-mw7aashj> <svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24" data-astro-cid-mw7aashj> <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z" data-astro-cid-mw7aashj></path> </svg> <span id="copy-btn-text" data-astro-cid-mw7aashj>Copy to LLM</span> </button> <article class="prose prose-invert max-w-4xl" data-astro-cid-mw7aashj> <h1 id="sdk">SDK</h1>
|
|
2
3
|
<p>Use <strong>loopwind</strong> programmatically in your Next.js API routes, serverless functions, or Node.js applications. Perfect for building image/video generation APIs!</p>
|
|
3
4
|
<h2 id="installation">Installation</h2>
|
|
4
5
|
<pre class="astro-code github-dark" style="background-color:#24292e;color:#e1e4e8;overflow-x:auto" tabindex="0" data-language="bash"><code><span class="line"><span style="color:#B392F0">npm</span><span style="color:#9ECBFF"> install</span><span style="color:#9ECBFF"> loopwind</span></span>
|
|
@@ -24,10 +25,219 @@
|
|
|
24
25
|
<span class="line"><span style="color:#E1E4E8"> description: </span><span style="color:#9ECBFF">'Generated with loopwind SDK'</span><span style="color:#E1E4E8">,</span></span>
|
|
25
26
|
<span class="line"><span style="color:#E1E4E8">});</span></span>
|
|
26
27
|
<span class="line"></span></code></pre>
|
|
28
|
+
<h2 id="sdk-vs-cli">SDK vs CLI</h2>
|
|
29
|
+
<p>The SDK is designed to be <strong>completely stateless</strong> and <strong>self-contained</strong> - perfect for serverless environments like Vercel, Netlify, or AWS Lambda.</p>
|
|
30
|
+
<p><strong>Key differences:</strong></p>
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
<table><thead><tr><th>Feature</th><th>CLI (<code>loopwind render</code>)</th><th>SDK (<code>renderImage()</code>)</th></tr></thead><tbody><tr><td><strong>Configuration</strong></td><td>Uses <code>loopwind.json</code> for colors, fonts, paths</td><td>Programmatic <code>StyleConfig</code> passed directly</td></tr><tr><td><strong>Templates</strong></td><td>File-based in <code>_loopwind/templates/</code></td><td>Defined with <code>defineTemplate()</code></td></tr><tr><td><strong>State</strong></td><td>Stateful (project directory)</td><td>Stateless (no filesystem reads)</td></tr><tr><td><strong>Use case</strong></td><td>Local development, project-based</td><td>APIs, serverless, dynamic generation</td></tr></tbody></table>
|
|
62
|
+
<p><strong>Important:</strong> The SDK does <strong>not</strong> read <code>loopwind.json</code> from the filesystem. All configuration (colors, fonts) must be passed programmatically using <code>StyleConfig</code>.</p>
|
|
63
|
+
<h2 id="style-configuration">Style Configuration</h2>
|
|
64
|
+
<p>The SDK accepts configuration through the <code>StyleConfig</code> type, which you can pass in two places:</p>
|
|
65
|
+
<ol>
|
|
66
|
+
<li><strong>In <code>defineTemplate()</code></strong> - For fixed theme per template</li>
|
|
67
|
+
<li><strong>In <code>renderImage()</code>/<code>renderVideo()</code></strong> - For dynamic theming at render time</li>
|
|
68
|
+
</ol>
|
|
69
|
+
<p><strong>Priority:</strong> Options config overrides template config.</p>
|
|
70
|
+
<h3 id="basic-example">Basic Example</h3>
|
|
71
|
+
<pre class="astro-code github-dark" style="background-color:#24292e;color:#e1e4e8;overflow-x:auto" tabindex="0" data-language="typescript"><code><span class="line"><span style="color:#F97583">import</span><span style="color:#E1E4E8"> { defineTemplate, renderImage, </span><span style="color:#F97583">type</span><span style="color:#E1E4E8"> StyleConfig } </span><span style="color:#F97583">from</span><span style="color:#9ECBFF"> 'loopwind/sdk'</span><span style="color:#E1E4E8">;</span></span>
|
|
72
|
+
<span class="line"></span>
|
|
73
|
+
<span class="line"><span style="color:#6A737D">// Define your style config</span></span>
|
|
74
|
+
<span class="line"><span style="color:#F97583">const</span><span style="color:#79B8FF"> config</span><span style="color:#F97583">:</span><span style="color:#B392F0"> StyleConfig</span><span style="color:#F97583"> =</span><span style="color:#E1E4E8"> {</span></span>
|
|
75
|
+
<span class="line"><span style="color:#E1E4E8"> colors: {</span></span>
|
|
76
|
+
<span class="line"><span style="color:#E1E4E8"> primary: </span><span style="color:#9ECBFF">'#3b82f6'</span><span style="color:#E1E4E8">,</span></span>
|
|
77
|
+
<span class="line"><span style="color:#E1E4E8"> background: </span><span style="color:#9ECBFF">'#ffffff'</span><span style="color:#E1E4E8">,</span></span>
|
|
78
|
+
<span class="line"><span style="color:#E1E4E8"> text: </span><span style="color:#9ECBFF">'#09090b'</span><span style="color:#E1E4E8">,</span></span>
|
|
79
|
+
<span class="line"><span style="color:#E1E4E8"> },</span></span>
|
|
80
|
+
<span class="line"><span style="color:#E1E4E8"> fonts: {</span></span>
|
|
81
|
+
<span class="line"><span style="color:#E1E4E8"> sans: [</span><span style="color:#9ECBFF">'Inter'</span><span style="color:#E1E4E8">, </span><span style="color:#9ECBFF">'system-ui'</span><span style="color:#E1E4E8">, </span><span style="color:#9ECBFF">'sans-serif'</span><span style="color:#E1E4E8">],</span></span>
|
|
82
|
+
<span class="line"><span style="color:#E1E4E8"> },</span></span>
|
|
83
|
+
<span class="line"><span style="color:#E1E4E8">};</span></span>
|
|
84
|
+
<span class="line"></span>
|
|
85
|
+
<span class="line"><span style="color:#6A737D">// Option 1: Pass config to template definition</span></span>
|
|
86
|
+
<span class="line"><span style="color:#F97583">const</span><span style="color:#79B8FF"> template</span><span style="color:#F97583"> =</span><span style="color:#B392F0"> defineTemplate</span><span style="color:#E1E4E8">({</span></span>
|
|
87
|
+
<span class="line"><span style="color:#E1E4E8"> name: </span><span style="color:#9ECBFF">'og-image'</span><span style="color:#E1E4E8">,</span></span>
|
|
88
|
+
<span class="line"><span style="color:#E1E4E8"> size: { width: </span><span style="color:#79B8FF">1200</span><span style="color:#E1E4E8">, height: </span><span style="color:#79B8FF">630</span><span style="color:#E1E4E8"> },</span></span>
|
|
89
|
+
<span class="line"><span style="color:#E1E4E8"> config, </span><span style="color:#6A737D">// Fixed theme for this template</span></span>
|
|
90
|
+
<span class="line"><span style="color:#B392F0"> render</span><span style="color:#E1E4E8">: ({ </span><span style="color:#FFAB70">tw</span><span style="color:#E1E4E8">, </span><span style="color:#FFAB70">title</span><span style="color:#E1E4E8"> }) </span><span style="color:#F97583">=></span><span style="color:#E1E4E8"> (</span></span>
|
|
91
|
+
<span class="line"><span style="color:#F97583"> <</span><span style="color:#E1E4E8">div style</span><span style="color:#F97583">=</span><span style="color:#E1E4E8">{</span><span style="color:#B392F0">tw</span><span style="color:#E1E4E8">(</span><span style="color:#9ECBFF">'flex items-center justify-center w-full h-full bg-background'</span><span style="color:#E1E4E8">)}</span><span style="color:#F97583">></span></span>
|
|
92
|
+
<span class="line"><span style="color:#F97583"> <</span><span style="color:#E1E4E8">h1 style</span><span style="color:#F97583">=</span><span style="color:#E1E4E8">{</span><span style="color:#B392F0">tw</span><span style="color:#E1E4E8">(</span><span style="color:#9ECBFF">'text-6xl font-bold text-primary'</span><span style="color:#E1E4E8">)}</span><span style="color:#F97583">></span><span style="color:#E1E4E8">{title}</span><span style="color:#F97583"></</span><span style="color:#E1E4E8">h1</span><span style="color:#F97583">></span></span>
|
|
93
|
+
<span class="line"><span style="color:#F97583"> </</span><span style="color:#E1E4E8">div</span><span style="color:#F97583">></span></span>
|
|
94
|
+
<span class="line"><span style="color:#E1E4E8"> ),</span></span>
|
|
95
|
+
<span class="line"><span style="color:#E1E4E8">});</span></span>
|
|
96
|
+
<span class="line"></span>
|
|
97
|
+
<span class="line"><span style="color:#6A737D">// Option 2: Pass config at render time</span></span>
|
|
98
|
+
<span class="line"><span style="color:#F97583">const</span><span style="color:#79B8FF"> png</span><span style="color:#F97583"> =</span><span style="color:#F97583"> await</span><span style="color:#B392F0"> renderImage</span><span style="color:#E1E4E8">(template, { title: </span><span style="color:#9ECBFF">'Hello'</span><span style="color:#E1E4E8"> }, {</span></span>
|
|
99
|
+
<span class="line"><span style="color:#E1E4E8"> config: {</span></span>
|
|
100
|
+
<span class="line"><span style="color:#E1E4E8"> colors: {</span></span>
|
|
101
|
+
<span class="line"><span style="color:#E1E4E8"> primary: </span><span style="color:#9ECBFF">'#8b5cf6'</span><span style="color:#E1E4E8">, </span><span style="color:#6A737D">// Override template config</span></span>
|
|
102
|
+
<span class="line"><span style="color:#E1E4E8"> },</span></span>
|
|
103
|
+
<span class="line"><span style="color:#E1E4E8"> },</span></span>
|
|
104
|
+
<span class="line"><span style="color:#E1E4E8">});</span></span>
|
|
105
|
+
<span class="line"></span></code></pre>
|
|
106
|
+
<h3 id="dynamic-theming">Dynamic Theming</h3>
|
|
107
|
+
<p>Perfect for multi-tenant apps or user-customizable themes:</p>
|
|
108
|
+
<pre class="astro-code github-dark" style="background-color:#24292e;color:#e1e4e8;overflow-x:auto" tabindex="0" data-language="typescript"><code><span class="line"><span style="color:#F97583">const</span><span style="color:#79B8FF"> brandTemplate</span><span style="color:#F97583"> =</span><span style="color:#B392F0"> defineTemplate</span><span style="color:#E1E4E8">({</span></span>
|
|
109
|
+
<span class="line"><span style="color:#E1E4E8"> name: </span><span style="color:#9ECBFF">'branded-og'</span><span style="color:#E1E4E8">,</span></span>
|
|
110
|
+
<span class="line"><span style="color:#E1E4E8"> size: { width: </span><span style="color:#79B8FF">1200</span><span style="color:#E1E4E8">, height: </span><span style="color:#79B8FF">630</span><span style="color:#E1E4E8"> },</span></span>
|
|
111
|
+
<span class="line"><span style="color:#B392F0"> render</span><span style="color:#E1E4E8">: ({ </span><span style="color:#FFAB70">tw</span><span style="color:#E1E4E8">, </span><span style="color:#FFAB70">title</span><span style="color:#E1E4E8">, </span><span style="color:#FFAB70">subtitle</span><span style="color:#E1E4E8"> }) </span><span style="color:#F97583">=></span><span style="color:#E1E4E8"> (</span></span>
|
|
112
|
+
<span class="line"><span style="color:#F97583"> <</span><span style="color:#E1E4E8">div style</span><span style="color:#F97583">=</span><span style="color:#E1E4E8">{</span><span style="color:#B392F0">tw</span><span style="color:#E1E4E8">(</span><span style="color:#9ECBFF">'flex flex-col w-full h-full bg-background p-12 justify-between'</span><span style="color:#E1E4E8">)}</span><span style="color:#F97583">></span></span>
|
|
113
|
+
<span class="line"><span style="color:#F97583"> <</span><span style="color:#E1E4E8">div style</span><span style="color:#F97583">=</span><span style="color:#E1E4E8">{</span><span style="color:#B392F0">tw</span><span style="color:#E1E4E8">(</span><span style="color:#9ECBFF">'flex items-center gap-4'</span><span style="color:#E1E4E8">)}</span><span style="color:#F97583">></span></span>
|
|
114
|
+
<span class="line"><span style="color:#F97583"> <</span><span style="color:#E1E4E8">div style</span><span style="color:#F97583">=</span><span style="color:#E1E4E8">{</span><span style="color:#B392F0">tw</span><span style="color:#E1E4E8">(</span><span style="color:#9ECBFF">'w-16 h-16 rounded-full bg-brand'</span><span style="color:#E1E4E8">)} </span><span style="color:#F97583">/></span></span>
|
|
115
|
+
<span class="line"><span style="color:#F97583"> </</span><span style="color:#E1E4E8">div</span><span style="color:#F97583">></span></span>
|
|
116
|
+
<span class="line"><span style="color:#E1E4E8"> <</span><span style="color:#B392F0">div</span><span style="color:#E1E4E8">></span></span>
|
|
117
|
+
<span class="line"><span style="color:#F97583"> <</span><span style="color:#E1E4E8">h1 style</span><span style="color:#F97583">=</span><span style="color:#E1E4E8">{</span><span style="color:#B392F0">tw</span><span style="color:#E1E4E8">(</span><span style="color:#9ECBFF">'text-7xl font-bold text-foreground mb-4'</span><span style="color:#E1E4E8">)}</span><span style="color:#F97583">></span><span style="color:#E1E4E8">{title}</span><span style="color:#F97583"></</span><span style="color:#E1E4E8">h1</span><span style="color:#F97583">></span></span>
|
|
118
|
+
<span class="line"><span style="color:#F97583"> <</span><span style="color:#E1E4E8">p style</span><span style="color:#F97583">=</span><span style="color:#E1E4E8">{</span><span style="color:#B392F0">tw</span><span style="color:#E1E4E8">(</span><span style="color:#9ECBFF">'text-3xl text-muted-foreground'</span><span style="color:#E1E4E8">)}</span><span style="color:#F97583">></span><span style="color:#E1E4E8">{subtitle}</span><span style="color:#F97583"></</span><span style="color:#E1E4E8">p</span><span style="color:#F97583">></span></span>
|
|
119
|
+
<span class="line"><span style="color:#F97583"> </</span><span style="color:#E1E4E8">div</span><span style="color:#F97583">></span></span>
|
|
120
|
+
<span class="line"><span style="color:#F97583"> </</span><span style="color:#E1E4E8">div</span><span style="color:#F97583">></span></span>
|
|
121
|
+
<span class="line"><span style="color:#E1E4E8"> ),</span></span>
|
|
122
|
+
<span class="line"><span style="color:#E1E4E8">});</span></span>
|
|
123
|
+
<span class="line"></span>
|
|
124
|
+
<span class="line"><span style="color:#6A737D">// Render with different brand colors for each customer</span></span>
|
|
125
|
+
<span class="line"><span style="color:#F97583">const</span><span style="color:#79B8FF"> customer1</span><span style="color:#F97583"> =</span><span style="color:#F97583"> await</span><span style="color:#B392F0"> renderImage</span><span style="color:#E1E4E8">(brandTemplate,</span></span>
|
|
126
|
+
<span class="line"><span style="color:#E1E4E8"> { title: </span><span style="color:#9ECBFF">'Welcome'</span><span style="color:#E1E4E8">, subtitle: </span><span style="color:#9ECBFF">'Customer 1'</span><span style="color:#E1E4E8"> },</span></span>
|
|
127
|
+
<span class="line"><span style="color:#E1E4E8"> {</span></span>
|
|
128
|
+
<span class="line"><span style="color:#E1E4E8"> config: {</span></span>
|
|
129
|
+
<span class="line"><span style="color:#E1E4E8"> colors: {</span></span>
|
|
130
|
+
<span class="line"><span style="color:#E1E4E8"> brand: </span><span style="color:#9ECBFF">'#ef4444'</span><span style="color:#E1E4E8">,</span></span>
|
|
131
|
+
<span class="line"><span style="color:#E1E4E8"> background: </span><span style="color:#9ECBFF">'#fef2f2'</span><span style="color:#E1E4E8">,</span></span>
|
|
132
|
+
<span class="line"><span style="color:#E1E4E8"> foreground: </span><span style="color:#9ECBFF">'#7f1d1d'</span><span style="color:#E1E4E8">,</span></span>
|
|
133
|
+
<span class="line"><span style="color:#9ECBFF"> 'muted-foreground'</span><span style="color:#E1E4E8">: </span><span style="color:#9ECBFF">'#991b1b'</span><span style="color:#E1E4E8">,</span></span>
|
|
134
|
+
<span class="line"><span style="color:#E1E4E8"> },</span></span>
|
|
135
|
+
<span class="line"><span style="color:#E1E4E8"> },</span></span>
|
|
136
|
+
<span class="line"><span style="color:#E1E4E8"> }</span></span>
|
|
137
|
+
<span class="line"><span style="color:#E1E4E8">);</span></span>
|
|
138
|
+
<span class="line"></span>
|
|
139
|
+
<span class="line"><span style="color:#F97583">const</span><span style="color:#79B8FF"> customer2</span><span style="color:#F97583"> =</span><span style="color:#F97583"> await</span><span style="color:#B392F0"> renderImage</span><span style="color:#E1E4E8">(brandTemplate,</span></span>
|
|
140
|
+
<span class="line"><span style="color:#E1E4E8"> { title: </span><span style="color:#9ECBFF">'Welcome'</span><span style="color:#E1E4E8">, subtitle: </span><span style="color:#9ECBFF">'Customer 2'</span><span style="color:#E1E4E8"> },</span></span>
|
|
141
|
+
<span class="line"><span style="color:#E1E4E8"> {</span></span>
|
|
142
|
+
<span class="line"><span style="color:#E1E4E8"> config: {</span></span>
|
|
143
|
+
<span class="line"><span style="color:#E1E4E8"> colors: {</span></span>
|
|
144
|
+
<span class="line"><span style="color:#E1E4E8"> brand: </span><span style="color:#9ECBFF">'#3b82f6'</span><span style="color:#E1E4E8">,</span></span>
|
|
145
|
+
<span class="line"><span style="color:#E1E4E8"> background: </span><span style="color:#9ECBFF">'#eff6ff'</span><span style="color:#E1E4E8">,</span></span>
|
|
146
|
+
<span class="line"><span style="color:#E1E4E8"> foreground: </span><span style="color:#9ECBFF">'#1e3a8a'</span><span style="color:#E1E4E8">,</span></span>
|
|
147
|
+
<span class="line"><span style="color:#9ECBFF"> 'muted-foreground'</span><span style="color:#E1E4E8">: </span><span style="color:#9ECBFF">'#1e40af'</span><span style="color:#E1E4E8">,</span></span>
|
|
148
|
+
<span class="line"><span style="color:#E1E4E8"> },</span></span>
|
|
149
|
+
<span class="line"><span style="color:#E1E4E8"> },</span></span>
|
|
150
|
+
<span class="line"><span style="color:#E1E4E8"> }</span></span>
|
|
151
|
+
<span class="line"><span style="color:#E1E4E8">);</span></span>
|
|
152
|
+
<span class="line"></span></code></pre>
|
|
153
|
+
<h3 id="full-styleconfig-example">Full StyleConfig Example</h3>
|
|
154
|
+
<pre class="astro-code github-dark" style="background-color:#24292e;color:#e1e4e8;overflow-x:auto" tabindex="0" data-language="typescript"><code><span class="line"><span style="color:#F97583">import</span><span style="color:#F97583"> type</span><span style="color:#E1E4E8"> { StyleConfig } </span><span style="color:#F97583">from</span><span style="color:#9ECBFF"> 'loopwind/sdk'</span><span style="color:#E1E4E8">;</span></span>
|
|
155
|
+
<span class="line"></span>
|
|
156
|
+
<span class="line"><span style="color:#F97583">const</span><span style="color:#79B8FF"> config</span><span style="color:#F97583">:</span><span style="color:#B392F0"> StyleConfig</span><span style="color:#F97583"> =</span><span style="color:#E1E4E8"> {</span></span>
|
|
157
|
+
<span class="line"><span style="color:#6A737D"> // Theme colors (any custom color names)</span></span>
|
|
158
|
+
<span class="line"><span style="color:#E1E4E8"> colors: {</span></span>
|
|
159
|
+
<span class="line"><span style="color:#E1E4E8"> primary: </span><span style="color:#9ECBFF">'#6366f1'</span><span style="color:#E1E4E8">,</span></span>
|
|
160
|
+
<span class="line"><span style="color:#9ECBFF"> 'primary-foreground'</span><span style="color:#E1E4E8">: </span><span style="color:#9ECBFF">'#ffffff'</span><span style="color:#E1E4E8">,</span></span>
|
|
161
|
+
<span class="line"><span style="color:#E1E4E8"> background: </span><span style="color:#9ECBFF">'#ffffff'</span><span style="color:#E1E4E8">,</span></span>
|
|
162
|
+
<span class="line"><span style="color:#E1E4E8"> foreground: </span><span style="color:#9ECBFF">'#0f172a'</span><span style="color:#E1E4E8">,</span></span>
|
|
163
|
+
<span class="line"><span style="color:#E1E4E8"> muted: </span><span style="color:#9ECBFF">'#f1f5f9'</span><span style="color:#E1E4E8">,</span></span>
|
|
164
|
+
<span class="line"><span style="color:#9ECBFF"> 'muted-foreground'</span><span style="color:#E1E4E8">: </span><span style="color:#9ECBFF">'#64748b'</span><span style="color:#E1E4E8">,</span></span>
|
|
165
|
+
<span class="line"><span style="color:#E1E4E8"> border: </span><span style="color:#9ECBFF">'#e2e8f0'</span><span style="color:#E1E4E8">,</span></span>
|
|
166
|
+
<span class="line"><span style="color:#E1E4E8"> brand: </span><span style="color:#9ECBFF">'#8b5cf6'</span><span style="color:#E1E4E8">,</span></span>
|
|
167
|
+
<span class="line"><span style="color:#E1E4E8"> },</span></span>
|
|
168
|
+
<span class="line"></span>
|
|
169
|
+
<span class="line"><span style="color:#6A737D"> // Font families</span></span>
|
|
170
|
+
<span class="line"><span style="color:#E1E4E8"> fonts: {</span></span>
|
|
171
|
+
<span class="line"><span style="color:#E1E4E8"> sans: [</span><span style="color:#9ECBFF">'Inter'</span><span style="color:#E1E4E8">, </span><span style="color:#9ECBFF">'sans-serif'</span><span style="color:#E1E4E8">],</span></span>
|
|
172
|
+
<span class="line"><span style="color:#E1E4E8"> serif: [</span><span style="color:#9ECBFF">'Playfair Display'</span><span style="color:#E1E4E8">, </span><span style="color:#9ECBFF">'serif'</span><span style="color:#E1E4E8">],</span></span>
|
|
173
|
+
<span class="line"><span style="color:#E1E4E8"> mono: [</span><span style="color:#9ECBFF">'JetBrains Mono'</span><span style="color:#E1E4E8">, </span><span style="color:#9ECBFF">'monospace'</span><span style="color:#E1E4E8">],</span></span>
|
|
174
|
+
<span class="line"><span style="color:#E1E4E8"> },</span></span>
|
|
175
|
+
<span class="line"></span>
|
|
176
|
+
<span class="line"><span style="color:#6A737D"> // Custom tokens (optional)</span></span>
|
|
177
|
+
<span class="line"><span style="color:#E1E4E8"> tokens: {</span></span>
|
|
178
|
+
<span class="line"><span style="color:#E1E4E8"> borderRadius: {</span></span>
|
|
179
|
+
<span class="line"><span style="color:#E1E4E8"> sm: </span><span style="color:#9ECBFF">'0.25rem'</span><span style="color:#E1E4E8">,</span></span>
|
|
180
|
+
<span class="line"><span style="color:#E1E4E8"> md: </span><span style="color:#9ECBFF">'0.375rem'</span><span style="color:#E1E4E8">,</span></span>
|
|
181
|
+
<span class="line"><span style="color:#E1E4E8"> lg: </span><span style="color:#9ECBFF">'0.5rem'</span><span style="color:#E1E4E8">,</span></span>
|
|
182
|
+
<span class="line"><span style="color:#E1E4E8"> },</span></span>
|
|
183
|
+
<span class="line"><span style="color:#E1E4E8"> },</span></span>
|
|
184
|
+
<span class="line"><span style="color:#E1E4E8">};</span></span>
|
|
185
|
+
<span class="line"></span></code></pre>
|
|
186
|
+
<h3 id="font-files">Font Files</h3>
|
|
187
|
+
<p>You can load custom fonts from local paths or external URLs:</p>
|
|
188
|
+
<pre class="astro-code github-dark" style="background-color:#24292e;color:#e1e4e8;overflow-x:auto" tabindex="0" data-language="typescript"><code><span class="line"><span style="color:#F97583">const</span><span style="color:#79B8FF"> config</span><span style="color:#F97583">:</span><span style="color:#B392F0"> StyleConfig</span><span style="color:#F97583"> =</span><span style="color:#E1E4E8"> {</span></span>
|
|
189
|
+
<span class="line"><span style="color:#E1E4E8"> colors: {</span></span>
|
|
190
|
+
<span class="line"><span style="color:#E1E4E8"> text: </span><span style="color:#9ECBFF">'#000000'</span><span style="color:#E1E4E8">,</span></span>
|
|
191
|
+
<span class="line"><span style="color:#E1E4E8"> },</span></span>
|
|
192
|
+
<span class="line"><span style="color:#E1E4E8"> fonts: {</span></span>
|
|
193
|
+
<span class="line"><span style="color:#E1E4E8"> sans: {</span></span>
|
|
194
|
+
<span class="line"><span style="color:#E1E4E8"> family: [</span><span style="color:#9ECBFF">'Inter'</span><span style="color:#E1E4E8">, </span><span style="color:#9ECBFF">'sans-serif'</span><span style="color:#E1E4E8">],</span></span>
|
|
195
|
+
<span class="line"><span style="color:#E1E4E8"> files: [</span></span>
|
|
196
|
+
<span class="line"><span style="color:#6A737D"> // Local font file (relative to your project)</span></span>
|
|
197
|
+
<span class="line"><span style="color:#E1E4E8"> { path: </span><span style="color:#9ECBFF">'./fonts/Inter-Regular.woff'</span><span style="color:#E1E4E8">, weight: </span><span style="color:#79B8FF">400</span><span style="color:#E1E4E8"> },</span></span>
|
|
198
|
+
<span class="line"><span style="color:#6A737D"> // External URL</span></span>
|
|
199
|
+
<span class="line"><span style="color:#E1E4E8"> {</span></span>
|
|
200
|
+
<span class="line"><span style="color:#E1E4E8"> path: </span><span style="color:#9ECBFF">'https://unpkg.com/@fontsource/inter@5.0.18/files/inter-latin-700-normal.woff'</span><span style="color:#E1E4E8">,</span></span>
|
|
201
|
+
<span class="line"><span style="color:#E1E4E8"> weight: </span><span style="color:#79B8FF">700</span></span>
|
|
202
|
+
<span class="line"><span style="color:#E1E4E8"> }</span></span>
|
|
203
|
+
<span class="line"><span style="color:#E1E4E8"> ]</span></span>
|
|
204
|
+
<span class="line"><span style="color:#E1E4E8"> }</span></span>
|
|
205
|
+
<span class="line"><span style="color:#E1E4E8"> }</span></span>
|
|
206
|
+
<span class="line"><span style="color:#E1E4E8">};</span></span>
|
|
207
|
+
<span class="line"></span>
|
|
208
|
+
<span class="line"><span style="color:#F97583">const</span><span style="color:#79B8FF"> template</span><span style="color:#F97583"> =</span><span style="color:#B392F0"> defineTemplate</span><span style="color:#E1E4E8">({</span></span>
|
|
209
|
+
<span class="line"><span style="color:#E1E4E8"> config,</span></span>
|
|
210
|
+
<span class="line"><span style="color:#B392F0"> render</span><span style="color:#E1E4E8">: ({ </span><span style="color:#FFAB70">tw</span><span style="color:#E1E4E8"> }) </span><span style="color:#F97583">=></span><span style="color:#E1E4E8"> (</span></span>
|
|
211
|
+
<span class="line"><span style="color:#F97583"> <</span><span style="color:#E1E4E8">div style</span><span style="color:#F97583">=</span><span style="color:#E1E4E8">{</span><span style="color:#B392F0">tw</span><span style="color:#E1E4E8">(</span><span style="color:#9ECBFF">'font-sans'</span><span style="color:#E1E4E8">)}</span><span style="color:#F97583">></span></span>
|
|
212
|
+
<span class="line"><span style="color:#F97583"> <</span><span style="color:#E1E4E8">h1 style</span><span style="color:#F97583">=</span><span style="color:#E1E4E8">{</span><span style="color:#B392F0">tw</span><span style="color:#E1E4E8">(</span><span style="color:#9ECBFF">'font-bold'</span><span style="color:#E1E4E8">)}</span><span style="color:#F97583">></span><span style="color:#E1E4E8">Bold uses weight </span><span style="color:#79B8FF">700</span><span style="color:#F97583"></</span><span style="color:#E1E4E8">h1</span><span style="color:#F97583">></span></span>
|
|
213
|
+
<span class="line"><span style="color:#F97583"> <</span><span style="color:#E1E4E8">p style</span><span style="color:#F97583">=</span><span style="color:#E1E4E8">{</span><span style="color:#B392F0">tw</span><span style="color:#E1E4E8">(</span><span style="color:#9ECBFF">'font-normal'</span><span style="color:#E1E4E8">)}</span><span style="color:#F97583">></span><span style="color:#E1E4E8">Normal uses weight </span><span style="color:#79B8FF">400</span><span style="color:#F97583"></</span><span style="color:#E1E4E8">p</span><span style="color:#F97583">></span></span>
|
|
214
|
+
<span class="line"><span style="color:#F97583"> </</span><span style="color:#E1E4E8">div</span><span style="color:#F97583">></span></span>
|
|
215
|
+
<span class="line"><span style="color:#E1E4E8"> ),</span></span>
|
|
216
|
+
<span class="line"><span style="color:#E1E4E8">});</span></span>
|
|
217
|
+
<span class="line"></span></code></pre>
|
|
218
|
+
<p><strong>Supported formats:</strong></p>
|
|
219
|
+
<ul>
|
|
220
|
+
<li>✅ WOFF (<code>.woff</code>)</li>
|
|
221
|
+
<li>✅ TTF (<code>.ttf</code>)</li>
|
|
222
|
+
<li>✅ OTF (<code>.otf</code>)</li>
|
|
223
|
+
<li>❌ WOFF2 (not supported)</li>
|
|
224
|
+
</ul>
|
|
225
|
+
<h3 id="alternative-hardcoded-colors">Alternative: Hardcoded Colors</h3>
|
|
226
|
+
<p>If you prefer not to use config, you can still hardcode colors:</p>
|
|
227
|
+
<pre class="astro-code github-dark" style="background-color:#24292e;color:#e1e4e8;overflow-x:auto" tabindex="0" data-language="typescript"><code><span class="line"><span style="color:#F97583">const</span><span style="color:#79B8FF"> template</span><span style="color:#F97583"> =</span><span style="color:#B392F0"> defineTemplate</span><span style="color:#E1E4E8">({</span></span>
|
|
228
|
+
<span class="line"><span style="color:#E1E4E8"> name: </span><span style="color:#9ECBFF">'og-image'</span><span style="color:#E1E4E8">,</span></span>
|
|
229
|
+
<span class="line"><span style="color:#E1E4E8"> size: { width: </span><span style="color:#79B8FF">1200</span><span style="color:#E1E4E8">, height: </span><span style="color:#79B8FF">630</span><span style="color:#E1E4E8"> },</span></span>
|
|
230
|
+
<span class="line"><span style="color:#B392F0"> render</span><span style="color:#E1E4E8">: ({ </span><span style="color:#FFAB70">tw</span><span style="color:#E1E4E8">, </span><span style="color:#FFAB70">title</span><span style="color:#E1E4E8"> }) </span><span style="color:#F97583">=></span><span style="color:#E1E4E8"> (</span></span>
|
|
231
|
+
<span class="line"><span style="color:#F97583"> <</span><span style="color:#E1E4E8">div style</span><span style="color:#F97583">=</span><span style="color:#E1E4E8">{</span><span style="color:#B392F0">tw</span><span style="color:#E1E4E8">(</span><span style="color:#9ECBFF">'bg-[#3B82F6] text-white p-12'</span><span style="color:#E1E4E8">)}</span><span style="color:#F97583">></span></span>
|
|
232
|
+
<span class="line"><span style="color:#F97583"> <</span><span style="color:#E1E4E8">h1 style</span><span style="color:#F97583">=</span><span style="color:#E1E4E8">{</span><span style="color:#B392F0">tw</span><span style="color:#E1E4E8">(</span><span style="color:#9ECBFF">'text-6xl font-bold'</span><span style="color:#E1E4E8">)}</span><span style="color:#F97583">></span><span style="color:#E1E4E8">{title}</span><span style="color:#F97583"></</span><span style="color:#E1E4E8">h1</span><span style="color:#F97583">></span></span>
|
|
233
|
+
<span class="line"><span style="color:#F97583"> </</span><span style="color:#E1E4E8">div</span><span style="color:#F97583">></span></span>
|
|
234
|
+
<span class="line"><span style="color:#E1E4E8"> ),</span></span>
|
|
235
|
+
<span class="line"><span style="color:#E1E4E8">});</span></span>
|
|
236
|
+
<span class="line"></span></code></pre>
|
|
27
237
|
<h2 id="core-functions">Core Functions</h2>
|
|
28
238
|
<h3 id="definetemplate">defineTemplate()</h3>
|
|
29
239
|
<p>Define a template programmatically without any file system dependencies:</p>
|
|
30
|
-
<pre class="astro-code github-dark" style="background-color:#24292e;color:#e1e4e8;overflow-x:auto" tabindex="0" data-language="typescript"><code><span class="line"><span style="color:#F97583">import</span><span style="color:#E1E4E8"> { defineTemplate } </span><span style="color:#F97583">from</span><span style="color:#9ECBFF"> 'loopwind/sdk'</span><span style="color:#E1E4E8">;</span></span>
|
|
240
|
+
<pre class="astro-code github-dark" style="background-color:#24292e;color:#e1e4e8;overflow-x:auto" tabindex="0" data-language="typescript"><code><span class="line"><span style="color:#F97583">import</span><span style="color:#E1E4E8"> { defineTemplate, </span><span style="color:#F97583">type</span><span style="color:#E1E4E8"> StyleConfig } </span><span style="color:#F97583">from</span><span style="color:#9ECBFF"> 'loopwind/sdk'</span><span style="color:#E1E4E8">;</span></span>
|
|
31
241
|
<span class="line"></span>
|
|
32
242
|
<span class="line"><span style="color:#F97583">const</span><span style="color:#79B8FF"> template</span><span style="color:#F97583"> =</span><span style="color:#B392F0"> defineTemplate</span><span style="color:#E1E4E8">({</span></span>
|
|
33
243
|
<span class="line"><span style="color:#E1E4E8"> name: </span><span style="color:#9ECBFF">'my-template'</span><span style="color:#E1E4E8">, </span><span style="color:#6A737D">// Template name</span></span>
|
|
@@ -37,13 +247,21 @@
|
|
|
37
247
|
<span class="line"><span style="color:#6A737D"> // For videos only</span></span>
|
|
38
248
|
<span class="line"><span style="color:#E1E4E8"> video: { fps: </span><span style="color:#79B8FF">30</span><span style="color:#E1E4E8">, duration: </span><span style="color:#79B8FF">3</span><span style="color:#E1E4E8"> },</span></span>
|
|
39
249
|
<span class="line"></span>
|
|
40
|
-
<span class="line"><span style="color:#6A737D"> // Optional fonts</span></span>
|
|
41
|
-
<span class="line"><span style="color:#E1E4E8">
|
|
250
|
+
<span class="line"><span style="color:#6A737D"> // Optional style config (colors, fonts, etc.)</span></span>
|
|
251
|
+
<span class="line"><span style="color:#E1E4E8"> config: {</span></span>
|
|
252
|
+
<span class="line"><span style="color:#E1E4E8"> colors: {</span></span>
|
|
253
|
+
<span class="line"><span style="color:#E1E4E8"> primary: </span><span style="color:#9ECBFF">'#3b82f6'</span><span style="color:#E1E4E8">,</span></span>
|
|
254
|
+
<span class="line"><span style="color:#E1E4E8"> background: </span><span style="color:#9ECBFF">'#ffffff'</span><span style="color:#E1E4E8">,</span></span>
|
|
255
|
+
<span class="line"><span style="color:#E1E4E8"> },</span></span>
|
|
256
|
+
<span class="line"><span style="color:#E1E4E8"> fonts: {</span></span>
|
|
257
|
+
<span class="line"><span style="color:#E1E4E8"> sans: [</span><span style="color:#9ECBFF">'Inter'</span><span style="color:#E1E4E8">, </span><span style="color:#9ECBFF">'sans-serif'</span><span style="color:#E1E4E8">],</span></span>
|
|
258
|
+
<span class="line"><span style="color:#E1E4E8"> },</span></span>
|
|
259
|
+
<span class="line"><span style="color:#E1E4E8"> },</span></span>
|
|
42
260
|
<span class="line"></span>
|
|
43
261
|
<span class="line"><span style="color:#6A737D"> // The render function</span></span>
|
|
44
262
|
<span class="line"><span style="color:#B392F0"> render</span><span style="color:#E1E4E8">: ({ </span><span style="color:#FFAB70">tw</span><span style="color:#E1E4E8">, </span><span style="color:#FFAB70">title</span><span style="color:#E1E4E8"> }) </span><span style="color:#F97583">=></span><span style="color:#E1E4E8"> (</span></span>
|
|
45
|
-
<span class="line"><span style="color:#F97583"> <</span><span style="color:#E1E4E8">div style</span><span style="color:#F97583">=</span><span style="color:#E1E4E8">{</span><span style="color:#B392F0">tw</span><span style="color:#E1E4E8">(</span><span style="color:#9ECBFF">'flex items-center justify-center w-full h-full bg-
|
|
46
|
-
<span class="line"><span style="color:#F97583"> <</span><span style="color:#E1E4E8">h1 style</span><span style="color:#F97583">=</span><span style="color:#E1E4E8">{</span><span style="color:#B392F0">tw</span><span style="color:#E1E4E8">(</span><span style="color:#9ECBFF">'text-6xl font-bold'</span><span style="color:#E1E4E8">)}</span><span style="color:#F97583">></span><span style="color:#E1E4E8">{title}</span><span style="color:#F97583"></</span><span style="color:#E1E4E8">h1</span><span style="color:#F97583">></span></span>
|
|
263
|
+
<span class="line"><span style="color:#F97583"> <</span><span style="color:#E1E4E8">div style</span><span style="color:#F97583">=</span><span style="color:#E1E4E8">{</span><span style="color:#B392F0">tw</span><span style="color:#E1E4E8">(</span><span style="color:#9ECBFF">'flex items-center justify-center w-full h-full bg-background'</span><span style="color:#E1E4E8">)}</span><span style="color:#F97583">></span></span>
|
|
264
|
+
<span class="line"><span style="color:#F97583"> <</span><span style="color:#E1E4E8">h1 style</span><span style="color:#F97583">=</span><span style="color:#E1E4E8">{</span><span style="color:#B392F0">tw</span><span style="color:#E1E4E8">(</span><span style="color:#9ECBFF">'text-6xl font-bold text-primary'</span><span style="color:#E1E4E8">)}</span><span style="color:#F97583">></span><span style="color:#E1E4E8">{title}</span><span style="color:#F97583"></</span><span style="color:#E1E4E8">h1</span><span style="color:#F97583">></span></span>
|
|
47
265
|
<span class="line"><span style="color:#F97583"> </</span><span style="color:#E1E4E8">div</span><span style="color:#F97583">></span></span>
|
|
48
266
|
<span class="line"><span style="color:#E1E4E8"> ),</span></span>
|
|
49
267
|
<span class="line"><span style="color:#E1E4E8">});</span></span>
|
|
@@ -55,6 +273,11 @@
|
|
|
55
273
|
<span class="line"><span style="color:#F97583">const</span><span style="color:#79B8FF"> buffer</span><span style="color:#F97583"> =</span><span style="color:#F97583"> await</span><span style="color:#B392F0"> renderImage</span><span style="color:#E1E4E8">(template, props, {</span></span>
|
|
56
274
|
<span class="line"><span style="color:#E1E4E8"> format: </span><span style="color:#9ECBFF">'png'</span><span style="color:#E1E4E8">, </span><span style="color:#6A737D">// 'png', 'jpeg', 'jpg', 'webp', 'svg'</span></span>
|
|
57
275
|
<span class="line"><span style="color:#E1E4E8"> quality: </span><span style="color:#79B8FF">92</span><span style="color:#E1E4E8">, </span><span style="color:#6A737D">// JPEG/WebP quality (1-100)</span></span>
|
|
276
|
+
<span class="line"><span style="color:#E1E4E8"> config: { </span><span style="color:#6A737D">// Optional: Override template config</span></span>
|
|
277
|
+
<span class="line"><span style="color:#E1E4E8"> colors: {</span></span>
|
|
278
|
+
<span class="line"><span style="color:#E1E4E8"> primary: </span><span style="color:#9ECBFF">'#8b5cf6'</span><span style="color:#E1E4E8">,</span></span>
|
|
279
|
+
<span class="line"><span style="color:#E1E4E8"> },</span></span>
|
|
280
|
+
<span class="line"><span style="color:#E1E4E8"> },</span></span>
|
|
58
281
|
<span class="line"><span style="color:#E1E4E8">});</span></span>
|
|
59
282
|
<span class="line"></span></code></pre>
|
|
60
283
|
<p><strong>Supported formats:</strong></p>
|
|
@@ -73,8 +296,43 @@
|
|
|
73
296
|
<span class="line"><span style="color:#B392F0"> onProgress</span><span style="color:#E1E4E8">: (</span><span style="color:#FFAB70">frame</span><span style="color:#E1E4E8">, </span><span style="color:#FFAB70">total</span><span style="color:#E1E4E8">, </span><span style="color:#FFAB70">phase</span><span style="color:#E1E4E8">) </span><span style="color:#F97583">=></span><span style="color:#E1E4E8"> {</span></span>
|
|
74
297
|
<span class="line"><span style="color:#E1E4E8"> console.</span><span style="color:#B392F0">log</span><span style="color:#E1E4E8">(</span><span style="color:#9ECBFF">`${</span><span style="color:#E1E4E8">phase</span><span style="color:#9ECBFF">}: ${</span><span style="color:#E1E4E8">frame</span><span style="color:#9ECBFF">}/${</span><span style="color:#E1E4E8">total</span><span style="color:#9ECBFF">}`</span><span style="color:#E1E4E8">);</span></span>
|
|
75
298
|
<span class="line"><span style="color:#E1E4E8"> },</span></span>
|
|
299
|
+
<span class="line"><span style="color:#E1E4E8"> config: { </span><span style="color:#6A737D">// Optional: Override template config</span></span>
|
|
300
|
+
<span class="line"><span style="color:#E1E4E8"> colors: {</span></span>
|
|
301
|
+
<span class="line"><span style="color:#E1E4E8"> primary: </span><span style="color:#9ECBFF">'#8b5cf6'</span><span style="color:#E1E4E8">,</span></span>
|
|
302
|
+
<span class="line"><span style="color:#E1E4E8"> },</span></span>
|
|
303
|
+
<span class="line"><span style="color:#E1E4E8"> },</span></span>
|
|
76
304
|
<span class="line"><span style="color:#E1E4E8">});</span></span>
|
|
77
305
|
<span class="line"></span></code></pre>
|
|
306
|
+
<h2 id="importing-template-files">Importing Template Files</h2>
|
|
307
|
+
<p>You can reuse file-based templates from <code>_loopwind/templates/</code> in your SDK code! Perfect for sharing templates between CLI and API.</p>
|
|
308
|
+
<pre class="astro-code github-dark" style="background-color:#24292e;color:#e1e4e8;overflow-x:auto" tabindex="0" data-language="typescript"><code><span class="line"><span style="color:#6A737D">// Import a template file</span></span>
|
|
309
|
+
<span class="line"><span style="color:#F97583">import</span><span style="color:#79B8FF"> *</span><span style="color:#F97583"> as</span><span style="color:#E1E4E8"> videoIntro </span><span style="color:#F97583">from</span><span style="color:#9ECBFF"> './_loopwind/templates/video-intro/template'</span><span style="color:#E1E4E8">;</span></span>
|
|
310
|
+
<span class="line"><span style="color:#F97583">import</span><span style="color:#E1E4E8"> { defineTemplateFromFile, renderVideo } </span><span style="color:#F97583">from</span><span style="color:#9ECBFF"> 'loopwind/sdk'</span><span style="color:#E1E4E8">;</span></span>
|
|
311
|
+
<span class="line"></span>
|
|
312
|
+
<span class="line"><span style="color:#6A737D">// Create SDK template from file with optional config override</span></span>
|
|
313
|
+
<span class="line"><span style="color:#F97583">const</span><span style="color:#79B8FF"> template</span><span style="color:#F97583"> =</span><span style="color:#B392F0"> defineTemplateFromFile</span><span style="color:#E1E4E8">(videoIntro, {</span></span>
|
|
314
|
+
<span class="line"><span style="color:#E1E4E8"> config: {</span></span>
|
|
315
|
+
<span class="line"><span style="color:#E1E4E8"> colors: {</span></span>
|
|
316
|
+
<span class="line"><span style="color:#E1E4E8"> primary: </span><span style="color:#9ECBFF">'#ff0000'</span><span style="color:#E1E4E8">,</span></span>
|
|
317
|
+
<span class="line"><span style="color:#E1E4E8"> },</span></span>
|
|
318
|
+
<span class="line"><span style="color:#E1E4E8"> },</span></span>
|
|
319
|
+
<span class="line"><span style="color:#E1E4E8">});</span></span>
|
|
320
|
+
<span class="line"></span>
|
|
321
|
+
<span class="line"><span style="color:#6A737D">// Render with props</span></span>
|
|
322
|
+
<span class="line"><span style="color:#F97583">const</span><span style="color:#79B8FF"> mp4</span><span style="color:#F97583"> =</span><span style="color:#F97583"> await</span><span style="color:#B392F0"> renderVideo</span><span style="color:#E1E4E8">(template, {</span></span>
|
|
323
|
+
<span class="line"><span style="color:#E1E4E8"> version: </span><span style="color:#9ECBFF">'2.0.0'</span><span style="color:#E1E4E8">,</span></span>
|
|
324
|
+
<span class="line"><span style="color:#E1E4E8"> changes: [</span><span style="color:#9ECBFF">'New feature added'</span><span style="color:#E1E4E8">, </span><span style="color:#9ECBFF">'Bug fixes'</span><span style="color:#E1E4E8">],</span></span>
|
|
325
|
+
<span class="line"><span style="color:#E1E4E8">});</span></span>
|
|
326
|
+
<span class="line"></span></code></pre>
|
|
327
|
+
<p><strong>Benefits:</strong></p>
|
|
328
|
+
<ul>
|
|
329
|
+
<li>✅ Reuse templates between CLI and SDK</li>
|
|
330
|
+
<li>✅ Keep templates in separate files (better organization)</li>
|
|
331
|
+
<li>✅ Override config at SDK level</li>
|
|
332
|
+
<li>✅ Type-safe with TypeScript</li>
|
|
333
|
+
<li>✅ Works with any bundler (Next.js, Vite, webpack, etc.)</li>
|
|
334
|
+
</ul>
|
|
335
|
+
<p><strong>Note:</strong> Requires a bundler that handles TypeScript/TSX imports (Next.js, Vite, etc.)</p>
|
|
78
336
|
<h2 id="nextjs-api-routes">Next.js API Routes</h2>
|
|
79
337
|
<h3 id="image-generation">Image Generation</h3>
|
|
80
338
|
<pre class="astro-code github-dark" style="background-color:#24292e;color:#e1e4e8;overflow-x:auto" tabindex="0" data-language="typescript"><code><span class="line"><span style="color:#6A737D">// pages/api/og-image.ts</span></span>
|
|
@@ -170,63 +428,135 @@
|
|
|
170
428
|
<span class="line"><span style="color:#F97583"> </</span><span style="color:#E1E4E8">div</span><span style="color:#F97583">></span></span>
|
|
171
429
|
<span class="line"><span style="color:#E1E4E8">)</span></span>
|
|
172
430
|
<span class="line"></span></code></pre>
|
|
431
|
+
<h3 id="using-qr">Using qr()</h3>
|
|
432
|
+
<p>Generate QR codes as data URIs:</p>
|
|
433
|
+
<pre class="astro-code github-dark" style="background-color:#24292e;color:#e1e4e8;overflow-x:auto" tabindex="0" data-language="typescript"><code><span class="line"><span style="color:#B392F0">render</span><span style="color:#E1E4E8">: ({ </span><span style="color:#FFAB70">tw</span><span style="color:#E1E4E8">, </span><span style="color:#FFAB70">qr</span><span style="color:#E1E4E8">, </span><span style="color:#FFAB70">url</span><span style="color:#E1E4E8"> }) </span><span style="color:#F97583">=></span><span style="color:#E1E4E8"> (</span></span>
|
|
434
|
+
<span class="line"><span style="color:#F97583"> <</span><span style="color:#E1E4E8">div style</span><span style="color:#F97583">=</span><span style="color:#E1E4E8">{</span><span style="color:#B392F0">tw</span><span style="color:#E1E4E8">(</span><span style="color:#9ECBFF">'flex items-center justify-center w-full h-full bg-white p-12'</span><span style="color:#E1E4E8">)}</span><span style="color:#F97583">></span></span>
|
|
435
|
+
<span class="line"><span style="color:#F97583"> <</span><span style="color:#FFAB70">img</span></span>
|
|
436
|
+
<span class="line"><span style="color:#E1E4E8"> src</span><span style="color:#F97583">=</span><span style="color:#E1E4E8">{</span><span style="color:#B392F0">qr</span><span style="color:#E1E4E8">(</span><span style="color:#FFAB70">url</span><span style="color:#E1E4E8">, {</span></span>
|
|
437
|
+
<span class="line"><span style="color:#FFAB70"> width</span><span style="color:#E1E4E8">: </span><span style="color:#79B8FF">200</span><span style="color:#E1E4E8">,</span></span>
|
|
438
|
+
<span class="line"><span style="color:#FFAB70"> margin</span><span style="color:#E1E4E8">: </span><span style="color:#79B8FF">2</span><span style="color:#E1E4E8">,</span></span>
|
|
439
|
+
<span class="line"><span style="color:#FFAB70"> errorCorrectionLevel</span><span style="color:#E1E4E8">: </span><span style="color:#9ECBFF">'M'</span><span style="color:#E1E4E8">,</span></span>
|
|
440
|
+
<span class="line"><span style="color:#FFAB70"> color</span><span style="color:#E1E4E8">: {</span></span>
|
|
441
|
+
<span class="line"><span style="color:#FFAB70"> dark</span><span style="color:#E1E4E8">: </span><span style="color:#9ECBFF">'#000000'</span><span style="color:#E1E4E8">,</span></span>
|
|
442
|
+
<span class="line"><span style="color:#FFAB70"> light</span><span style="color:#E1E4E8">: </span><span style="color:#9ECBFF">'#ffffff'</span></span>
|
|
443
|
+
<span class="line"><span style="color:#E1E4E8"> }</span></span>
|
|
444
|
+
<span class="line"><span style="color:#E1E4E8"> })}</span></span>
|
|
445
|
+
<span class="line"><span style="color:#E1E4E8"> style</span><span style="color:#F97583">=</span><span style="color:#E1E4E8">{</span><span style="color:#B392F0">tw</span><span style="color:#E1E4E8">(</span><span style="color:#9ECBFF">'w-48 h-48'</span><span style="color:#E1E4E8">)}</span></span>
|
|
446
|
+
<span class="line"><span style="color:#F97583"> /></span></span>
|
|
447
|
+
<span class="line"><span style="color:#F97583"> </</span><span style="color:#E1E4E8">div</span><span style="color:#F97583">></span></span>
|
|
448
|
+
<span class="line"><span style="color:#E1E4E8">)</span></span>
|
|
449
|
+
<span class="line"></span></code></pre>
|
|
450
|
+
<p><strong>Options:</strong></p>
|
|
451
|
+
<ul>
|
|
452
|
+
<li><code>width</code> - QR code size in pixels (default: 200)</li>
|
|
453
|
+
<li><code>margin</code> - Quiet zone margin (default: 4)</li>
|
|
454
|
+
<li><code>errorCorrectionLevel</code> - <code>'L'</code>, <code>'M'</code>, <code>'Q'</code>, or <code>'H'</code> (default: ‘M’)</li>
|
|
455
|
+
<li><code>color.dark</code> - Dark module color (default: ‘#000000’)</li>
|
|
456
|
+
<li><code>color.light</code> - Light module color (default: ‘#ffffff’)</li>
|
|
457
|
+
</ul>
|
|
458
|
+
<h3 id="using-image">Using image()</h3>
|
|
459
|
+
<p>Embed local images as data URIs:</p>
|
|
460
|
+
<pre class="astro-code github-dark" style="background-color:#24292e;color:#e1e4e8;overflow-x:auto" tabindex="0" data-language="typescript"><code><span class="line"><span style="color:#B392F0">render</span><span style="color:#E1E4E8">: ({ </span><span style="color:#FFAB70">tw</span><span style="color:#E1E4E8">, </span><span style="color:#FFAB70">image</span><span style="color:#E1E4E8"> }) </span><span style="color:#F97583">=></span><span style="color:#E1E4E8"> (</span></span>
|
|
461
|
+
<span class="line"><span style="color:#F97583"> <</span><span style="color:#E1E4E8">div style</span><span style="color:#F97583">=</span><span style="color:#E1E4E8">{</span><span style="color:#B392F0">tw</span><span style="color:#E1E4E8">(</span><span style="color:#9ECBFF">'flex items-center justify-center w-full h-full'</span><span style="color:#E1E4E8">)}</span><span style="color:#F97583">></span></span>
|
|
462
|
+
<span class="line"><span style="color:#E1E4E8"> {</span><span style="color:#6A737D">/* Image path relative to template directory */</span><span style="color:#E1E4E8">}</span></span>
|
|
463
|
+
<span class="line"><span style="color:#F97583"> <</span><span style="color:#FFAB70">img</span></span>
|
|
464
|
+
<span class="line"><span style="color:#E1E4E8"> src</span><span style="color:#F97583">=</span><span style="color:#E1E4E8">{</span><span style="color:#B392F0">image</span><span style="color:#E1E4E8">(</span><span style="color:#9ECBFF">'logo.png'</span><span style="color:#E1E4E8">)}</span></span>
|
|
465
|
+
<span class="line"><span style="color:#E1E4E8"> style</span><span style="color:#F97583">=</span><span style="color:#E1E4E8">{</span><span style="color:#B392F0">tw</span><span style="color:#E1E4E8">(</span><span style="color:#9ECBFF">'w-32 h-32'</span><span style="color:#E1E4E8">)}</span></span>
|
|
466
|
+
<span class="line"><span style="color:#F97583"> /></span></span>
|
|
467
|
+
<span class="line"><span style="color:#F97583"> </</span><span style="color:#E1E4E8">div</span><span style="color:#F97583">></span></span>
|
|
468
|
+
<span class="line"><span style="color:#E1E4E8">)</span></span>
|
|
469
|
+
<span class="line"></span></code></pre>
|
|
470
|
+
<p><strong>Note:</strong> Images must be in the same directory as your template file when using <code>defineTemplateFromFile()</code>, or embedded as data URIs when using <code>defineTemplate()</code>.</p>
|
|
471
|
+
<h3 id="using-template">Using template()</h3>
|
|
472
|
+
<p>Compose templates by embedding one template inside another:</p>
|
|
473
|
+
<pre class="astro-code github-dark" style="background-color:#24292e;color:#e1e4e8;overflow-x:auto" tabindex="0" data-language="typescript"><code><span class="line"><span style="color:#6A737D">// Card template</span></span>
|
|
474
|
+
<span class="line"><span style="color:#F97583">const</span><span style="color:#79B8FF"> cardTemplate</span><span style="color:#F97583"> =</span><span style="color:#B392F0"> defineTemplate</span><span style="color:#E1E4E8">({</span></span>
|
|
475
|
+
<span class="line"><span style="color:#E1E4E8"> name: </span><span style="color:#9ECBFF">'card'</span><span style="color:#E1E4E8">,</span></span>
|
|
476
|
+
<span class="line"><span style="color:#E1E4E8"> size: { width: </span><span style="color:#79B8FF">400</span><span style="color:#E1E4E8">, height: </span><span style="color:#79B8FF">200</span><span style="color:#E1E4E8"> },</span></span>
|
|
477
|
+
<span class="line"><span style="color:#B392F0"> render</span><span style="color:#E1E4E8">: ({ </span><span style="color:#FFAB70">tw</span><span style="color:#E1E4E8">, </span><span style="color:#FFAB70">title</span><span style="color:#E1E4E8"> }) </span><span style="color:#F97583">=></span><span style="color:#E1E4E8"> (</span></span>
|
|
478
|
+
<span class="line"><span style="color:#F97583"> <</span><span style="color:#E1E4E8">div style</span><span style="color:#F97583">=</span><span style="color:#E1E4E8">{</span><span style="color:#B392F0">tw</span><span style="color:#E1E4E8">(</span><span style="color:#9ECBFF">'flex items-center justify-center w-full h-full bg-blue-500'</span><span style="color:#E1E4E8">)}</span><span style="color:#F97583">></span></span>
|
|
479
|
+
<span class="line"><span style="color:#F97583"> <</span><span style="color:#E1E4E8">h2 style</span><span style="color:#F97583">=</span><span style="color:#E1E4E8">{</span><span style="color:#B392F0">tw</span><span style="color:#E1E4E8">(</span><span style="color:#9ECBFF">'text-2xl font-bold text-white'</span><span style="color:#E1E4E8">)}</span><span style="color:#F97583">></span><span style="color:#E1E4E8">{title}</span><span style="color:#F97583"></</span><span style="color:#E1E4E8">h2</span><span style="color:#F97583">></span></span>
|
|
480
|
+
<span class="line"><span style="color:#F97583"> </</span><span style="color:#E1E4E8">div</span><span style="color:#F97583">></span></span>
|
|
481
|
+
<span class="line"><span style="color:#E1E4E8"> ),</span></span>
|
|
482
|
+
<span class="line"><span style="color:#E1E4E8">});</span></span>
|
|
483
|
+
<span class="line"></span>
|
|
484
|
+
<span class="line"><span style="color:#6A737D">// Main template embedding the card</span></span>
|
|
485
|
+
<span class="line"><span style="color:#F97583">const</span><span style="color:#79B8FF"> mainTemplate</span><span style="color:#F97583"> =</span><span style="color:#B392F0"> defineTemplate</span><span style="color:#E1E4E8">({</span></span>
|
|
486
|
+
<span class="line"><span style="color:#E1E4E8"> name: </span><span style="color:#9ECBFF">'main'</span><span style="color:#E1E4E8">,</span></span>
|
|
487
|
+
<span class="line"><span style="color:#E1E4E8"> size: { width: </span><span style="color:#79B8FF">1200</span><span style="color:#E1E4E8">, height: </span><span style="color:#79B8FF">630</span><span style="color:#E1E4E8"> },</span></span>
|
|
488
|
+
<span class="line"><span style="color:#B392F0"> render</span><span style="color:#E1E4E8">: ({ </span><span style="color:#FFAB70">tw</span><span style="color:#E1E4E8">, </span><span style="color:#FFAB70">template</span><span style="color:#E1E4E8"> }) </span><span style="color:#F97583">=></span><span style="color:#E1E4E8"> (</span></span>
|
|
489
|
+
<span class="line"><span style="color:#F97583"> <</span><span style="color:#E1E4E8">div style</span><span style="color:#F97583">=</span><span style="color:#E1E4E8">{</span><span style="color:#B392F0">tw</span><span style="color:#E1E4E8">(</span><span style="color:#9ECBFF">'flex flex-col gap-4 w-full h-full bg-gray-100 p-8'</span><span style="color:#E1E4E8">)}</span><span style="color:#F97583">></span></span>
|
|
490
|
+
<span class="line"><span style="color:#F97583"> <</span><span style="color:#E1E4E8">h1 style</span><span style="color:#F97583">=</span><span style="color:#E1E4E8">{</span><span style="color:#B392F0">tw</span><span style="color:#E1E4E8">(</span><span style="color:#9ECBFF">'text-4xl font-bold'</span><span style="color:#E1E4E8">)}</span><span style="color:#F97583">></span><span style="color:#E1E4E8">My Cards</span><span style="color:#F97583"></</span><span style="color:#E1E4E8">h1</span><span style="color:#F97583">></span></span>
|
|
491
|
+
<span class="line"><span style="color:#E1E4E8"> {</span><span style="color:#6A737D">/* Embed card template */</span><span style="color:#E1E4E8">}</span></span>
|
|
492
|
+
<span class="line"><span style="color:#F97583"> <</span><span style="color:#FFAB70">img</span></span>
|
|
493
|
+
<span class="line"><span style="color:#E1E4E8"> src</span><span style="color:#F97583">=</span><span style="color:#E1E4E8">{</span><span style="color:#B392F0">template</span><span style="color:#E1E4E8">(</span><span style="color:#9ECBFF">'card'</span><span style="color:#E1E4E8">, { </span><span style="color:#FFAB70">title</span><span style="color:#E1E4E8">: </span><span style="color:#9ECBFF">'Card 1'</span><span style="color:#E1E4E8"> })}</span></span>
|
|
494
|
+
<span class="line"><span style="color:#E1E4E8"> style</span><span style="color:#F97583">=</span><span style="color:#E1E4E8">{</span><span style="color:#B392F0">tw</span><span style="color:#E1E4E8">(</span><span style="color:#9ECBFF">'w-96'</span><span style="color:#E1E4E8">)}</span></span>
|
|
495
|
+
<span class="line"><span style="color:#F97583"> /></span></span>
|
|
496
|
+
<span class="line"><span style="color:#F97583"> </</span><span style="color:#E1E4E8">div</span><span style="color:#F97583">></span></span>
|
|
497
|
+
<span class="line"><span style="color:#E1E4E8"> ),</span></span>
|
|
498
|
+
<span class="line"><span style="color:#E1E4E8">});</span></span>
|
|
499
|
+
<span class="line"></span></code></pre>
|
|
173
500
|
<h3 id="video-animations">Video Animations</h3>
|
|
174
|
-
<p>Use Tailwind-style animation classes for easy video animations
|
|
175
|
-
<h4 id="
|
|
176
|
-
<p>Format: <code>
|
|
501
|
+
<p>Use Tailwind-style animation classes for easy video animations! All timing values are in <strong>milliseconds</strong>.</p>
|
|
502
|
+
<h4 id="enter-animations">Enter Animations</h4>
|
|
503
|
+
<p>Format: <code>enter-{type}/{startMs}/{endMs}</code> with optional easing</p>
|
|
177
504
|
<pre class="astro-code github-dark" style="background-color:#24292e;color:#e1e4e8;overflow-x:auto" tabindex="0" data-language="typescript"><code><span class="line"><span style="color:#B392F0">render</span><span style="color:#E1E4E8">: ({ </span><span style="color:#FFAB70">tw</span><span style="color:#E1E4E8">, </span><span style="color:#FFAB70">title</span><span style="color:#E1E4E8"> }) </span><span style="color:#F97583">=></span><span style="color:#E1E4E8"> (</span></span>
|
|
178
505
|
<span class="line"><span style="color:#F97583"> <</span><span style="color:#E1E4E8">div style</span><span style="color:#F97583">=</span><span style="color:#E1E4E8">{</span><span style="color:#B392F0">tw</span><span style="color:#E1E4E8">(</span><span style="color:#9ECBFF">'flex items-center justify-center w-full h-full'</span><span style="color:#E1E4E8">)}</span><span style="color:#F97583">></span></span>
|
|
179
|
-
<span class="line"><span style="color:#E1E4E8"> {</span><span style="color:#6A737D">/* Fade in from
|
|
180
|
-
<span class="line"><span style="color:#F97583"> <</span><span style="color:#E1E4E8">h1 style</span><span style="color:#F97583">=</span><span style="color:#E1E4E8">{</span><span style="color:#B392F0">tw</span><span style="color:#E1E4E8">(</span><span style="color:#9ECBFF">'text-8xl font-bold
|
|
506
|
+
<span class="line"><span style="color:#E1E4E8"> {</span><span style="color:#6A737D">/* Fade in from 0ms to 1500ms */</span><span style="color:#E1E4E8">}</span></span>
|
|
507
|
+
<span class="line"><span style="color:#F97583"> <</span><span style="color:#E1E4E8">h1 style</span><span style="color:#F97583">=</span><span style="color:#E1E4E8">{</span><span style="color:#B392F0">tw</span><span style="color:#E1E4E8">(</span><span style="color:#9ECBFF">'text-8xl font-bold enter-fade-in/0/1500'</span><span style="color:#E1E4E8">)}</span><span style="color:#F97583">></span></span>
|
|
181
508
|
<span class="line"><span style="color:#E1E4E8"> {</span><span style="color:#FFAB70">title</span><span style="color:#E1E4E8">}</span></span>
|
|
182
509
|
<span class="line"><span style="color:#F97583"> </</span><span style="color:#E1E4E8">h1</span><span style="color:#F97583">></span></span>
|
|
183
510
|
<span class="line"><span style="color:#F97583"> </</span><span style="color:#E1E4E8">div</span><span style="color:#F97583">></span></span>
|
|
184
511
|
<span class="line"><span style="color:#E1E4E8">)</span></span>
|
|
185
512
|
<span class="line"></span></code></pre>
|
|
186
|
-
<p><strong>Available
|
|
513
|
+
<p><strong>Available enter animations:</strong></p>
|
|
187
514
|
<p><em>Fade:</em></p>
|
|
188
515
|
<ul>
|
|
189
|
-
<li><code>
|
|
190
|
-
<li><code>
|
|
191
|
-
<li><code>
|
|
192
|
-
<li><code>
|
|
193
|
-
<li><code>
|
|
194
|
-
<li><code>animate-fade-in-right/0/1</code> - Fade in + slide from right</li>
|
|
195
|
-
<li><code>animate-fade-out-up/0/1</code> - Fade out + slide up</li>
|
|
196
|
-
<li><code>animate-fade-out-down/0/1</code> - Fade out + slide down</li>
|
|
516
|
+
<li><code>enter-fade-in/0/500</code> - Fade in</li>
|
|
517
|
+
<li><code>enter-fade-in-up/0/500</code> - Fade in + slide up</li>
|
|
518
|
+
<li><code>enter-fade-in-down/0/500</code> - Fade in + slide down</li>
|
|
519
|
+
<li><code>enter-fade-in-left/0/500</code> - Fade in + slide from left</li>
|
|
520
|
+
<li><code>enter-fade-in-right/0/500</code> - Fade in + slide from right</li>
|
|
197
521
|
</ul>
|
|
198
522
|
<p><em>Slide:</em></p>
|
|
199
523
|
<ul>
|
|
200
|
-
<li><code>
|
|
201
|
-
<li><code>
|
|
202
|
-
<li><code>
|
|
203
|
-
<li><code>
|
|
524
|
+
<li><code>enter-slide-left/0/500</code> - Slide in from left (100px)</li>
|
|
525
|
+
<li><code>enter-slide-right/0/500</code> - Slide in from right (100px)</li>
|
|
526
|
+
<li><code>enter-slide-up/0/500</code> - Slide in from bottom (100px)</li>
|
|
527
|
+
<li><code>enter-slide-down/0/500</code> - Slide in from top (100px)</li>
|
|
204
528
|
</ul>
|
|
205
529
|
<p><em>Bounce:</em></p>
|
|
206
530
|
<ul>
|
|
207
|
-
<li><code>
|
|
208
|
-
<li><code>
|
|
209
|
-
<li><code>
|
|
210
|
-
<li><code>
|
|
211
|
-
<li><code>
|
|
531
|
+
<li><code>enter-bounce-in/0/500</code> - Bounce in with scale overshoot</li>
|
|
532
|
+
<li><code>enter-bounce-in-up/0/500</code> - Bounce in from below</li>
|
|
533
|
+
<li><code>enter-bounce-in-down/0/500</code> - Bounce in from above</li>
|
|
534
|
+
<li><code>enter-bounce-in-left/0/500</code> - Bounce in from left</li>
|
|
535
|
+
<li><code>enter-bounce-in-right/0/500</code> - Bounce in from right</li>
|
|
212
536
|
</ul>
|
|
213
537
|
<p><em>Scale & Zoom:</em></p>
|
|
214
538
|
<ul>
|
|
215
|
-
<li><code>
|
|
216
|
-
<li><code>
|
|
217
|
-
<li><code>animate-zoom-in/0/1</code> - Zoom in from 0%</li>
|
|
218
|
-
<li><code>animate-zoom-out/0/1</code> - Zoom out to 200%</li>
|
|
539
|
+
<li><code>enter-scale-in/0/500</code> - Scale up from 50%</li>
|
|
540
|
+
<li><code>enter-zoom-in/0/500</code> - Zoom in from 0%</li>
|
|
219
541
|
</ul>
|
|
220
542
|
<p><em>Rotate & Flip:</em></p>
|
|
221
543
|
<ul>
|
|
222
|
-
<li><code>
|
|
223
|
-
<li><code>
|
|
224
|
-
<li><code>
|
|
225
|
-
|
|
544
|
+
<li><code>enter-rotate-in/0/500</code> - Rotate in (180°)</li>
|
|
545
|
+
<li><code>enter-flip-in-x/0/500</code> - Flip in horizontally</li>
|
|
546
|
+
<li><code>enter-flip-in-y/0/500</code> - Flip in vertically</li>
|
|
547
|
+
</ul>
|
|
548
|
+
<h4 id="exit-animations">Exit Animations</h4>
|
|
549
|
+
<p>Format: <code>exit-{type}/{startMs}/{endMs}</code></p>
|
|
550
|
+
<ul>
|
|
551
|
+
<li><code>exit-fade-out/2500/3000</code> - Fade out</li>
|
|
552
|
+
<li><code>exit-fade-out-up/2500/3000</code> - Fade out + slide up</li>
|
|
553
|
+
<li><code>exit-slide-left/2500/3000</code> - Slide out to left</li>
|
|
554
|
+
<li><code>exit-scale-out/2500/3000</code> - Scale out to 150%</li>
|
|
555
|
+
<li><code>exit-zoom-out/2500/3000</code> - Zoom out to 200%</li>
|
|
226
556
|
</ul>
|
|
227
557
|
<p><strong>Easing modifiers:</strong></p>
|
|
228
558
|
<pre class="astro-code github-dark" style="background-color:#24292e;color:#e1e4e8;overflow-x:auto" tabindex="0" data-language="typescript"><code><span class="line"><span style="color:#6A737D">// Add easing before animation class</span></span>
|
|
229
|
-
<span class="line"><span style="color:#F97583"><</span><span style="color:#E1E4E8">h1 style</span><span style="color:#F97583">=</span><span style="color:#E1E4E8">{</span><span style="color:#B392F0">tw</span><span style="color:#E1E4E8">(</span><span style="color:#9ECBFF">'ease-in-out
|
|
559
|
+
<span class="line"><span style="color:#F97583"><</span><span style="color:#E1E4E8">h1 style</span><span style="color:#F97583">=</span><span style="color:#E1E4E8">{</span><span style="color:#B392F0">tw</span><span style="color:#E1E4E8">(</span><span style="color:#9ECBFF">'ease-in-out enter-fade-in/0/1500'</span><span style="color:#E1E4E8">)}</span><span style="color:#F97583">></span></span>
|
|
230
560
|
<span class="line"></span></code></pre>
|
|
231
561
|
<ul>
|
|
232
562
|
<li><code>linear</code> - Linear</li>
|
|
@@ -238,11 +568,11 @@
|
|
|
238
568
|
<li><code>ease-in-out-cubic</code> - Strong ease in/out</li>
|
|
239
569
|
</ul>
|
|
240
570
|
<h4 id="loop-animations">Loop Animations</h4>
|
|
241
|
-
<p>Format: <code>
|
|
571
|
+
<p>Format: <code>loop-{type}/{durationMs}</code></p>
|
|
242
572
|
<pre class="astro-code github-dark" style="background-color:#24292e;color:#e1e4e8;overflow-x:auto" tabindex="0" data-language="typescript"><code><span class="line"><span style="color:#B392F0">render</span><span style="color:#E1E4E8">: ({ </span><span style="color:#FFAB70">tw</span><span style="color:#E1E4E8">, </span><span style="color:#FFAB70">title</span><span style="color:#E1E4E8"> }) </span><span style="color:#F97583">=></span><span style="color:#E1E4E8"> (</span></span>
|
|
243
573
|
<span class="line"><span style="color:#F97583"> <</span><span style="color:#E1E4E8">div style</span><span style="color:#F97583">=</span><span style="color:#E1E4E8">{</span><span style="color:#B392F0">tw</span><span style="color:#E1E4E8">(</span><span style="color:#9ECBFF">'flex items-center justify-center w-full h-full'</span><span style="color:#E1E4E8">)}</span><span style="color:#F97583">></span></span>
|
|
244
|
-
<span class="line"><span style="color:#E1E4E8"> {</span><span style="color:#6A737D">/* Pulse every
|
|
245
|
-
<span class="line"><span style="color:#F97583"> <</span><span style="color:#E1E4E8">h1 style</span><span style="color:#F97583">=</span><span style="color:#E1E4E8">{</span><span style="color:#B392F0">tw</span><span style="color:#E1E4E8">(</span><span style="color:#9ECBFF">'text-8xl font-bold
|
|
574
|
+
<span class="line"><span style="color:#E1E4E8"> {</span><span style="color:#6A737D">/* Pulse every 500ms */</span><span style="color:#E1E4E8">}</span></span>
|
|
575
|
+
<span class="line"><span style="color:#F97583"> <</span><span style="color:#E1E4E8">h1 style</span><span style="color:#F97583">=</span><span style="color:#E1E4E8">{</span><span style="color:#B392F0">tw</span><span style="color:#E1E4E8">(</span><span style="color:#9ECBFF">'text-8xl font-bold loop-fade/500'</span><span style="color:#E1E4E8">)}</span><span style="color:#F97583">></span></span>
|
|
246
576
|
<span class="line"><span style="color:#E1E4E8"> {</span><span style="color:#FFAB70">title</span><span style="color:#E1E4E8">}</span></span>
|
|
247
577
|
<span class="line"><span style="color:#F97583"> </</span><span style="color:#E1E4E8">h1</span><span style="color:#F97583">></span></span>
|
|
248
578
|
<span class="line"><span style="color:#F97583"> </</span><span style="color:#E1E4E8">div</span><span style="color:#F97583">></span></span>
|
|
@@ -250,28 +580,36 @@
|
|
|
250
580
|
<span class="line"></span></code></pre>
|
|
251
581
|
<p><strong>Available loop animations:</strong></p>
|
|
252
582
|
<ul>
|
|
253
|
-
<li><code>
|
|
254
|
-
<li><code>
|
|
255
|
-
<li><code>
|
|
256
|
-
<li><code>
|
|
257
|
-
<li><code>
|
|
258
|
-
<li><code>
|
|
583
|
+
<li><code>loop-fade/1000</code> - Opacity pulse</li>
|
|
584
|
+
<li><code>loop-bounce/1000</code> - Bounce up and down</li>
|
|
585
|
+
<li><code>loop-spin/1000</code> - Full rotation</li>
|
|
586
|
+
<li><code>loop-ping/1000</code> - Scale up and fade out</li>
|
|
587
|
+
<li><code>loop-wiggle/1000</code> - Side to side wiggle</li>
|
|
588
|
+
<li><code>loop-float/1000</code> - Gentle floating</li>
|
|
259
589
|
</ul>
|
|
260
590
|
<h4 id="staggered-animations">Staggered Animations</h4>
|
|
261
591
|
<p>Combine multiple animations with different timings:</p>
|
|
262
592
|
<pre class="astro-code github-dark" style="background-color:#24292e;color:#e1e4e8;overflow-x:auto" tabindex="0" data-language="typescript"><code><span class="line"><span style="color:#B392F0">render</span><span style="color:#E1E4E8">: ({ </span><span style="color:#FFAB70">tw</span><span style="color:#E1E4E8">, </span><span style="color:#FFAB70">title</span><span style="color:#E1E4E8">, </span><span style="color:#FFAB70">subtitle</span><span style="color:#E1E4E8"> }) </span><span style="color:#F97583">=></span><span style="color:#E1E4E8"> (</span></span>
|
|
263
593
|
<span class="line"><span style="color:#F97583"> <</span><span style="color:#E1E4E8">div style</span><span style="color:#F97583">=</span><span style="color:#E1E4E8">{</span><span style="color:#B392F0">tw</span><span style="color:#E1E4E8">(</span><span style="color:#9ECBFF">'flex flex-col items-center justify-center w-full h-full'</span><span style="color:#E1E4E8">)}</span><span style="color:#F97583">></span></span>
|
|
264
|
-
<span class="line"><span style="color:#E1E4E8"> {</span><span style="color:#6A737D">/* Title
|
|
265
|
-
<span class="line"><span style="color:#F97583"> <</span><span style="color:#E1E4E8">h1 style</span><span style="color:#F97583">=</span><span style="color:#E1E4E8">{</span><span style="color:#B392F0">tw</span><span style="color:#E1E4E8">(</span><span style="color:#9ECBFF">'text-8xl font-bold ease-out
|
|
594
|
+
<span class="line"><span style="color:#E1E4E8"> {</span><span style="color:#6A737D">/* Title slides in first */</span><span style="color:#E1E4E8">}</span></span>
|
|
595
|
+
<span class="line"><span style="color:#F97583"> <</span><span style="color:#E1E4E8">h1 style</span><span style="color:#F97583">=</span><span style="color:#E1E4E8">{</span><span style="color:#B392F0">tw</span><span style="color:#E1E4E8">(</span><span style="color:#9ECBFF">'text-8xl font-bold ease-out enter-slide-up/0/900'</span><span style="color:#E1E4E8">)}</span><span style="color:#F97583">></span></span>
|
|
266
596
|
<span class="line"><span style="color:#E1E4E8"> {</span><span style="color:#FFAB70">title</span><span style="color:#E1E4E8">}</span></span>
|
|
267
597
|
<span class="line"><span style="color:#F97583"> </</span><span style="color:#E1E4E8">h1</span><span style="color:#F97583">></span></span>
|
|
268
|
-
<span class="line"><span style="color:#E1E4E8"> {</span><span style="color:#6A737D">/* Subtitle
|
|
269
|
-
<span class="line"><span style="color:#F97583"> <</span><span style="color:#E1E4E8">p style</span><span style="color:#F97583">=</span><span style="color:#E1E4E8">{</span><span style="color:#B392F0">tw</span><span style="color:#E1E4E8">(</span><span style="color:#9ECBFF">'text-2xl mt-4 ease-out
|
|
598
|
+
<span class="line"><span style="color:#E1E4E8"> {</span><span style="color:#6A737D">/* Subtitle slides in after */</span><span style="color:#E1E4E8">}</span></span>
|
|
599
|
+
<span class="line"><span style="color:#F97583"> <</span><span style="color:#E1E4E8">p style</span><span style="color:#F97583">=</span><span style="color:#E1E4E8">{</span><span style="color:#B392F0">tw</span><span style="color:#E1E4E8">(</span><span style="color:#9ECBFF">'text-2xl mt-4 ease-out enter-slide-up/600/1500'</span><span style="color:#E1E4E8">)}</span><span style="color:#F97583">></span></span>
|
|
270
600
|
<span class="line"><span style="color:#E1E4E8"> {</span><span style="color:#FFAB70">subtitle</span><span style="color:#E1E4E8">}</span></span>
|
|
271
601
|
<span class="line"><span style="color:#F97583"> </</span><span style="color:#E1E4E8">p</span><span style="color:#F97583">></span></span>
|
|
272
602
|
<span class="line"><span style="color:#F97583"> </</span><span style="color:#E1E4E8">div</span><span style="color:#F97583">></span></span>
|
|
273
603
|
<span class="line"><span style="color:#E1E4E8">)</span></span>
|
|
274
604
|
<span class="line"></span></code></pre>
|
|
605
|
+
<h4 id="combined-enter-and-exit">Combined Enter and Exit</h4>
|
|
606
|
+
<p>You can use both on the same element:</p>
|
|
607
|
+
<pre class="astro-code github-dark" style="background-color:#24292e;color:#e1e4e8;overflow-x:auto" tabindex="0" data-language="typescript"><code><span class="line"><span style="color:#B392F0">render</span><span style="color:#E1E4E8">: ({ </span><span style="color:#FFAB70">tw</span><span style="color:#E1E4E8">, </span><span style="color:#FFAB70">title</span><span style="color:#E1E4E8"> }) </span><span style="color:#F97583">=></span><span style="color:#E1E4E8"> (</span></span>
|
|
608
|
+
<span class="line"><span style="color:#F97583"> <</span><span style="color:#E1E4E8">h1 style</span><span style="color:#F97583">=</span><span style="color:#E1E4E8">{</span><span style="color:#B392F0">tw</span><span style="color:#E1E4E8">(</span><span style="color:#9ECBFF">'text-8xl font-bold enter-fade-in/0/500 exit-fade-out/2500/3000'</span><span style="color:#E1E4E8">)}</span><span style="color:#F97583">></span></span>
|
|
609
|
+
<span class="line"><span style="color:#E1E4E8"> {</span><span style="color:#FFAB70">title</span><span style="color:#E1E4E8">}</span></span>
|
|
610
|
+
<span class="line"><span style="color:#F97583"> </</span><span style="color:#E1E4E8">h1</span><span style="color:#F97583">></span></span>
|
|
611
|
+
<span class="line"><span style="color:#E1E4E8">)</span></span>
|
|
612
|
+
<span class="line"></span></code></pre>
|
|
275
613
|
<h4 id="manual-animations">Manual Animations</h4>
|
|
276
614
|
<p>You can still use <code>progress</code> and <code>frame</code> directly for custom animations:</p>
|
|
277
615
|
<pre class="astro-code github-dark" style="background-color:#24292e;color:#e1e4e8;overflow-x:auto" tabindex="0" data-language="typescript"><code><span class="line"><span style="color:#B392F0">render</span><span style="color:#E1E4E8">: ({ </span><span style="color:#FFAB70">tw</span><span style="color:#E1E4E8">, </span><span style="color:#FFAB70">progress</span><span style="color:#E1E4E8">, </span><span style="color:#FFAB70">frame</span><span style="color:#E1E4E8">, </span><span style="color:#FFAB70">title</span><span style="color:#E1E4E8"> }) </span><span style="color:#F97583">=></span><span style="color:#E1E4E8"> {</span></span>
|
|
@@ -432,4 +770,4 @@
|
|
|
432
770
|
<ul>
|
|
433
771
|
<li><code>http://localhost:3000/api/og-image?title=Hello</code></li>
|
|
434
772
|
<li><code>http://localhost:3000/api/intro-video?title=Welcome</code></li>
|
|
435
|
-
</ul> </article> </div> </main> </div> </body></html>
|
|
773
|
+
</ul> </article> </div> </main> <!-- Table of Contents Sidebar (Desktop only) --> <aside id="toc-sidebar" class="toc-sidebar fixed top-0 right-0 h-screen w-64 overflow-y-auto z-10" data-astro-cid-mw7aashj> <div class="px-6 py-8" data-astro-cid-mw7aashj> <h3 class="text-xs font-semibold text-muted-foreground mb-4 uppercase tracking-wider" data-astro-cid-mw7aashj>On this page</h3> <nav id="toc-nav" data-astro-cid-mw7aashj> <!-- TOC will be populated by JavaScript --> </nav> </div> </aside> </div> </body></html>
|