Curtains.js
Development library / tool · Free
Connects HTML images and videos to WebGL planes for shader transitions.
Also known as: martinlaxenaire/curtainsjs

What you can use for free
Curtains.js code is available free of charge for local and commercial projects, subject to its license.
Paid features and costs
This library does not require a paid plan. Development and hosting of the finished application are separate from the free code license.
Access and limitations
Curtains.js code is available free of charge for local and commercial projects, subject to its license. This library does not require a paid plan. Development and hosting of the finished application are separate from the free code license.
Use cases
- Shader transitions between images
- Interactive backgrounds based on DOM elements
Example workflow
A possible workflow; this is not a report of hands-on testing.
Shader transitions between images with Curtains.js.
Before you start
- A working JavaScript; WebGL project and a specific use case: shader transitions between images.
- A design, interface states, or dataset; target screens and accessibility requirements.
Steps
- Check the project's stack and version against the current Curtains.js documentation; add the package or the required source component.
- Implement the selected workflow with the supplied data, adapting styles and states to the project.
- Check the result in the target environment, remove sample data, and retain the notices required by the license.
Check your result
- The example works in the chosen tech stack, including target dimensions and input errors.
- Dependency size, keyboard behavior, and reduced motion suit the task; license terms are met.
Choosing Curtains.js
Shader transitions between images
Choose this when
- Shader transitions between images
- Interactive backgrounds based on DOM elements
Consider alternatives when
- When choosing for this topic, compare Curtains.js with OGL. A candidate to compare under the topic: WebGL and interactive 3D scenes. This is an editorial connection by topic, not a confirmed alternative or a guarantee that the products work together.
- When choosing for this topic, compare Curtains.js with Three.js. A candidate to compare under the topic: WebGL and interactive 3D scenes. This is an editorial connection by topic, not a confirmed alternative or a guarantee that the products work together.
Requirements
- HTML/CSS/JavaScript and browser WebGL are required; a custom effect uses shaders/uniforms.
Things to consider
- Costs and limits of free use: This library does not require a paid plan. Development and hosting of the finished application are separate from the free code license.
- Terms of use: MIT: permits commercial use, modification, and distribution of the code at no charge, provided the license text and copyright notice are retained.
Frequently asked questions
What can you use for free in Curtains.js?
Curtains.js code is available free of charge for local and commercial projects, subject to its license.
What additional costs might arise with Curtains.js?
This library does not require a paid plan. Development and hosting of the finished application are separate from the free code license.
What terms of use matter for Curtains.js?
MIT: permits commercial use, modification, and distribution of the code at no charge, provided the license text and copyright notice are retained.
How do you get started with Curtains.js?
Check the project's stack and version against the current Curtains.js documentation; add the package or the required source component. Implement the selected workflow with the supplied data, adapting styles and states to the project. Check the result in the target environment, remove sample data, and retain the notices required by the license.
How do I connect a WebGL effect to ordinary HTML layout?
Curtains.js turns HTML images and videos into textures on WebGL planes, preserving their dimensions and positioning through CSS. ShaderPass adds post-processing, and RenderTarget provides an intermediate buffer. React has a separate react-curtains integration; this does not make every example a built-in React component.
Related tasks and approaches
- OGL
A candidate to compare under the topic: WebGL and interactive 3D scenes. This is an editorial connection by topic, not a confirmed alternative or a guarantee that the products work together.
- Three.js
A candidate to compare under the topic: WebGL and interactive 3D scenes. This is an editorial connection by topic, not a confirmed alternative or a guarantee that the products work together.
License
MIT: permits commercial use, modification, and distribution of the code at no charge, provided the license text and copyright notice are retained.
MIT — permissive license
You can use, modify, distribute, and sell the code, including in a closed-source commercial product. When sharing copies or substantial portions of the code, retain the license text and copyright notice. You do not need to open-source your entire project; the author provides no warranties.
License termsTechnologies and topics
- JavaScript
- WebGL