This repository has been archived by the owner on Jan 18, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
demodays.html
135 lines (121 loc) · 4.95 KB
/
demodays.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
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
<!DOCTYPE html>
<html lang="en">
<head>
<title>Swiss Open Data Alps</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<link rel="stylesheet" type="text/css" href="res/main.css">
</head>
<body>
<div class="help" id="helpbox">
<button class="close" onclick="document.getElementById('helpbox').style.display = 'none';">×</button>
Click and drag to turn, use your mousewheel to zoom
</div>
<div class="ghost" id="ghost" style="display:none">
<a href="http://make.opendata.ch" target="_blank"><img src="res/okcon1.png"></a><br/>
<a href="http://okcon.org" id="okcon" target="_blank"><img src="res/okcon2.png"></a>
</div>
<div class="legend" id="legendbox">
<a href="http://make.opendata.ch/wiki/project:dataalps" target="_blank" style="float:left">
<img src="res/opendata_logo2.png">
</a>
<a href="http://github.com/loleg/dataalps" target="_blank" style="float:right">
<img src="res/github-256-black.png">
</a>
<div class="title">
<span>Swiss Open Data Alps</span>
<a href="http://demodays.org" target="_blank">#Demodays2013 Edition</a>
</div>
<div class="toolbar" style="display:inline-block">
<span>
<button class="maplabels">Labels</button>
<button class="heatmap">Heatmap</button>
<button class="heightmap">Heightmap</button>
</span><span> <font size="4px">♙</font>
<a href="http://www.bfs.admin.ch/bfs/portal/de/index/themen/01.html" target="_blank">Population</a>:
<button class="population radio" data-year="2013">2013</button>
<button class="population radio" data-year="2023">2023</button>
<button class="population radio" data-year="2033">2033</button>
</span><span> <font size="4px">♯</font>
<a href="https://soundcloud.com/patsch/hafenplatz-basel" target="_blank">Soundscape</a>:
<button class="audio on">Playing ...</button>
</span>
</div>
</div>
<div id="map" style="position:absolute;top:0px;left:0px;display:none"></div>
<div class="labels" style="display:none"></div>
<script src="lib/three/three.min.js"></script>
<!--<script src="lib/three/libs/stats.min.js"></script>-->
<script src="lib/three/controls/OrbitControls.js"></script>
<script src="lib/three/Detector.js"></script>
<script src="lib/three/ShaderTerrain.js"></script>
<script src="lib/d3/d3.v2.js"></script>
<script src="lib/d3/d3-threeD.js"></script>
<script src="lib/fit-projection.js"></script>
<script src="lib/ParticleEngine.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="lib/jquery-1.9.1.min.js"><\/script>')</script>
<script src="js/config.js"></script>
<script src="js/heightmap.js"></script>
<script src="js/render.js"></script>
<script src="js/ui.js"></script>
<script src="js/features.js"></script>
<script src="js/data.js"></script>
<script src="js/fireworks.js"></script>
<!-- Demodays 2013 special edition -->
<style>
body { background-image:url(res/cow.png); }
.title a { text-decoration:none; color:black; font-weight:bold; }
</style>
<script>
/** Set up audio control */
var audio = document.createElement( 'audio' );
audio.src = 'res/hafenplatz.ogg';
audio.style.opacity = 0;
audio.controls = false;
document.body.appendChild( audio );
audio.play();
$('button.audio').click(function() {
if (audio.paused) {
$(this).html('Playing ...').addClass('on');
audio.play();
} else {
$(this).html('Paused.').removeClass('on');
audio.pause();
}
});
var deepole, deeflag;
var deeflagTexture = THREE.ImageUtils.loadTexture("res/buenzli.png");
setTimeout(function() {
var pts = projectorGeom([7.9, 47.35]);
deepole = new THREE.Mesh(new THREE.CylinderGeometry(0.5,0.5,40),
new THREE.MeshBasicMaterial({ color: 0xff1111 }));
deepole.overdraw = true;
deepole.position.set(pts[0], 10, pts[1]);
scene.add(deepole);
var flag = new THREE.PlaneGeometry(14, 10);
flag.computeBoundingBox();
var bb = flag.boundingBox.min;
flag.applyMatrix( new THREE.Matrix4().makeTranslation( bb.x, bb.y, bb.z ) );
flag.computeBoundingBox();
deeflag = new THREE.Mesh(flag,
new THREE.MeshPhongMaterial( { color: 0xffffff, map: deeflagTexture } ))
deeflag.material.side = THREE.DoubleSide;
deeflag.material.opacity = 0.7;
deeflag.material.transparent = false;
deeflag.position.set(pts[0], 30, pts[1]);
deeflag._rsteps = 0;
scene.add(deeflag);
}, 500);
function animator() {
if (typeof deeflag == 'undefined') return;
if (deeflag._rsteps == 0) {
deeflag._rspeed = (Math.random()*0.2)-0.1;
deeflag._rsteps = parseInt(Math.random()*15);
}
deeflag.rotation.y += deeflag._rspeed;
deeflag._rsteps--;
}
</script>
</body>
</html>