forked from trumank/phosphorus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
embed.html
77 lines (68 loc) · 2.24 KB
/
embed.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
<!doctype html>
<meta charset=utf-8>
<meta name=viewport content="width=device-width, initial-scale=1.0">
<title>phosphorus</title>
<link rel=stylesheet href=player.css>
<link rel=stylesheet href=embed.css>
<div class=controls>
<div class=progress-bar></div>
<span class=stop></span>
<span class=pause></span>
<span class=flag title="Shift+click to enable turbo mode."></span>
<div class=turbo>Turbo Mode</div>
<span class=full-screen></span>
</div>
<div class=player></div>
<div class=internal-error>
An internal error occurred. <a id=error-bug-link target=_blank href=https://github.com/nathan/phosphorus/issues/new>Click here</a> to file a bug report.
</div>
<script src=fonts.js></script>
<script src=//cdnjs.cloudflare.com/ajax/libs/jszip/2.4.0/jszip.js></script>
<script src=phosphorus.js></script>
<script src=player.js></script>
<script>
(function() {
'use strict';
var projectId = 17088932;
var autoStart = false;
var lightContent = false;
var hasUI = true;
var resolution = 480;
var params = location.search.substr(1).split('&');
params.forEach(function(p) {
var parts = p.split('=');
if (parts.length > 1) {
switch (parts[0]) {
case 'id':
projectId = Number(parts[1]);
break;
case 'auto-start':
autoStart = parts[1] !== 'false';
break;
case 'light-content':
lightContent = parts[1] !== 'false';
break;
case 'ui':
hasUI = parts[1] !== 'false';
break;
case 'resolution-x':
resolution = parts[1];
break;
default:
console.log('Skipping unknown option: ' + parts[0] + '=' + parts[1])
}
}
});
P.resolution = resolution;
P.player.setResolution(resolution);
document.body.style.width = resolution + 'px';
if (lightContent) document.body.className += ' light-content';
document.body.className += hasUI ? ' has-ui' : ' hide-ui';
document.title = 'phosphorus';
P.player.load(projectId, function(stage) {
if (autoStart || !hasUI) stage.triggerGreenFlag();
}, function(title) {
document.title = title ? title + ' \xb7 phosphorus' : 'phosphorus';
});
}());
</script>