Jump to 0.3.1

This commit is contained in:
Wu Cheng-Han
2015-07-02 00:10:20 +08:00
parent f7f8c901f4
commit 10c9811fc5
49 changed files with 2336 additions and 448 deletions

125
public/vendor/showup/showup.css vendored Executable file
View File

@@ -0,0 +1,125 @@
/*
* Showup.js jQuery Plugin
* http://github.com/jonschlinkert/showup
*
* Copyright (c) 2013 Jon Schlinkert, contributors
* Licensed under the MIT License (MIT).
*/
/**
* Docs navbar transitions effects
*/
.navbar-tall,
.navbar-show {
-webkit-transition: -webkit-transform .3s;
-moz-transition: -moz-transform .3s;
-o-transition: -o-transform .3s;
transition: transform .3s;
-webkit-transform: translate(0, 0);
-ms-transform: translate(0, 0);
transform: translate(0, 0);
}
.navbar-hide {
-webkit-transition: -webkit-transform .2s;
-moz-transition: -moz-transform .2s;
-o-transition: -o-transform .2s;
transition: transform .2s;
-webkit-transform: translate(0, -60px);
-ms-transform: translate(0, -60px);
transform: translate(0, -60px);
}
.navbar-tall,
.navbar-short,
.navbar-tall .navbar-brand,
.navbar-short .navbar-brand,
.navbar-tall .navbar-nav > li > a,
.navbar-short .navbar-nav > li > a {
-webkit-transition: all 0.2s linear;
transition: all 0.2s linear;
}
.navbar-short {
min-height: 40px;
}
.navbar-short .navbar-brand {
font-size: 16px;
padding: 13px 15px 10px;
}
.navbar-short .navbar-nav > li > a {
padding-top: 12px;
padding-bottom: 12px;
}
.navbar-tall {
min-height: 70px;
}
.navbar-tall .navbar-brand {
font-size: 24px;
padding: 25px 15px;
}
.navbar-tall .navbar-nav > li > a {
padding-top: 25px;
}
/**
* Docs Buttons
*/
/* Fixed button, bottom right */
.btn-fixed-bottom {
position: fixed;
bottom: 30px;
display: none;
z-index: 5;
width: 40px;
height: 40px;
}
/* Toggles navbar classes */
.btn-hide-show {
margin-right: 10px;
}
/* Light theme */
.btn-light {
color: #555;
background-color: rgba(0, 0, 0,.1);
}
.btn-light:hover {
color: #111;
background-color: rgba(0, 0, 0,.25);
}
/* Dark theme */
.btn-dark {
color: #fff;
background-color: rgba(0, 0, 0,.5);
}
.btn-dark:hover {
color: #fff;
background-color: rgba(0, 0, 0,.9);
}
/* Buttons displayed throughout the content */
.btn-showup {
position: relative;
color: #fff;
font-weight: normal;
background-color: #463265;
border-color: #3F2961;
}
.btn-showup:hover,
.btn-showup:focus {
color: #fff;
outline: none;
background-color: #39235A;
border-color: #39235A;
}

87
public/vendor/showup/showup.js vendored Executable file
View File

@@ -0,0 +1,87 @@
/*
* Showup.js jQuery Plugin
* http://github.com/jonschlinkert/showup
*
* Copyright (c) 2013 Jon Schlinkert, contributors
* Licensed under the MIT License (MIT).
*/
(function( $ ) {
$.fn.showUp = function(ele, options) {
options = options || {};
var target = $(ele);
var down = options.down || 'navbar-hide';
var up = options.up || 'navbar-show';
var btnHideShow = options.btnHideShow || '.btn-hide-show';
var hideOffset = options.offset || 60;
var previousScroll = 0;
var isHide = false;
$(window).scroll(function () {
checkScrollTop();
});
$(window).resize(function () {
checkScrollTop();
});
$(window).mousewheel(function () {
checkScrollTop();
});
function checkScrollTop()
{
target.clearQueue();
target.stop();
var currentScroll = $(this).scrollTop();
if (currentScroll > hideOffset) {
if(Math.abs(previousScroll - currentScroll) < 50) return;
if (currentScroll > previousScroll) {
// Action on scroll down
target.removeClass(up).addClass(down);
} else if (currentScroll < previousScroll) {
// Action on scroll up
target.removeClass(down).addClass(up);
}
} else {
target.removeClass(down).addClass(up);
}
previousScroll = $(this).scrollTop();
}
// Toggle visibility of target on click
$(btnHideShow).click(function () {
if (target.hasClass(down)) {
target.removeClass(down).addClass(up);
} else {
target.removeClass(up).addClass(down);
}
});
};
})( jQuery );
// TODO: make customizable
$(document).ready(function () {
var duration = 420;
var showOffset = 220;
var btnFixed = '.btn-fixed-bottom';
var btnToTopClass = '.back-to-top';
$(window).scroll(function () {
if ($(this).scrollTop() > showOffset) {
$(btnFixed).fadeIn(duration);
} else {
$(btnFixed).fadeOut(duration);
}
});
$(btnToTopClass).click(function (event) {
event.preventDefault();
$('html, body').animate({
scrollTop: 0
}, duration);
return false;
});
});