Optimize background navigation
This commit is contained in:
parent
3e2a27d2b8
commit
1cc2bf53a5
|
|
@ -20,7 +20,6 @@
|
||||||
|
|
||||||
.header-left {
|
.header-left {
|
||||||
width: 190px;
|
width: 190px;
|
||||||
// flex-wrap: wrap;
|
|
||||||
|
|
||||||
.logo {
|
.logo {
|
||||||
a {
|
a {
|
||||||
|
|
@ -44,6 +43,176 @@
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
|
|
||||||
|
.search-wrap {
|
||||||
|
margin-left: 30px;
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
.input-wrap {
|
||||||
|
background-color: #f0f3f8;
|
||||||
|
.search-icon {
|
||||||
|
color: #4f5b68;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.input-wrap {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
padding: 0 0 0 14px;
|
||||||
|
height: 35px;
|
||||||
|
transition: all .2s ease-in-out;
|
||||||
|
width: 330px;
|
||||||
|
border-radius: 6px;
|
||||||
|
font-size: 16px;
|
||||||
|
background-color: #f6f7fa;
|
||||||
|
|
||||||
|
.search-icon {
|
||||||
|
// color: #8c98a4;
|
||||||
|
// color: #798591;
|
||||||
|
color: #626f7c;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.active {
|
||||||
|
// background-color: #f6f7fa;
|
||||||
|
background-color: #f0f3f8;
|
||||||
|
height: 40px;
|
||||||
|
.search-icon {
|
||||||
|
color: #4f5b68;
|
||||||
|
}
|
||||||
|
|
||||||
|
.close-icon {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
& ~ .dropdown-menu {
|
||||||
|
opacity: 1;
|
||||||
|
visibility: visible;
|
||||||
|
top: 140%;
|
||||||
|
pointer-events: auto;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.close-icon {
|
||||||
|
color: #aaa;
|
||||||
|
outline: none;
|
||||||
|
display: none;
|
||||||
|
box-shadow: none;
|
||||||
|
|
||||||
|
i {
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
i {
|
||||||
|
color: $primary;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
input {
|
||||||
|
border: none;
|
||||||
|
font-size: 14px;
|
||||||
|
background-color: transparent;
|
||||||
|
height: 40px;
|
||||||
|
// 设置 placeholder 颜色
|
||||||
|
&::-webkit-input-placeholder {
|
||||||
|
color: #8c98a4;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.dropdown-menu {
|
||||||
|
top: 180%;
|
||||||
|
width: 100%;
|
||||||
|
animation-duration: 300ms;
|
||||||
|
display: block;
|
||||||
|
opacity: 0;
|
||||||
|
visibility: hidden;
|
||||||
|
border: none;
|
||||||
|
transition: all .2s ease-in-out;
|
||||||
|
padding: .7rem 0;
|
||||||
|
border-radius: 0.5rem;
|
||||||
|
// box-shadow: 0 0.6125rem 2.5rem 0.6125rem rgba(140,152,164,.175);
|
||||||
|
box-shadow: 0 0.8rem 2.5rem 0.6125rem rgba(140, 152, 164, 0.286);
|
||||||
|
.dropdown-wrap {
|
||||||
|
max-height: 380px;
|
||||||
|
overflow-y: auto;
|
||||||
|
overflow-x: hidden;
|
||||||
|
padding: 0 0.5rem;
|
||||||
|
|
||||||
|
// 修改滚动条样式
|
||||||
|
&::-webkit-scrollbar {
|
||||||
|
width: 8px;
|
||||||
|
height: 6px;
|
||||||
|
background-color: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
&::-webkit-scrollbar-thumb {
|
||||||
|
background-color: #d1d5da;
|
||||||
|
border-radius: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.link-item {
|
||||||
|
a {
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.common-links {
|
||||||
|
a {
|
||||||
|
span {
|
||||||
|
width: 24px;
|
||||||
|
height: 24px;
|
||||||
|
border-radius: 50%;
|
||||||
|
display: inline-block;
|
||||||
|
line-height: 24px;
|
||||||
|
margin-right: 0.2rem;
|
||||||
|
text-align: center;
|
||||||
|
background-color: rgba(19,33,68,.1);
|
||||||
|
font-size: 12px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.recent-search {
|
||||||
|
.recent-search-links {
|
||||||
|
padding: 0 1rem;
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
|
||||||
|
a {
|
||||||
|
background-color: rgba(19,33,68,.1);
|
||||||
|
border-radius: 20px;
|
||||||
|
padding: 0.3rem 0.7rem;
|
||||||
|
font-size: .75rem;
|
||||||
|
margin-bottom: 0.5rem;
|
||||||
|
margin-right: 0.3rem;
|
||||||
|
&:hover {
|
||||||
|
background-color: $primary;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.dropdown-divider {
|
||||||
|
width: calc(100% + 1rem);
|
||||||
|
margin-left: -0.5rem;
|
||||||
|
opacity: 0.5;
|
||||||
|
}
|
||||||
|
|
||||||
|
a.dropdown-item {
|
||||||
|
border-radius: 0.3rem;
|
||||||
|
padding: 0.5rem 1rem;
|
||||||
|
&:hover {
|
||||||
|
background-color: rgba(189, 197, 209, 0.2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
> .navbar {
|
> .navbar {
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
* @link https://beikeshop.com
|
* @link https://beikeshop.com
|
||||||
* @Author pu shuo <pushuo@guangda.work>
|
* @Author pu shuo <pushuo@guangda.work>
|
||||||
* @Date 2022-08-16 18:47:18
|
* @Date 2022-08-16 18:47:18
|
||||||
* @LastEditTime 2022-11-04 16:00:27
|
* @LastEditTime 2023-04-26 19:45:54
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$(function () {
|
$(function () {
|
||||||
|
|
@ -12,4 +12,20 @@ $(function () {
|
||||||
const offcanvasMobileMenu = new bootstrap.Offcanvas('#offcanvas-mobile-menu')
|
const offcanvasMobileMenu = new bootstrap.Offcanvas('#offcanvas-mobile-menu')
|
||||||
offcanvasMobileMenu.show()
|
offcanvasMobileMenu.show()
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$(document).on("focus", ".search-wrap .input-wrap input", function () {
|
||||||
|
$(this).parents('.input-wrap').addClass("active");
|
||||||
|
});
|
||||||
|
|
||||||
|
$(document).on("focus", ".search-wrap .input-wrap .close-icon", function () {
|
||||||
|
$(this).parents('.input-wrap').removeClass("active");
|
||||||
|
$(this).siblings('input').val('');
|
||||||
|
});
|
||||||
|
|
||||||
|
// 点击 search-wrap 以外的地方关闭搜索框
|
||||||
|
$(document).on("click", function (e) {
|
||||||
|
if (!$(e.target).parents(".search-wrap").length) {
|
||||||
|
$(".search-wrap .input-wrap").removeClass("active");
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -6,11 +6,56 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="header-right">
|
<div class="header-right">
|
||||||
<ul class="navbar navbar-left">
|
{{-- <ul class="navbar navbar-left">
|
||||||
@foreach ($links as $link)
|
@foreach ($links as $link)
|
||||||
<li class="nav-item {{ $link['active'] ? 'active' : '' }}"><a href="{{ $link['url'] }}" class="nav-link">{{ $link['title'] }}</a></li>
|
<li class="nav-item {{ $link['active'] ? 'active' : '' }}"><a href="{{ $link['url'] }}" class="nav-link">{{ $link['title'] }}</a></li>
|
||||||
@endforeach
|
@endforeach
|
||||||
</ul>
|
</ul> --}}
|
||||||
|
<div class="search-wrap">
|
||||||
|
<div class="input-wrap">
|
||||||
|
<div class="search-icon"><i class="bi bi-search"></i></div>
|
||||||
|
<input type="text" class="form-control" placeholder="Search in front">
|
||||||
|
<button class="btn close-icon" type="button"><i class="bi bi-x-lg"></i></button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="dropdown-menu">
|
||||||
|
<div class="dropdown-wrap">
|
||||||
|
<div class="link-item recent-search">
|
||||||
|
<div class="dropdown-header fw-bold mb-2">最近搜索</div>
|
||||||
|
<div class="recent-search-links">
|
||||||
|
<a href="{{ admin_route('design_menu.index') }}"><i class="bi bi-search"></i> {{ __('admin/common.design_menu_index') }}</a>
|
||||||
|
<a href="{{ admin_route('languages.index') }}"><i class="bi bi-search"></i> {{ __('admin/common.languages_index') }}</a>
|
||||||
|
<a href="{{ admin_route('currencies.index') }}"><i class="bi bi-search"></i> {{ __('admin/common.currencies_index') }}</a>
|
||||||
|
<a href="{{ admin_route('plugins.index') }}"><i class="bi bi-search"></i> {{ __('admin/common.plugins_index') }}</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="dropdown-divider"></div>
|
||||||
|
<div class="link-item">
|
||||||
|
<div class="dropdown-header fw-bold">常用链接</div>
|
||||||
|
<div class="common-links">
|
||||||
|
<a class="dropdown-item" href="{{ admin_route('design.index') }}" target="_blank">
|
||||||
|
<span><i class="bi bi-palette"></i></span> {{ __('admin/common.design_index') }}
|
||||||
|
</a>
|
||||||
|
<a class="dropdown-item" href="{{ admin_route('design_footer.index') }}" target="_blank">
|
||||||
|
<span><i class="bi bi-palette"></i></span> {{ __('admin/common.design_footer_index') }}
|
||||||
|
</a>
|
||||||
|
<a class="dropdown-item" href="{{ admin_route('design_menu.index') }}">
|
||||||
|
<span><i class="bi bi-list"></i></span> {{ __('admin/common.design_menu_index') }}
|
||||||
|
</a>
|
||||||
|
<a class="dropdown-item" href="{{ admin_route('languages.index') }}">
|
||||||
|
<span><i class="bi bi-globe2"></i></span> {{ __('admin/common.languages_index') }}
|
||||||
|
</a>
|
||||||
|
<a class="dropdown-item" href="{{ admin_route('currencies.index') }}">
|
||||||
|
<span><i class="bi bi-currency-dollar"></i></span> {{ __('admin/common.currencies_index') }}
|
||||||
|
</a>
|
||||||
|
<a class="dropdown-item" href="{{ admin_route('plugins.index') }}">
|
||||||
|
<span><i class="bi bi-plug"></i></span> {{ __('admin/common.plugins_index') }}
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<ul class="navbar navbar-right">
|
<ul class="navbar navbar-right">
|
||||||
@hookwrapper('admin.header.upgrade')
|
@hookwrapper('admin.header.upgrade')
|
||||||
<li class="nav-item update-btn me-2" style="display: none">
|
<li class="nav-item update-btn me-2" style="display: none">
|
||||||
|
|
@ -165,14 +210,5 @@
|
||||||
$('.update-pop .btn-outline-secondary').click(function() {
|
$('.update-pop .btn-outline-secondary').click(function() {
|
||||||
layer.close(updatePop)
|
layer.close(updatePop)
|
||||||
});
|
});
|
||||||
|
|
||||||
// $('.vip-serve').click(function(event) {
|
|
||||||
// layer.open({
|
|
||||||
// type: 2,
|
|
||||||
// title: '',
|
|
||||||
// area: ['840px', '80%'],
|
|
||||||
// content: `${config.api_url}/api/vip_rights?domain=${config.app_url}&developer_token={{ system_setting('base.developer_token') }}`,
|
|
||||||
// });
|
|
||||||
// });
|
|
||||||
</script>
|
</script>
|
||||||
@endpush
|
@endpush
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue