Skip to content

Commit a045cdb

Browse files
committed
Unignore output
1 parent 0b38258 commit a045cdb

File tree

127 files changed

+180507
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

127 files changed

+180507
-1
lines changed

Diff for: .gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
.cache/
22
.temp/
33
html/
4-
output/

Diff for: output/.htaccess

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
AddDefaultCharset utf-8
2+
AddCharset utf-8 .css .js .json
3+
Redirect 301 /complete.html /
4+
Redirect 301 /complete /
5+
Redirect 301 /index /
6+
Redirect 301 /C /multipage/
7+
Redirect 301 /multipage/entities.json /entities.json
8+
Redirect 301 /multipage/images/ /images/
9+
Redirect 301 /multipage/link-fixup.js /link-fixup.js
10+
ErrorDocument 404 /404.html
11+
12+
<Files print.pdf>
13+
Header add Content-Disposition "inline; filename=html-standard.pdf"
14+
</Files>
15+
16+
# Previously-generated filenames for /multipage/ that do not redirect via script:
17+
Redirect 301 /multipage/embedded-content-0.html /multipage/embedded-content.html
18+
Redirect 301 /multipage/scripting-1.html /multipage/scripting.html
19+
Redirect 301 /multipage/tabular-data.html /multipage/tables.html
20+
21+
# Previously-generated filenames for /multipage/ that are better to end in a 404 and let redirect
22+
# via script:
23+
# * Redirect 301 /multipage/common-input-element-attributes.html /multipage/forms.html
24+
# * Redirect 301 /multipage/dnd.html /multipage/interaction.html
25+
# * Redirect 301 /multipage/editing.html /multipage/interaction.html
26+
# * Redirect 301 /multipage/edits.html /multipage/semantics.html
27+
# * Redirect 301 /multipage/history.html /multipage/browsers.html
28+
# * Redirect 301 /multipage/links.html /multipage/semantics.html
29+
# * Redirect 301 /multipage/named-character-references.html /multipage/syntax.html
30+
# * Redirect 301 /multipage/offline.html /multipage/browsers.html
31+
# * Redirect 301 /multipage/sections.html /multipage/semantics.html
32+
# * Redirect 301 /multipage/states-of-the-type-attribute.html /multipage/forms.html
33+
# * Redirect 301 /multipage/text-level-semantics.html /multipage/semantics.html
34+
# * Redirect 301 /multipage/the-canvas-element.html /multipage/scripting.html
35+
# * Redirect 301 /multipage/the-end.html /multipage/syntax.html
36+
# * Redirect 301 /multipage/the-iframe-element.html /multipage/embedded-content.html
37+
# * Redirect 301 /multipage/the-input-element.html /multipage/forms.html
38+
# * Redirect 301 /multipage/the-map-element.html /multipage/embedded-content.html
39+
# * Redirect 301 /multipage/the-video-element.html /multipage/embedded-content.html
40+
# * Redirect 301 /multipage/the-xhtml-syntax.html /multipage/xhtml.html
41+
# * Redirect 301 /multipage/tree-construction.html /multipage/syntax.html
42+
# * Redirect 301 /multipage/video.html /multipage/embedded-content.html
43+
44+
# Intentionally deleted previously-generated filenames for /multipage/:
45+
Redirect 410 /multipage/section-sql.html
46+
47+
# Images converted to svg:
48+
Redirect 301 /images/content-venn.png /images/content-venn.svg
49+
Redirect 301 /images/parsing-model-overview.png /images/parsing-model-overview.svg
50+
Redirect 301 /images/sample-email-1.png /images/sample-email-1.svg
51+
Redirect 301 /images/sample-email-2.png /images/sample-email-2.svg
52+
Redirect 301 /images/sample-url.png /images/sample-url.svg

Diff for: output/404.html

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<!DOCTYPE html>
2+
<script src="/link-fixup.js" defer></script>
3+
<title>404 Not Found</title>
4+
<style>
5+
body.loading div.failed, body.failed div.loading, div.failed { display: none; }
6+
body.loading div.loading, body.failed div.failed, div.loading { display: block; }
7+
</style>
8+
<body onload="document.body.className = 'failed'">
9+
<script>document.body.className = 'loading'</script>
10+
<div class="loading">
11+
<p>Loading...</p>
12+
</div>
13+
<div class="failed">
14+
<h1>Not Found</h1>
15+
<p>The page you are looking for is no longer available at this URL.</p>
16+
<p>Links to the multipage version of the specification are
17+
unfortunately likely to break over time. You might be able to find
18+
what you want from <a href="/multipage/">the contents page</a>.</p>
19+
<p>If you have found a broken link on the WHATWG site itself, please
20+
e-mail <a href="mailto:[email protected]">Ian Hickson</a>. If you found a
21+
broken link from another site pointing to the WHATWG site, please
22+
let that site know of the problem instead. Thanks!</p>
23+
</div>

Diff for: output/demos/canvas/blue-robot/blue-robot.png

947 Bytes
Loading

Diff for: output/demos/canvas/blue-robot/index-idle.html

+188
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,188 @@
1+
<!DOCTYPE HTML>
2+
<meta charset="utf-8">
3+
<title>Blue Robot Demo</title>
4+
<style>
5+
html { overflow: hidden; min-height: 200px; min-width: 380px; }
6+
body { height: 200px; position: relative; margin: 8px; }
7+
.buttons { position: absolute; bottom: 0px; left: 0px; margin: 4px; }
8+
</style>
9+
<canvas width="380" height="200"></canvas>
10+
<script>
11+
var Landscape = function (context, width, height) {
12+
this.offset = 0;
13+
this.width = width;
14+
this.advance = function (dx) {
15+
this.offset += dx;
16+
};
17+
this.horizon = height * 0.7;
18+
// This creates the sky gradient (from a darker blue to white at the bottom)
19+
this.sky = context.createLinearGradient(0, 0, 0, this.horizon);
20+
this.sky.addColorStop(0.0, 'rgb(55,121,179)');
21+
this.sky.addColorStop(0.7, 'rgb(121,194,245)');
22+
this.sky.addColorStop(1.0, 'rgb(164,200,214)');
23+
// this creates the grass gradient (from a darker green to a lighter green)
24+
this.earth = context.createLinearGradient(0, this.horizon, 0, height);
25+
this.earth.addColorStop(0.0, 'rgb(81,140,20)');
26+
this.earth.addColorStop(1.0, 'rgb(123,177,57)');
27+
this.paintBackground = function (context, width, height) {
28+
// first, paint the sky and grass rectangles
29+
context.fillStyle = this.sky;
30+
context.fillRect(0, 0, width, this.horizon);
31+
context.fillStyle = this.earth;
32+
context.fillRect(0, this.horizon, width, height-this.horizon);
33+
// then, draw the cloudy banner
34+
// we make it cloudy by having the draw text off the top of the
35+
// canvas, and just having the blurred shadow shown on the canvas
36+
context.save();
37+
context.translate(width-((this.offset+(this.width*3.2)) % (this.width*4.0))+0, 0);
38+
context.shadowColor = 'white';
39+
context.shadowOffsetY = 30+this.horizon/3; // offset down on canvas
40+
context.shadowBlur = '5';
41+
context.fillStyle = 'white';
42+
context.textAlign = 'left';
43+
context.textBaseline = 'top';
44+
context.font = '20px sans-serif';
45+
context.fillText('WHATWG ROCKS', 10, -30); // text up above canvas
46+
context.restore();
47+
// then, draw the background tree
48+
context.save();
49+
context.translate(width-((this.offset+(this.width*0.2)) % (this.width*1.5))+30, 0);
50+
context.beginPath();
51+
context.fillStyle = 'rgb(143,89,2)';
52+
context.lineStyle = 'rgb(10,10,10)';
53+
context.lineWidth = 2;
54+
context.rect(0, this.horizon+5, 10, -50); // trunk
55+
context.fill();
56+
context.stroke();
57+
context.beginPath();
58+
context.fillStyle = 'rgb(78,154,6)';
59+
context.arc(5, this.horizon-60, 30, 0, Math.PI*2); // leaves
60+
context.fill();
61+
context.stroke();
62+
context.restore();
63+
};
64+
this.paintForeground = function (context, width, height) {
65+
// draw the box that goes in front
66+
context.save();
67+
context.translate(width-((this.offset+(this.width*0.7)) % (this.width*1.1))+0, 0);
68+
context.beginPath();
69+
context.rect(0, this.horizon - 5, 25, 25);
70+
context.fillStyle = 'rgb(220,154,94)';
71+
context.lineStyle = 'rgb(10,10,10)';
72+
context.lineWidth = 2;
73+
context.fill();
74+
context.stroke();
75+
context.restore();
76+
};
77+
};
78+
</script>
79+
<script>
80+
var BlueRobot = function () {
81+
this.sprites = new Image();
82+
this.sprites.src = 'blue-robot.png'; // this sprite sheet has 8 cells
83+
this.targetMode = 'idle';
84+
this.walk = function () {
85+
this.targetMode = 'walk';
86+
};
87+
this.stop = function () {
88+
this.targetMode = 'idle';
89+
};
90+
this.frameIndex = {
91+
'idle': [0], // first cell is the idle frame
92+
'walk': [1,2,3,4,5,6], // the walking animation is cells 1-6
93+
'stop': [7], // last cell is the stopping animation
94+
};
95+
this.mode = 'idle';
96+
this.frame = 0; // index into frameIndex
97+
this.tick = function () {
98+
// this advances the frame and the robot
99+
// the return value is how many pixels the robot has moved
100+
this.frame += 1;
101+
if (this.frame >= this.frameIndex[this.mode].length) {
102+
// we've reached the end of this animation cycle
103+
this.frame = 0;
104+
if (this.mode != this.targetMode) {
105+
// switch to next cycle
106+
if (this.mode == 'walk') {
107+
// we need to stop walking before we decide what to do next
108+
this.mode = 'stop';
109+
} else if (this.mode == 'stop') {
110+
if (this.targetMode == 'walk')
111+
this.mode = 'walk';
112+
else
113+
this.mode = 'idle';
114+
} else if (this.mode == 'idle') {
115+
if (this.targetMode == 'walk')
116+
this.mode = 'walk';
117+
}
118+
}
119+
}
120+
if (this.mode == 'walk')
121+
return 8;
122+
return 0;
123+
},
124+
this.paint = function (context, x, y) {
125+
if (!this.sprites.complete) return;
126+
// draw the right frame out of the sprite sheet onto the canvas
127+
// we assume each frame is as high as the sprite sheet
128+
// the x,y coordinates give the position of the bottom center of the sprite
129+
context.drawImage(this.sprites,
130+
this.frameIndex[this.mode][this.frame] * this.sprites.height, 0, this.sprites.height, this.sprites.height,
131+
x-this.sprites.height/2, y-this.sprites.height, this.sprites.height, this.sprites.height);
132+
};
133+
};
134+
</script>
135+
<script>
136+
var animating = false;
137+
var canvas = document.getElementsByTagName('canvas')[0];
138+
var context = canvas.getContext('2d');
139+
var landscape = new Landscape(context, canvas.width, canvas.height);
140+
var blueRobot = new BlueRobot();
141+
// paint when the browser wants us to, using requestAnimationFrame()
142+
function paint() {
143+
context.clearRect(0, 0, canvas.width, canvas.height);
144+
landscape.paintBackground(context, canvas.width, canvas.height);
145+
blueRobot.paint(context, canvas.width/2, landscape.horizon*1.1);
146+
landscape.paintForeground(context, canvas.width, canvas.height);
147+
if (animating)
148+
requestAnimationFrame(paint);
149+
}
150+
var interval = null;
151+
var cancelingTimeout = null;
152+
function startAnim() {
153+
if (cancelingTimeout) {
154+
clearTimeout(cancelingTimeout);
155+
cancelingTimeout = null;
156+
}
157+
if (!animating) {
158+
animating = true;
159+
paint();
160+
// but tick every 150ms, so that we don't slow down when we don't paint
161+
interval = setInterval(function () {
162+
var dx = blueRobot.tick();
163+
landscape.advance(dx);
164+
}, 100);
165+
}
166+
}
167+
function stopAnim() {
168+
if (cancelingTimeout) return;
169+
cancelingTimeout = setTimeout(function () {
170+
cancelingTimeout = null;
171+
if (animating) {
172+
clearInterval(interval);
173+
animating = false;
174+
}
175+
}, 1000);
176+
}
177+
paint();
178+
blueRobot.sprites.onload = paint;
179+
</script>
180+
<p class="buttons">
181+
<input type=button value="Walk" onclick="blueRobot.walk(); startAnim();">
182+
<input type=button value="Stop" onclick="blueRobot.stop(); stopAnim();">
183+
<footer>
184+
<small> Blue Robot Player Sprite by <a href="https://johncolburn.deviantart.com/">JohnColburn</a>.
185+
Licensed under the terms of the Creative Commons Attribution Share-Alike 3.0 Unported license.</small>
186+
<small> This work is itself licensed under a <a rel="license" href="https://creativecommons.org/licenses/by-sa/3.0/">Creative
187+
Commons Attribution-ShareAlike 3.0 Unported License</a>.</small>
188+
</footer>

0 commit comments

Comments
 (0)