-
Notifications
You must be signed in to change notification settings - Fork 0
/
arpg.html
142 lines (116 loc) · 4.77 KB
/
arpg.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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Diablo-style item name generator</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<!-- Le styles -->
<link href="../style/bootstrap.css" rel="stylesheet">
<style>
/* Lets override some of the Bootstrap styles */
body {
padding-top: 60px; /* 60px to make the container go all the way to the bottom of the topbar */
font-family: 'IM Fell English SC', serif;
}
.navbar-search .search-query {
font-family: 'IM Fell English SC', serif;
}
.btn-xlarge {
padding: 16px 18px;
font-size: 28px;
line-height: normal;
-webkit-border-radius: 8px;
-moz-border-radius: 8px;
border-radius: 8px;
}
</style>
<link href="../style/bootstrap-responsive.css" rel="stylesheet">
<link href='http://fonts.googleapis.com/css?family=IM+Fell+English+SC' rel='stylesheet' type='text/css'>
<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<!-- Fav and touch icons -->
<link rel="shortcut icon" href="images/theft_16x16.ico">
</head>
<body>
<SCRIPT LANGUAGE="JavaScript">
<!--
adjectivesList = new XMLHttpRequest();
adjectivesList.open("GET",'adjectives',false);
adjectivesList.send(null);
adjectivesArray = adjectivesList.responseText.split('\n');
nounsList = new XMLHttpRequest();
nounsList.open("GET",'nouns',false);
nounsList.send(null);
nounsArray = nounsList.responseText.split('\n');
suffixesList = new XMLHttpRequest();
suffixesList.open("GET",'suffixes',false);
suffixesList.send(null);
suffixesArray = suffixesList.responseText.split('\n');
function randomItem(){
document.getElementById('item_image').src = "images/cc_chest_32x32.png";
var adjective = adjectivesArray[Math.floor(Math.random()*adjectivesArray.length)]
var noun = nounsArray[Math.floor(Math.random()*nounsArray.length)]
var suffix = suffixesArray[Math.floor(Math.random()*suffixesArray.length)]
var item = adjective + " " + noun + " of " + suffix
//alert(item);
document.getElementById('item_name').innerHTML = item;
var item_pic = "images/" + noun + ".png"
var response = UrlExists(item_pic)
if (response == true)
{document.getElementById('item_image').src = item_pic;}
}
function UrlExists(url)
{
var http = new XMLHttpRequest();
http.open('HEAD', url, false);
http.send();
return http.status!=404;
}
// -->
</script>
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</a>
<a class="brand" href="#">Diablo-style item name generator</a>
<div class="nav-collapse collapse">
<ul class="nav">
<li class="active"><a href="#">Home</a></li>
<li><a href="https://github.com/keithzg/diablo-item-name-generator">Github</a></li>
</ul>
</div><!--/.nav-collapse -->
</div>
</div>
</div>
<div class="container">
<p><input type='button' class="btn btn-xlarge btn-warning" onclick='randomItem()' value="Loot!"/></p>
<p><h3><i>You have found:</i></h3></p>
<p><h1><strong id='item_name'>?</strong></h1></p>
<p><img src="images/cc_chest_32x32.png" id="item_image">
</div> <!-- /container -->
<!-- Le javascript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="../script/jquery.js"></script>
<script src="../script/bootstrap-transition.js"></script>
<script src="../script/bootstrap-alert.js"></script>
<script src="../script/bootstrap-modal.js"></script>
<script src="../script/bootstrap-dropdown.js"></script>
<script src="../script/bootstrap-scrollspy.js"></script>
<script src="../script/bootstrap-tab.js"></script>
<script src="../script/bootstrap-tooltip.js"></script>
<script src="../script/bootstrap-popover.js"></script>
<script src="../script/bootstrap-button.js"></script>
<script src="../script/bootstrap-collapse.js"></script>
<script src="../script/bootstrap-carousel.js"></script>
<script src="../script/bootstrap-typeahead.js"></script>
</body>
</html>