-
Notifications
You must be signed in to change notification settings - Fork 462
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
196 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
<!doctype html> | ||
<html> | ||
|
||
<head> | ||
<meta charset="utf-8" /> | ||
<title>Object destroy</title> | ||
<meta name="viewport" content="width=device-width"> | ||
<style> | ||
.container { | ||
width: 450px; | ||
margin: 50px auto 0 auto; | ||
text-align: center; | ||
} | ||
|
||
.gauge { | ||
width: 450px; | ||
height: 350px; | ||
border: 1px solid grey; | ||
} | ||
|
||
a:link.button, | ||
a:active.button, | ||
a:visited.button, | ||
a:hover.button { | ||
margin: 30px auto 0 auto; | ||
padding: 10px 13px; | ||
display: block; | ||
font-family: 'Arial'; | ||
width: 200px; | ||
border-radius: 3px; | ||
cursor: pointer; | ||
} | ||
</style> | ||
</head> | ||
|
||
<body> | ||
<div class="container" id="container"> | ||
<div id="jg1" class="gauge"></div> | ||
<a href="#" id="jg1_create" class="button grey">Create object</a> | ||
<a href="#" id="jg1_destroy" class="button grey" style="display:none">Destroy object</a> | ||
</div> | ||
<script src="../raphael-2.1.4.min.js"></script> | ||
<script src="../justgage.js"></script> | ||
<script> | ||
|
||
document.addEventListener("DOMContentLoaded", function(event) { | ||
|
||
var jg1; | ||
|
||
document.getElementById('jg1_create').addEventListener('click', function() { | ||
jg1 = new JustGage({ | ||
id: "jg1", | ||
title: "", | ||
value: 50, | ||
min: 0, | ||
max: 100, | ||
decimals: 0, | ||
gaugeWidthScale: 0.6 | ||
}); | ||
document.getElementById('jg1_create').style.display = 'none'; | ||
document.getElementById('jg1_destroy').style.display = 'block'; | ||
|
||
}); | ||
|
||
document.getElementById('jg1_destroy').addEventListener('click', function() { | ||
jg1.destroy(); | ||
document.getElementById('jg1_create').style.display = 'block'; | ||
document.getElementById('jg1_destroy').style.display = 'none'; | ||
}); | ||
|
||
}); | ||
</script> | ||
</body> | ||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
<!doctype html> | ||
<html> | ||
|
||
<head> | ||
<meta charset="utf-8" /> | ||
<title>Custom Render Function</title> | ||
<style> | ||
.container { | ||
margin: 0 auto; | ||
text-align: center; | ||
} | ||
|
||
.gauge_container { | ||
text-align: left; | ||
height: 450px; | ||
display: inline-block; | ||
border: 1px solid #ccc; | ||
margin: 40px 5px 0 5px; | ||
} | ||
|
||
.gauge { | ||
width: 300px; | ||
height: 200px; | ||
display: inline-block; | ||
-webkit-transform: translate3d(0, 0, 0); | ||
} | ||
|
||
.controls { | ||
text-align: left; | ||
} | ||
|
||
li { | ||
padding: 10px 0 0 0; | ||
} | ||
|
||
li.refresh { | ||
border-top: 1px solid #eee; | ||
border-bottom: 1px solid #eee; | ||
padding-top: 15px; | ||
padding-bottom: 15px; | ||
} | ||
|
||
label { | ||
font-family: Arial; | ||
display: inline-block; | ||
width: 65px; | ||
margin: 0 0 5px 0; | ||
text-align: right; | ||
padding: 5px; | ||
color: #919191; | ||
} | ||
|
||
input { | ||
font-weight: bold; | ||
font-size: 13px; | ||
padding: 10px; | ||
border: 1px solid #ccc; | ||
margin: 5px; | ||
} | ||
|
||
input[disabled=disabled] { | ||
font-weight: normal; | ||
font-size: 11px; | ||
padding: 0 0 0 10px; | ||
margin: 0px; | ||
color: #777777; | ||
border-color: transparent; | ||
background: #fff; | ||
} | ||
|
||
a:link.button, | ||
a:active.button, | ||
a:visited.button, | ||
a:hover.button { | ||
margin: 0px 5px 0 2px; | ||
padding: 7px 13px; | ||
} | ||
</style> | ||
</head> | ||
|
||
<body> | ||
<div id="jg1" style="width: 200px; height: 150px;"></div> | ||
<a href="#" id="jg1_refresh" class="button grey">Random Refresh</a> | ||
<script src="../raphael-2.1.4.min.js"></script> | ||
<script src="../justgage.js"></script> | ||
<script> | ||
document.addEventListener("DOMContentLoaded", function(event) { | ||
var maxx = 100; | ||
|
||
var jg1 = new JustGage({ | ||
id: "jg1", | ||
value: 50, | ||
min: 0, | ||
max: maxx, | ||
title: "Score", | ||
label: "", | ||
pointer: true, | ||
textRenderer: function(val) { | ||
return (val + '/' + maxx); | ||
}, | ||
onAnimationEnd: function() { | ||
console.log('f: onAnimationEnd()'); | ||
} | ||
}); | ||
|
||
document.getElementById('jg1_refresh').addEventListener('click', function() { | ||
jg1.refresh(getRandomInt(0, 100)); | ||
return false; | ||
}); | ||
}); | ||
</script> | ||
</body> | ||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters