-
Notifications
You must be signed in to change notification settings - Fork 0
/
variables.js
50 lines (43 loc) · 2.01 KB
/
variables.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
const API_URL = document.getElementById("apiUrl");
const token = document.getElementById("token");
const refreshToken = document.getElementById("refresh-token");
const wheelId = document.getElementById("wheelId");
const startDate = document.getElementById("start-date");
// Loading
const loading = document.getElementById("loading");
const loadingImg = document.getElementById("loading-img");
const loadingError = document.getElementById("loading-error");
const btnLoadingError = document.getElementById("loading-error-button");
// Content
const imageLoadedFlags = Array(9).fill(false);
const TIME_OUT_RENDER = 30; // 30s
const playCount = document.getElementById("play-count");
const countShare = document.getElementById("count-share");
const gameTitle = document.getElementById("game-title");
const wheelWrapper = document.getElementById("wheel-wrapper");
const turns = document.getElementById("turns");
const missions = document.getElementById("missions");
const endGame = document.getElementById("end-game");
const bgBody = document.getElementById("bg-body");
// Scripts.js file
const wheel = document.querySelector(".wheel");
const btnSpin = document.querySelector(".btn-spin");
const btnBack = document.getElementById("btn-back");
const btnGuide = document.getElementById("btn-guide");
const btnGift = document.getElementById("btn-gift");
const btnShare = document.getElementById("btn-share");
let isWheelStopped = true;
let totalDegree = 0;
let gifts = [];
let sectionsSortedByDegree = [];
// Gift modal
const iconClose = document.getElementById("close-icon");
const modal = document.getElementById("modal");
const imgSuccess = document.getElementById("img-success");
const imgSpin = document.getElementById("img-spin");
const textSuccess = document.getElementById("text-success");
const btnViewGift = document.getElementById("view-gift");
const btnContinueSpin = document.getElementById("continue-spin");
const btnUnderstand = document.getElementById("understand");
// Prevent modal
const preventModal = document.getElementById("modal-prevent");