Skip to content

Commit

Permalink
feat(animation)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jee-vim committed Dec 2, 2023
1 parent ee7ae72 commit a63f85c
Show file tree
Hide file tree
Showing 7 changed files with 458 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/components/Layout/Grid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ interface IGrid {
export default function Grid({ isGrid, setIsGrid }: IGrid) {
return (
<button
className="text-dark0 dark:text-light0 animate hover:rotate-180 animate"
className="text-dark0 dark:text-light0 hover:rotate-180 animate"
onClick={() => setIsGrid(!isGrid)}
>
{isGrid ? (
Expand Down
8 changes: 5 additions & 3 deletions src/components/Modal.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { useNavigate } from "react-router-dom";
import { useStoreApp } from "~/stores/useStoreApp";
import { slideInupAnimate } from "~/utils/animations";

type TModal = {
id: number;
Expand Down Expand Up @@ -31,14 +32,15 @@ const Modal = ({ id, isModal, setIsModal }: TModal) => {
<div className="fixed inset-0 flexCenterCenter z-50">
{/* Modal Overlay */}
<div
className={`fixed inset-0 ${isModal ? "bg-black bg-opacity-50" : "bg-transparent"
}`}
className={`fixed inset-0 ${
isModal ? "bg-black bg-opacity-50" : "bg-transparent"
}`}
onClick={handleOutsideClick}
></div>

{/* Modal Content */}
{isModal && id && (
<div className="bg-light0 text-dark0 shadow-lg w-4/5 md:w-1/2 lg:w-1/3 rounded-lg p-3 z-50">
<div className="bg-light0 text-dark0 shadow-lg w-4/5 md:w-1/2 lg:w-1/3 rounded-lg p-3 z-50" style={slideInupAnimate("100ms")}>
<p>Are you sure you want to delete this notes?</p>

<div className="flexCenterCenter mt-5">
Expand Down
5 changes: 4 additions & 1 deletion src/main.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import React from "react";
import ReactDOM from "react-dom/client";
import App from "./App.tsx";
import "./globals.css";
import { BrowserRouter, Routes, Route } from "react-router-dom";


import "./styles/globals.css";
import "./styles/animations.css";

ReactDOM.createRoot(document.getElementById("root")!).render(
<React.StrictMode>
<BrowserRouter>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Notes/NoteUpdate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { useStoreApp } from "~/stores/useStoreApp";
export default function EditNotes() {
const { editNotes, notes } = useStoreApp();
const { id } = useParams();
const note = notes[Number(id)];// get params and parse to number
const note = notes[Number(id)];
const [notesEdit, setNotesEdit] = useState({
title: note.title,
body: note.body,
Expand Down
Loading

0 comments on commit a63f85c

Please sign in to comment.