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

How to use snow-effect without CDN #1

Open
felixranesberger opened this issue Dec 6, 2024 · 4 comments
Open

How to use snow-effect without CDN #1

felixranesberger opened this issue Dec 6, 2024 · 4 comments

Comments

@felixranesberger
Copy link

I would like to use the module without a CDN, could you extend the documentation on how to do this?

Using a CDN can become quite a large supply chain vulnerability vector.

@anchan42
Copy link

This one work with two small files, one js and one css. You can download and run from local.
https://github.com/hyperstown/pure-snow.js

@le-pepe
Copy link
Owner

le-pepe commented Dec 15, 2024

I would like to use the module without a CDN, could you extend the documentation on how to do this?

Using a CDN can become quite a large supply chain vulnerability vector.

For now, I haven’t tested using it without a CDN in a project that isn’t based on a framework. What stack are you using?

@felixranesberger
Copy link
Author

I'm using Nuxt, but had issues while deploying it using Vercel and your Nuxt module.
Then I wanted to import it inside my Nuxt onMounted hook to implement it myself but without success.
Only using the CDN worked for me, but I think most people would prefer a NPM import solution :)

@le-pepe
Copy link
Owner

le-pepe commented Dec 15, 2024

I'm using Nuxt, but had issues while deploying it using Vercel and your Nuxt module. Then I wanted to import it inside my Nuxt onMounted hook to implement it myself but without success. Only using the CDN worked for me, but I think most people would prefer a NPM import solution :)

Did you check the Nuxt module plugin file?

https://github.com/le-pepe/nuxt-snow-effect/blob/main/src/runtime/plugin.client.ts

Try creating the plugin, then use the following in your component or page:

<ClientOnly>
    <snow-effect
      :color="color"
      :flakes="flakes"
      :speed="speed"
    />
</ClientOnly>

Also, remember to add the custom element configuration in nuxt.config.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants