Çıkış Yap Butonu navbar'a taşındı

This commit is contained in:
2025-11-08 12:49:10 +03:00
parent aa665dd6d1
commit 4980095543
4 changed files with 47 additions and 15 deletions

View File

@@ -1,5 +1,11 @@
<script> <script>
import { page } from '$app/stores'; import { page } from '$app/stores';
import { goto } from '$app/navigation';
function handleLogout() {
localStorage.removeItem('user');
goto('/');
}
</script> </script>
<nav class="navbar"> <nav class="navbar">
@@ -10,7 +16,14 @@
</div> </div>
<div class="navbar-menu"> <div class="navbar-menu">
<button
class="logout-btn"
on:click={handleLogout}
title="Çıkış Yap"
aria-label=ıkış Yap"
>
<i class="fas fa-sign-out-alt"></i>
</button>
</div> </div>
</div> </div>
</nav> </nav>
@@ -59,6 +72,7 @@
display: flex; display: flex;
align-items: center; align-items: center;
gap: 30px; gap: 30px;
margin-right: 30px;
} }
.nav-link { .nav-link {
@@ -80,6 +94,25 @@
color: #ffffff; color: #ffffff;
} }
.logout-btn {
background: none;
border: none;
color: #ffffff;
font-size: 18px;
cursor: pointer;
padding: 8px;
border-radius: 6px;
transition: all 0.3s ease;
display: flex;
align-items: center;
justify-content: center;
}
.logout-btn:hover {
background-color: #34495e;
transform: scale(1.1);
}
@media (max-width: 768px) { @media (max-width: 768px) {
.navbar-content { .navbar-content {
padding: 0 var(--page-horizontal-padding); padding: 0 var(--page-horizontal-padding);
@@ -106,6 +139,11 @@
padding: 6px 12px; padding: 6px 12px;
font-size: 14px; font-size: 14px;
} }
.logout-btn {
font-size: 16px;
padding: 6px;
}
} }
@media (max-width: 480px) { @media (max-width: 480px) {
@@ -127,5 +165,10 @@
padding: 4px 8px; padding: 4px 8px;
font-size: 12px; font-size: 12px;
} }
.logout-btn {
font-size: 14px;
padding: 4px;
}
} }
</style> </style>

View File

@@ -759,10 +759,7 @@
<line x1="3" y1="18" x2="21" y2="18" /> <line x1="3" y1="18" x2="21" y2="18" />
</svg> </svg>
</button> </button>
<button class="btn btn-inactive" on:click={handleLogout}> </div>
Çıkış Yap
</button>
</div>
</div> </div>
<!-- Ayırıcı --> <!-- Ayırıcı -->

View File

@@ -259,10 +259,6 @@
return type === 'benzin' ? 'Benzin' : 'Motorin'; return type === 'benzin' ? 'Benzin' : 'Motorin';
} }
function handleLogout() {
localStorage.removeItem('user');
goto('/');
}
function goBack() { function goBack() {
goto('/dashboard'); goto('/dashboard');

View File

@@ -168,10 +168,6 @@
return 'priority-low'; return 'priority-low';
} }
function handleLogout() {
localStorage.removeItem('user');
goto('/');
}
function goBack() { function goBack() {
goto('/dashboard'); goto('/dashboard');