SVGAutoLoader is a lightweight tool that automatically loads SVG files into <svg> elements using the src attribute. It also dynamically detects changes and new SVG elements.
To use SVGAutoLoader, simply load the script <script src="https://assets.lucasguimaraes.pro/js/SVGAutoLoader.js"></script> in your HTML and add the src attribute to the <svg> element with the path to the SVG file you want to load.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>SVG Auto Loader</title>
<script src="https://assets.lucasguimaraes.pro/js/SVGAutoLoader.js"></script>
</head>
<body>
<svg src="https://lucasguimaraes.pro/svg/icon.svg"></svg>
</body>
</html>