-
Notifications
You must be signed in to change notification settings - Fork 1
/
kodlar.js
70 lines (55 loc) · 2.02 KB
/
kodlar.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
67
68
69
70
$(window).load(function () {
var body = $("body"),
universe = $("#universe"),
solarsys = $("#solar-system");
var init = function () {
body.removeClass('view-2D opening').addClass("view-3D").delay(2000).queue(function () {
$(this).removeClass('hide-UI').addClass("set-speed");
$(this).dequeue();
});
};
var setView = function (view) { universe.removeClass().addClass(view); };
$("#toggle-data").click(function (e) {
body.toggleClass("data-open data-close");
e.preventDefault();
});
$("#toggle-controls").click(function (e) {
body.toggleClass("controls-open controls-close");
e.preventDefault();
});
$("#data a").click(function (e) {
var ref = $(this).attr("class");
solarsys.removeClass().addClass(ref);
$(this).parent().find('a').removeClass('active');
$(this).addClass('active');
e.preventDefault();
});
$(".set-view").click(function () { body.toggleClass("view-3D view-2D"); });
$(".set-zoom").click(function () { body.toggleClass("zoom-large zoom-close"); });
$(".set-speed").click(function () { setView("scale-stretched set-speed"); });
$(".set-size").click(function () { setView("scale-s set-size"); });
$(".set-distance").click(function () { setView("scale-d set-distance"); });
init();
});
function openCity(evt, cityName) {
var i, tabcontent, tablinks;
tabcontent = document.getElementsByClassName("tabcontent");
for (i = 0; i < tabcontent.length; i++) {
tabcontent[i].style.display = "none";
}
tablinks = document.getElementsByClassName("tablinks");
for (i = 0; i < tablinks.length; i++) {
tablinks[i].className = tablinks[i].className.replace(" active", "");
}
document.getElementById(cityName).style.display = "block";
evt.currentTarget.className += " active";
}
$('#myModal').on('shown.bs.modal', function () {
$('#myInput').trigger('focus')
})
function openForm() {
document.getElementById("myForm").style.display = "block";
}
function closeForm() {
document.getElementById("myForm").style.display = "none";
}