Off Canvas Menu can be an Automatic Library. Itβs simple, and users donβt need any configuration.
Weβll start by copy-pasting the entire Off Canvas Menuβs code into a module file called off-canvas.js.
// Place all the code we have here.To import this module file, we need to add type="module" to main.js.
<script type="module" src="js/main.js"></script>Then we import off-canvas.js in main.js.
import './off-canvas.js'The off-canvas menu should still work as before.
And weβre done building an Automatic Library β you can include the Off Canvas Menu on any project as long as you write the required HTML and CSS.
Welcome! Unfortunately, you donβt have access to this lesson. To get access, please purchase the course or enroll in Magical Dev School.
Unlock this lesson