Skip to content

Commit

Permalink
🐛 fix(animation): mmswe logo loading
Browse files Browse the repository at this point in the history
  • Loading branch information
lwinmoepaing committed Oct 23, 2023
1 parent 4669d2f commit 447e243
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
24 changes: 14 additions & 10 deletions src/components/Animate/MseTypo/MseTypo.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"use client";
import { useRef } from "react";
import { motion, useInView } from "framer-motion";
import { cn } from "@/utils";
import { titleFont, titleFontBold } from "@/fonts/fonts";
import { cn } from "@/utils";
import { motion, useInView } from "framer-motion";
import { useRef } from "react";

export const strokeAnimation = {
hidden: { strokeDashoffset: 650, strokeDasharray: 650 },
Expand All @@ -16,16 +16,20 @@ export const strokeAnimation = {
},
} as const;

const MseTypo = ({ bgColor = "bg-indigo-500", isWhite = false }: { bgColor?: string, isWhite?: boolean }) => {
const MseTypo = ({
bgColor = "bg-indigo-500",
isWhite = false,
}: {
bgColor?: string;
isWhite?: boolean;
}) => {
const containerRef = useRef<SVGSVGElement>(null);
const isInView = useInView(containerRef, { amount: 0.5 });
const textColor = `${bgColor
.replace(/bg/, "text")
.replace(/-400/, "")} opacity-90`;

const fillColor = `fill-white`;

const strokeColor = isWhite ? "stroke-white" : `${bgColor.replace(/bg/, "stroke")} opacity-80`;
const strokeColor = isWhite
? "stroke-white"
: `${bgColor.replace(/bg/, "stroke")} opacity-80`;

return (
<motion.svg
Expand All @@ -34,7 +38,7 @@ const MseTypo = ({ bgColor = "bg-indigo-500", isWhite = false }: { bgColor?: str
xmlSpace="preserve"
id="Layer_1"
initial="hidden"
animate={isInView ? "visible" : "hidden"}
animate={isWhite ? "visible" : isInView ? "visible" : "hidden"}
x={0}
y={0}
viewBox="0 0 572.3 144.6"
Expand Down
1 change: 0 additions & 1 deletion src/hooks/profile/useProfileHook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ const useProfileHook = (initProfiles: Profile[], initSearchTag: string) => {
checkIsFoundTag(tagName, tag)
);

console.log("isAlreadySearched", isAlreadySearched);
if (isAlreadySearched) {
setSearchTag("");
setSelectedTags((prev) => []);
Expand Down

0 comments on commit 447e243

Please sign in to comment.