-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
13,909 additions
and
63 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,29 @@ | ||
export default function () { | ||
export default function() { | ||
const navbar = document.querySelector('#navbar'); | ||
const heroBottom = document.querySelector('#hero').offsetHeight; | ||
let scrollTop = 0; | ||
|
||
function checkState() { | ||
scrollTop = window.pageYOffset || document.documentElement.scrollTop; | ||
if(scrollTop > heroBottom) { | ||
if (scrollTop > heroBottom) { | ||
navbar.classList.add('--condensed'); | ||
$(".navbar-toggler>.line").css("background-color", "#747474"); | ||
|
||
|
||
if (window.matchMedia('(max-width: 767px)').matches) | ||
$("nav#navbar .container").css("background-color", "#fff"); | ||
|
||
} else { | ||
navbar.classList.remove('--condensed'); | ||
$(".navbar-toggler>.line").css("background-color", "white"); | ||
|
||
if (window.matchMedia('(max-width: 767px)').matches) { | ||
$("nav#navbar .container").css("background-color", "#19293b"); | ||
} | ||
} | ||
} | ||
|
||
checkState(); | ||
document.addEventListener('scroll', checkState); | ||
} | ||
} | ||
`` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,10 @@ | |
{ | ||
"title": "Samples", | ||
"url": "samples" | ||
}, | ||
{ | ||
"title": "Contact", | ||
"url": "contact" | ||
} | ||
], | ||
"hero": { | ||
|
@@ -128,7 +132,7 @@ | |
}, | ||
"tel": { | ||
"address": "[email protected]", | ||
"label": "+98 21 6640 4125" | ||
"label": "+98 21 9100 33 03" | ||
}, | ||
"address": "No. 1070, Enghelab St.\nTehran, Iran", | ||
"sobhe_link": "Visit Sobhe.ir", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,51 @@ | ||
nav#navbar.navbar | ||
.container | ||
.navbar-inner | ||
.navbar-sections | ||
each link in $i18n.nav ? $i18n.nav : [] | ||
a(data-scroll='' href='#'+link.url) #{link.title} | ||
- if($i18n.lang == 'fa') | ||
a(href=baseurl+'/en') English | ||
- else | ||
a(href=baseurl class='type-fa') فارسی | ||
#horizonlalNav | ||
.navbar-inner | ||
.navbar-sections | ||
each link in $i18n.nav ? $i18n.nav : [] | ||
a(data-scroll='' href='#'+link.url) #{link.title} | ||
- if($i18n.lang == 'fa') | ||
a(href=baseurl+'/en') English | ||
- else | ||
a(href=baseurl class='type-fa') فارسی | ||
#hamburgerNav | ||
nav.navbar-light | ||
button#btnHamburger.navbar-toggler.hidden-sm-up(type='button' onclick='lockScroll()' data-toggle='collapse' data-target='#navbarResponsive' aria-controls='navbarResponsive' aria-expanded='false' aria-label='Toggle navigation') | ||
span.line | ||
span.line | ||
span.line | ||
|
||
|
||
#navbarResponsive.collapse.navbar-toggleable-xs | ||
.navbar-inner | ||
.navbar-sections | ||
each link in $i18n.nav ? $i18n.nav : [] | ||
a.nav-link(data-scroll='' href='#'+link.url class=' link' ) #{link.title} | ||
- if($i18n.lang == 'fa') | ||
a(href=baseurl+'/en' class=' link') English | ||
- else | ||
a(href=baseurl class='type-fa' class=' link') فارسی | ||
|
||
|
||
script. | ||
$('.navbar-sections a').on('click', function(){ | ||
$('.btn-navbar').click(); //bootstrap 2.x | ||
$('.navbar-toggle').click(); //bootstrap 3.x by Richard | ||
$('.navbar-toggler').click(); //bootstrap 4.x | ||
}); | ||
function lockScroll() { | ||
if ($('html').hasClass('lock-scroll')) { | ||
//- $('body').removeClass('lock-scroll'); | ||
$('html').removeClass('lock-scroll'); | ||
} | ||
else { | ||
//- $('body').addClass('lock-scroll'); | ||
$('html').addClass('lock-scroll'); | ||
} | ||
} | ||
|
||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.