From 6bff62c0c20ec99acb9ccae2d5a9c68ceb48d3a3 Mon Sep 17 00:00:00 2001 From: aronmal Date: Fri, 26 May 2023 18:24:51 +0200 Subject: [PATCH] Better fog --- .../components/Gamefield/FogImages.tsx | 10 ++-- leaky-ships/styles/App.scss | 58 +++++++++++++++++-- 2 files changed, 59 insertions(+), 9 deletions(-) diff --git a/leaky-ships/components/Gamefield/FogImages.tsx b/leaky-ships/components/Gamefield/FogImages.tsx index 06ba202..3d455c9 100644 --- a/leaky-ships/components/Gamefield/FogImages.tsx +++ b/leaky-ships/components/Gamefield/FogImages.tsx @@ -1,11 +1,11 @@ -import Image from "next/image" - function FogImages() { return ( <> - {`fog1.png`} - {`fog1.png`} - {`fog4.png`} + {`fog1.png`} + {`fog1.png`} + {`fog1.png`} + {`fog1.png`} + {`fog4.png`} ) } diff --git a/leaky-ships/styles/App.scss b/leaky-ships/styles/App.scss index 87fc692..463201b 100644 --- a/leaky-ships/styles/App.scss +++ b/leaky-ships/styles/App.scss @@ -71,6 +71,7 @@ body { justify-items: center; grid-template-rows: 0.75fr repeat(12, 1fr) 0.75fr; grid-template-columns: 0.75fr repeat(12, 1fr) 0.75fr; + overflow: hidden; > .label { grid-column: var(--x); @@ -274,21 +275,70 @@ body { width: inherit; pointer-events: none; - &.left { + &:not(.middle) { grid-area: 1 / 1 / -1 / -1; + transform-origin: 324px 0; align-self: flex-start; - transform: rotate(180deg); + margin-top: 324px; + opacity: 1; + } + + &.left { + transform: rotate(90deg); + animation: floatInl 3s ease-out; + @keyframes floatInl { + from { + transform: scale(2) rotate(90deg); + margin-left: -324px; + opacity: 0; + } + } } &.right { - grid-area: 1 / 1 / -1 / -1; - align-self: flex-end; + transform: rotate(270deg); + animation: floatInr 3s ease-out; + @keyframes floatInr { + from { + transform: scale(2) rotate(270deg); + margin-left: 324px; + opacity: 0; + } + } + } + &.top { + animation: floatInt 3s ease-out; + @keyframes floatInt { + from { + transform: scale(2); + margin-top: 648px; + opacity: 0; + } + } + } + + &.bottom { + transform: rotate(180deg); + animation: floatInb 3s ease-out; + @keyframes floatInb { + from { + transform: scale(2) rotate(180deg); + margin-top: 0; + opacity: 0; + } + } } &.middle { grid-area: 4 / 4 / -4 / -4; } } + + canvas { + grid-area: 1 / 1 / -1 / -1; + border: 1px solid #000; + display: absolute; + } } .event-bar {