Skip to content

Commit

Permalink
feat: added venobox for preview
Browse files Browse the repository at this point in the history
  • Loading branch information
surajair committed Oct 30, 2024
1 parent caaccfc commit a7f18ff
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/Editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ function ChaiBuilderDefault() {
]);
return (
<ChaiBuilderEditor
fallbackLang="fr"
languages={["en"]}
// fallbackLang="fr"
// languages={["en"]}
unsplashAccessKey={"import.meta.env.VITE_UNSPLASH_ACCESS_KEY"}
showDebugLogs={true}
autoSaveSupport={false}
autoSaveSupport={true}
autoSaveInterval={5}
previewComponent={PreviewWeb}
blocks={blocks}
brandingOptions={brandingOptions}
Expand All @@ -48,7 +48,7 @@ function ChaiBuilderDefault() {
localStorage.setItem("chai-builder-blocks", JSON.stringify(blocks));
localStorage.setItem("chai-builder-providers", JSON.stringify(providers));
localStorage.setItem("chai-builder-branding-options", JSON.stringify(brandingOptions));
await new Promise((resolve) => setTimeout(resolve, 2000));
await new Promise((resolve) => setTimeout(resolve, 100));
return true;
}}
saveAiContextCallback={async (aiContext: string) => {
Expand Down
5 changes: 5 additions & 0 deletions src/__dev/preview/WebPreview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,20 @@ export const IframeInitialContent = (fonts: string, html: string): string => `<!
</style>
<link rel="stylesheet" href="https://unpkg.com/aos@next/dist/aos.css" />
<script src="https://cdn.tailwindcss.com?plugins=forms,typography,aspect-ratio"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/venobox.min.css">
</head>
<body class="font-body antialiased h-full">
<div class="frame-root h-full">
${html}
</div>
<script src="//unpkg.com/alpinejs" defer></script>
<script src="https://unpkg.com/aos@next/dist/aos.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/venobox.min.js"></script>
<script>
AOS.init();
new VenoBox({
selector: '.cb-lightbox',
});
function addClickEventToLinks() {
document.querySelectorAll('a').forEach(link => {
link.addEventListener('click', function(event) {
Expand Down

0 comments on commit a7f18ff

Please sign in to comment.