diff --git a/src/index.js b/src/index.js index ccbb3d7..99b0a6c 100644 --- a/src/index.js +++ b/src/index.js @@ -1,12 +1,14 @@ import "./style.scss"; -import {startClosedAnimation} from "./closed"; -import {startOpenAnimation} from "./open"; window.addEventListener('load', function () { if (document.body.classList.contains('open')) { - startOpenAnimation(); + import("./open").then(function (module) { + module.startOpenAnimation(); + }); } else { - startClosedAnimation(); + import("./closed").then(function (module) { + module.startClosedAnimation(); + }); } doIfAuthorized(showToggleButton);