From 1fc9f413d4facc20432a44dbd8c2f376b80f4f63 Mon Sep 17 00:00:00 2001 From: Atiwit Pattanapukdee <65160394@go.buu.ac.th> Date: Wed, 19 Mar 2025 15:25:00 +0700 Subject: [PATCH] Project Round 7 --- public/css/styles.css | 4 ++-- views/index.ejs | 32 +++++++++++++++++++------------- 2 files changed, 21 insertions(+), 15 deletions(-) diff --git a/public/css/styles.css b/public/css/styles.css index e6c2fae..5653bc1 100644 --- a/public/css/styles.css +++ b/public/css/styles.css @@ -23,6 +23,7 @@ header { nav { display: flex; justify-content: center; + align-items: center; gap: 20px; margin-top: 10px; } @@ -182,7 +183,7 @@ footer { display: flex; align-items: center; width: 100%; - max-width: 400px; + max-width: 500px; border: 2px solid #007BFF; border-radius: 25px; overflow: hidden; @@ -204,7 +205,6 @@ footer { padding: 10px 20px; font-size: 16px; cursor: pointer; - transition: background-color 0.3s ease, transform 0.2s ease; } .search-container button:hover { diff --git a/views/index.ejs b/views/index.ejs index 4c00214..b3204e7 100644 --- a/views/index.ejs +++ b/views/index.ejs @@ -12,19 +12,25 @@ <header> <h1>Welcome to JourneyHub</h1> <nav> - <% if (session.userId) { %> - <a href="/create" class="btn-create">Create Tour</a> - <% } %> - <form action="/search" method="GET" class="search-container"> - <input type="text" name="query" placeholder="Search for tours..." required> - <button type="submit">Search</button> - </form> - <% if (session && session.userId) { %> <!-- ตรวจสอบว่า userId อยู่ใน session หรือไม่ --> - <a><%= session.userName %></a> <!-- แสดงชื่อผู้ใช้ --> - <a href="/logout">Logout</a> - <% } else { %> - <a href="/login" class="login-btn">Login</a> <!-- ถ้ายังไม่ได้ login --> - <% } %> + <div class="header"> + <% if (session.userId) { %> + <a href="/create" class="btn-create">Create Tour</a> + <% } %> + + <form action="/search" method="GET" class="search-container"> + <input type="text" name="query" placeholder="Search for tours..." required> + <button type="submit">Search</button> + </form> + + <div class="navbar"> + <% if (session && session.userId) { %> + <a><%= session.userName %></a> + <a href="/logout">Logout</a> + <% } else { %> + <a href="/login" class="login-btn">Login</a> + <% } %> + </div> + </div> </nav> </header> -- GitLab