# create-codepen **Repository Path**: Mister-Hope/create-codepen ## Basic Information - **Project Name**: create-codepen - **Description**: Create codepen through api - **Primary Language**: TypeScript - **License**: Not specified - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2024-02-23 - **Last Updated**: 2024-12-24 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # create-codepen A library creating codepen with api. ## loadCodePens Load codepen through dom, this should be the same as the codepen embed script, while we are not calling `loadCodePen(".codepen")` directly. ```ts export const loadCodePens: (selector = ".codepen") => void; ``` Example: ```html
See the Pen Walkers - How to by Louis Hoebregts (@Mamboleoo) on CodePen.
``` ## openCodePens Open codepen in new window ```ts export const openCodePens: (selector?: string) => void; ``` Example: ```htmlSee the Pen Walkers - How to by Louis Hoebregts (@Mamboleoo) on CodePen.
``` ## renderCodePen Generate a codepen iframe through options. If a valid selector is provided, the codepen will be rendered inside selector element. Otherwise it will be rendered in new window. ```ts interface CodePenStyleOptions { /** * @default 300 */ height?: number | string; /** * @default none */ border?: "none" | "thin" | "thick"; /** * @default #000000 */ "border-color"?: string; /** * @default #3d3d3e */ "tab-bar-color"?: string; /** * @default #76daff */ "tab-link-color"?: string; /** * @default #cccccc */ "active-tab-color"?: string; /** * @default #000000 */ "active-link-color"?: string; /** * @default #ffffff */ "link-logo-color"?: string; /** * Additional class name */ class?: string; "custom-css-url"?: string; } interface CodePenDomOptions extends CodePenStyleOptions, Record