Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix animation #194

Merged
merged 2 commits into from
Oct 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 79 additions & 2 deletions src/app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ a[href^="https://maps.google.com/maps"]{display:none !important} */
}

/* loading skeletons */
.card {
/* .card {
position: relative;
-webkit-box-shadow: 0 6px 8px rgba(0, 0, 0, 0.1);
box-shadow: 0 6px 8px rgba(0, 0, 0, 0.1);
Expand All @@ -194,7 +194,7 @@ a[href^="https://maps.google.com/maps"]{display:none !important} */
overflow: hidden;
width: 360px;
margin: 40px auto;
}
} */

.shimmerBG {
animation-duration: 2.2s;
Expand Down Expand Up @@ -290,3 +290,80 @@ font {
box-shadow: none !important;
position: initial !important;
}

/**
* ==============================================
* Loading animation map
* ==============================================
*/
.dot-pulse {
position: relative;
left: -9999px;
width: 10px;
height: 10px;
border-radius: 5px;
background-color: #333333;
color: #333333;
box-shadow: 9999px 0 0 -5px;
animation: dot-pulse 1.5s infinite linear;
animation-delay: 0.25s;
}
.dot-pulse::before,
.dot-pulse::after {
content: "";
display: inline-block;
position: absolute;
top: 0;
width: 8px;
height: 8px;
border-radius: 5px;
background-color: #333333;
color: #333333;
}
.dot-pulse::before {
box-shadow: 9984px 0 0 -5px;
animation: dot-pulse-before 1.5s infinite linear;
animation-delay: 0s;
}
.dot-pulse::after {
box-shadow: 10014px 0 0 -5px;
animation: dot-pulse-after 1.5s infinite linear;
animation-delay: 0.5s;
}

@keyframes dot-pulse-before {
0% {
box-shadow: 9984px 0 0 -5px;
}
30% {
box-shadow: 9984px 0 0 2px;
}
60%,
100% {
box-shadow: 9984px 0 0 -5px;
}
}
@keyframes dot-pulse {
0% {
box-shadow: 9999px 0 0 -5px;
}
30% {
box-shadow: 9999px 0 0 2px;
}
60%,
100% {
box-shadow: 9999px 0 0 -5px;
}
}
@keyframes dot-pulse-after {
0% {
box-shadow: 10014px 0 0 -5px;
}
30% {
box-shadow: 10014px 0 0 2px;
}
60%,
100% {
box-shadow: 10014px 0 0 -5px;
}
}
21 changes: 14 additions & 7 deletions src/components/OffCanvasMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@
"use client";

import { useState } from "react";
import { Dialog, DialogBackdrop, DialogPanel } from "@headlessui/react";
import {
Dialog,
DialogBackdrop,
DialogPanel,
Transition,
} from "@headlessui/react";
import Link from "next/link";

interface OffCanvasMenuProps {
Expand Down Expand Up @@ -111,10 +116,10 @@ const OffCanvasMenu = ({ open, onClose }: OffCanvasMenuProps) => {
</div>
</div>
<div className="relative mt-6 flex-1 px-4 sm:px-6 flex flex-col">
<div className="flex-1">
{nestedNav ? (
<div className="flex-1 relative">
<Transition show={nestedNav}>
<div
className="pt-16 flex flex-col items-center sm:items-start space-y-6 bg-amber-300 absolute inset-x-0 px-6 inset-y-0"
className="pt-16 flex flex-col items-center sm:items-start space-y-6 bg-amber-300 absolute inset-x-0 px-6 inset-y-0 transition duration-300 ease-in data-[closed]:opacity-0 data-[enter]:duration-100 data-[enter]:data-[closed]:-translate-x-full data-[leave]:duration-300 data-[leave]:data-[closed]:translate-x-full"
id="servicesNav"
>
<Link
Expand Down Expand Up @@ -160,9 +165,11 @@ const OffCanvasMenu = ({ open, onClose }: OffCanvasMenuProps) => {
Other Services
</Link>
</div>
) : (
</Transition>

<Transition show={!nestedNav}>
<div
className="pt-16 flex flex-col items-center sm:items-start space-y-6"
className="pt-16 flex flex-col items-center sm:items-start space-y-6 "
id="main_menu"
>
<Link
Expand Down Expand Up @@ -222,7 +229,7 @@ const OffCanvasMenu = ({ open, onClose }: OffCanvasMenuProps) => {
Terms
</Link>
</div>
)}
</Transition>
</div>
<div>
<div className="flex items-center justify-center sm:justify-start space-x-4 py-10">
Expand Down
8 changes: 5 additions & 3 deletions src/components/location-detail-component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -340,9 +340,11 @@ export default function LocationDetailComponent({
Closed
</p>
{location.info?.map((info) => (
<p key={info} className="text-dark font-normal text-sm">
{info}
</p>
<p
key={info}
className="text-dark font-normal text-sm"
dangerouslySetInnerHTML={{ __html: info }}
></p>
))}
</div>
</div>
Expand Down
8 changes: 5 additions & 3 deletions src/components/map-loading-animation.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
export function MapLoadingAnimation() {
return (
<div className="bg-white rounded-lg shadow-lg py-2 px-4 text-xs absolute top-2 left-1/2 -translate-x-1/2 text-black font-semibold">
<span className="animate-pulse text-sm">Loading...</span>
</div>
<>
<div className="stage bg-white rounded-lg shadow-lg py-3 px-6 text-xs absolute top-2 left-1/2 -translate-x-1/2 text-black font-semibold">
<div className="dot-pulse"></div>
</div>
</>
);
}