Update Search Bar. Fix dropdown menus.
This commit is contained in:
54
cloud/static/assets/js/layout.min.js
vendored
54
cloud/static/assets/js/layout.min.js
vendored
@@ -1,26 +1,56 @@
|
|||||||
|
/* Variables
|
||||||
|
================================================================== */
|
||||||
|
var searchToggleStatus = false
|
||||||
|
|
||||||
|
/* Selectors
|
||||||
|
================================================================== */
|
||||||
|
var searchButton = document.querySelector('#searchButton')
|
||||||
|
var searchCloseButton = document.querySelector('#searchCloseButton')
|
||||||
|
var searchNav = document.querySelector('#searchNav')
|
||||||
|
var searchNavInput = document.querySelector('#searchNav input')
|
||||||
|
var navbarNav = document.querySelector('#navbarNav')
|
||||||
|
var profileMenu = document.querySelector('#navbarNav .navbar-nav').lastElementChild
|
||||||
|
|
||||||
/* Interactions
|
/* Interactions
|
||||||
================================================================== */
|
================================================================== */
|
||||||
$('#searchButton').click(function(){
|
searchButton.addEventListener('click', showSearch)
|
||||||
showSearch()
|
searchCloseButton.addEventListener('click', closeSearch)
|
||||||
})
|
|
||||||
$('#searchCloseButton').click(function(){
|
|
||||||
closeSearch()
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* Functions
|
/* Functions
|
||||||
================================================================== */
|
================================================================== */
|
||||||
function showSearch() {
|
function showSearch() {
|
||||||
$('#searchbarNav').addClass('active')
|
searchToggleStatus = true
|
||||||
$('#searchbarNav input').focus()
|
searchNav.classList.add('active')
|
||||||
$('#navbarNav').addClass('invisible')
|
searchNavInput.focus()
|
||||||
|
navbarNav.classList.add('invisible')
|
||||||
|
profileMenu.classList.add('visible')
|
||||||
// $('#search-overlay').addClass('active')
|
// $('#search-overlay').addClass('active')
|
||||||
|
// if (searchToggleStatus == true) {
|
||||||
|
// // $(document.body).click(function() {
|
||||||
|
// // console.log('detect click outside');
|
||||||
|
// // searchToggleStatus = false
|
||||||
|
// // })
|
||||||
|
// console.log(searchToggleStatus);
|
||||||
|
// console.log('detect click outside');
|
||||||
|
// searchToggleStatus = false
|
||||||
|
// console.log(searchToggleStatus);
|
||||||
|
// } else {
|
||||||
|
// console.log(searchToggleStatus);
|
||||||
|
// console.log('not detecting clicks');
|
||||||
|
|
||||||
|
// }
|
||||||
|
// $(document.body).click(function () {
|
||||||
|
// console.log('detected click outside');
|
||||||
|
// searchToggleStatus == false
|
||||||
|
// }) else {
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
function closeSearch() {
|
function closeSearch() {
|
||||||
$('#searchbarNav').removeClass('active')
|
console.log('close button working')
|
||||||
$('#navbarNav').removeClass('invisible')
|
searchNav.classList.remove('active')
|
||||||
|
navbarNav.classList.remove('invisible')
|
||||||
|
profileMenu.classList.remove('visible')
|
||||||
// $('#search-overlay').removeClass('active')
|
// $('#search-overlay').removeClass('active')
|
||||||
}
|
}
|
@@ -1,26 +1,56 @@
|
|||||||
|
/* Variables
|
||||||
|
================================================================== */
|
||||||
|
var searchToggleStatus = false
|
||||||
|
|
||||||
|
/* Selectors
|
||||||
|
================================================================== */
|
||||||
|
var searchButton = document.querySelector('#searchButton')
|
||||||
|
var searchCloseButton = document.querySelector('#searchCloseButton')
|
||||||
|
var searchNav = document.querySelector('#searchNav')
|
||||||
|
var searchNavInput = document.querySelector('#searchNav input')
|
||||||
|
var navbarNav = document.querySelector('#navbarNav')
|
||||||
|
var profileMenu = document.querySelector('#navbarNav .navbar-nav').lastElementChild
|
||||||
|
|
||||||
/* Interactions
|
/* Interactions
|
||||||
================================================================== */
|
================================================================== */
|
||||||
$('#searchButton').click(function(){
|
searchButton.addEventListener('click', showSearch)
|
||||||
showSearch()
|
searchCloseButton.addEventListener('click', closeSearch)
|
||||||
})
|
|
||||||
$('#searchCloseButton').click(function(){
|
|
||||||
closeSearch()
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* Functions
|
/* Functions
|
||||||
================================================================== */
|
================================================================== */
|
||||||
function showSearch() {
|
function showSearch() {
|
||||||
$('#searchbarNav').addClass('active')
|
searchToggleStatus = true
|
||||||
$('#searchbarNav input').focus()
|
searchNav.classList.add('active')
|
||||||
$('#navbarNav').addClass('invisible')
|
searchNavInput.focus()
|
||||||
|
navbarNav.classList.add('invisible')
|
||||||
|
profileMenu.classList.add('visible')
|
||||||
// $('#search-overlay').addClass('active')
|
// $('#search-overlay').addClass('active')
|
||||||
|
// if (searchToggleStatus == true) {
|
||||||
|
// // $(document.body).click(function() {
|
||||||
|
// // console.log('detect click outside');
|
||||||
|
// // searchToggleStatus = false
|
||||||
|
// // })
|
||||||
|
// console.log(searchToggleStatus);
|
||||||
|
// console.log('detect click outside');
|
||||||
|
// searchToggleStatus = false
|
||||||
|
// console.log(searchToggleStatus);
|
||||||
|
// } else {
|
||||||
|
// console.log(searchToggleStatus);
|
||||||
|
// console.log('not detecting clicks');
|
||||||
|
|
||||||
|
// }
|
||||||
|
// $(document.body).click(function () {
|
||||||
|
// console.log('detected click outside');
|
||||||
|
// searchToggleStatus == false
|
||||||
|
// }) else {
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
function closeSearch() {
|
function closeSearch() {
|
||||||
$('#searchbarNav').removeClass('active')
|
console.log('close button working')
|
||||||
$('#navbarNav').removeClass('invisible')
|
searchNav.classList.remove('active')
|
||||||
|
navbarNav.classList.remove('invisible')
|
||||||
|
profileMenu.classList.remove('visible')
|
||||||
// $('#search-overlay').removeClass('active')
|
// $('#search-overlay').removeClass('active')
|
||||||
}
|
}
|
@@ -38,20 +38,17 @@ nav.navbar
|
|||||||
box-shadow: none
|
box-shadow: none
|
||||||
li:last-of-type
|
li:last-of-type
|
||||||
// profile menu
|
// profile menu
|
||||||
|
z-index: 1002
|
||||||
.dropdown-menu
|
.dropdown-menu
|
||||||
right: 0
|
right: 0
|
||||||
left: auto
|
left: auto
|
||||||
min-width: 10rem
|
top: 54px
|
||||||
padding: .5rem 0
|
padding: .5rem 0
|
||||||
margin: -1px 0 0
|
margin: .125rem 0 0
|
||||||
font-size: 1rem
|
&.visible
|
||||||
color: #111
|
visibility: visible
|
||||||
text-align: left
|
li a
|
||||||
list-style: none
|
padding: 0 15px 0 12px
|
||||||
background-color: #fff
|
|
||||||
background-clip: padding-box
|
|
||||||
border: 1px solid rgba(0,0,0,.15)
|
|
||||||
border-radius: .25rem
|
|
||||||
li:hover
|
li:hover
|
||||||
background-color: #f8f9fa
|
background-color: #f8f9fa
|
||||||
.dropdown ul.dropdown-menu li a
|
.dropdown ul.dropdown-menu li a
|
||||||
@@ -67,7 +64,7 @@ nav.navbar
|
|||||||
+media-breakpoint-up(lg)
|
+media-breakpoint-up(lg)
|
||||||
padding: 6px 18px
|
padding: 6px 18px
|
||||||
&:hover
|
&:hover
|
||||||
color: $muted
|
color: $primary
|
||||||
.navbar-toggler
|
.navbar-toggler
|
||||||
border: 0
|
border: 0
|
||||||
display: block
|
display: block
|
||||||
@@ -92,17 +89,19 @@ nav.navbar
|
|||||||
display:none !important
|
display:none !important
|
||||||
&.show
|
&.show
|
||||||
padding-bottom: 75vh
|
padding-bottom: 75vh
|
||||||
.search-icon
|
.search-icon
|
||||||
display: flex
|
display: flex
|
||||||
align-items: center
|
align-items: center
|
||||||
justify-content: center
|
justify-content: center
|
||||||
padding: 0 8px
|
padding: 0 8px
|
||||||
+media-breakpoint-up(lg)
|
+media-breakpoint-up(lg)
|
||||||
padding: 0 16px
|
padding: 0 16px
|
||||||
.pi-search
|
.pi-search
|
||||||
&::before
|
&::before
|
||||||
color: rgba(17,17,17,0.75)
|
color: rgba(17,17,17,0.75)
|
||||||
font-size: 16px
|
font-size: 16px
|
||||||
|
&:hover
|
||||||
|
color: $primary
|
||||||
.nav-notifications
|
.nav-notifications
|
||||||
display: flex
|
display: flex
|
||||||
align-items: center
|
align-items: center
|
||||||
@@ -129,17 +128,30 @@ nav.navbar
|
|||||||
display: block
|
display: block
|
||||||
.nav-notifications-icon
|
.nav-notifications-icon
|
||||||
color: rgba(17,17,17,0.75)
|
color: rgba(17,17,17,0.75)
|
||||||
|
&:hover
|
||||||
|
color: $primary
|
||||||
.gravatar
|
.gravatar
|
||||||
width: 32px
|
width: 32px
|
||||||
border-radius: 50%
|
border-radius: 50%
|
||||||
.dropdown-menu
|
.dropdown-menu
|
||||||
margin-top: -1px
|
margin-top: -1px
|
||||||
.dropdown:hover>.dropdown-menu
|
border: 0
|
||||||
display: block
|
border-radius: 0 0 4px 4px
|
||||||
|
box-shadow: none
|
||||||
|
font-size: 1rem
|
||||||
|
color: #111
|
||||||
|
text-align: left
|
||||||
|
list-style: none
|
||||||
|
background-color: #fff
|
||||||
|
background-clip: padding-box
|
||||||
|
.dropdown:hover
|
||||||
|
background: none
|
||||||
|
&>.dropdown-menu
|
||||||
|
display: block
|
||||||
.dropdown-item
|
.dropdown-item
|
||||||
color: #111
|
color: #111
|
||||||
font-size: 18px
|
font-size: 18px
|
||||||
padding: 4px 8px
|
padding: 0px 15px
|
||||||
i
|
i
|
||||||
padding-right: 8px
|
padding-right: 8px
|
||||||
#userDropdown
|
#userDropdown
|
||||||
@@ -149,7 +161,7 @@ nav.navbar
|
|||||||
padding-right: 0
|
padding-right: 0
|
||||||
outline: none
|
outline: none
|
||||||
|
|
||||||
#searchbarNav
|
#searchNav
|
||||||
background-color: #fff
|
background-color: #fff
|
||||||
position: absolute
|
position: absolute
|
||||||
display: none
|
display: none
|
||||||
@@ -167,11 +179,11 @@ nav.navbar
|
|||||||
max-width: 560px
|
max-width: 560px
|
||||||
width: 100%
|
width: 100%
|
||||||
input
|
input
|
||||||
padding: 8px 20px
|
padding: 8px 20px 8px 46px
|
||||||
color: #4d4e53
|
color: #4d4e53
|
||||||
box-shadow: none
|
box-shadow: none
|
||||||
border: 1px solid #999
|
border: 1px solid #bebebe
|
||||||
border-radius: 4
|
border-radius: 4px
|
||||||
border-bottom-color: none
|
border-bottom-color: none
|
||||||
background-color: #fff
|
background-color: #fff
|
||||||
font-size: 18px
|
font-size: 18px
|
||||||
@@ -179,13 +191,15 @@ nav.navbar
|
|||||||
width: 100%
|
width: 100%
|
||||||
max-width: 560px
|
max-width: 560px
|
||||||
.search-icon
|
.search-icon
|
||||||
|
cursor: pointer
|
||||||
position: absolute
|
position: absolute
|
||||||
top: 11px
|
top: 11px
|
||||||
right: 0px
|
left: 11px
|
||||||
#searchCloseButton
|
#searchCloseButton
|
||||||
cursor: pointer
|
cursor: pointer
|
||||||
position: absolute
|
position: absolute
|
||||||
right: 20px
|
right: 16px
|
||||||
|
top: 9px
|
||||||
// #search-overlay.active {
|
// #search-overlay.active {
|
||||||
// opacity: 1;
|
// opacity: 1;
|
||||||
// visibility: visible;
|
// visibility: visible;
|
||||||
|
@@ -94,13 +94,12 @@ html(lang="en")
|
|||||||
span
|
span
|
||||||
span
|
span
|
||||||
//- Search Bar
|
//- Search Bar
|
||||||
#searchbarNav
|
#searchNav
|
||||||
span.search-container
|
span.search-container
|
||||||
input#cloud-search(type="text", placeholder="Search assets, tutorials...")
|
input#cloud-search(type="text", placeholder="Search Blender Cloud")
|
||||||
a
|
i.search-icon.pi-search
|
||||||
i.search-icon.pi-search
|
a#searchCloseButton(ahref="#")
|
||||||
a#searchCloseButton(ahref="#")
|
img(src="{{ url_for('static', filename='assets/img/icons/icon-close-button.svg') }}", alt="alt")
|
||||||
img(src="{{ url_for('static', filename='assets/img/icons/icon-close-button.svg') }}", alt="alt")
|
|
||||||
//- Links
|
//- Links
|
||||||
#navbarNav.collapse.navbar-collapse.justify-content-end
|
#navbarNav.collapse.navbar-collapse.justify-content-end
|
||||||
ul.navbar-nav
|
ul.navbar-nav
|
||||||
|
Reference in New Issue
Block a user