Parcourir la source

更改头部颜色

charles_c il y a 5 mois
Parent
commit
a49ced2e6c
1 fichiers modifiés avec 4 ajouts et 7 suppressions
  1. 4 7
      src/app/page.js

+ 4 - 7
src/app/page.js

@@ -22,17 +22,14 @@ export default function Home() {
   };
 
   const handleLogout = () => {
-    // Clear the currentUser from state
     setCurrentUser(null);
-    // Clear the currentUser from local storage
     localStorage.removeItem("currentUser");
-    // Redirect to the home page
     router.push("/");
   };
 
   return (
     <div className="bg-blue-600 text-white min-h-screen">
-      <header className="h-16 fixed top-0 left-0 right-0 bg-[#ea1c24] shadow-md z-10 transition-all duration-300">
+      <header className="h-16 fixed top-0 left-0 right-0 bg-white shadow-md z-10 transition-all duration-300">
         <div className="max-w-md mx-auto p-4">
           <div className="flex justify-between items-center">
             <div className="flex items-center">
@@ -69,12 +66,12 @@ export default function Home() {
                       />
                     </div>
                   )}
-                  <span className="text-sm font-bold">
+                  <span className="text-sm font-bold text-gray-700">
                     {currentUser.username}
                   </span>
                 </div>
                 <span
-                  className="text-sm font-bold cursor-pointer hover:text-gray-200"
+                  className="text-sm font-bold cursor-pointer text-red-400 hover:text-red-500"
                   onClick={handleLogout}
                 >
                   退出登录
@@ -82,7 +79,7 @@ export default function Home() {
               </div>
             ) : (
               <button
-                className="bg-white text-blue-600 px-3 py-1 rounded-full text-sm font-bold"
+                className="bg-blue-500 text-white hover:bg-blue-600 px-4 py-1 rounded-full text-sm font-bold transition duration-300"
                 onClick={() => router.push("/login")}
               >
                 登录