-
Notifications
You must be signed in to change notification settings - Fork 0
/
enterName_gujarati.html
106 lines (102 loc) · 3.93 KB
/
enterName_gujarati.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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="style/enterName.css">
<title>તમારી વિગત દાખલ કરો</title>
<style type="text/css">
</style>
</head>
<body>
<div id="header">
<div id="logo">Edutainer's</div>
<div id="back"><a href="index.html">ભાષા બદલો</a></div>
</div>
<div id="content">
<div id="screen"></div>
<div id="error">
<h2>સાવધાન!</h2>
<ul id="errorData"> </ul>
</div>
<div id="mainContent">
<div id="inputbox">
<input type="text" name="name" id="name" placeholder="તમારું નામ ટાઈપ કરો"> </div>
<div id="iconBox">
<div id="iconContainer"></div>
<button id="submitButton" onclick="setUser()">ચાલો રમવા</button>
</div>
</div>
</div>
</body>
<script src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/custom.js"></script>
<script>
/************************************************************************************/
$(document).ready(function () {
checkOldUser();
});
/************************************************************************************/
function checkOldUser() {
if (getCookie("name") != "" && getCookie("icon") != "") {
window.location.assign("selectCategory_gujarati.html");
}
else {
loadIcons();
}
}
/************************************************************************************/
function setUser() {
$('#errorData').empty();
if ($('#name').val().length == 0 || getCookie('icon') == "") {
$('#screen').fadeIn('fast', function () {
$('#error').animate({
"top": "0px"
}, 500);
});
if ($('#name').val().length == 0) {
$('#errorData').append("<li>તમારું નામ લખો");
}
if (getCookie('icon') == "") {
$('#errorData').append("<li>કોઈપણ એક આઇકોન પસંદ કરો");
}
setTimeout(function () {
$('#error').animate({
"top": "-100%"
}, 500, function () {
$('#screen').fadeOut('fast');
});
}, 5000);
}
else {
setCookie('name', $('#name').val(), 365);
window.location.assign("selectCategory_gujarati.html");
}
}
/************************************************************************************/
function loadIcons() {
total = 88;
currentSelectedIcon = null;
for (var i = 0; i < total; i++) {
var imgId = "0";
var imgNum = i + 1;
var div = $("<div/>", {
'id': imgNum
, 'class': "icon"
}).appendTo("#iconContainer");
if ((i + 1) < 10) {
imgId = imgId + "0";
}
var img = $("<img/>", {
'src': "img/icons/" + imgId + imgNum + ".png"
}).appendTo(div);
div.on('click', function () {
$(currentSelectedIcon).removeClass("selectedIcon");
currentSelectedIcon = this;
$(this).addClass("selectedIcon");
setCookie("icon", imgId + this.id, 365);
});
}
}
/************************************************************************************/
</script>
</html>