-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
92 lines (92 loc) · 4.77 KB
/
index.html
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
<html>
<head>
<title>Tic Tac Toe</title>
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="stylesheet" href="style.css">
<script src="script.js" defer></script>
</head>
<body>
<script>
document.body.onload = ()=>{
//resizing part
let f = () => {
let mw_WIDTH = window.innerWidth, mw_HEIGHT = window.innerHeight
let GAME_WINDOW = document.getElementById("game-window")
if (mw_WIDTH <= mw_HEIGHT) {
GAME_WINDOW.style.width = ""
GAME_WINDOW.style.height = ""
GAME_WINDOW.style.position = "absolute"
GAME_WINDOW.style.top = GAME_WINDOW.style.bottom = GAME_WINDOW.style.left = GAME_WINDOW.style.right = "0vw"
}
else {
GAME_WINDOW.style.position = "absolute"
GAME_WINDOW.style.top = "0vw"
GAME_WINDOW.style.bottom = "0vw"
//let c = (((mw_WIDTH-mw_HEIGHT)*50)/mw_WIDTH).toString()
GAME_WINDOW.style.left = GAME_WINDOW.style.right = (((mw_WIDTH - mw_HEIGHT) * 50) / mw_WIDTH).toString() + "vw"
}
}
document.defaultView.onresize = ()=>{
let mw_WIDTH = window.innerWidth, mw_HEIGHT = window.innerHeight
let GAME_WINDOW = document.getElementById("game-window")
if (mw_WIDTH <= mw_HEIGHT) {
GAME_WINDOW.style.width = ""
GAME_WINDOW.style.height = ""
GAME_WINDOW.style.position = "absolute"
GAME_WINDOW.style.top = GAME_WINDOW.style.bottom = GAME_WINDOW.style.left = GAME_WINDOW.style.right = "0vw"
}
else {
GAME_WINDOW.style.position = "absolute"
GAME_WINDOW.style.top = "0vw"
GAME_WINDOW.style.bottom = "0vw"
//let c = (((mw_WIDTH-mw_HEIGHT)*50)/mw_WIDTH).toString()
GAME_WINDOW.style.left = GAME_WINDOW.style.right = (((mw_WIDTH - mw_HEIGHT) * 50) / mw_WIDTH).toString() + "vw"
}
}
f()
}
</script>
<div id="game-window">
<!--HOME PAGE-->
<div id="homepage" style="display: none;">
<button class="gametitle">Tic Tac Toe</button>
<div class="btngroups">
<button id="hpb1" class="btn" title="You can play this game alone... with our friendly bots">Play with Bot</button>
<button id="hpb2" class="btn" title="If you want play this game with your friends... select this">Play with Friend</button>
</div>
</div>
<!--BOT LOG IN PAGE-->
<div id="playwithbotloginpage" style="display: none;">
<!--bot selection form-->
<div id="sbtf1" class="selectbotform" style="display: none;">
<div id="sbtf2" class="selectbotwin">
<div id="botlist" selection="">
<img src="robots/icons/ramanuj.jpg" alt="ramanuj" class="bot botbtn">
<img src="robots/icons/brinda.jpg" alt="brinda" class="bot botbtn">
<img src="robots/icons/yishu.jpg" alt="yishu" class="bot botbtn">
<img src="robots/icons/shridhar.jpg" alt="shridhar" class="bot botbtn">
<img src="robots/icons/mrinalini.jpg" alt="mrinalini" class="bot botbtn">
<img src="robots/icons/sarathi.jpg" alt="sarathi" class="bot botbtn">
</div>
<button id="sbtfbtn" class="botbtn">
Close
</button>
</div>
</div>
<div id="playwithbotloginpage2">
<div class="topnavbar">
<button id="botlnbtn1" class="navback">
Back
</button>
<div class="blanknav"></div>
</div>
<div class="botloginform">
<input id="botlnip" type="text" placeholder="User id (e.g. user123)" class="botinput">
<button id="botlnbtn2" class="botbtn" value="">Select Bot</button>
<button id="botlnbtn3" class="botbtn">Play Game</button>
</div>
</div>
</div>
</div>
</body>
</html>