-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
executable file
·257 lines (214 loc) · 13.3 KB
/
index.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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no">
<title>Happy New Year</title>
<!-- Bootstrap Bootswatch theme CSS - other themes available here: https://bootswatch.com -->
<link rel="stylesheet" href="assets/css/bootstrap.min.css" />
<!-- Spinkit -->
<link rel="stylesheet" href="bower_components/SpinKit/css/spinkit.css" />
<!-- Custom CSS -->
<link rel="stylesheet" href="assets/css/style.css" />
<!-- Bootstrap JS Dependencies -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js" integrity="sha384-nvAa0+6Qg9clwYCGGPpDQLVpLNn0fRaROjHqs13t4Ggj3Ez50XnGQqc/r8MhnRDZ" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<!-- A-Frame JS Dependencies -->
<script src="https://aframe.io/releases/0.7.1/aframe.min.js"></script>
<script src="js/aframe-ar.js"></script>
<script src="dist/aframe-preloader-component.min.js"></script>
<script src="assets/js/main.js"></script>
<link href="https://fonts.googleapis.com/css?family=Amatic+SC" rel="stylesheet">
<style>
.a-enter-vr { display: none; }
</style>
</head>
<body>
<div id="preloader-modal" class="modal instructions-modal" tabindex="-1" role="dialog" style="display: none;">
<div class="modal-dialog modal-dialog__full" role="document">
<div class="modal-content vertical-align text-center">
<div class="col-md-6 col-md-offset-3">
<div class="row">
<div class="col-xs-12">
<div class="preloader-modal__spinner sk-spinner sk-rotating-plane" aria-hidden="true"></div>
</div>
</div>
<div class="row" align="left">
<div class="col-xs-12">
<span class="progress-label">Loading 0%</span>
</div>
<br />スマホを横向きにして、<br />カメラをQRコードに向けると<br />カリントウが現れます。
</div>
</div>
</div>
</div>
</div>
<div id="direction" align="right"></div>
<a-scene embedded arjs="debugUIEnabled:false; sourceType: webcam;" vr-mode-ui="enabled: false">
<a-assets>
<a-asset-item id="dog315" src="models/model-00315.obj"></a-asset-item>
<a-asset-item id="mtl315" src="models/model-00315.mtl"></a-asset-item>
<a-asset-item id="dog320" src="models/model-00320.obj"></a-asset-item>
<a-asset-item id="mtl320" src="models/model-00320.mtl"></a-asset-item>
<a-asset-item id="dog325" src="models/model-00325.obj"></a-asset-item>
<a-asset-item id="mtl325" src="models/model-00325.mtl"></a-asset-item>
<a-asset-item id="dog330" src="models/model-00330.obj"></a-asset-item>
<a-asset-item id="mtl330" src="models/model-00330.mtl"></a-asset-item>
<a-asset-item id="dog335" src="models/model-00335.obj"></a-asset-item>
<a-asset-item id="mtl335" src="models/model-00335.mtl"></a-asset-item>
<a-asset-item id="dog340" src="models/model-00340.obj"></a-asset-item>
<a-asset-item id="mtl340" src="models/model-00340.mtl"></a-asset-item>
<a-asset-item id="dog345" src="models/model-00345.obj"></a-asset-item>
<a-asset-item id="mtl345" src="models/model-00345.mtl"></a-asset-item>
<a-asset-item id="dog350" src="models/model-00350.obj"></a-asset-item>
<a-asset-item id="mtl350" src="models/model-00350.mtl"></a-asset-item>
<a-asset-item id="dog355" src="models/model-00355.obj"></a-asset-item>
<a-asset-item id="mtl355" src="models/model-00355.mtl"></a-asset-item>
<a-asset-item id="dog360" src="models/model-00360.obj"></a-asset-item>
<a-asset-item id="mtl360" src="models/model-00360.mtl"></a-asset-item>
<a-asset-item id="dog365" src="models/model-00365.obj"></a-asset-item>
<a-asset-item id="mtl365" src="models/model-00365.mtl"></a-asset-item>
<a-asset-item id="dog370" src="models/model-00370.obj"></a-asset-item>
<a-asset-item id="mtl370" src="models/model-00370.mtl"></a-asset-item>
<a-asset-item id="dog375" src="models/model-00375.obj"></a-asset-item>
<a-asset-item id="mtl375" src="models/model-00375.mtl"></a-asset-item>
<a-asset-item id="dog380" src="models/model-00380.obj"></a-asset-item>
<a-asset-item id="mtl380" src="models/model-00380.mtl"></a-asset-item>
<a-asset-item id="dog385" src="models/model-00385.obj"></a-asset-item>
<a-asset-item id="mtl385" src="models/model-00385.mtl"></a-asset-item>
<a-asset-item id="dog390" src="models/model-00390.obj"></a-asset-item>
<a-asset-item id="mtl390" src="models/model-00390.mtl"></a-asset-item>
<a-asset-item id="dog395" src="models/model-00395.obj"></a-asset-item>
<a-asset-item id="mtl395" src="models/model-00395.mtl"></a-asset-item>
<a-asset-item id="dog400" src="models/model-00400.obj"></a-asset-item>
<a-asset-item id="mtl400" src="models/model-00400.mtl"></a-asset-item>
<a-asset-item id="dog405" src="models/model-00405.obj"></a-asset-item>
<a-asset-item id="mtl405" src="models/model-00405.mtl"></a-asset-item>
<a-asset-item id="dog410" src="models/model-00410.obj"></a-asset-item>
<a-asset-item id="mtl410" src="models/model-00410.mtl"></a-asset-item>
<a-asset-item id="dog415" src="models/model-00415.obj"></a-asset-item>
<a-asset-item id="mtl415" src="models/model-00415.mtl"></a-asset-item>
<a-asset-item id="dog420" src="models/model-00420.obj"></a-asset-item>
<a-asset-item id="mtl420" src="models/model-00420.mtl"></a-asset-item>
<a-asset-item id="dog425" src="models/model-00425.obj"></a-asset-item>
<a-asset-item id="mtl425" src="models/model-00425.mtl"></a-asset-item>
<a-asset-item id="dog430" src="models/model-00430.obj"></a-asset-item>
<a-asset-item id="mtl430" src="models/model-00430.mtl"></a-asset-item>
<a-asset-item id="dog435" src="models/model-00435.obj"></a-asset-item>
<a-asset-item id="mtl435" src="models/model-00435.mtl"></a-asset-item>
<a-asset-item id="dog440" src="models/model-00440.obj"></a-asset-item>
<a-asset-item id="mtl440" src="models/model-00440.mtl"></a-asset-item>
<a-asset-item id="dog450" src="models/model-00450.obj"></a-asset-item>
<a-asset-item id="mtl450" src="models/model-00450.mtl"></a-asset-item>
<a-asset-item id="dog475" src="models/model-00475.obj"></a-asset-item>
<a-asset-item id="mtl475" src="models/model-00475.mtl"></a-asset-item>
<a-asset-item id="dog500" src="models/model-00500.obj"></a-asset-item>
<a-asset-item id="mtl500" src="models/model-00500.mtl"></a-asset-item>
<audio src="sounds/small-dog-barking_daniel-simion.mp3" autoplay preload></audio>
</a-assets>
<a-marker preset='custom' type='pattern' url="marker/pattern-marker.patt">
<a-entity text="value:Peace, Love, and Joy to You!; color:#FFFFFF; shader: msdf; font:fonts/amaticsc/AmaticSC-Bold.json;" scale="5 5 5" position="-1 0 1" align="center" rotation="-90 0 0"></a-entity>
<a-obj-model src="#dog315" mtl="#mtl315" position="-0.5 0 -0.4" rotation="-90 0 180" scale="1 1 1"></a-obj-model>
<a-obj-model src="#dog320" mtl="#mtl320" position="-0.7 0 -0.48" rotation="-90 0 180" scale="1.2 1.2 1.2"></a-obj-model>
<a-obj-model src="#dog325" mtl="#mtl325" position="-0.9 0 -0.56" rotation="-90 0 180" scale="1.4 1.4 1.4"></a-obj-model>
<a-obj-model src="#dog330" mtl="#mtl330" position="-1.1 0 -0.64" rotation="-90 0 180" scale="1.6 1.6 1.6"></a-obj-model>
<a-obj-model src="#dog335" mtl="#mtl335" position="-1.2 0 -0.72" rotation="-90 0 180" scale="1.8 1.8 1.8"></a-obj-model>
<a-obj-model src="#dog340" mtl="#mtl340" position="-1.25 0 -0.8" rotation="-90 0 180" scale="2 2 2"></a-obj-model>
<a-obj-model src="#dog345" mtl="#mtl345" position="-1.30 0 -0.88" rotation="-90 0 180" scale="2.2 2.2 2.2"></a-obj-model>
<a-obj-model src="#dog350" mtl="#mtl350" position="-1.35 0 -0.96" rotation="-90 0 180" scale="2.4 2.4 2.4"></a-obj-model>
<a-obj-model src="#dog355" mtl="#mtl355" position="-1.40 0 -1.04" rotation="-90 0 180" scale="2.6 2.6 2.6"></a-obj-model>
<a-obj-model src="#dog360" mtl="#mtl360" position="-1.45 0 -1.12" rotation="-90 0 180" scale="2.8 2.8 2.8"></a-obj-model>
<a-obj-model src="#dog365" mtl="#mtl365" position="-1.5 0 -1.2" rotation="-90 0 180" scale="3 3 3"></a-obj-model>
<a-obj-model src="#dog370" mtl="#mtl370" position="-1.4 0 -1.28" rotation="-90 0 180" scale="3.2 3.2 3.2"></a-obj-model>
<a-obj-model src="#dog375" mtl="#mtl375" position="-1.3 0 -1.36" rotation="-90 0 180" scale="3.4 3.4 3.4"></a-obj-model>
<a-obj-model src="#dog380" mtl="#mtl380" position="-1.2 0 -1.44" rotation="-90 0 180" scale="3.6 3.6 3.6"></a-obj-model>
<a-obj-model src="#dog385" mtl="#mtl385" position="-1.1 0 -1.52" rotation="-90 0 180" scale="3.8 3.8 3.8"></a-obj-model>
<a-obj-model src="#dog390" mtl="#mtl390" position="-1.0 0 -1.6" rotation="-90 0 180" scale="4 4 4"></a-obj-model>
<a-obj-model src="#dog395" mtl="#mtl395" position="-0.8 0 -1.68" rotation="-90 0 180" scale="4.2 4.2 4.2"></a-obj-model>
<a-obj-model src="#dog400" mtl="#mtl400" position="-0.6 0 -1.76" rotation="-90 0 180" scale="4.4 4.4 4.4"></a-obj-model>
<a-obj-model src="#dog405" mtl="#mtl405" position="-0.4 0 -1.84" rotation="-90 0 180" scale="4.6 4.6 4.6"></a-obj-model>
<a-obj-model src="#dog410" mtl="#mtl410" position="-0.2 0 -1.92" rotation="-90 0 180" scale="4.8 4.8 4.8"></a-obj-model>
<a-obj-model src="#dog415" mtl="#mtl415" position="0 0 -2" rotation="-90 0 180" scale="5 5 5"></a-obj-model>
<a-obj-model src="#dog420" mtl="#mtl420" position="0 0 -2" rotation="-90 0 180" scale="5 5 5"></a-obj-model>
<a-obj-model src="#dog425" mtl="#mtl425" position="0 0 -2" rotation="-90 0 180" scale="5 5 5"></a-obj-model>
<a-obj-model src="#dog430" mtl="#mtl430" position="0 0 -2" rotation="-90 0 180" scale="5 5 5"></a-obj-model>
<a-obj-model src="#dog435" mtl="#mtl435" position="0 0 -2" rotation="-90 0 180" scale="5 5 5"></a-obj-model>
<a-obj-model src="#dog440" mtl="#mtl440" position="0 0 -2" rotation="-90 0 180" scale="5 5 5"></a-obj-model>
<a-obj-model src="#dog450" mtl="#mtl450" position="0 0 -2" rotation="-90 0 180" scale="5 5 5"></a-obj-model>
<a-obj-model src="#dog475" mtl="#mtl475" position="0 0 -2" rotation="-90 0 180" scale="5 5 5"></a-obj-model>
<a-obj-model src="#dog500" mtl="#mtl500" position="0 0 -2" rotation="-90 0 180" scale="5 5 5"></a-obj-model>
<a-obj-model src="#dog500" mtl="#mtl500" position="0 0 -2" rotation="-90 0 180" scale="5 5 5"></a-obj-model>
<a-obj-model src="#dog500" mtl="#mtl500" position="0 0 -2" rotation="-90 0 180" scale="5 5 5"></a-obj-model>
</a-marker>
<a-entity camera></a-entity>
</a-scene>
<script type="text/javascript">
//document.querySelector('.a-enter-vr-button').style.visible = 'none';
// iOSのバージョン判断
function ios_ver (){
var ios_ua = navigator.userAgent;
if( ios_ua.indexOf("iPhone") > 0 ) {
ios_ua.match(/iPhone OS (\w+){1,3}/g);
var version = (RegExp.$1.replace(/_/g, '')+'00').slice(0,3);
return version;
}
}
// Androidのバージョン判断
function and_ver() {
var and_ua = navigator.userAgent;
if( and_ua.indexOf("Android") > 0 ) {
var version = parseFloat(and_ua.slice(and_ua.indexOf("Android")+8));
return version;
}
}
if(ios_ver() < 110) {
alert("iOS 11以上のSafariが必要です。");
}
if(and_ver() < 5) {
alert("Android 5.0以上のChromeが必要です。");
}
var ua = navigator.userAgent.toLowerCase();
// iPhone
var isiPhone = (ua.indexOf('iphone') > -1);
// iPad
var isiPad = (ua.indexOf('ipad') > -1);
// Android
var isAndroid = (ua.indexOf('android') > -1) && (ua.indexOf('mobile') > -1);
// Android Tablet
var isAndroidTablet = (ua.indexOf('android') > -1) && (ua.indexOf('mobile') == -1);
// iOS
if(isiPhone || isiPad) {
window.onorientationchange = directionCheck;
}
// Android
if(isAndroid || isAndroidTablet) {
window.onresize = directionCheck;
}
directionCheck();
function directionCheck() {
var direction = Math.abs(window.orientation);
if(direction == 90) {
//document.getElementById('direction').innerHTML = '横向き';
} else {
document.getElementById('direction').innerHTML = '<p>スマホを横向きにして、<br />カメラをQRコードに向けると<br />カリントウが現れます。</p>';
}
}
let els = document.querySelectorAll('a-obj-model');
let current = 0, total = els.length;
let hideAll = ()=> {
for (let el of els) {
el.setAttribute('visible', false);
}
}
let show = ()=>{
hideAll();
if (current > total-1) {
current = 0;
}
els[current].setAttribute('visible', true);
current++;
}
show();
setInterval(show, 200);
</script>
</body>
</html>