begin lang implementation

This commit is contained in:
Plailect 2017-01-15 01:06:59 -05:00
parent 410c792424
commit bab43f0b3b
No known key found for this signature in database
GPG key ID: F8A415C5EA602A41
8 changed files with 111 additions and 25 deletions

View file

@ -104,4 +104,4 @@ DEPENDENCIES
rake (~> 10.0) rake (~> 10.0)
BUNDLED WITH BUNDLED WITH
1.13.6 1.13.7

View file

@ -211,9 +211,6 @@ defaults:
# Outputting # Outputting
permalink: /:categories/:title/ permalink: /:categories/:title/
paginate: 5 # amount of posts to show
paginate_path: /page:num/
timezone: # http://en.wikipedia.org/wiki/List_of_tz_database_time_zones
# Plugins # Plugins

View file

@ -2,7 +2,6 @@
<div class="masthead__inner-wrap"> <div class="masthead__inner-wrap">
<div class="masthead__menu"> <div class="masthead__menu">
<nav id="site-nav" class="greedy-nav"> <nav id="site-nav" class="greedy-nav">
<button><div class="navicon"></div></button>
<ul class="visible-links"> <ul class="visible-links">
<li class="masthead__menu-item masthead__menu-item--lg"><a href="{{ '/' | absolute_url }}">{{ site.title }}</a></li> <li class="masthead__menu-item masthead__menu-item--lg"><a href="{{ '/' | absolute_url }}">{{ site.title }}</a></li>
{% for link in site.data.navigation.main %} {% for link in site.data.navigation.main %}
@ -14,7 +13,10 @@
<li class="masthead__menu-item"><a href="{{ domain }}{{ link.url }}">{{ link.title }}</a></li> <li class="masthead__menu-item"><a href="{{ domain }}{{ link.url }}">{{ link.title }}</a></li>
{% endfor %} {% endfor %}
</ul> </ul>
<ul class="hidden-links hidden"></ul> <ul class="hidden-links links-menu hidden"></ul>
<ul class="hidden-links lang-menu hidden"></ul>
<button class="lang-selector"><div class="langicon"><i class="fa fa-language fa-lg" aria-hidden="true"></i></div></button>
<button class="nav-selector" id="toggle-nav"><div class="navicon"></div></button>
</nav> </nav>
</div> </div>
</div> </div>

View file

@ -193,6 +193,7 @@
position: absolute; position: absolute;
height: 100%; height: 100%;
right: 0; right: 0;
top: 0;
padding: 0 0.5rem; padding: 0 0.5rem;
border: 0; border: 0;
outline: none; outline: none;
@ -201,6 +202,10 @@
cursor: pointer; cursor: pointer;
} }
.nav-selector {
right: 3rem;
}
.visible-links { .visible-links {
display: table; display: table;
@ -249,6 +254,10 @@
} }
} }
.links-menu {
right: 3rem !important;
}
.hidden-links { .hidden-links {
position: absolute; position: absolute;
top: 100%; top: 100%;

View file

@ -295,8 +295,6 @@ body:hover .visually-hidden button {
height: $navicon-height; height: $navicon-height;
background: #fff; background: #fff;
margin: auto; margin: auto;
-webkit-transition: 0.3s;
transition: 0.3s;
&:before, &:before,
&:after { &:after {
@ -306,8 +304,6 @@ body:hover .visually-hidden button {
width: $navicon-width; width: $navicon-width;
height: $navicon-height; height: $navicon-height;
background: #fff; background: #fff;
-webkit-transition: 0.3s;
transition: 0.3s;
} }
&:before { &:before {
@ -320,7 +316,6 @@ body:hover .visually-hidden button {
} }
.close .navicon { .close .navicon {
/* hide the middle line*/
background: transparent; background: transparent;
/* overlay the lines by setting both their top values to 0*/ /* overlay the lines by setting both their top values to 0*/
@ -343,6 +338,69 @@ body:hover .visually-hidden button {
} }
} }
/*
Langicons
========================================================================== */
.langicon {
position: relative;
width: $navicon-width;
background: transparent;
margin: auto;
&:before,
&:after {
content: "";
position: absolute;
left: 0;
width: $navicon-width;
height: $navicon-height;
background: #fff;
display: none;
}
/* overlay the lines by setting both their top values to 0*/
&:before, &:after{
-webkit-transform-origin: 50% 50%;
-ms-transform-origin: 50% 50%;
transform-origin: 50% 50%;
top: 0;
width: $navicon-width;
}
/* rotate the lines to form the x shape*/
&:before{
-webkit-transform: rotate3d(0,0,1,45deg);
transform: rotate3d(0,0,1,45deg);
}
&:after{
-webkit-transform: rotate3d(0,0,1,-45deg);
transform: rotate3d(0,0,1,-45deg);
}
}
.close .langicon {
/* hide the middle line*/
background: transparent;
.fa-language {
display: none;
-webkit-transition: 0.3s;
transition: 0.3s;
}
/* overlay the lines by setting both their top values to 0*/
&:before, &:after{
-webkit-transform-origin: 50% 50%;
-ms-transform-origin: 50% 50%;
transform-origin: 50% 50%;
top: 0;
width: $navicon-width;
display: block;
-webkit-transition: 0.3s;
transition: 0.3s;
}
}
/* /*
Sticky, fixed to top content Sticky, fixed to top content

View file

@ -29,8 +29,8 @@ $(document).ready(function(){
$(".sticky").Stickyfill(); $(".sticky").Stickyfill();
var stickySideBar = function(){ var stickySideBar = function(){
var show = $(".author__urls-wrapper button").length === 0 ? $(window).width() > 1024 : !$(".author__urls-wrapper button").is(":visible"); var show = $(".author__urls-wrapper #toggle-nav").length === 0 ? $(window).width() > 1024 : !$(".author__urls-wrapper #toggle-nav").is(":visible");
// console.log("has button: " + $(".author__urls-wrapper button").length === 0); // console.log("has button: " + $(".author__urls-wrapper #toggle-nav").length === 0);
// console.log("Window Width: " + windowWidth); // console.log("Window Width: " + windowWidth);
// console.log("show: " + show); // console.log("show: " + show);
//old code was if($(window).width() > 1024) //old code was if($(window).width() > 1024)
@ -54,9 +54,9 @@ $(document).ready(function(){
// Follow menu drop down // Follow menu drop down
$(".author__urls-wrapper button").on("click", function() { $(".author__urls-wrapper #toggle-nav").on("click", function() {
$(".author__urls").fadeToggle("fast", function() {}); $(".author__urls").fadeToggle("fast", function() {});
$(".author__urls-wrapper button").toggleClass("open"); $(".author__urls-wrapper #toggle-nav").toggleClass("open");
}); });
// init smooth scroll // init smooth scroll

10
assets/js/main.min.js vendored

File diff suppressed because one or more lines are too long

View file

@ -6,15 +6,15 @@
*/ */
var $nav = $('#site-nav'); var $nav = $('#site-nav');
var $btn = $('#site-nav button'); var $btn = $('#site-nav #toggle-nav');
var $vlinks = $('#site-nav .visible-links'); var $vlinks = $('#site-nav .visible-links');
var $hlinks = $('#site-nav .hidden-links'); var $hlinks = $('#site-nav .hidden-links.links-menu');
var breaks = []; var breaks = [];
function updateNav() { function updateNav() {
var availableSpace = $btn.hasClass('hidden') ? $nav.width() : $nav.width() - $btn.width() - 30; var availableSpace = $btn.hasClass('hidden') ? $nav.width() : $nav.width() - $btn.width() - 80;
// The visible list is overflowing the nav // The visible list is overflowing the nav
if($vlinks.width() > availableSpace) { if($vlinks.width() > availableSpace) {
@ -65,8 +65,28 @@ $(window).resize(function() {
}); });
$btn.on('click', function() { $btn.on('click', function() {
$hlinks.toggleClass('hidden'); if($hlinks.is(":visible")){
$(this).toggleClass('close'); $hlinks.addClass('hidden');
$btn.removeClass('close');
} else {
$hlinks.removeClass('hidden');
$('.lang-menu').addClass('hidden');
$btn.addClass('close');
$('.lang-selector').removeClass('close');
}
});
// Language selector button
$('.lang-selector').on('click', function() {
if($('.lang-menu').is(":visible")){
$('.lang-menu').addClass('hidden');
$('.lang-selector').removeClass('close');
} else {
$('.lang-menu').removeClass('hidden');
$('.lang-selector').addClass('close');
$hlinks.addClass('hidden');
$btn.removeClass('close');
}
}); });
updateNav(); updateNav();