-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathponyseeker.js
66 lines (55 loc) · 1.73 KB
/
ponyseeker.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
var ponyseeker = ponyseeker || {};
ponyseeker.resizeVideo = ponyseeker.resizeVideo || function() {
var helperVideo = $('#helper-video');
var width = helperVideo.width();
helperVideo.css('height', (width * 5) / 8);
var helperVideo2 = $('#helper-video-2');
var width = helperVideo2.width();
helperVideo2.css('height', (width * 5) / 8);
};
ponyseeker.showPage = ponyseeker.showPage || function(pageSelector) {
$(".page").hide();
if (!pageSelector) {
pageSelector = "#about-ponyseeker";
}
var $page = $(pageSelector);
if ($page.lengh < 1) {
$page = $("#about-ponyseeker");
pageSelector = "#about-ponyseeker";
} else if (pageSelector.substring(0, 8) === "#version") {
$page = $("#patch-notes");
pageSelector = "#patch-notes";
}
$page.show();
$(".pony-link").parent().removeClass("selected");
$('a[href="' + pageSelector + '"]').parent().addClass("selected");
ponyseeker.resizeVideo();
};
ponyseeker.hideVertMenu = ponyseeker.hideVertMenu || function() {
$("#vert-menu-x").css("display", "none");
$("#vert-menu").hide();
$("#hamburger-icon").show();
};
$(document).ready(function(){
var currentPage = window.location.hash;
ponyseeker.showPage(currentPage);
ponyseeker.resizeVideo();
setTimeout(ponyseeker.resizeVideo, 300);
$(window).resize(ponyseeker.resizeVideo);
$(".pony-link").on('click', function(e) {
var pageHref = $(this).attr("href");
ponyseeker.showPage(pageHref);
e.preventDefault();
window.location.hash = this.hash;
ponyseeker.hideVertMenu();
$("html, body").scrollTop(0);
});
$("#hamburger-icon").on('click', function() {
$(this).hide();
$("#vert-menu").show();
$("#vert-menu-x").css("display", "inline");
});
$("#vert-menu-x").on('click', function() {
ponyseeker.hideVertMenu();
});
});