-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.js
More file actions
26 lines (23 loc) · 673 Bytes
/
main.js
File metadata and controls
26 lines (23 loc) · 673 Bytes
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
$(document).ready(function () {
function loadingWait() {
return Math.random() * 3000;
}
var ui = {
$prompt: $(".js-prompt"),
$findOutButton: $(".js-find-out-button"),
$loadingIndicator: $(".js-loading-indicator"),
$result: $(".js-result"),
$tryAgain: $(".js-try-again"),
};
ui.$findOutButton.click(function () {
ui.$prompt.addClass("u-displayNone");
ui.$loadingIndicator.removeClass("u-displayNone");
setTimeout(function () {
ui.$loadingIndicator.addClass("u-displayNone");
ui.$result.removeClass("u-displayNone");
}, loadingWait());
});
ui.$tryAgain.click(function () {
location.reload();
});
});