This repository has been archived by the owner on Jun 16, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.php
103 lines (86 loc) · 2.76 KB
/
index.php
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
<?PHP
$title = "";
include "header.php";
if ($local) {?>
<script src="lib/three.min.js"></script>
<script src="lib/d3.min.js"></script>
<script src="lib/TweenMax.min.js"></script>
<script src="js/data.js"></script>
<script src="js/parser.js"></script>
<script src="js/ui.js"></script>
<script src="js/svg.js"></script>
<script src="js/countdown.js"></script>
<script src="js/webgl.js"></script>
<?PHP } else {?>
<script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r77/three.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/gsap/latest/TweenMax.min.js"></script>
<?PHP }?>
<!--
Made by Rauri Rochford
Unbiased Queenslander
Contact: @raurir
Open source at: https://github.com/raurir/StatsOfOrigin
-->
</head>
<body style='overflow:hidden;'>
<div id='container'>
<!-- <div id='orientation'>Rotate device</div> -->
<div id='header'>
<div id='debug'></div>
<h1>Stats Of Origin - State of Origin Statistics 1982 - 2020</h1>
<h4 id='stat'></h4>
</div>
<div class='button-show-state button' id='show-NSW'>NSW</div>
<div class='button-show-state button' id='show-QLD'>QLD</div>
<div id='webglcontainer'></div>
<svg id="svgcontainer"></svg>
<div id="buttons">
<h4 id='buttons-help'></h4>
<a id="about" href="about.html" class="button">About</a>
</div>
</div>
<script type="text/javascript">
var debug = document.getElementById("debug");
</script>
<!-- mostly lifted from: view-source:http://threejs.org/examples/webgl_shader2.html -->
<script id="vertexShader" type="x-shader/x-vertex">
varying vec2 vUv;
void main()
{
vUv = uv;
vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );
gl_Position = projectionMatrix * mvPosition;
}
</script>
<script id="fragmentShader" type="x-shader/x-fragment">
uniform float time;
uniform float red;
uniform float green;
uniform float blue;
uniform float index;
// uniform vec2 resolution;
varying vec2 vUv;
void main( void ) {
vec2 position = abs(-1.0 + 2.0 * vUv);
float undulation = abs(sin(time + index));
float edging = abs((pow(position.y, 5.0) + pow(position.x, 5.0)) / 2.0);
float perc = 0.2 + undulation * 0.2 + edging * 0.6;
float r = red * perc;
float g = green * perc;
float b = blue * perc;
gl_FragColor = vec4( r, g, b, 1.0 );
}
</script>
<?PHP
if ($local) {
?>
<script src="js/origin.js"></script>
<?PHP
} else {
?>
<script src="js/origin.min.js"></script>
<?PHP
}
include "footer.php";
?>