aboutsummaryrefslogtreecommitdiffstats
path: root/pelican-striped-html5up/static/js/main.js
diff options
context:
space:
mode:
authorFish <aroaminggeek@users.noreply.github.com>2017-03-25 16:38:01 -0600
committerGitHub <noreply@github.com>2017-03-25 16:38:01 -0600
commit36c2ef5937c24f9f276f75ac439ec2670f33e5b3 (patch)
tree3a5df2b2bbc95fefc847a2c58a2ec862188e2cd3 /pelican-striped-html5up/static/js/main.js
parentd7779b637b990aa70266d55faf842fbb4c837715 (diff)
downloadpelican-themes-36c2ef5937c24f9f276f75ac439ec2670f33e5b3.tar.gz
pelican-striped-html5up added
for pull request to origin
Diffstat (limited to 'pelican-striped-html5up/static/js/main.js')
-rw-r--r--pelican-striped-html5up/static/js/main.js87
1 files changed, 87 insertions, 0 deletions
diff --git a/pelican-striped-html5up/static/js/main.js b/pelican-striped-html5up/static/js/main.js
new file mode 100644
index 0000000..9dd199a
--- /dev/null
+++ b/pelican-striped-html5up/static/js/main.js
@@ -0,0 +1,87 @@
+/*
+ Striped by Pixelarity
+ pixelarity.com | hello@pixelarity.com
+ License: pixelarity.com/license
+*/
+
+(function($) {
+
+ skel.breakpoints({
+ desktop: '(min-width: 737px)',
+ wide: '(min-width: 1201px)',
+ narrow: '(min-width: 737px) and (max-width: 1200px)',
+ narrower: '(min-width: 737px) and (max-width: 1000px)',
+ mobile: '(max-width: 736px)'
+ });
+
+ $(function() {
+
+ var $window = $(window),
+ $body = $('body'),
+ $document = $(document);
+
+ // Disable animations/transitions until the page has loaded.
+ $body.addClass('is-loading');
+
+ $window.on('load', function() {
+ $body.removeClass('is-loading');
+ });
+
+ // Fix: Placeholder polyfill.
+ $('form').placeholder();
+
+ // Prioritize "important" elements on mobile.
+ skel.on('+mobile -mobile', function() {
+ $.prioritize(
+ '.important\\28 mobile\\29',
+ skel.breakpoint('mobile').active
+ );
+ });
+
+ // Off-Canvas Sidebar.
+
+ // Height hack.
+ var $sc = $('#sidebar, #content'), tid;
+
+ $window
+ .on('resize', function() {
+ window.clearTimeout(tid);
+ tid = window.setTimeout(function() {
+ $sc.css('min-height', $document.height());
+ }, 100);
+ })
+ .on('load', function() {
+ $window.trigger('resize');
+ })
+ .trigger('resize');
+
+ // Title Bar.
+ $(
+ '<div id="titleBar">' +
+ '<a href="#sidebar" class="toggle"></a>' +
+ '<span class="title">' + $('#logo').html() + '</span>' +
+ '</div>'
+ )
+ .appendTo($body);
+
+ // Sidebar
+ $('#sidebar')
+ .panel({
+ delay: 500,
+ hideOnClick: true,
+ hideOnSwipe: true,
+ resetScroll: true,
+ resetForms: true,
+ side: 'left',
+ target: $body,
+ visibleClass: 'sidebar-visible'
+ });
+
+ // Fix: Remove navPanel transitions on WP<10 (poor/buggy performance).
+ if (skel.vars.os == 'wp' && skel.vars.osVersion < 10)
+ $('#titleBar, #sidebar, #main')
+ .css('transition', 'none');
+
+ });
+
+})(jQuery); \ No newline at end of file