Skip to content

Commit

Permalink
Fix errors with the smoke on rotation
Browse files Browse the repository at this point in the history
  • Loading branch information
fedeperin committed Feb 28, 2024
1 parent fe254af commit b7b0a67
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/components/KonamiCode.astro
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script defer>
const container = document.querySelector("body")
const container = document.querySelector("#main-content")

const konamiCode = [
"ArrowUp",
Expand Down Expand Up @@ -28,11 +28,11 @@
if (konamiCodePosition !== konamiCode.length) return

container.style.transform = "rotateY(360deg)"
container.style.transition = "transform 3s ease"
container.style.transition = "transform 2s ease"

container.addEventListener("transitionend", () => {
container.style.transition = "none"
container.style.transform = "rotateY(0deg)"
container.style.transition = ""
container.style.transform = ""
})

konamiCodePosition = 0
Expand Down
2 changes: 1 addition & 1 deletion src/layouts/Layout.astro
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ const { title, description } = Astro.props
class="[&_:focus-visible]:outline-none [&_:focus-visible]:ring-2 [&_:focus-visible]:ring-primary"
>
<SmokeBackground />
<div class="mx-auto max-w-6xl px-2 pt-16 md:pt-20 lg:px-10">
<div class="mx-auto max-w-6xl px-2 pt-16 md:pt-20 lg:px-10" id="main-content">
<slot />
</div>
</body>
Expand Down

0 comments on commit b7b0a67

Please sign in to comment.