v 1.3.5 - Christmas theme! 🎄

This commit is contained in:
Wruczek
2016-12-01 01:47:40 +01:00
parent bb8dda37bd
commit ff11404532
9 changed files with 208 additions and 12 deletions

34
js/christmas.js Normal file
View File

@ -0,0 +1,34 @@
// Remember: This file is loaded before jQuery!
// Check if the current month on user device is December...
if (new Date().getMonth() === 11) {
// Enable the christmas functions! Happy holidays from Wruczek! :D
// Load and enable the christmas theme
var stylesheet = document.createElement('link');
stylesheet.href = 'css/christmas-theme.css';
stylesheet.rel = 'stylesheet';
document.head.appendChild(stylesheet);
// Load and enable the snow
var script = document.createElement('script');
script.src = 'https://cdnjs.cloudflare.com/ajax/libs/JQuery-Snowfall/1.7.4/snowfall.jquery.min.js';
document.head.appendChild(script);
// Wait for the snowfall script and jQuery to load
window.addEventListener('load', function () {
$(document).snowfall({
flakeCount: 500,
flakeIndex: -1,
minSize: 4,
maxSize: 5,
minSpeed: 1,
maxSpeed: 2,
round: true,
shadow: true
});
// Change background artist in the footer
$('#background-artist').html('<a href="http://www.publicdomainpictures.net/view-image.php?image=28562&picture=christmas-bulbs-red-background">Debi Geroux - Public Domain</a>');
});
}

View File

@ -1,10 +1,17 @@
$(function () {
$('[data-toggle="tooltip"]').tooltip({"html": true})
})
$(document).ready(function () {
"use strict";
// Bootstrap tooltips initialization
$('[data-toggle="tooltip"]').tooltip({
"html": true
});
// Add "Show more" button to news panels
$('.news-body').readmore({
speed: 500,
collapsedHeight: 300,
moreLink: '<button type="button" class="btn btn-dark"><i class="fa fa-plus-circle" aria-hidden="true"></i> ' + textShowMore + '</button>',
lessLink: '<button type="button" class="btn btn-dark"><i class="fa fa-minus-circle" aria-hidden="true"></i> ' + textShowLess + '</button>'
});
$('.news-body').readmore({
speed: 500,
collapsedHeight: 300,
moreLink: '<button type="button" class="btn btn-dark"><i class="fa fa-plus-circle" aria-hidden="true"></i> ' + textShowMore + '</button>',
lessLink: '<button type="button" class="btn btn-dark"><i class="fa fa-minus-circle" aria-hidden="true"></i> ' + textShowLess + '</button>'
});