diff --git a/main.js b/main.js index 1e1e3a9..8d0309b 100644 --- a/main.js +++ b/main.js @@ -77,9 +77,13 @@ document.body.appendChild( div.text(item.content).h("4rem"), ], onclick: function (event) { + if (this.dataset.lock) return + this.dataset.lock = true + const height = `${this.scrollHeight}px` const { marginTop, marginBottom, paddingTop, paddingBottom } = this.style + console.log(marginTop, marginBottom, paddingTop, paddingBottom, height) const animation = [ - { transform: "scaleY(1)", opacity: 1, height: this.scrollHeight + 'px', marginTop, marginBottom, paddingTop, paddingBottom }, + { transform: "scaleY(1)", opacity: 1, height, marginTop, marginBottom, paddingTop, paddingBottom }, { transform: "scaleY(0)", opacity: 0, height: 0, marginTop: 0, marginBottom: 0, paddingTop: 0, paddingBottom: 0 }, ] this.animate(animation, { duration: 750, easing: "ease", fill: "forwards" }).onfinish = () => { diff --git a/package.json b/package.json index dd0206e..566b935 100755 --- a/package.json +++ b/package.json @@ -4,9 +4,10 @@ "private": true, "scripts": { "dev": "vite", - "serve": "vue-cli-service serve", - "build": "vue-cli-service build", - "lint": "vue-cli-service lint" + "build": "vite build", + "vueserve": "vue-cli-service serve", + "vuebuild": "vue-cli-service build", + "vuelint": "vue-cli-service lint" }, "dependencies": { "@laniakeasupercluster/widgets": "^1.1.8",