Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(): Link v5 version explicitly #177

Merged
merged 3 commits into from
Dec 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 4 additions & 0 deletions astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ export default defineConfig({
collapsed: true,
autogenerate: { directory: 'api' },
},
{
label: 'Fabric.js v5',
link: 'https://fabric5.fabricjs.com/docs',
}
],
customCss: [
// Relative path to your custom CSS file
Expand Down
19 changes: 19 additions & 0 deletions src/components/CarbonAd/InlineCarbonAd.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
import CarbonAdReminder from './InlineCarbonAdReminder';
import './InlineCarbonAd.css'

const props = Astro.props
---

<main>
<div>
<script
key="carbonads"
async
id="_carbonads_js"
type="text/javascript"
src="//cdn.carbonads.com/carbon.js?serve=CKYIEK7E&placement=fabricjscom"
/>
<CarbonAdReminder client:load />
<div>
</main>
68 changes: 0 additions & 68 deletions src/components/CarbonAd/InlineCarbonAd.jsx

This file was deleted.

32 changes: 32 additions & 0 deletions src/components/CarbonAd/InlineCarbonAdReminder.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import { useEffect, useState, useRef, useCallback, Suspense } from 'react'

const CarbonAd = () => {
const [showReminder, setShowreminder] = useState(false)

useEffect(() => {
const verifyIsLoaded = () => {
const ads = document.getElementById('carbonads');
if (!ads || ads.style.display === 'none' || !window._carbonads) {
setShowreminder(true)
}
}
setTimeout(verifyIsLoaded, 3000);
}, []);

if (!showReminder) return null;

return (
<div key="placeholder" id="gentle-reminder" className='reminder'>
Do you like fabricJS?
<br />
If you want it continue running and you do not mind tech related ads,
please allow this website in your adblocker.
<br />
The ad is actually smaller than this nag screen!
<br />
❤️ Thank You!
</div>
);
}

export default CarbonAd
4 changes: 2 additions & 2 deletions src/components/PageTitleDocs/PageTitle.astro
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
import RealPageTitle from '@astrojs/starlight/components/PageTitle.astro';
import CarbonAd from '../CarbonAd/InlineCarbonAd';
import CarbonAd from '../CarbonAd/InlineCarbonAd.astro';

const props = Astro.props
---

<CarbonAd client:load />
<CarbonAd />
<RealPageTitle {...props} />
Loading
Loading