-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrays.html
54 lines (51 loc) · 1.73 KB
/
rays.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
<html>
<head>
<title></title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script src="js/jquery.rayzr.js"></script>
<style type="text/css">
body {margin: 0; padding: 0; background-color: orange;}
#rayzr {position: relative; width: 100%; height: 100%; overflow: hidden;}
.ray {width: 100%; height: 80px; position: absolute;}
.control {position: absolute; padding: 10px; margin: 10px; background-color: white; border: 0px solid blue; border-radius: 20px; z-index: 100; box-shadow: 0px 0px 20px #000;}
.control h1 {margin: 0px; border-bottom: 2px solid #333; font: bold 24px Arial; line-height: 25px; color: #333; margin-bottom: 5px;}
.control input {width: 60px;}
</style>
<script type="text/javascript">
$(function() {
$('input[name=x]').val($('#rayzr').width() / 2);
$('input[name=y]').val($('#rayzr').height() / 2);
$("#raysControl").change(function() {
$('#rayzr').rayzr({segmentsCount: this.value, center: {x: $('input[name=x]').val(), y: $('input[name=y]').val()}});
}).click(function () {// fix chrome numeric stepper
$(this).trigger("change");
}).trigger("change");
$("input[name=y], input[name=x]").change(function () {
$("#raysControl").trigger("change");
}).click(function () {
$("#raysControl").trigger("change");
});
});
</script>
</head>
<body>
<div class="control">
<h1>Sun control</h1>
<table>
<tr>
<td>Rays count</td>
<td><input style="float: right;" id="raysControl" type="number" value="24"/></td>
</tr>
<tr>
<td>Center X</td>
<td><input type="number" name="x"/></td>
</tr>
<tr>
<td>Center Y</td>
<td><input type="number" name="y"/></td>
</tr>
</table>
</div>
<div id="rayzr"></div>
</body>
</html>