Diolix Posted February 5 Posted February 5 Hello everyone Sorry to bother you with my questions :) Has anyone tried to integrate Gsap into Blazor? Does anyone know if Gsap is going to develop a library for Blazor? Thank you for your attention.
mvaneijgen Posted February 5 Posted February 5 18 minutes ago, Diolix said: Has anyone tried to integrate Gsap into Blazor? Never came across it here on the forum. 19 minutes ago, Diolix said: Does anyone know if Gsap is going to develop a library for Blazor? You can just import it like you can import any other library it looks like https://learn.microsoft.com/en-us/aspnet/core/blazor/fundamentals/static-files?view=aspnetcore-9.0#import-maps. So to use GSAP you don't need anything special, just import it like Blazor wants it and you're off to the races. Hope it helps and happy tweening! 1
Rodrigo Posted February 5 Posted February 5 Hi, Until now I didn't even knew about Blazor, but if it creates web apps/sites, it runs on the browser and JS can be used, so just include GSAP and your custom JS files following the approaches suggested by them and you should be OK: https://learn.microsoft.com/en-us/aspnet/core/blazor/javascript-interoperability/location-of-javascript https://learn.microsoft.com/en-us/aspnet/core/blazor/javascript-interoperability/?view=aspnetcore-9.0 Happy Tweening! 1
Diolix Posted February 5 Author Posted February 5 Thank you for your reply. I'll try and keep you posted. I was wondering because Blazor uses C# and I thought there might be an incompatibility. https://dotnet.microsoft.com/en-us/apps/aspnet/web-apps/blazor I wish you a good day!
Rodrigo Posted February 5 Posted February 5 Yeah the development is made in C# but the end result runs on browsers and browsers use JS, no way around it as far as I can tell, but I could be wrong about it. Even in frameworks that use PHP, Python, Ruby, etc. that language is ran on the server not on the browser. If you want to use some kind of language to do stuff in the browser Javascript is the one. I know that there are JS compilers for several languages but the end result is JS. The only language I've seen running on the HTML directly is the one used for GLSL Shaders: https://developer.mozilla.org/en-US/docs/Games/Techniques/3D_on_the_web/GLSL_Shaders#html_structure 1
Diolix Posted February 23 Author Posted February 23 Hello guys So it works under Blazor! To make it work I have to copy gsap.mini.js in the project and declare it in App.razor like this: <script src="gsap.min.js"></script> Do I need to copy other files and declare them for this to work properly? That will be beautiful if in the future you can create a package NuGet Thank you for your help
mvaneijgen Posted February 24 Posted February 24 On 2/23/2025 at 2:16 AM, Diolix said: To make it work I have to copy gsap.mini.js in the project and declare it in App.razor like this: <script src="gsap.min.js"></script> That looks like you just install it like any other website, so you can just follow our installation guide https://gsap.com/docs/v3/Installation?tab=cdn Hope it helps and happy tweening! 1
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now