[Javascript][Source]Arena calculator menu

User Tag List

Results 1 to 3 of 3
  1. #1
    WakkaHakka's Avatar Member
    Reputation
    1
    Join Date
    Jan 2009
    Posts
    5
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [Javascript][Source]Arena calculator

    Just thought I'd post the source for an Arena Calculator I made a while back in Javascript, hopefully someone might be able to learn from it or even use it!

    It uses CSS for the layout and style and does the calculations realtime :-)

    Heres a live demo: http://decelo.ulmb.com

    index.html
    HTML Code:
    <html> 
    	<head> 
    		<script src="arena.js"></script> 
    		<link rel="stylesheet" type="text/css" href="style.css" /> 
    	</head> 
    	<body>  
    		<div class="content"> 
    		<h>Arena Claculator</h> 
    		<hr /> 
    		<br /> 
    		<div id="points2">2v2 Points......0</div> 
    		<div id="points3">3v3 Points......0</div> 
    		<div id="points5">5v5 Points......0</div> 
    		<br /> 
    		<FORM NAME = formRating> 
    			Rating: <input class="input" type="text" method="post" name="Ratings" value="0" id="fname" onkeypress="updateAll(this.id)" onkeyup="updateAll(this.id)" onClick="javascript:select();"> 
    		</FORM> 
    		</div> 
    	</body> 
    </html>

    arena.js
    Code:
    function calcPoints(rating,size)
    {
    if (isNaN(rating))
    	return 0;
    var points = 0;
    if (rating < 1500)
    {
    	points =  (0.22 * rating + 14);
    }
    else
    {
    	points =  (1511.26 / (1 + 1639.28 * Math.pow(2.71828,(-0.00412 * rating))));
    }
    if (points < 0)
    	return 0;
    else if (size == 2)
    	return Math.floor(points * 0.76);
    else if (size == 3)
    	return Math.floor(points * 0.88);
    
    else if (size == 5)
    	return Math.floor(points)
    }
    
    function update(x,size)
    {
    var y = document.getElementById(x).value;
    var rating;
    rating = parseInt(y);
    if (y=="")
    {
    document.getElementById('points'+size).innerHTML = size + "v" + size + " Points......0";
    }
    else
    {
    document.getElementById('points'+size).innerHTML = size + "v" + size + " Points......" + calcPoints(rating,size);
    }
    }
    
    function updateAll(rating)
    {
    update(rating,2);
    update(rating,3);
    update(rating,5);
    }
    style.css
    Code:
    body
    {
    	background: #ebebeb;
    	text-align:center;
    }
    
    .container
    {
    	position: relative;
    }
    
    .content
     {
    	border: 1px solid #9e9e9e;
    	padding:5px;
    	margin:auto;
    	padding-top:15px;
    	padding-bottom:15px;
    	font-family:verdana,tahoma;
    	font-weight:normal;
    	color:#9e9e9e;
    	font-size:12px;
    	text-align:center;
    	width:250px;
    	position: relative;
    	top:200px;
    }
    
    .content h
    {
    	font-weight:bold;
    	font-family:verdana,tahoma;
    	color:#9e9e9e;
    	font-size:18px;
    }
    
    .content hr
    {
    	height: 1px;
    	border: 0px;
    	background-color: #9E9E9E;
    	color: #9E9E9E;
    }
    
    .content div
    {
    	font-size:15px;
    	text-align: center;
    }
    
    .content form
    {
    	font-size:15px;
    	text-align: center;
    }
    
    .input
    {
    	color: #9e9e9e;
    	background: #ebebeb;
    	border: 1px solid #9e9e9e;
    	width:60px;
    	text-align: center;
    }

    [Javascript][Source]Arena calculator
  2. #2
    Troki's Avatar Member
    Reputation
    1
    Join Date
    Feb 2009
    Posts
    2
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Good Tutorials Mate.

  3. #3
    Alexis's Avatar Member
    Reputation
    3
    Join Date
    Dec 2007
    Posts
    31
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    n1 rep for you

Similar Threads

  1. [Release] [AutoIt] Open source Arena Wintrading Bot
    By guyvrouze in forum World of Warcraft Bots and Programs
    Replies: 2
    Last Post: 11-25-2012, 01:21 AM
  2. Atlantica Online - Arena Calculator
    By Diuuude in forum MMO Exploits|Hacks
    Replies: 0
    Last Post: 11-10-2010, 01:46 AM
  3. [Addon] Arena Calculator
    By WakkaHakka in forum WoW UI, Macros and Talent Specs
    Replies: 0
    Last Post: 01-21-2009, 03:00 PM
  4. [Progam] Arena Calculator
    By cartwright in forum World of Warcraft Bots and Programs
    Replies: 14
    Last Post: 07-13-2008, 05:59 PM
  5. [Progam] Arena Calculator - nice and simple
    By cartwright in forum World of Warcraft General
    Replies: 0
    Last Post: 07-08-2008, 09:55 PM
All times are GMT -5. The time now is 02:17 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search