-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathehp-calc.html
More file actions
87 lines (77 loc) · 2.99 KB
/
ehp-calc.html
File metadata and controls
87 lines (77 loc) · 2.99 KB
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
---
layout: default
title: Team Nexus - Effective HP Calculator
---
<link rel="stylesheet" href="/css/ehp-calc.css"/>
<meta name="description" content="Calculate effective HP for some games like League of Legends or Guardian Tales."/>
</head>
<body>
<!-- Facebook Like Script -->
<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.5";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<!-- Google +1 Script -->
<script src="https://apis.google.com/js/platform.js" async defer></script>
<!-- background tint-->
<div class="overlay"></div>
<!-- awesome zoom box navbar! -->
<nav class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<div id="projects-btn" class="box">
Projects
<span class="top"></span>
<span class="right"></span>
<span class="bottom"></span>
<span class="left"></span>
<a href="http://teamnex.us/#projects" class="boxlink"></a>
</div>
</div>
</nav>
<!-- Google +1 and Facebook Like buttons -->
<div class="social">
<span class="fb-like" data-href="http://teamnex.us/ehp-calc" data-layout="button_count" data-action="like" data-show-faces="false" data-share="false" style="vertical-align:top !important"></span>
<span class="g-plusone" data-size="medium" data-annotation="bubble"></span>
</div>
<!-- Effective HP Calculator -->
<div class="title">Effective HP Calculator</div>
<form class="ehp-calc row" onsubmit="return false;">
<div class="col-md-4">
<div class="form-group">
<label for="hp-input" class="input-label">HP</label>
<input class="form-control" type="text" id="hp-input" placeholder="Enter HP">
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<label for="def-input" class="input-label">DEF</label>
<input class="form-control" id="def-input" placeholder="Enter DEF">
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<label for="ehp-output" class="input-label">Effective HP</label>
<input class="form-control" id="ehp-output" placeholder="Effective HP" readonly>
</div>
</div>
</form>
<button type="button" id="calculate-btn" class="btn" onclick="CalculateEHP()">Calculate!</button>
<script>
$('.form-control').keypress(function(event) {
if (event.keyCode == 13 || event.which == 13) {
CalculateEHP();
}
});
function CalculateEHP() {
var hp = document.getElementById('hp-input').value;
var def = document.getElementById('def-input').value;
var ehp = hp * (1 + def/100);
ehp = Math.round(ehp);
ehp = ehp.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",")
document.getElementById('ehp-output').value = ehp;
}
</script>