mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-06 13:11:13 -07:00
First commit to new site
This commit is contained in:
parent
637547a51c
commit
d570b3ff1a
22 changed files with 645 additions and 0 deletions
74
js/javascript.js
Normal file
74
js/javascript.js
Normal file
|
@ -0,0 +1,74 @@
|
|||
(function($) {
|
||||
$.fn.fitText = function(kompressor, options) {
|
||||
var compressor = kompressor || 1,
|
||||
settings = $.extend({
|
||||
'minFontSize': Number.NEGATIVE_INFINITY,
|
||||
'maxFontSize': Number.POSITIVE_INFINITY
|
||||
}, options);
|
||||
return this.each(function() {
|
||||
var $this = $(this);
|
||||
var resizer = function() {
|
||||
$this.css('font-size', Math.max(Math.min($this.width() / (compressor * 10), parseFloat(settings.maxFontSize)), parseFloat(settings.minFontSize)));
|
||||
};
|
||||
resizer();
|
||||
$(window).on('resize.fittext orientationchange.fittext', resizer);
|
||||
});
|
||||
};
|
||||
})($);
|
||||
|
||||
// Smooth scrolling when clicking anchor
|
||||
$('a[href*="#"]')
|
||||
.not('[href="#"]')
|
||||
.not('[href="#0"]')
|
||||
.click(function(event) {
|
||||
if (
|
||||
location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') &&
|
||||
location.hostname == this.hostname
|
||||
) {
|
||||
var target = $(this.hash);
|
||||
target = target.length ? target : $('[name=' + this.hash.slice(1) + ']');
|
||||
if (target.length) {
|
||||
event.preventDefault();
|
||||
$('html, body').animate({
|
||||
scrollTop: target.offset().top
|
||||
}, 1000, function() {
|
||||
var $target = $(target);
|
||||
$target.focus();
|
||||
if ($target.is(":focus")) {
|
||||
return false;
|
||||
} else {
|
||||
$target.attr('tabindex', '-1');
|
||||
$target.focus();
|
||||
};
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// Fit long h1 on small screen
|
||||
$("h1").fitText(1.2, {
|
||||
'maxFontSize': 30
|
||||
});
|
||||
|
||||
// enable screenshot lightbox
|
||||
var lightbox = $('.screenshots a').simpleLightbox();
|
||||
|
||||
// only after all images have loaded
|
||||
$(window).on('load', function() {
|
||||
$('body').addClass('load-done'); // unfold triangles etc
|
||||
/*! slides | https://gist.github.com/mhulse/66bcbb7099bb4beae530 */
|
||||
(function($) {
|
||||
'use strict';
|
||||
var $slides = $('[data-slides]');
|
||||
var images = $slides.data('slides');
|
||||
var count = images.length;
|
||||
var slideshow = function() {
|
||||
$slides
|
||||
.css('background-image', 'url("' + images[Math.floor(Math.random() * count)] + '")')
|
||||
.show(0, function() {
|
||||
setTimeout(slideshow, 5000);
|
||||
});
|
||||
};
|
||||
slideshow();
|
||||
}(jQuery));
|
||||
})
|
Loading…
Add table
Add a link
Reference in a new issue