├── README.md ├── app.yaml ├── config.rb ├── demos ├── .DS_Store ├── audio_streamer │ ├── README.md │ ├── audio_streamer.js │ ├── index.html │ ├── jdataview.js │ ├── server.js │ ├── speaker.svg │ └── start_servers.sh ├── gamepad.html ├── popup.html └── screenshare │ ├── .DS_Store │ ├── README.md │ ├── app.js │ ├── background.html │ ├── background.js │ ├── img │ ├── .DS_Store │ └── screen.png │ ├── manifest.json │ ├── options.html │ ├── popup.html │ ├── screenshare.crx │ ├── server.js │ ├── viewer.html │ └── viewer.js ├── images ├── HTML5_Badge.svg ├── HTML5_Badge_128.png ├── HTML5_Badge_64.png ├── audio-routing-analysis.png ├── audio-routing-crossfade.png ├── audio-routing.png ├── barchart.png ├── browser_logos │ ├── .DS_Store │ ├── ff_logo.png │ ├── ie10_logo.png │ ├── opera_logo.png │ └── safari_logo.png ├── chart.png ├── chrome-logo-tiny.png ├── chrome_logo.png ├── google_developers_icon_128.png ├── google_developers_logo.png ├── google_developers_logo_white.png ├── html_can_not_do_that.jpg ├── icons │ ├── bug.png │ ├── bug_closed.png │ ├── gears.svg │ └── radar.svg ├── io2012_logo.png ├── my_book_cover.jpg ├── slides │ ├── .DS_Store │ ├── binding.jpg │ ├── blueprint.jpg │ ├── fast.jpg │ ├── flexbox-holygrail.svg │ ├── flexbox-tools.svg │ ├── rocket.jpg │ ├── stream.jpg │ ├── tools.jpg │ └── tools2.jpg ├── transferables.jpg └── twitter_newbird_blue.png ├── index.html ├── js ├── angular-1.0.0.min.js ├── app.js ├── hammer.js ├── modernizr.custom.45394.js ├── order.js ├── polyfills │ ├── classList.min.js │ ├── dataset.min.js │ └── history.min.js ├── prettify │ ├── lang-apollo.js │ ├── lang-clj.js │ ├── lang-css.js │ ├── lang-go.js │ ├── lang-hs.js │ ├── lang-lisp.js │ ├── lang-lua.js │ ├── lang-ml.js │ ├── lang-n.js │ ├── lang-proto.js │ ├── lang-scala.js │ ├── lang-sql.js │ ├── lang-tex.js │ ├── lang-vb.js │ ├── lang-vhdl.js │ ├── lang-wiki.js │ ├── lang-xq.js │ ├── lang-yaml.js │ ├── prettify.css │ └── prettify.js ├── require-1.0.8.min.js ├── slide-controller.js ├── slide-deck.js └── slides.js ├── serve.sh ├── slide_config.js └── theme ├── css ├── .DS_Store ├── animate.css ├── custom.css ├── default.css └── phone.css └── scss ├── _base.scss ├── _variables.scss ├── custom.scss ├── default.scss └── phone.scss /README.md: -------------------------------------------------------------------------------- 1 | htmlfivecan.com 2 | ======== 3 | 4 | The Web Can Do That!? presentation from Google IO 2012 5 | 6 | [![Analytics](https://ga-beacon.appspot.com/UA-46812528-1/ebidel/html5can/README)](https://github.com/igrigorik/ga-beacon) 7 | -------------------------------------------------------------------------------- /app.yaml: -------------------------------------------------------------------------------- 1 | application: html5can 2 | version: 1 3 | runtime: python27 4 | api_version: 1 5 | threadsafe: yes 6 | 7 | handlers: 8 | - url: /images/chrome-logo-tiny\.png 9 | static_files: images/chrome-logo-tiny.png 10 | upload: images/chrome-logo-tiny\.png 11 | 12 | - url: /js 13 | static_dir: js 14 | 15 | - url: /images 16 | static_dir: images 17 | 18 | - url: /demos 19 | static_dir: demos 20 | 21 | - url: /theme 22 | static_dir: theme 23 | 24 | - url: /slide_config.js 25 | static_files: slide_config.js 26 | upload: slide_config.js 27 | 28 | - url: / 29 | static_files: index.html 30 | upload: index.html 31 | 32 | #- url: .* 33 | # script: main.app 34 | 35 | # libraries: 36 | # - name: webapp2 37 | # version: "2.5.1" 38 | -------------------------------------------------------------------------------- /config.rb: -------------------------------------------------------------------------------- 1 | # Require any additional compass plugins here. 2 | 3 | # Set this to the root of your project when deployed: 4 | http_path = "/" 5 | css_dir = "theme/css" 6 | sass_dir = "theme/scss" 7 | images_dir = "images" 8 | javascripts_dir = "js" 9 | 10 | # You can select your preferred output style here (can be overridden via the command line): 11 | output_style = :compressed #:expanded or :nested or :compact or :compressed 12 | 13 | # To enable relative paths to assets via compass helper functions. Uncomment: 14 | # relative_assets = true 15 | 16 | # To disable debugging comments that display the original location of your selectors. Uncomment: 17 | # line_comments = false 18 | 19 | 20 | # If you prefer the indented syntax, you might want to regenerate this 21 | # project again passing --syntax sass, or you can uncomment this: 22 | # preferred_syntax = :sass 23 | # and then run: 24 | # sass-convert -R --from scss --to sass sass scss && rm -rf sass && mv scss sass 25 | -------------------------------------------------------------------------------- /demos/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ebidel/html5can/0df43e2890bb122aad2f31376a8327ec2482d8ca/demos/.DS_Store -------------------------------------------------------------------------------- /demos/audio_streamer/README.md: -------------------------------------------------------------------------------- 1 | To run: 2 | 3 | node server.js 4 | python -m SimpleHTTPServer 8000; -------------------------------------------------------------------------------- /demos/audio_streamer/audio_streamer.js: -------------------------------------------------------------------------------- 1 | var PLAY_ON_DJ_MACHINE = false; 2 | var PLAY_ON_REMOTE_MACHINES = true; 3 | var SHOW_PROGRESS = true; // progress bar. 4 | var SHOW_VISUALIZATIONS = true; // canvas visual. 5 | var NUM_CHUNKS = 100; // TODO: should be optimized based on song's size. 6 | 7 | function Progress(selector, max) { 8 | this.container = document.querySelector(selector); 9 | this.add(max); 10 | this.counter = 1; 11 | } 12 | 13 | Progress.prototype = { 14 | add: function(totalDuration) { 15 | var frag = document.createDocumentFragment(); 16 | this.progress = document.createElement('progress'); 17 | this.progress.value = 0; 18 | this.progress.min = 0; 19 | this.progress.max = totalDuration; 20 | frag.appendChild(this.progress); 21 | 22 | this.input = document.createElement('input'); 23 | this.input.type = 'number'; 24 | this.input.id = 'curr-time'; 25 | this.input.value = 0; 26 | this.input.max = totalDuration; 27 | this.input.readOnly = true; 28 | frag.appendChild(this.input); 29 | 30 | this.count = document.createElement('input'); 31 | this.count.type = 'number'; 32 | this.count.value = 0; 33 | this.count.readOnly = true; 34 | frag.appendChild(this.count); 35 | 36 | this.container.appendChild(frag); 37 | }, 38 | 39 | update: function(currTime, duration) { 40 | this.progress.value = currTime; 41 | this.input.value = currTime; 42 | 43 | var count = Math.ceil(currTime / duration); 44 | this.count.value = count; 45 | 46 | if (count > this.counter) { 47 | this.counter = count; 48 | } 49 | } 50 | }; 51 | 52 | 53 | function AudioLoader(selector) { 54 | this.sm = null; 55 | document.querySelector(selector).addEventListener( 56 | 'change', this.onChange.bind(this), false); 57 | } 58 | 59 | AudioLoader.prototype = { 60 | 61 | get TXT() { 62 | return 0; 63 | }, 64 | get BIN_STR() { 65 | return 1; 66 | }, 67 | get ARRAY_BUFFER() { 68 | return 2; 69 | }, 70 | get DATA_URL() { 71 | return 3; 72 | }, 73 | 74 | onChange: function(e) { 75 | if (this.sm) { 76 | this.sm.kill(); 77 | } 78 | 79 | var file = e.target.files[0]; 80 | if (!file) { 81 | alert('Nice try! Please select a file.'); 82 | return; 83 | } else if (!file.type.match('audio.*')) { 84 | alert('Please select an audio file.'); 85 | return; 86 | } 87 | 88 | this.sm = new SoundManager(); 89 | this.sm.displayID3Info({info: 'Loading...'}); 90 | 91 | var self = this; 92 | this.readFile(this.ARRAY_BUFFER, file, function(arrayBuffer) { 93 | self.sm.load(arrayBuffer, function(audioBuffers, totalDuration) { 94 | var id3 = self.getID3Data(arrayBuffer); 95 | self.sm.displayID3Info(id3); 96 | self.sm.play(audioBuffers, totalDuration, id3); 97 | }); 98 | }); 99 | }, 100 | 101 | readFile: function(type, file, callback) { 102 | var reader = new FileReader(); 103 | 104 | reader.onload = function(e) { 105 | callback(this.result); 106 | }; 107 | 108 | reader.onerror = function(e) { 109 | console.log(e); 110 | }; 111 | 112 | switch(type) { 113 | case this.TXT: 114 | reader.readAsText(file); 115 | break; 116 | case this.BIN_STR: 117 | reader.readAsBinaryString(file); 118 | break; 119 | case this.ARRAY_BUFFER: 120 | reader.readAsArrayBuffer(file); 121 | break; 122 | case this.DATA_URL: 123 | reader.readAsDataURL(file); 124 | break; 125 | default: 126 | reader.readAsArrayBuffer(file); 127 | } 128 | }, 129 | 130 | getID3Data: function(arrayBuffer) { 131 | var dv = new jDataView(arrayBuffer); 132 | // "TAG" starts at byte -128 from EOF. 133 | // See http://en.wikipedia.org/wiki/ID3 134 | if (dv.getString(3, dv.byteLength - 128) == 'TAG') { 135 | var title = dv.getString(30, dv.tell()); 136 | var artist = dv.getString(30, dv.tell()); 137 | var album = dv.getString(30, dv.tell()); 138 | var year = dv.getString(4, dv.tell()); 139 | return { 140 | title: title, 141 | artist: artist, 142 | album: album, 143 | year: year 144 | }; 145 | } else { 146 | return {}; // no ID3v1 data found. 147 | } 148 | } 149 | 150 | }; 151 | 152 | 153 | function Visualizer() { 154 | this.canvas = document.getElementById('fft'); 155 | this.ctx = this.canvas.getContext('2d'); 156 | this.canvas.width = document.body.clientWidth / 1.4; 157 | 158 | var NUM_SAMPLES = 2048; 159 | var CANVAS_HEIGHT = this.canvas.height; 160 | var CANVAS_WIDTH = this.canvas.width; 161 | var SPACER_WIDTH = 5; 162 | var NUM_BARS = Math.round(CANVAS_WIDTH / SPACER_WIDTH); 163 | 164 | this.render = function(analyser) { 165 | var freqByteData = new Uint8Array(analyser.frequencyBinCount); 166 | analyser.getByteFrequencyData(freqByteData); 167 | //analyser.getByteTimeDomainData(freqByteData); 168 | 169 | //var numBars = Math.round(CANVAS_WIDTH / SPACER_WIDTH); //freqByteData.length 170 | 171 | this.ctx.clearRect(0, 0, CANVAS_WIDTH, CANVAS_HEIGHT); 172 | 173 | //freqByteData = freqByteData.subarray(Math.round((NUM_SAMPLES / 2) - CANVAS_WIDTH / 4)); 174 | 175 | // Draw rectangle for each frequency bin. 176 | for (var i = 0; i < NUM_BARS; ++i) { 177 | this.ctx.fillRect(i * SPACER_WIDTH, CANVAS_HEIGHT, 3, -freqByteData[i]); 178 | } 179 | }; 180 | } 181 | 182 | 183 | function send(data) { 184 | // Stringify JSON data. 185 | if ((typeof data == 'object') && (data.__proto__ !== ArrayBuffer.prototype)) { 186 | data = JSON.stringify(data); 187 | } 188 | ws.send(data); 189 | } 190 | 191 | function SoundManager() { 192 | var self_ = this; 193 | var audioBuffers_ = []; 194 | var sources_ = []; 195 | var reqId_ = null; 196 | var sendQueue_ = []; 197 | 198 | this.audioCtx = null; 199 | this.progress = null; 200 | 201 | var SAMPLE_RATE = 44100; 202 | 203 | window.AudioContext = window.AudioContext || window.webkitAudioContext; 204 | if (window.AudioContext) { 205 | this.audioCtx = new window.AudioContext(); 206 | if (SHOW_VISUALIZATIONS) { 207 | this.analyser = this.audioCtx.createAnalyser(); 208 | 209 | //this.gainNode = this.audioCtx.createGainNode(); 210 | //this.gainNode.connect(this.analyser); 211 | 212 | this.analyser.connect(this.audioCtx.destination); 213 | 214 | } 215 | } 216 | 217 | this.visualizer = new Visualizer(); 218 | 219 | var sendAudioChunk_ = function(audioBuffer, meta) { 220 | 221 | var buffer = audioBuffer.getChannelData(0).buffer; 222 | 223 | sendQueue_.push({buffer: buffer, meta: meta}); 224 | 225 | // Rate limit how much we're sending. Send every 2s when there's nothing buffered. 226 | var id = setInterval(function() { 227 | if (ws.bufferedAmount == 0) { 228 | clearInterval(id); 229 | 230 | var chunk = sendQueue_.shift(); 231 | 232 | console.log('Sending chunk'); 233 | send(chunk.meta); // Send metadata before sending actual audio chunk. 234 | send(chunk.buffer); 235 | } 236 | }, 2000); // TODO: optimize this number 237 | 238 | }; 239 | 240 | this.load = function(data, opt_callback) { 241 | if (!this.audioCtx) { 242 | return; 243 | } 244 | 245 | if (typeof data == 'string') { 246 | var xhr = new XMLHttpRequest(); 247 | xhr.open('GET', data, true); 248 | xhr.responseType = 'arraybuffer'; 249 | xhr.onload = function(e) { 250 | self_.audioCtx.decodeAudioData(this.response, function(audioBuffer) { 251 | audioBuffers.push(audioBuffer); 252 | opt_callback && opt_callback(audioBuffer); 253 | }, function(e) { 254 | console.log(e); 255 | }); 256 | }; 257 | xhr.send(); 258 | 259 | } else { 260 | this.audioCtx.decodeAudioData(data, function(audioBuffer) { 261 | 262 | console.log('Total duration: ' + audioBuffer.duration); 263 | 264 | var channel1 = audioBuffer.getChannelData(0); 265 | var channel2 = audioBuffer.getChannelData(1); 266 | 267 | var CHUNK_SIZE = Math.ceil(channel1.length / NUM_CHUNKS); 268 | var NUM_SAMPLES = CHUNK_SIZE; 269 | var NUM_CHANNELS = audioBuffer.numberOfChannels; 270 | 271 | var audioBuffers = []; 272 | 273 | for (var i = 0; i < NUM_CHUNKS; ++i) { 274 | var begin = i * CHUNK_SIZE; 275 | var end = begin + CHUNK_SIZE; 276 | var aBuffer = self_.audioCtx.createBuffer( 277 | NUM_CHANNELS, NUM_SAMPLES, SAMPLE_RATE); 278 | aBuffer.getChannelData(0).set(channel1.subarray(begin, end)); 279 | if (audioBuffer.numberOfChannels == 2) { 280 | aBuffer.getChannelData(1).set(channel2.subarray(begin, end)); 281 | } 282 | 283 | audioBuffers_.push(aBuffer); 284 | } 285 | 286 | opt_callback && opt_callback(audioBuffers_, audioBuffer.duration); 287 | 288 | }, function(e) { 289 | alert('Error decoding audio'); 290 | console.error(e); 291 | }); 292 | } 293 | }; 294 | 295 | this.schedulePlayback = function(startTime, audioBuffer) { 296 | if (!this.audioCtx) { 297 | return; 298 | } 299 | 300 | var source = this.audioCtx.createBufferSource(); 301 | source.buffer = audioBuffer; 302 | 303 | if (SHOW_VISUALIZATIONS) { 304 | source.connect(this.analyser); 305 | //source.connect(this.gainNode); 306 | } else { 307 | source.connect(this.audioCtx.destination); 308 | } 309 | 310 | source.noteOn(startTime); 311 | 312 | sources_.push(source); 313 | 314 | console.log('scheduled: ' + startTime, 'until: ' + 315 | (startTime + audioBuffer.duration)); 316 | }; 317 | 318 | this.periodSend = function() { 319 | 320 | // Rate limit how much we're sending. Send every 2s when there's nothing buffered. 321 | var id = setInterval(function() { 322 | if (sendQueue_.length == 0) { 323 | clearInterval(id); 324 | } 325 | if (ws.bufferedAmount == 0) { 326 | var next = sendQueue_.shift(); 327 | 328 | console.log('Sending chunk'); 329 | 330 | send(next.meta); // Send metadata before sending actual audio chunk. 331 | send(next.buffer); 332 | } 333 | }, 2000); // TODO: optimize this number 334 | 335 | }; 336 | 337 | this.play = function(audioBuffers, totalDuration, id3) { 338 | var startTime = 0; 339 | for (var i = 0, audioBuffer; audioBuffer = audioBuffers[i]; ++i) { 340 | if (PLAY_ON_DJ_MACHINE) { 341 | this.schedulePlayback(startTime, audioBuffer); 342 | } 343 | 344 | sendQueue_.push({ 345 | buffer: audioBuffer.getChannelData(0).buffer, 346 | meta: { 347 | startTime: startTime, 348 | numChunks: audioBuffers.length, 349 | totalDuration: totalDuration, 350 | id3: id3 351 | } 352 | }); 353 | 354 | startTime += audioBuffer.duration; 355 | } 356 | 357 | this.periodSend(); 358 | 359 | if (SHOW_VISUALIZATIONS || SHOW_PROGRESS) { 360 | this.visualize(audioBuffers[0].duration, totalDuration, audioBuffers[0]); 361 | } 362 | }; 363 | 364 | this.kill = function() { 365 | window.webkitCancelAnimationFrame(reqId_); 366 | 367 | this.analyser.disconnect(0); 368 | 369 | for (var i = 0, source; source = sources_[i]; ++i) { 370 | source.noteOff(0); 371 | source.disconnect(0); 372 | } 373 | sources_ = []; 374 | }; 375 | 376 | this.playFromArrayBuffer = function(arrayBuffer, props) { 377 | 378 | var float32Array = new Float32Array(arrayBuffer); 379 | 380 | // TODO(ericbidelman): clean up duplicate vars. 381 | var NUM_SAMPLES = float32Array.length; 382 | var NUM_CHANNELS = 2; 383 | 384 | var audioBuffer = this.audioCtx.createBuffer( 385 | NUM_CHANNELS, NUM_SAMPLES, SAMPLE_RATE); 386 | audioBuffer.getChannelData(0).set(float32Array); 387 | 388 | //TODO: send over channel2 data instead of duplicating channel's data. 389 | if (audioBuffer.numberOfChannels == 2) { 390 | audioBuffer.getChannelData(1).set(float32Array); 391 | } 392 | 393 | /*buffer a few chunks 394 | audioBuffers_.push(audioBuffer); 395 | if (audioBuffers_.length >= 3) { 396 | this.schedulePlayback(props.startTime, audioBuffers_.shift()); 397 | }*/ 398 | 399 | if (PLAY_ON_REMOTE_MACHINES) { 400 | this.schedulePlayback(props.startTime, audioBuffer); 401 | } 402 | 403 | if (SHOW_VISUALIZATIONS || SHOW_PROGRESS) { 404 | this.visualize(audioBuffer.duration, props.totalDuration); 405 | } 406 | 407 | this.displayID3Info(props.id3); 408 | }; 409 | 410 | this.visualize = function(chunkDuration, totalDuration) { 411 | 412 | if (this.progress) { 413 | return; 414 | } 415 | 416 | this.progress = new Progress('#container', totalDuration); 417 | 418 | var self = this; 419 | (function callback(time) { 420 | var currTime = self.audioCtx.currentTime; 421 | 422 | // Unhook if we're played all chunks. 423 | if (currTime >= totalDuration) { 424 | self.kill(); 425 | } else { 426 | reqId_ = window.webkitRequestAnimationFrame(callback); 427 | } 428 | 429 | if (SHOW_PROGRESS) { 430 | self.progress.update(currTime, chunkDuration); 431 | } 432 | if (SHOW_VISUALIZATIONS) { 433 | self.visualizer.render(self.analyser); 434 | } 435 | })(); 436 | 437 | }; 438 | 439 | this.displayID3Info = function(id3) { 440 | var title = id3.title ? id3.title : ''; 441 | var album = id3.album ? id3.album : ''; 442 | var artist = id3.artist ? ' ( ' + id3.artist + ' )' : ''; 443 | 444 | var html = []; 445 | if (id3.info) { 446 | html.push(id3.info); 447 | } else { 448 | html.push('', title, '', artist); 449 | } 450 | 451 | if (id3.title) { 452 | document.querySelector('#song-title').innerHTML = html.join(''); 453 | } 454 | }; 455 | 456 | } 457 | -------------------------------------------------------------------------------- /demos/audio_streamer/index.html: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | Binary WebSocket Audio Streamer 22 | 23 | 24 | 25 | 200 | 201 | 202 | 203 |
204 |

WebSocket Audio Streamer

205 |
206 | 207 |
208 |

209 | 210 | 211 | 212 | 213 |

214 |
215 | 216 |
217 |
218 |
219 | 220 |
221 | 222 | 223 | 224 | 354 | 358 | 359 | 360 | -------------------------------------------------------------------------------- /demos/audio_streamer/jdataview.js: -------------------------------------------------------------------------------- 1 | // 2 | // jDataView by Vjeux - Jan 2010 3 | // 4 | // A unique way to read a binary file in the browser 5 | // http://github.com/vjeux/jDataView 6 | // http://blog.vjeux.com/ 7 | // 8 | 9 | (function (global) { 10 | 11 | var compatibility = { 12 | ArrayBuffer: typeof ArrayBuffer !== 'undefined', 13 | DataView: typeof DataView !== 'undefined' && 'getFloat64' in DataView.prototype, 14 | NodeBuffer: typeof Buffer !== 'undefined', 15 | // 0.6.0 -> readInt8LE(offset) 16 | NodeBufferFull: typeof Buffer !== 'undefined' && 'readInt8LE' in Buffer, 17 | // 0.5.0 -> readInt8(offset, endian) 18 | NodeBufferEndian: typeof Buffer !== 'undefined' && 'readInt8' in Buffer 19 | }; 20 | 21 | var jDataView = function (buffer, byteOffset, byteLength, littleEndian) { 22 | if (!(this instanceof arguments.callee)) { 23 | throw new Error("Constructor may not be called as a function"); 24 | } 25 | 26 | this.buffer = buffer; 27 | 28 | // Handle Type Errors 29 | if (!(compatibility.NodeBuffer && buffer instanceof Buffer) && 30 | !(compatibility.ArrayBuffer && buffer instanceof ArrayBuffer) && 31 | typeof buffer !== 'string') { 32 | throw new TypeError('Type error'); 33 | } 34 | 35 | // Check parameters and existing functionnalities 36 | this._isArrayBuffer = compatibility.ArrayBuffer && buffer instanceof ArrayBuffer; 37 | this._isDataView = compatibility.DataView && this._isArrayBuffer; 38 | this._isNodeBuffer = compatibility.NodeBuffer && buffer instanceof Buffer; 39 | 40 | // Default Values 41 | this._littleEndian = littleEndian === undefined ? true : littleEndian; 42 | 43 | var bufferLength = this._isArrayBuffer ? buffer.byteLength : buffer.length; 44 | if (byteOffset === undefined) { 45 | byteOffset = 0; 46 | } 47 | this.byteOffset = byteOffset; 48 | 49 | if (byteLength === undefined) { 50 | byteLength = bufferLength - byteOffset; 51 | } 52 | this.byteLength = byteLength; 53 | 54 | if (!this._isDataView) { 55 | // Do additional checks to simulate DataView 56 | if (typeof byteOffset !== 'number') { 57 | throw new TypeError('Type error'); 58 | } 59 | if (typeof byteLength !== 'number') { 60 | throw new TypeError('Type error'); 61 | } 62 | if (typeof byteOffset < 0) { 63 | throw new Error('INDEX_SIZE_ERR: DOM Exception 1'); 64 | } 65 | if (typeof byteLength < 0) { 66 | throw new Error('INDEX_SIZE_ERR: DOM Exception 1'); 67 | } 68 | } 69 | 70 | // Instanciate 71 | if (this._isDataView) { 72 | this._view = new DataView(buffer, byteOffset, byteLength); 73 | this._start = 0; 74 | } 75 | this._start = byteOffset; 76 | if (byteOffset + byteLength > bufferLength) { 77 | throw new Error("INDEX_SIZE_ERR: DOM Exception 1"); 78 | } 79 | 80 | this._offset = 0; 81 | }; 82 | 83 | jDataView.createBuffer = function () { 84 | if (compatibility.NodeBuffer) { 85 | var buffer = new Buffer(arguments.length); 86 | for (var i = 0; i < arguments.length; ++i) { 87 | buffer[i] = arguments[i]; 88 | } 89 | return buffer; 90 | } 91 | if (compatibility.ArrayBuffer) { 92 | var buffer = new ArrayBuffer(arguments.length); 93 | var view = new Int8Array(buffer); 94 | for (var i = 0; i < arguments.length; ++i) { 95 | view[i] = arguments[i]; 96 | } 97 | return buffer; 98 | } 99 | 100 | return String.fromCharCode.apply(null, arguments); 101 | }; 102 | 103 | jDataView.prototype = { 104 | 105 | // Helpers 106 | 107 | getString: function (length, byteOffset) { 108 | var value; 109 | 110 | // Handle the lack of byteOffset 111 | if (byteOffset === undefined) { 112 | byteOffset = this._offset; 113 | } 114 | 115 | // Error Checking 116 | if (typeof byteOffset !== 'number') { 117 | throw new TypeError('Type error'); 118 | } 119 | if (length < 0 || byteOffset + length > this.byteLength) { 120 | throw new Error('INDEX_SIZE_ERR: DOM Exception 1'); 121 | } 122 | 123 | if (this._isNodeBuffer) { 124 | value = this.buffer.toString('ascii', this._start + byteOffset, this._start + byteOffset + length); 125 | } 126 | else { 127 | value = ''; 128 | for (var i = 0; i < length; ++i) { 129 | var char = this.getUint8(byteOffset + i); 130 | value += String.fromCharCode(char > 127 ? 65533 : char); 131 | } 132 | } 133 | 134 | this._offset = byteOffset + length; 135 | return value; 136 | }, 137 | 138 | getChar: function (byteOffset) { 139 | return this.getString(1, byteOffset); 140 | }, 141 | 142 | tell: function () { 143 | return this._offset; 144 | }, 145 | 146 | seek: function (byteOffset) { 147 | if (typeof byteOffset !== 'number') { 148 | throw new TypeError('Type error'); 149 | } 150 | if (byteOffset < 0 || byteOffset > this.byteLength) { 151 | throw new Error('INDEX_SIZE_ERR: DOM Exception 1'); 152 | } 153 | 154 | return this._offset = byteOffset; 155 | }, 156 | 157 | // Compatibility functions on a String Buffer 158 | 159 | _endianness: function (byteOffset, pos, max, littleEndian) { 160 | return byteOffset + (littleEndian ? max - pos - 1 : pos); 161 | }, 162 | 163 | _getFloat64: function (byteOffset, littleEndian) { 164 | var b0 = this._getUint8(this._endianness(byteOffset, 0, 8, littleEndian)), 165 | b1 = this._getUint8(this._endianness(byteOffset, 1, 8, littleEndian)), 166 | b2 = this._getUint8(this._endianness(byteOffset, 2, 8, littleEndian)), 167 | b3 = this._getUint8(this._endianness(byteOffset, 3, 8, littleEndian)), 168 | b4 = this._getUint8(this._endianness(byteOffset, 4, 8, littleEndian)), 169 | b5 = this._getUint8(this._endianness(byteOffset, 5, 8, littleEndian)), 170 | b6 = this._getUint8(this._endianness(byteOffset, 6, 8, littleEndian)), 171 | b7 = this._getUint8(this._endianness(byteOffset, 7, 8, littleEndian)), 172 | 173 | sign = 1 - (2 * (b0 >> 7)), 174 | exponent = ((((b0 << 1) & 0xff) << 3) | (b1 >> 4)) - (Math.pow(2, 10) - 1), 175 | 176 | // Binary operators such as | and << operate on 32 bit values, using + and Math.pow(2) instead 177 | mantissa = ((b1 & 0x0f) * Math.pow(2, 48)) + (b2 * Math.pow(2, 40)) + (b3 * Math.pow(2, 32)) + 178 | (b4 * Math.pow(2, 24)) + (b5 * Math.pow(2, 16)) + (b6 * Math.pow(2, 8)) + b7; 179 | 180 | if (exponent === 1024) { 181 | if (mantissa !== 0) { 182 | return NaN; 183 | } else { 184 | return sign * Infinity; 185 | } 186 | } 187 | 188 | if (exponent === -1023) { // Denormalized 189 | return sign * mantissa * Math.pow(2, -1022 - 52); 190 | } 191 | 192 | return sign * (1 + mantissa * Math.pow(2, -52)) * Math.pow(2, exponent); 193 | }, 194 | 195 | _getFloat32: function (byteOffset, littleEndian) { 196 | var b0 = this._getUint8(this._endianness(byteOffset, 0, 4, littleEndian)), 197 | b1 = this._getUint8(this._endianness(byteOffset, 1, 4, littleEndian)), 198 | b2 = this._getUint8(this._endianness(byteOffset, 2, 4, littleEndian)), 199 | b3 = this._getUint8(this._endianness(byteOffset, 3, 4, littleEndian)), 200 | 201 | sign = 1 - (2 * (b0 >> 7)), 202 | exponent = (((b0 << 1) & 0xff) | (b1 >> 7)) - 127, 203 | mantissa = ((b1 & 0x7f) << 16) | (b2 << 8) | b3; 204 | 205 | if (exponent === 128) { 206 | if (mantissa !== 0) { 207 | return NaN; 208 | } else { 209 | return sign * Infinity; 210 | } 211 | } 212 | 213 | if (exponent === -127) { // Denormalized 214 | return sign * mantissa * Math.pow(2, -126 - 23); 215 | } 216 | 217 | return sign * (1 + mantissa * Math.pow(2, -23)) * Math.pow(2, exponent); 218 | }, 219 | 220 | _getInt32: function (byteOffset, littleEndian) { 221 | var b = this._getUint32(byteOffset, littleEndian); 222 | return b > Math.pow(2, 31) - 1 ? b - Math.pow(2, 32) : b; 223 | }, 224 | 225 | _getUint32: function (byteOffset, littleEndian) { 226 | var b3 = this._getUint8(this._endianness(byteOffset, 0, 4, littleEndian)), 227 | b2 = this._getUint8(this._endianness(byteOffset, 1, 4, littleEndian)), 228 | b1 = this._getUint8(this._endianness(byteOffset, 2, 4, littleEndian)), 229 | b0 = this._getUint8(this._endianness(byteOffset, 3, 4, littleEndian)); 230 | 231 | return (b3 * Math.pow(2, 24)) + (b2 << 16) + (b1 << 8) + b0; 232 | }, 233 | 234 | _getInt16: function (byteOffset, littleEndian) { 235 | var b = this._getUint16(byteOffset, littleEndian); 236 | return b > Math.pow(2, 15) - 1 ? b - Math.pow(2, 16) : b; 237 | }, 238 | 239 | _getUint16: function (byteOffset, littleEndian) { 240 | var b1 = this._getUint8(this._endianness(byteOffset, 0, 2, littleEndian)), 241 | b0 = this._getUint8(this._endianness(byteOffset, 1, 2, littleEndian)); 242 | 243 | return (b1 << 8) + b0; 244 | }, 245 | 246 | _getInt8: function (byteOffset) { 247 | var b = this._getUint8(byteOffset); 248 | return b > Math.pow(2, 7) - 1 ? b - Math.pow(2, 8) : b; 249 | }, 250 | 251 | _getUint8: function (byteOffset) { 252 | if (this._isArrayBuffer) { 253 | return new Uint8Array(this.buffer, byteOffset, 1)[0]; 254 | } 255 | else if (this._isNodeBuffer) { 256 | return this.buffer[byteOffset]; 257 | } else { 258 | return this.buffer.charCodeAt(byteOffset) & 0xff; 259 | } 260 | } 261 | }; 262 | 263 | // Create wrappers 264 | 265 | var dataTypes = { 266 | 'Int8': 1, 267 | 'Int16': 2, 268 | 'Int32': 4, 269 | 'Uint8': 1, 270 | 'Uint16': 2, 271 | 'Uint32': 4, 272 | 'Float32': 4, 273 | 'Float64': 8 274 | }; 275 | var nodeNaming = { 276 | 'Int8': 'Int8', 277 | 'Int16': 'Int16', 278 | 'Int32': 'Int32', 279 | 'Uint8': 'UInt8', 280 | 'Uint16': 'UInt16', 281 | 'Uint32': 'UInt32', 282 | 'Float32': 'Float', 283 | 'Float64': 'Double' 284 | }; 285 | 286 | for (var type in dataTypes) { 287 | if (!dataTypes.hasOwnProperty(type)) { 288 | continue; 289 | } 290 | 291 | // Bind the variable type 292 | (function (type) { 293 | var size = dataTypes[type]; 294 | 295 | // Create the function 296 | jDataView.prototype['get' + type] = 297 | function (byteOffset, littleEndian) { 298 | var value; 299 | 300 | // Handle the lack of endianness 301 | if (littleEndian === undefined) { 302 | littleEndian = this._littleEndian; 303 | } 304 | 305 | // Handle the lack of byteOffset 306 | if (byteOffset === undefined) { 307 | byteOffset = this._offset; 308 | } 309 | 310 | // Dispatch on the good method 311 | if (this._isDataView) { 312 | // DataView: we use the direct method 313 | value = this._view['get' + type](byteOffset, littleEndian); 314 | } 315 | // ArrayBuffer: we use a typed array of size 1 if the alignment is good 316 | // ArrayBuffer does not support endianess flag (for size > 1) 317 | else if (this._isArrayBuffer && (this._start + byteOffset) % size === 0 && (size === 1 || littleEndian)) { 318 | value = new global[type + 'Array'](this.buffer, this._start + byteOffset, 1)[0]; 319 | } 320 | // NodeJS Buffer 321 | else if (this._isNodeBuffer && compatibility.NodeBufferFull) { 322 | if (littleEndian) { 323 | value = this.buffer['read' + nodeNaming[type] + 'LE'](this._start + byteOffset); 324 | } else { 325 | value = this.buffer['read' + nodeNaming[type] + 'BE'](this._start + byteOffset); 326 | } 327 | } else if (this._isNodeBuffer && compatibility.NodeBufferEndian) { 328 | value = this.buffer['read' + nodeNaming[type]](this._start + byteOffset, littleEndian); 329 | } 330 | else { 331 | // Error Checking 332 | if (typeof byteOffset !== 'number') { 333 | throw new TypeError('Type error'); 334 | } 335 | if (byteOffset + size > this.byteLength) { 336 | throw new Error('INDEX_SIZE_ERR: DOM Exception 1'); 337 | } 338 | value = this['_get' + type](this._start + byteOffset, littleEndian); 339 | } 340 | 341 | // Move the internal offset forward 342 | this._offset = byteOffset + size; 343 | 344 | return value; 345 | }; 346 | })(type); 347 | } 348 | 349 | if (typeof jQuery !== 'undefined' && jQuery.fn.jquery >= "1.6.2") { 350 | var convertResponseBodyToText = function (byteArray) { 351 | // http://jsperf.com/vbscript-binary-download/6 352 | var scrambledStr; 353 | try { 354 | scrambledStr = IEBinaryToArray_ByteStr(byteArray); 355 | } catch (e) { 356 | // http://stackoverflow.com/questions/1919972/how-do-i-access-xhr-responsebody-for-binary-data-from-javascript-in-ie 357 | // http://miskun.com/javascript/internet-explorer-and-binary-files-data-access/ 358 | var IEBinaryToArray_ByteStr_Script = 359 | "Function IEBinaryToArray_ByteStr(Binary)\r\n"+ 360 | " IEBinaryToArray_ByteStr = CStr(Binary)\r\n"+ 361 | "End Function\r\n"+ 362 | "Function IEBinaryToArray_ByteStr_Last(Binary)\r\n"+ 363 | " Dim lastIndex\r\n"+ 364 | " lastIndex = LenB(Binary)\r\n"+ 365 | " if lastIndex mod 2 Then\r\n"+ 366 | " IEBinaryToArray_ByteStr_Last = AscB( MidB( Binary, lastIndex, 1 ) )\r\n"+ 367 | " Else\r\n"+ 368 | " IEBinaryToArray_ByteStr_Last = -1\r\n"+ 369 | " End If\r\n"+ 370 | "End Function\r\n"; 371 | 372 | // http://msdn.microsoft.com/en-us/library/ms536420(v=vs.85).aspx 373 | // proprietary IE function 374 | window.execScript(IEBinaryToArray_ByteStr_Script, 'vbscript'); 375 | 376 | scrambledStr = IEBinaryToArray_ByteStr(byteArray); 377 | } 378 | 379 | var lastChr = IEBinaryToArray_ByteStr_Last(byteArray), 380 | result = "", 381 | i = 0, 382 | l = scrambledStr.length % 8, 383 | thischar; 384 | while (i < l) { 385 | thischar = scrambledStr.charCodeAt(i++); 386 | result += String.fromCharCode(thischar & 0xff, thischar >> 8); 387 | } 388 | l = scrambledStr.length 389 | while (i < l) { 390 | result += String.fromCharCode( 391 | (thischar = scrambledStr.charCodeAt(i++), thischar & 0xff), thischar >> 8, 392 | (thischar = scrambledStr.charCodeAt(i++), thischar & 0xff), thischar >> 8, 393 | (thischar = scrambledStr.charCodeAt(i++), thischar & 0xff), thischar >> 8, 394 | (thischar = scrambledStr.charCodeAt(i++), thischar & 0xff), thischar >> 8, 395 | (thischar = scrambledStr.charCodeAt(i++), thischar & 0xff), thischar >> 8, 396 | (thischar = scrambledStr.charCodeAt(i++), thischar & 0xff), thischar >> 8, 397 | (thischar = scrambledStr.charCodeAt(i++), thischar & 0xff), thischar >> 8, 398 | (thischar = scrambledStr.charCodeAt(i++), thischar & 0xff), thischar >> 8); 399 | } 400 | if (lastChr > -1) { 401 | result += String.fromCharCode(lastChr); 402 | } 403 | return result; 404 | }; 405 | 406 | jQuery.ajaxSetup({ 407 | converters: { 408 | '* dataview': function(data) { 409 | return new jDataView(data); 410 | } 411 | }, 412 | accepts: { 413 | dataview: "text/plain; charset=x-user-defined" 414 | }, 415 | responseHandler: { 416 | dataview: function (responses, options, xhr) { 417 | // Array Buffer Firefox 418 | if ('mozResponseArrayBuffer' in xhr) { 419 | responses.text = xhr.mozResponseArrayBuffer; 420 | } 421 | // Array Buffer Chrome 422 | else if ('responseType' in xhr && xhr.responseType === 'arraybuffer' && xhr.response) { 423 | responses.text = xhr.response; 424 | } 425 | // Internet Explorer (Byte array accessible through VBScript -- convert to text) 426 | else if ('responseBody' in xhr) { 427 | responses.text = convertResponseBodyToText(xhr.responseBody); 428 | } 429 | // Older Browsers 430 | else { 431 | responses.text = xhr.responseText; 432 | } 433 | } 434 | } 435 | }); 436 | 437 | jQuery.ajaxPrefilter('dataview', function(options, originalOptions, jqXHR) { 438 | // trying to set the responseType on IE 6 causes an error 439 | if (jQuery.support.ajaxResponseType) { 440 | if (!options.hasOwnProperty('xhrFields')) { 441 | options.xhrFields = {}; 442 | } 443 | options.xhrFields.responseType = 'arraybuffer'; 444 | } 445 | options.mimeType = 'text/plain; charset=x-user-defined'; 446 | }); 447 | } 448 | 449 | global.jDataView = (global.module || {}).exports = jDataView; 450 | 451 | })(this); 452 | -------------------------------------------------------------------------------- /demos/audio_streamer/server.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | //var WebSocketServer = require('../websocket_node/lib/WebSocketServer'); 4 | var WebSocketServer = require('ws').Server; 5 | 6 | var http = require('http'); 7 | var url = require('url'); 8 | var fs = require('fs'); 9 | 10 | var args = { /* defaults */ 11 | port: '8080' 12 | }; 13 | 14 | /* Parse command line options */ 15 | var pattern = /^--(.*?)(?:=(.*))?$/; 16 | process.argv.forEach(function(value) { 17 | var match = pattern.exec(value); 18 | if (match) { 19 | args[match[1]] = match[2] ? match[2] : true; 20 | } 21 | }); 22 | 23 | var port = parseInt(args.port, 10); 24 | 25 | console.log("Usage: ./server.js [--port=8080]"); 26 | 27 | var connections = {}; 28 | 29 | /* //websocket_node 30 | var server = http.createServer(function(request, response) { 31 | console.log((new Date()) + " Received request for " + request.url); 32 | response.writeHead(404); 33 | response.end(); 34 | }); 35 | 36 | server.listen(port, function() { 37 | console.log((new Date()) + " Server is listening on port " + port); 38 | }); 39 | 40 | var wsServer = new WebSocketServer({ 41 | httpServer: server, 42 | autoAcceptConnections: true, 43 | maxReceivedFrameSize: 64 * 1024 * 1024, // 64MiB 44 | maxReceivedMessageSize: 64 * 1024 * 1024, // 64MiB 45 | fragmentOutgoingMessages: false, 46 | keepalive: true, 47 | keepaliveInterval: 20000, 48 | disableNagleAlgorithm: false 49 | }); 50 | 51 | wsServer.on('connect', function(connection) { 52 | connection.id = Date.now(); // Assign unique id to this connection. 53 | 54 | console.log((new Date()) + ' Connection accepted: ' + connection.id); 55 | 56 | connections[connection.id] = connection; 57 | 58 | connection.on('message', function(message) { 59 | var length; 60 | switch (message.type) { 61 | case 'utf8': 62 | length = message.utf8Data.length; 63 | break; 64 | case 'binary': 65 | length = message.binaryData.length; 66 | break; 67 | } 68 | 69 | console.log('Received ' + message.type + ' message of ' + length + ' characters.'); 70 | 71 | broadcast(message, connection); 72 | }); 73 | 74 | connection.on('close', function(connection) { 75 | console.log((new Date()) + " Peer " + connection.remoteAddress + " disconnected."); 76 | delete connections[connection.id]; 77 | }); 78 | }); 79 | 80 | // Broadcasts a message to all connected sockets accept for the sender. 81 | function broadcast(message, fromConnection) { 82 | for (var id in connections) { 83 | if (id != fromConnection.id) { 84 | if (message.type === 'binary') { 85 | connections[id].sendBytes(message.binaryData); 86 | } else { 87 | connections[id].sendUTF(message.utf8Data); 88 | } 89 | } 90 | } 91 | } 92 | */ 93 | 94 | // ws is the fastest websocket lib: 95 | // http://einaros.github.com/ws/ 96 | var wsServer = new WebSocketServer({port: port}); 97 | 98 | wsServer.on('connection', function(ws) { 99 | 100 | ws.id = Date.now(); // Assign unique id to this ws connection. 101 | connections[ws.id] = ws; 102 | 103 | console.log((new Date()) + ' Connection accepted: ' + ws.id); 104 | 105 | ws.on('message', function(message, flags) { 106 | console.log('Received ' + (flags.binary ? 'binary' : '') + ' message: ' + 107 | message.length + ' bytes.'); 108 | broadcast(message, this, flags); 109 | }); 110 | 111 | ws.on('close', function() { 112 | console.log((new Date()) + " Peer " + this.id + " disconnected."); 113 | delete connections[this.id]; 114 | }); 115 | }); 116 | 117 | // Broadcasts a message to all connected sockets accept for the sender. 118 | function broadcast(message, fromWs, flags) { 119 | for (var id in connections) { 120 | if (id != fromWs.id) { 121 | connections[id].send(message, { 122 | binary: flags.binary ? true : false, 123 | mask: false 124 | }); 125 | } 126 | } 127 | } -------------------------------------------------------------------------------- /demos/audio_streamer/speaker.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 10 | 13 | 17 | 18 | -------------------------------------------------------------------------------- /demos/audio_streamer/start_servers.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | node server.js --port=8080 4 | serve 8000 5 | #open localhost:3000 -------------------------------------------------------------------------------- /demos/gamepad.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | GamePad Window 5 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 |
63 | 64 |

65 | 66 |

 67 | 
 68 |  
147 |  
148 |  
149 | 


--------------------------------------------------------------------------------
/demos/popup.html:
--------------------------------------------------------------------------------
1 | 
2 | 
3 | Lil Guy
4 | 
5 | HI
6 |  
7 |  
8 | 


--------------------------------------------------------------------------------
/demos/screenshare/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ebidel/html5can/0df43e2890bb122aad2f31376a8327ec2482d8ca/demos/screenshare/.DS_Store


--------------------------------------------------------------------------------
/demos/screenshare/README.md:
--------------------------------------------------------------------------------
1 | To run this demo:
2 | 
3 | 1. Start the WebSocket server: `node server.js`
4 | 2. Install screenshare.crx by dragging it onto `chrome://extensions` page.
5 | 3. Click the browser action icon. This should opener the viewer page in a new tab.
6 | 4. Open another window (the presenter) and click the browser action icon.
7 |    This should connect the apps and present the web page this tab visits.
8 | 


--------------------------------------------------------------------------------
/demos/screenshare/app.js:
--------------------------------------------------------------------------------
 1 | var WS_HOST = 'localhost:3000';
 2 | 
 3 | function connect() {
 4 |   ws = new WebSocket('ws://' + WS_HOST, 'dumby-protocol');
 5 |   ws.binaryType = 'blob';
 6 | 
 7 |   ws.onopen = function(e) {
 8 |     console.log('Connection OPEN');
 9 |     send({cmd: 'START'});
10 |   };
11 | 
12 |   ws.onmessage = function(e) {
13 |     var data = e.data;
14 |     console.log(data);
15 |   };
16 | 
17 |   ws.onclose = function(e) {
18 |     console.log('Connection CLOSED');
19 |   };
20 | 
21 |   ws.onerror = function(e) {
22 |     console.log('Connection ERROR', e);
23 |   };
24 | 
25 |   return ws;
26 | }
27 | 
28 | function disconnect() {
29 |   ws.close();
30 | }
31 | 
32 | function send(data) {
33 |   // Stringify JSON data if we try to send it.
34 |   if ((typeof data == 'object') && (data.__proto__ !== Blob.prototype)) {
35 |     data = JSON.stringify(data);
36 |   }
37 |   ws.send(data);
38 | }
39 | 
40 | function convertDataURIToBlob(dataURI, mimetype) {
41 |   if (!dataURI) {
42 |     return new Uint8Array(0);
43 |   }
44 | 
45 |   var BASE64_MARKER = ';base64,';
46 |   var base64Index = dataURI.indexOf(BASE64_MARKER) + BASE64_MARKER.length;
47 |   var base64 = dataURI.substring(base64Index);
48 |   var raw = window.atob(base64);
49 |   var uInt8Array = new Uint8Array(raw.length);
50 | 
51 |   for (var i = 0; i < uInt8Array.length; ++i) {
52 |     uInt8Array[i] = raw.charCodeAt(i);
53 |   }
54 | 
55 |   return new Blob([uInt8Array], {type: mimetype});
56 | }
57 | 


--------------------------------------------------------------------------------
/demos/screenshare/background.html:
--------------------------------------------------------------------------------
 1 | 
 2 | 
19 | 
20 | 
21 |   Background Page
22 | 
23 | 
24 | 
25 | 
26 | 
27 | 
28 | 


--------------------------------------------------------------------------------
/demos/screenshare/background.js:
--------------------------------------------------------------------------------
 1 | var IMG_FORMAT = 'jpeg';
 2 | var IMG_MIMETYPE = 'image/' + IMG_FORMAT;
 3 | var IMG_QUALITY = 80;
 4 | var SEND_INTERVAL_MS = 250;
 5 | var ws = null;
 6 | var intervalId = null;
 7 | var VIEWER_TAB_ID = null;
 8 | 
 9 | chrome.browserAction.setBadgeBackgroundColor({color: [255, 0, 0, 100]});
10 | 
11 | function captureAndSendTab() {
12 |   // Update to webp when crbug.com/112957 is fixed.
13 |   // captureVisibleTab only returns a dataURL. Need to decode it and create a
14 |   // typed array.
15 |   var opts = {
16 |     format: IMG_FORMAT,
17 |     quality: IMG_QUALITY
18 |   };
19 | 
20 |   chrome.tabs.captureVisibleTab(null, opts, function(dataUrl) {
21 |     send(convertDataURIToBlob(dataUrl, IMG_MIMETYPE));
22 |   });
23 | }
24 | 
25 | chrome.browserAction.onClicked.addListener(function(tab) {
26 |   if (!intervalId) {
27 |     ws = connect();
28 | 
29 |     if (!VIEWER_TAB_ID) {
30 |       chrome.tabs.create({url: 'viewer.html'}, function(tab) {
31 |         VIEWER_TAB_ID = tab.id;
32 |       });
33 |       return;
34 |     }
35 | 
36 |     chrome.browserAction.setBadgeText({text: 'ON'});
37 | 
38 |     // Rate limit how much we're sending through the websocket.
39 |     intervalId = setInterval(function() {
40 |       if (ws.bufferedAmount == 0) {
41 |         captureAndSendTab();
42 |       }
43 |     }, SEND_INTERVAL_MS); // TODO: optimize this number
44 |   } else {
45 |     clearInterval(intervalId);
46 |     chrome.browserAction.setBadgeText({text: ''});
47 |     send({cmd: 'DONE'});
48 |     intervalId = null;
49 |     ws = null;
50 |   }
51 | });
52 | 
53 | chrome.tabs.onRemoved.addListener(function(tabId, removeInfo) {
54 |   if (tabId == VIEWER_TAB_ID) {
55 |     VIEWER_TAB_ID = null;
56 |   }
57 | });
58 | 


--------------------------------------------------------------------------------
/demos/screenshare/img/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ebidel/html5can/0df43e2890bb122aad2f31376a8327ec2482d8ca/demos/screenshare/img/.DS_Store


--------------------------------------------------------------------------------
/demos/screenshare/img/screen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ebidel/html5can/0df43e2890bb122aad2f31376a8327ec2482d8ca/demos/screenshare/img/screen.png


--------------------------------------------------------------------------------
/demos/screenshare/manifest.json:
--------------------------------------------------------------------------------
 1 | {
 2 |   "name": "Screenshare",
 3 |   "description": "Screen capture browser using binary WebSockets",
 4 |   "version": "0.0.1",
 5 |   "icons": {
 6 |     "16": "img/screen.png",
 7 |     "32": "img/screen.png",
 8 |     "48": "img/screen.png",
 9 |     "128": "img/screen.png"
10 |   },
11 |   "manifest_version": 2,
12 |   "browser_action": {
13 |     "default_title": "Test",
14 |     "default_icon": "img/screen.png"
15 |     /*"default_popup": "popup.html"*/
16 |   },
17 |   "background": {
18 |     "page": "background.html"
19 |   },
20 |   "options_page": "options.html",
21 |   "permissions": [
22 |     "tabs",
23 |     "",
24 |     "http://*/*"
25 |   ]
26 | }
27 | 


--------------------------------------------------------------------------------
/demos/screenshare/options.html:
--------------------------------------------------------------------------------
 1 | 
 2 | 
19 | 
20 | 
21 |   
22 | 
23 | 
43 | 
44 | 
45 | 
46 | 

Refresh rate:

47 |

Image quality:

48 | 49 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /demos/screenshare/popup.html: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | 22 | 23 | 26 | 27 | 28 | 29 | 30 | 31 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /demos/screenshare/screenshare.crx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ebidel/html5can/0df43e2890bb122aad2f31376a8327ec2482d8ca/demos/screenshare/screenshare.crx -------------------------------------------------------------------------------- /demos/screenshare/server.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | //var WebSocketServer = require('../websocket_node/lib/WebSocketServer'); 4 | var WebSocketServer = require('ws').Server; 5 | 6 | var http = require('http'); 7 | var url = require('url'); 8 | var fs = require('fs'); 9 | 10 | var args = { /* defaults */ 11 | port: '3000' 12 | }; 13 | 14 | /* Parse command line options */ 15 | var pattern = /^--(.*?)(?:=(.*))?$/; 16 | process.argv.forEach(function(value) { 17 | var match = pattern.exec(value); 18 | if (match) { 19 | args[match[1]] = match[2] ? match[2] : true; 20 | } 21 | }); 22 | 23 | var port = parseInt(args.port, 10); 24 | 25 | console.log("Usage: ./server.js [--port=3000]"); 26 | 27 | var connections = {}; 28 | 29 | // ws is the fastest websocket lib: 30 | // http://einaros.github.com/ws/ 31 | var wsServer = new WebSocketServer({port: port}); 32 | 33 | wsServer.on('connection', function(ws) { 34 | 35 | ws.id = Date.now(); // Assign unique id to this ws connection. 36 | connections[ws.id] = ws; 37 | 38 | console.log((new Date()) + ' Connection accepted: ' + ws.id); 39 | 40 | ws.on('message', function(message, flags) { 41 | console.log('Received ' + (flags.binary ? 'binary' : '') + ' message: ' + 42 | message.length + ' bytes.'); 43 | broadcast(message, this, flags); 44 | }); 45 | 46 | ws.on('close', function() { 47 | console.log((new Date()) + " Peer " + this.id + " disconnected."); 48 | delete connections[this.id]; 49 | }); 50 | }); 51 | 52 | // Broadcasts a message to all connected sockets accept for the sender. 53 | function broadcast(message, fromWs, flags) { 54 | for (var id in connections) { 55 | if (id != fromWs.id) { 56 | connections[id].send(message, { 57 | binary: flags.binary ? true : false, 58 | mask: false 59 | }); 60 | } 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /demos/screenshare/viewer.html: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | Screen share 22 | 23 | 24 | 25 | 61 | 62 | 63 | 64 |

VIEWING

65 |
66 | 67 |
68 | 69 | 70 | 71 | 72 | 73 | -------------------------------------------------------------------------------- /demos/screenshare/viewer.js: -------------------------------------------------------------------------------- 1 | // do { 2 | // var id = prompt('Enter a session id'); 3 | // } while (!id); 4 | 5 | var screenshot = document.querySelector('#screenshot'); 6 | screenshot.onload = function(e) { 7 | window.webkitURL.revokeObjectURL(this.src); 8 | }; 9 | 10 | var ws = connect(); 11 | ws.onmessage = function(e) { 12 | var data = e.data; 13 | if (data.__proto__ == Blob.prototype) { 14 | screenshot.src = window.webkitURL.createObjectURL(e.data); 15 | } else { 16 | // Assume we got JSON. 17 | data = JSON.parse(data); 18 | if (data.cmd == 'DONE') { 19 | screenshot.hidden = true; 20 | } else if (data.cmd == 'START') { 21 | screenshot.hidden = false; 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /images/HTML5_Badge.svg: -------------------------------------------------------------------------------- 1 | 2 | 17 | 19 | 20 | 22 | image/svg+xml 23 | 25 | 26 | 27 | 28 | 30 | 53 | HTML5 Logo Badge 55 | 58 | 63 | 68 | 69 | 71 | 76 | 81 | 82 | 87 | 92 | 97 | 98 | 99 | -------------------------------------------------------------------------------- /images/HTML5_Badge_128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ebidel/html5can/0df43e2890bb122aad2f31376a8327ec2482d8ca/images/HTML5_Badge_128.png -------------------------------------------------------------------------------- /images/HTML5_Badge_64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ebidel/html5can/0df43e2890bb122aad2f31376a8327ec2482d8ca/images/HTML5_Badge_64.png -------------------------------------------------------------------------------- /images/audio-routing-analysis.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ebidel/html5can/0df43e2890bb122aad2f31376a8327ec2482d8ca/images/audio-routing-analysis.png -------------------------------------------------------------------------------- /images/audio-routing-crossfade.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ebidel/html5can/0df43e2890bb122aad2f31376a8327ec2482d8ca/images/audio-routing-crossfade.png -------------------------------------------------------------------------------- /images/audio-routing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ebidel/html5can/0df43e2890bb122aad2f31376a8327ec2482d8ca/images/audio-routing.png -------------------------------------------------------------------------------- /images/barchart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ebidel/html5can/0df43e2890bb122aad2f31376a8327ec2482d8ca/images/barchart.png -------------------------------------------------------------------------------- /images/browser_logos/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ebidel/html5can/0df43e2890bb122aad2f31376a8327ec2482d8ca/images/browser_logos/.DS_Store -------------------------------------------------------------------------------- /images/browser_logos/ff_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ebidel/html5can/0df43e2890bb122aad2f31376a8327ec2482d8ca/images/browser_logos/ff_logo.png -------------------------------------------------------------------------------- /images/browser_logos/ie10_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ebidel/html5can/0df43e2890bb122aad2f31376a8327ec2482d8ca/images/browser_logos/ie10_logo.png -------------------------------------------------------------------------------- /images/browser_logos/opera_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ebidel/html5can/0df43e2890bb122aad2f31376a8327ec2482d8ca/images/browser_logos/opera_logo.png -------------------------------------------------------------------------------- /images/browser_logos/safari_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ebidel/html5can/0df43e2890bb122aad2f31376a8327ec2482d8ca/images/browser_logos/safari_logo.png -------------------------------------------------------------------------------- /images/chart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ebidel/html5can/0df43e2890bb122aad2f31376a8327ec2482d8ca/images/chart.png -------------------------------------------------------------------------------- /images/chrome-logo-tiny.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ebidel/html5can/0df43e2890bb122aad2f31376a8327ec2482d8ca/images/chrome-logo-tiny.png -------------------------------------------------------------------------------- /images/chrome_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ebidel/html5can/0df43e2890bb122aad2f31376a8327ec2482d8ca/images/chrome_logo.png -------------------------------------------------------------------------------- /images/google_developers_icon_128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ebidel/html5can/0df43e2890bb122aad2f31376a8327ec2482d8ca/images/google_developers_icon_128.png -------------------------------------------------------------------------------- /images/google_developers_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ebidel/html5can/0df43e2890bb122aad2f31376a8327ec2482d8ca/images/google_developers_logo.png -------------------------------------------------------------------------------- /images/google_developers_logo_white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ebidel/html5can/0df43e2890bb122aad2f31376a8327ec2482d8ca/images/google_developers_logo_white.png -------------------------------------------------------------------------------- /images/html_can_not_do_that.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ebidel/html5can/0df43e2890bb122aad2f31376a8327ec2482d8ca/images/html_can_not_do_that.jpg -------------------------------------------------------------------------------- /images/icons/bug.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ebidel/html5can/0df43e2890bb122aad2f31376a8327ec2482d8ca/images/icons/bug.png -------------------------------------------------------------------------------- /images/icons/bug_closed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ebidel/html5can/0df43e2890bb122aad2f31376a8327ec2482d8ca/images/icons/bug_closed.png -------------------------------------------------------------------------------- /images/icons/gears.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 15 | 25 | 26 | -------------------------------------------------------------------------------- /images/icons/radar.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /images/io2012_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ebidel/html5can/0df43e2890bb122aad2f31376a8327ec2482d8ca/images/io2012_logo.png -------------------------------------------------------------------------------- /images/my_book_cover.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ebidel/html5can/0df43e2890bb122aad2f31376a8327ec2482d8ca/images/my_book_cover.jpg -------------------------------------------------------------------------------- /images/slides/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ebidel/html5can/0df43e2890bb122aad2f31376a8327ec2482d8ca/images/slides/.DS_Store -------------------------------------------------------------------------------- /images/slides/binding.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ebidel/html5can/0df43e2890bb122aad2f31376a8327ec2482d8ca/images/slides/binding.jpg -------------------------------------------------------------------------------- /images/slides/blueprint.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ebidel/html5can/0df43e2890bb122aad2f31376a8327ec2482d8ca/images/slides/blueprint.jpg -------------------------------------------------------------------------------- /images/slides/fast.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ebidel/html5can/0df43e2890bb122aad2f31376a8327ec2482d8ca/images/slides/fast.jpg -------------------------------------------------------------------------------- /images/slides/flexbox-holygrail.svg: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | 14 | <header> 15 | 16 | 17 | 18 | <footer> 19 | 20 | 21 | 22 | <nav> 23 | 24 | 25 | 26 | <article> 27 | 28 | 29 | 30 | <aside> 31 | 32 | -------------------------------------------------------------------------------- /images/slides/flexbox-tools.svg: -------------------------------------------------------------------------------- 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 | -------------------------------------------------------------------------------- /images/slides/rocket.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ebidel/html5can/0df43e2890bb122aad2f31376a8327ec2482d8ca/images/slides/rocket.jpg -------------------------------------------------------------------------------- /images/slides/stream.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ebidel/html5can/0df43e2890bb122aad2f31376a8327ec2482d8ca/images/slides/stream.jpg -------------------------------------------------------------------------------- /images/slides/tools.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ebidel/html5can/0df43e2890bb122aad2f31376a8327ec2482d8ca/images/slides/tools.jpg -------------------------------------------------------------------------------- /images/slides/tools2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ebidel/html5can/0df43e2890bb122aad2f31376a8327ec2482d8ca/images/slides/tools2.jpg -------------------------------------------------------------------------------- /images/transferables.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ebidel/html5can/0df43e2890bb122aad2f31376a8327ec2482d8ca/images/transferables.jpg -------------------------------------------------------------------------------- /images/twitter_newbird_blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ebidel/html5can/0df43e2890bb122aad2f31376a8327ec2482d8ca/images/twitter_newbird_blue.png -------------------------------------------------------------------------------- /js/app.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | window.requestAnimationFrame = window.requestAnimationFrame || 3 | window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || 4 | window.msequestAnimationFrame || window.oRequestAnimationFrame; 5 | window.cancelAnimationFrame = window.cancelAnimationFrame || 6 | window.webkitCancelAnimationFrame || window.mozCancelAnimationFrame || 7 | window.msCancelAnimationFrame || window.oCancelAnimationFrame; 8 | 9 | window.MutationObserver = window.MutationObserver || 10 | window.WebKitMutationObserver || window.MozMutationObserver || 11 | window.OMutationObserver || window.MsMutationObserver; 12 | 13 | var transEndEventNames = { 14 | 'WebkitTransition': 'webkitTransitionEnd', 15 | 'MozTransition': 'transitionend', 16 | 'OTransition': 'oTransitionEnd', 17 | 'msTransition': 'MSTransitionEnd', 18 | 'transition': 'transitionend' 19 | }; 20 | 21 | var PREFIXES = { 22 | 'webkit': 'WebKit', 23 | 'moz': 'Moz', 24 | 'ms': 'MS', 25 | 'o': 'O' 26 | }; 27 | 28 | // Find the correct transitionEnd vendor prefix. 29 | window.transEndEventName = transEndEventNames[Modernizr.prefixed('transition')]; 30 | 31 | window.$ = function(selector, opt_scope) { 32 | var scope = opt_scope || document; 33 | return scope.querySelector(selector); 34 | }; 35 | 36 | window.$$ = function(selector, opt_scope) { 37 | var scope = opt_scope || document; 38 | return Array.prototype.slice.call(scope.querySelectorAll(selector) || []); 39 | }; 40 | 41 | HTMLElement.prototype.$ = function(selector) { 42 | return $(selector, this); 43 | }; 44 | 45 | HTMLElement.prototype.$$ = function(selector) { 46 | return $$(selector, this); 47 | }; 48 | 49 | HTMLElement.prototype.listen = HTMLElement.prototype.addEventListener; 50 | document.listen = document.addEventListener; 51 | 52 | 53 | // If DOM is ready, run our setup. Otherwise wait for it to finish. 54 | if (document.readyState === 'complete') { 55 | initContent(); 56 | } else { 57 | document.listen('readystatechange', function() { 58 | if (document.readyState === 'complete') { 59 | initContent(); 60 | } 61 | }); 62 | } 63 | 64 | function addVendorPrefixes() { 65 | $$('[data-tooltip-property]').forEach(function(tip, i) { 66 | var property = tip.dataset.tooltipProperty; 67 | 68 | var support = Object.keys(PREFIXES); // Default to all prefixes if support array is missing. 69 | var includeUnprefixedVersion = false; 70 | if (tip.dataset.tooltipSupport) { 71 | support = JSON.parse(tip.dataset.tooltipSupport); 72 | // A 'unprefix' in the array indicates not to include unprefixed property. 73 | var idx = support.indexOf('unprefixed'); 74 | if (idx != -1) { 75 | includeUnprefixedVersion = true; 76 | support.splice(idx, 1); 77 | } 78 | } 79 | 80 | var str = ['/* Requires vendor prefixes. */']; 81 | 82 | if ('tooltipJs' in tip.dataset) { 83 | tip.href = 'http://caniuse.com/#search=' + property; 84 | 85 | support.forEach(function(prefix, i) { 86 | // Capitalized Properties should remain so, unless explicitly called out. 87 | if (property[0] == property[0].toUpperCase() && 88 | !('tooltipLowercase' in tip.dataset)) { 89 | var val = PREFIXES[prefix] + property + '(...)'; 90 | } else { 91 | var upperCasedProperty = property[0].toUpperCase() + property.substring(1); 92 | var val = prefix + upperCasedProperty + '(...);'; 93 | } 94 | str.push(val); 95 | }); 96 | 97 | if (includeUnprefixedVersion) { 98 | str.push(property + '(...);'); 99 | } 100 | 101 | } else { 102 | tip.href = 'http://sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html#including_a_mixin'; 103 | 104 | support.forEach(function(prefix, i) { 105 | str.push('-' + prefix + '-' + property);// + ': ...'); 106 | 107 | }); 108 | 109 | str.push(property);// + ': ...'); // Include unprefixed property by default for CSS. 110 | } 111 | 112 | tip.dataset.tooltip = str.join('\n'); 113 | tip.role = 'tooltip'; 114 | tip.innerHTML = '' + 115 | (!('tooltipJs' in tip.dataset) ? '+' : '') + property + 116 | ''; 117 | }); 118 | } 119 | 120 | function addBugStatus() { 121 | $$('.bug').forEach(function(bug, i) { 122 | bug.alt = 'WebKit bug link'; 123 | bug.title = 'WebKit bug link'; 124 | fetchBugStatus(bug); 125 | }); 126 | } 127 | 128 | function fetchBugStatus(bug) { 129 | // Ignore crbugs. They don't do CORS :( 130 | if (!bug.href.match(/webk\.it/)) { 131 | return; 132 | } 133 | var url = bug.href.split('/'); 134 | url = 'https://bugs.webkit.org/show_bug.cgi?id=' + url[url.length - 1]; 135 | var xhr = new XMLHttpRequest(); 136 | xhr.open('GET', url, true); 137 | xhr.onload = function(e) { 138 | var div = document.createElement('div'); 139 | div.innerHTML = this.response; 140 | var status = div.$('#static_bug_status').textContent.trim(); 141 | var isClosed = status.match(/resolved|closed|fixed/i); 142 | if (isClosed) { 143 | bug.classList.add('closed'); 144 | } 145 | }; 146 | xhr.onerror = function(e) { 147 | console.log(e); 148 | }; 149 | xhr.send(); 150 | } 151 | 152 | // DOM Ready business. 153 | function initContent(e) { 154 | document.body.classList.add('loaded'); // Add loaded class for templates to use. 155 | 156 | if (slidedeck.slides[slidedeck.curSlide_].classList.contains('blueprint')) { 157 | document.body.classList.add('blueprint'); 158 | } 159 | 160 | slidedeck.container.listen('slideenter', function(e) { 161 | var slide = e.target; 162 | if (slide.dataset.bodyClass) { 163 | document.body.classList.add(slide.dataset.bodyClass); 164 | } 165 | }); 166 | 167 | slidedeck.container.listen('slideleave', function(e) { 168 | var slide = e.target; 169 | if (slide.dataset.bodyClass) { 170 | document.body.classList.remove(slide.dataset.bodyClass); 171 | } 172 | }); 173 | 174 | var isChrome = navigator.userAgent.match(/Chrome/); 175 | if (!isChrome || isChrome && parseInt(navigator.userAgent.match(/Chrome\/(.*) /)[1]) < 21) { 176 | document.querySelector('#chrome-version-warning').style.display = 'block'; 177 | } 178 | 179 | // Can't use CSS counters because counts change when slides are hidden. 180 | $$('.can h2').forEach(function(el, i) { 181 | el.dataset.canNum = ++i; 182 | }); 183 | 184 | $$('[data-config-gplus]').forEach(function(el, i) { 185 | el.href = slidedeck.config_.presenters[0].gplus; 186 | }); 187 | 188 | $$('[data-config-twitter]').forEach(function(el, i) { 189 | var handle = slidedeck.config_.presenters[0].twitter; 190 | if (!el.hasChildNodes()) { 191 | el.textContent = handle; 192 | } 193 | if (el.nodeName == 'A') { 194 | el.href = 'http://twitter.com/' + handle; 195 | } 196 | }); 197 | 198 | $$('[data-config-www]').forEach(function(el, i) { 199 | var www = slidedeck.config_.presenters[0].www; 200 | if (!el.hasChildNodes()) { 201 | el.textContent = www.replace('http:\/\/www\.', ''); 202 | } 203 | if (el.nodeName == 'A') { 204 | el.href = www; 205 | } 206 | }); 207 | 208 | $$('[data-config-presenter-name]').forEach(function(el, i) { 209 | el.textContent = slidedeck.config_.presenters[0].name; 210 | }); 211 | 212 | $$('[data-config-presenter-company]').forEach(function(el, i) { 213 | el.textContent = slidedeck.config_.presenters[0].company; 214 | }); 215 | 216 | $$('[data-config-presenter-title]').forEach(function(el, i) { 217 | el.textContent = slidedeck.config_.presenters[0].title; 218 | }); 219 | 220 | addVendorPrefixes(); 221 | addBugStatus(); 222 | 223 | var wrapup = document.querySelector('#wrapup ul'); 224 | var cans = document.querySelectorAll('slide.can h2'); 225 | for (var i = 0, can; can = cans[i]; ++i) { 226 | can.dataset.canNum = i + 1; 227 | var li = document.createElement('li'); 228 | li.textContent = can.textContent; 229 | wrapup.appendChild(li); 230 | } 231 | } 232 | 233 | (function() { 234 | function calculateHeights() { 235 | // Flexbox column demo. 236 | $$('#flexbox-bad > div').forEach(function(el, i) { 237 | var h = window.getComputedStyle(el).height; 238 | if (h != 'auto') { 239 | var height = Math.round(h.split('px')[0]); 240 | 241 | // Remember initial height so we can reset it if coming back to this slide. 242 | if (!el.dataset.initialHeight) { 243 | el.dataset.initialHeight = height; 244 | el.style.minHeight = height + 'px'; 245 | } else { 246 | el.style.minHeight = el.dataset.initialHeight + 'px'; 247 | } 248 | 249 | el.dataset.height = height; 250 | } 251 | }); 252 | } 253 | 254 | calculateHeights(); // Call on page load. 255 | 256 | var slide = $('#flexbox-bad').parentElement; 257 | slide.listen('slideenter', calculateHeights); 258 | slide.listen('slideleave', function(e) { 259 | var el = $('#flexbox-bad div:first-child'); 260 | el.style.minHeight = el.dataset.initialHeight + 'px'; 261 | }); 262 | })(); 263 | 264 | 265 | (function() { 266 | var demo = $('#flexbox-bad'); 267 | var el = demo.$('div:first-child'); 268 | var rafId = null; 269 | 270 | var onMutation = function(e) { 271 | var target = !e.type ? e[0].target : e.target; 272 | 273 | var height = Math.round(window.getComputedStyle(target).height.split('px')[0]); 274 | target.dataset.height = height; 275 | 276 | if (height > 400) { 277 | target.classList.add('whoops'); 278 | } else { 279 | target.classList.remove('whoops'); 280 | } 281 | }; 282 | 283 | // If we have mutation observers, use them. Otherwise, bind to keyup. 284 | if (window.MutationObserver) { 285 | var observer = new MutationObserver(onMutation); 286 | observer.observe(el, {childList: true}); 287 | } else { 288 | el.listen('keyup', onMutation); 289 | } 290 | 291 | var onTransitionEnd = function(e) { 292 | if (e.propertyName === 'height') { 293 | window.cancelAnimationFrame(rafId); 294 | } 295 | }; 296 | 297 | demo.$$('div').forEach(function(el, i) { 298 | el.listen(transEndEventName, onTransitionEnd, false); 299 | }); 300 | 301 | demo.listen('click', function(e) { 302 | var target = e.target; 303 | 304 | if (target.nodeName == 'DIV') { 305 | (function callback(time) { 306 | target.dataset.height = Math.round(window.getComputedStyle(target).height.split('px')[0]); 307 | rafId = window.requestAnimationFrame(callback); 308 | })(); 309 | 310 | if (!target.previousElementSibling && target.classList.contains('active')) { 311 | target.contentEditable = true; 312 | target.classList.toggle('editable'); 313 | } 314 | 315 | target.classList.toggle('active'); 316 | } 317 | }); 318 | })(); 319 | 320 | (function() { 321 | var demo = $('#flexbox-ex2'); 322 | 323 | demo.listen('change', function(e) { 324 | var target = e.target; 325 | demo.$('.box').style[Modernizr.prefixed(target.id)] = target.value; 326 | }); 327 | })(); 328 | 329 | (function() { 330 | var demo = $('#flexbox-ex3'); 331 | 332 | demo.listen('change', function(e) { 333 | if (e.target.nodeName == 'INPUT') { 334 | var str = []; 335 | this.$$('input').forEach(function(input, i) { 336 | str.push(input.value); 337 | }); 338 | this.$('.box > :nth-child(2)').style[Modernizr.prefixed('flex')] = str.join(' '); 339 | } 340 | }); 341 | })(); 342 | 343 | (function() { 344 | var demo = $('#flexbox-ex4'); 345 | 346 | demo.listen('change', function(e) { 347 | var target = e.target; 348 | var el = null; 349 | if (target.id == 'order') { 350 | el = demo.$('.box > :nth-child(2)'); 351 | } else if (target.id == 'flexDirection') { 352 | el = demo.$('.box'); 353 | if (target.value.indexOf('column') == 0) { 354 | demo.$('.box').classList.add('switchmainaxis'); 355 | } else { 356 | demo.$('.box').classList.remove('switchmainaxis'); 357 | } 358 | } 359 | el.style[Modernizr.prefixed(target.id)] = target.value; 360 | }); 361 | })(); 362 | 363 | (function() { 364 | var input = document.querySelector('#data-binding-example input'); 365 | input.dataset.value = input.value; 366 | 367 | input.addEventListener('change', function(e) { 368 | this.dataset.value = this.valueAsNumber; 369 | }); 370 | })(); 371 | 372 | })(); 373 | -------------------------------------------------------------------------------- /js/hammer.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Hammer.JS 3 | * version 0.4 4 | * author: Eight Media 5 | * https://github.com/EightMedia/hammer.js 6 | */ 7 | function Hammer(element, options, undefined) 8 | { 9 | var self = this; 10 | 11 | var defaults = { 12 | // prevent the default event or not... might be buggy when false 13 | prevent_default : false, 14 | css_hacks : true, 15 | 16 | drag : true, 17 | drag_vertical : true, 18 | drag_horizontal : true, 19 | // minimum distance before the drag event starts 20 | drag_min_distance : 20, // pixels 21 | 22 | // pinch zoom and rotation 23 | transform : true, 24 | scale_treshold : 0.1, 25 | rotation_treshold : 15, // degrees 26 | 27 | tap : true, 28 | tap_double : true, 29 | tap_max_interval : 300, 30 | tap_double_distance: 20, 31 | 32 | hold : true, 33 | hold_timeout : 500 34 | }; 35 | options = mergeObject(defaults, options); 36 | 37 | // some css hacks 38 | (function() { 39 | if(!options.css_hacks) { 40 | return false; 41 | } 42 | 43 | var vendors = ['webkit','moz','ms','o','']; 44 | var css_props = { 45 | "userSelect": "none", 46 | "touchCallout": "none", 47 | "userDrag": "none", 48 | "tapHighlightColor": "rgba(0,0,0,0)" 49 | }; 50 | 51 | var prop = ''; 52 | for(var i = 0; i < vendors.length; i++) { 53 | for(var p in css_props) { 54 | prop = p; 55 | if(vendors[i]) { 56 | prop = vendors[i] + prop.substring(0, 1).toUpperCase() + prop.substring(1); 57 | } 58 | element.style[ prop ] = css_props[p]; 59 | } 60 | } 61 | })(); 62 | 63 | // holds the distance that has been moved 64 | var _distance = 0; 65 | 66 | // holds the exact angle that has been moved 67 | var _angle = 0; 68 | 69 | // holds the diraction that has been moved 70 | var _direction = 0; 71 | 72 | // holds position movement for sliding 73 | var _pos = { }; 74 | 75 | // how many fingers are on the screen 76 | var _fingers = 0; 77 | 78 | var _first = false; 79 | 80 | var _gesture = null; 81 | var _prev_gesture = null; 82 | 83 | var _touch_start_time = null; 84 | var _prev_tap_pos = {x: 0, y: 0}; 85 | var _prev_tap_end_time = null; 86 | 87 | var _hold_timer = null; 88 | 89 | var _offset = {}; 90 | 91 | // keep track of the mouse status 92 | var _mousedown = false; 93 | 94 | var _event_start; 95 | var _event_move; 96 | var _event_end; 97 | 98 | 99 | /** 100 | * angle to direction define 101 | * @param float angle 102 | * @return string direction 103 | */ 104 | this.getDirectionFromAngle = function( angle ) 105 | { 106 | var directions = { 107 | down: angle >= 45 && angle < 135, //90 108 | left: angle >= 135 || angle <= -135, //180 109 | up: angle < -45 && angle > -135, //270 110 | right: angle >= -45 && angle <= 45 //0 111 | }; 112 | 113 | var direction, key; 114 | for(key in directions){ 115 | if(directions[key]){ 116 | direction = key; 117 | break; 118 | } 119 | } 120 | return direction; 121 | }; 122 | 123 | 124 | /** 125 | * count the number of fingers in the event 126 | * when no fingers are detected, one finger is returned (mouse pointer) 127 | * @param event 128 | * @return int fingers 129 | */ 130 | function countFingers( event ) 131 | { 132 | // there is a bug on android (until v4?) that touches is always 1, 133 | // so no multitouch is supported, e.g. no, zoom and rotation... 134 | return event.touches ? event.touches.length : 1; 135 | } 136 | 137 | 138 | /** 139 | * get the x and y positions from the event object 140 | * @param event 141 | * @return array [{ x: int, y: int }] 142 | */ 143 | function getXYfromEvent( event ) 144 | { 145 | event = event || window.event; 146 | 147 | // no touches, use the event pageX and pageY 148 | if(!event.touches) { 149 | var doc = document, 150 | body = doc.body; 151 | 152 | return [{ 153 | x: event.pageX || event.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && doc.clientLeft || 0 ), 154 | y: event.pageY || event.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && doc.clientTop || 0 ) 155 | }]; 156 | } 157 | // multitouch, return array with positions 158 | else { 159 | var pos = [], src; 160 | for(var t=0, len=event.touches.length; t options.drag_min_distance) || _gesture == 'drag') { 262 | // calculate the angle 263 | _angle = getAngle(_pos.start[0], _pos.move[0]); 264 | _direction = self.getDirectionFromAngle(_angle); 265 | 266 | // check the movement and stop if we go in the wrong direction 267 | var is_vertical = (_direction == 'up' || _direction == 'down'); 268 | if(((is_vertical && !options.drag_vertical) || (!is_vertical && !options.drag_horizontal)) 269 | && (_distance > options.drag_min_distance)) { 270 | return; 271 | } 272 | 273 | _gesture = 'drag'; 274 | 275 | var position = { x: _pos.move[0].x - _offset.left, 276 | y: _pos.move[0].y - _offset.top }; 277 | 278 | var event_obj = { 279 | originalEvent : event, 280 | position : position, 281 | direction : _direction, 282 | distance : _distance, 283 | distanceX : _distance_x, 284 | distanceY : _distance_y, 285 | angle : _angle 286 | }; 287 | 288 | // on the first time trigger the start event 289 | if(_first) { 290 | triggerEvent("dragstart", event_obj); 291 | 292 | _first = false; 293 | } 294 | 295 | // normal slide event 296 | triggerEvent("drag", event_obj); 297 | 298 | cancelEvent(event); 299 | } 300 | }, 301 | 302 | 303 | // transform gesture 304 | // fired on touchmove 305 | transform : function(event) 306 | { 307 | if(options.transform) { 308 | var scale = event.scale || 1; 309 | var rotation = event.rotation || 0; 310 | 311 | if(countFingers(event) != 2) { 312 | return false; 313 | } 314 | 315 | if(_gesture != 'drag' && 316 | (_gesture == 'transform' || Math.abs(1-scale) > options.scale_treshold 317 | || Math.abs(rotation) > options.rotation_treshold)) { 318 | _gesture = 'transform'; 319 | 320 | _pos.center = { x: ((_pos.move[0].x + _pos.move[1].x) / 2) - _offset.left, 321 | y: ((_pos.move[0].y + _pos.move[1].y) / 2) - _offset.top }; 322 | 323 | var event_obj = { 324 | originalEvent : event, 325 | position : _pos.center, 326 | scale : scale, 327 | rotation : rotation 328 | }; 329 | 330 | // on the first time trigger the start event 331 | if(_first) { 332 | triggerEvent("transformstart", event_obj); 333 | _first = false; 334 | } 335 | 336 | triggerEvent("transform", event_obj); 337 | 338 | cancelEvent(event); 339 | 340 | return true; 341 | } 342 | } 343 | 344 | return false; 345 | }, 346 | 347 | 348 | // tap and double tap gesture 349 | // fired on touchend 350 | tap : function(event) 351 | { 352 | // compare the kind of gesture by time 353 | var now = new Date().getTime(); 354 | var touch_time = now - _touch_start_time; 355 | 356 | // dont fire when hold is fired 357 | if(options.hold && !(options.hold && options.hold_timeout > touch_time)) { 358 | return; 359 | } 360 | 361 | // when previous event was tap and the tap was max_interval ms ago 362 | var is_double_tap = (function(){ 363 | if (_prev_tap_pos && options.tap_double && _prev_gesture == 'tap' && (_touch_start_time - _prev_tap_end_time) < options.tap_max_interval) { 364 | var x_distance = Math.abs(_prev_tap_pos[0].x - _pos.start[0].x); 365 | var y_distance = Math.abs(_prev_tap_pos[0].y - _pos.start[0].y); 366 | return (_prev_tap_pos && _pos.start && Math.max(x_distance, y_distance) < options.tap_double_distance); 367 | 368 | } 369 | return false; 370 | })(); 371 | 372 | if(is_double_tap) { 373 | _gesture = 'double_tap'; 374 | _prev_tap_end_time = null; 375 | 376 | triggerEvent("doubletap", { 377 | originalEvent : event, 378 | position : _pos.start 379 | }); 380 | cancelEvent(event); 381 | } 382 | 383 | // single tap is single touch 384 | else { 385 | _gesture = 'tap'; 386 | _prev_tap_end_time = now; 387 | _prev_tap_pos = _pos.start; 388 | 389 | if(options.tap) { 390 | triggerEvent("tap", { 391 | originalEvent : event, 392 | position : _pos.start 393 | }); 394 | cancelEvent(event); 395 | } 396 | } 397 | 398 | } 399 | 400 | }; 401 | 402 | 403 | function handleEvents(event) 404 | { 405 | switch(event.type) 406 | { 407 | case 'mousedown': 408 | case 'touchstart': 409 | _pos.start = getXYfromEvent(event); 410 | _touch_start_time = new Date().getTime(); 411 | _fingers = countFingers(event); 412 | _first = true; 413 | _event_start = event; 414 | 415 | // borrowed from jquery offset https://github.com/jquery/jquery/blob/master/src/offset.js 416 | var box = element.getBoundingClientRect(); 417 | var clientTop = element.clientTop || document.body.clientTop || 0; 418 | var clientLeft = element.clientLeft || document.body.clientLeft || 0; 419 | var scrollTop = window.pageYOffset || element.scrollTop || document.body.scrollTop; 420 | var scrollLeft = window.pageXOffset || element.scrollLeft || document.body.scrollLeft; 421 | 422 | _offset = { 423 | top: box.top + scrollTop - clientTop, 424 | left: box.left + scrollLeft - clientLeft 425 | }; 426 | 427 | _mousedown = true; 428 | 429 | // hold gesture 430 | gestures.hold(event); 431 | 432 | if(options.prevent_default) { 433 | cancelEvent(event); 434 | } 435 | break; 436 | 437 | case 'mousemove': 438 | case 'touchmove': 439 | if(!_mousedown) { 440 | return false; 441 | } 442 | _event_move = event; 443 | _pos.move = getXYfromEvent(event); 444 | 445 | if(!gestures.transform(event)) { 446 | gestures.drag(event); 447 | } 448 | break; 449 | 450 | case 'mouseup': 451 | case 'mouseout': 452 | case 'touchcancel': 453 | case 'touchend': 454 | if(!_mousedown || (_gesture != 'transform' && event.touches && event.touches.length > 0)) { 455 | return false; 456 | } 457 | 458 | _mousedown = false; 459 | _event_end = event; 460 | 461 | // drag gesture 462 | // dragstart is triggered, so dragend is possible 463 | if(_gesture == 'drag') { 464 | triggerEvent("dragend", { 465 | originalEvent : event, 466 | direction : _direction, 467 | distance : _distance, 468 | angle : _angle 469 | }); 470 | } 471 | 472 | // transform 473 | // transformstart is triggered, so transformed is possible 474 | else if(_gesture == 'transform') { 475 | triggerEvent("transformend", { 476 | originalEvent : event, 477 | position : _pos.center, 478 | scale : event.scale, 479 | rotation : event.rotation 480 | }); 481 | } 482 | else { 483 | gestures.tap(_event_start); 484 | } 485 | 486 | _prev_gesture = _gesture; 487 | 488 | // reset vars 489 | reset(); 490 | break; 491 | } 492 | } 493 | 494 | 495 | // bind events for touch devices 496 | // except for windows phone 7.5, it doesnt support touch events..! 497 | if('ontouchstart' in window) { 498 | element.addEventListener("touchstart", handleEvents, false); 499 | element.addEventListener("touchmove", handleEvents, false); 500 | element.addEventListener("touchend", handleEvents, false); 501 | element.addEventListener("touchcancel", handleEvents, false); 502 | } 503 | // for non-touch 504 | else { 505 | 506 | if(element.addEventListener){ // prevent old IE errors 507 | element.addEventListener("mouseout", function(event) { 508 | if(!isInsideHammer(element, event.relatedTarget)) { 509 | handleEvents(event); 510 | } 511 | }, false); 512 | element.addEventListener("mouseup", handleEvents, false); 513 | element.addEventListener("mousedown", handleEvents, false); 514 | element.addEventListener("mousemove", handleEvents, false); 515 | 516 | // events for older IE 517 | }else if(document.attachEvent){ 518 | element.attachEvent("onmouseout", function(event) { 519 | if(!isInsideHammer(element, event.relatedTarget)) { 520 | handleEvents(event); 521 | } 522 | }, false); 523 | element.attachEvent("onmouseup", handleEvents); 524 | element.attachEvent("onmousedown", handleEvents); 525 | element.attachEvent("onmousemove", handleEvents); 526 | } 527 | } 528 | 529 | 530 | /** 531 | * find if element is (inside) given parent element 532 | * @param object element 533 | * @param object parent 534 | * @return bool inside 535 | */ 536 | function isInsideHammer(parent, child) { 537 | // get related target for IE 538 | if(!child && window.event && window.event.toElement){ 539 | child = window.event.toElement; 540 | } 541 | 542 | if(parent === child){ 543 | return true; 544 | } 545 | 546 | // loop over parentNodes of child until we find hammer element 547 | if(child){ 548 | var node = child.parentNode; 549 | while(node !== null){ 550 | if(node === parent){ 551 | return true; 552 | }; 553 | node = node.parentNode; 554 | } 555 | } 556 | return false; 557 | } 558 | 559 | 560 | /** 561 | * merge 2 objects into a new object 562 | * @param object obj1 563 | * @param object obj2 564 | * @return object merged object 565 | */ 566 | function mergeObject(obj1, obj2) { 567 | var output = {}; 568 | 569 | if(!obj2) { 570 | return obj1; 571 | } 572 | 573 | for (var prop in obj1) { 574 | if (prop in obj2) { 575 | output[prop] = obj2[prop]; 576 | } else { 577 | output[prop] = obj1[prop]; 578 | } 579 | } 580 | return output; 581 | } 582 | 583 | function isFunction( obj ){ 584 | return Object.prototype.toString.call( obj ) == "[object Function]"; 585 | } 586 | } -------------------------------------------------------------------------------- /js/modernizr.custom.45394.js: -------------------------------------------------------------------------------- 1 | /* Modernizr 2.5.3 (Custom Build) | MIT & BSD 2 | * Build: http://www.modernizr.com/download/#-fontface-backgroundsize-borderimage-borderradius-boxshadow-flexbox-flexbox_legacy-hsla-multiplebgs-opacity-rgba-textshadow-cssanimations-csscolumns-generatedcontent-cssgradients-cssreflections-csstransforms-csstransforms3d-csstransitions-applicationcache-canvas-canvastext-draganddrop-hashchange-history-audio-video-indexeddb-input-inputtypes-localstorage-postmessage-sessionstorage-websockets-websqldatabase-webworkers-geolocation-inlinesvg-smil-svg-svgclippaths-touch-webgl-mq-prefixed-teststyles-testprop-testallprops-hasevent-prefixes-domprefixes-load 3 | */ 4 | ;window.Modernizr=function(a,b,c){function C(a){i.cssText=a}function D(a,b){return C(m.join(a+";")+(b||""))}function E(a,b){return typeof a===b}function F(a,b){return!!~(""+a).indexOf(b)}function G(a,b){for(var d in a)if(i[a[d]]!==c)return b=="pfx"?a[d]:!0;return!1}function H(a,b,d){for(var e in a){var f=b[a[e]];if(f!==c)return d===!1?a[e]:E(f,"function")?f.bind(d||b):f}return!1}function I(a,b,c){var d=a.charAt(0).toUpperCase()+a.substr(1),e=(a+" "+o.join(d+" ")+d).split(" ");return E(b,"string")||E(b,"undefined")?G(e,b):(e=(a+" "+p.join(d+" ")+d).split(" "),H(e,b,c))}function K(){e.input=function(c){for(var d=0,e=c.length;d",a,""].join(""),k.id=g,(l?k:m).innerHTML+=h,m.appendChild(k),l||(m.style.background="",f.appendChild(m)),i=c(k,a),l?k.parentNode.removeChild(k):m.parentNode.removeChild(m),!!i},y=function(b){var c=a.matchMedia||a.msMatchMedia;if(c)return c(b).matches;var d;return x("@media "+b+" { #"+g+" { position: absolute; } }",function(b){d=(a.getComputedStyle?getComputedStyle(b,null):b.currentStyle)["position"]=="absolute"}),d},z=function(){function d(d,e){e=e||b.createElement(a[d]||"div"),d="on"+d;var f=d in e;return f||(e.setAttribute||(e=b.createElement("div")),e.setAttribute&&e.removeAttribute&&(e.setAttribute(d,""),f=E(e[d],"function"),E(e[d],"undefined")||(e[d]=c),e.removeAttribute(d))),e=null,f}var a={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return d}(),A={}.hasOwnProperty,B;!E(A,"undefined")&&!E(A.call,"undefined")?B=function(a,b){return A.call(a,b)}:B=function(a,b){return b in a&&E(a.constructor.prototype[b],"undefined")},Function.prototype.bind||(Function.prototype.bind=function(b){var c=this;if(typeof c!="function")throw new TypeError;var d=v.call(arguments,1),e=function(){if(this instanceof e){var a=function(){};a.prototype=c.prototype;var f=new a,g=c.apply(f,d.concat(v.call(arguments)));return Object(g)===g?g:f}return c.apply(b,d.concat(v.call(arguments)))};return e});var J=function(c,d){var f=c.join(""),g=d.length;x(f,function(c,d){var f=b.styleSheets[b.styleSheets.length-1],h=f?f.cssRules&&f.cssRules[0]?f.cssRules[0].cssText:f.cssText||"":"",i=c.childNodes,j={};while(g--)j[i[g].id]=i[g];e.touch="ontouchstart"in a||a.DocumentTouch&&b instanceof DocumentTouch||(j.touch&&j.touch.offsetTop)===9,e.csstransforms3d=(j.csstransforms3d&&j.csstransforms3d.offsetLeft)===9&&j.csstransforms3d.offsetHeight===3,e.generatedcontent=(j.generatedcontent&&j.generatedcontent.offsetHeight)>=1,e.fontface=/src/i.test(h)&&h.indexOf(d.split(" ")[0])===0},g,d)}(['@font-face {font-family:"font";src:url("https://")}',["@media (",m.join("touch-enabled),("),g,")","{#touch{top:9px;position:absolute}}"].join(""),["@media (",m.join("transform-3d),("),g,")","{#csstransforms3d{left:9px;position:absolute;height:3px;}}"].join(""),['#generatedcontent:after{content:"',k,'";visibility:hidden}'].join("")],["fontface","touch","csstransforms3d","generatedcontent"]);r.flexbox=function(){return I("flexOrder")},r["flexbox-legacy"]=function(){return I("boxDirection")},r.canvas=function(){var a=b.createElement("canvas");return!!a.getContext&&!!a.getContext("2d")},r.canvastext=function(){return!!e.canvas&&!!E(b.createElement("canvas").getContext("2d").fillText,"function")},r.webgl=function(){try{var d=b.createElement("canvas"),e;e=!(!a.WebGLRenderingContext||!d.getContext("experimental-webgl")&&!d.getContext("webgl")),d=c}catch(f){e=!1}return e},r.touch=function(){return e.touch},r.geolocation=function(){return!!navigator.geolocation},r.postmessage=function(){return!!a.postMessage},r.websqldatabase=function(){return!!a.openDatabase},r.indexedDB=function(){return!!I("indexedDB",a)},r.hashchange=function(){return z("hashchange",a)&&(b.documentMode===c||b.documentMode>7)},r.history=function(){return!!a.history&&!!history.pushState},r.draganddrop=function(){var a=b.createElement("div");return"draggable"in a||"ondragstart"in a&&"ondrop"in a},r.websockets=function(){for(var b=-1,c=o.length;++b0&&g.splice(0,a);setTimeout(function(){b.parentNode.removeChild(b)},15)}}function m(a){var b,c;a.setAttribute("data-orderloaded","loaded");for(a=0;c=h[a];a++)if((b=i[c])&&b.getAttribute("data-orderloaded")==="loaded")delete i[c],require.addScriptToDom(b);else break;a>0&&h.splice(0, 7 | a)}var f=typeof document!=="undefined"&&typeof window!=="undefined"&&document.createElement("script"),n=f&&(f.async||window.opera&&Object.prototype.toString.call(window.opera)==="[object Opera]"||"MozAppearance"in document.documentElement.style),o=f&&f.readyState==="uninitialized",l=/^(complete|loaded)$/,g=[],j={},i={},h=[],f=null;define({version:"1.0.5",load:function(a,b,c,e){var d;b.nameToUrl?(d=b.nameToUrl(a,null),require.s.skipAsync[d]=!0,n||e.isBuild?b([a],c):o?(e=require.s.contexts._,!e.urlFetched[d]&& 8 | !e.loaded[a]&&(e.urlFetched[d]=!0,require.resourcesReady(!1),e.scriptCount+=1,d=require.attach(d,e,a,null,null,m),i[a]=d,h.push(a)),b([a],c)):b.specified(a)?b([a],c):(g.push({name:a,req:b,onLoad:c}),require.attach(d,null,a,k,"script/cache"))):b([a],c)}})})(); 9 | -------------------------------------------------------------------------------- /js/polyfills/classList.min.js: -------------------------------------------------------------------------------- 1 | /* @source http://purl.eligrey.com/github/classList.js/blob/master/classList.js*/ 2 | "use strict";if(typeof document!=="undefined"&&!("classList" in document.createElement("a"))){(function(a){var f="classList",d="prototype",e=(a.HTMLElement||a.Element)[d],g=Object;strTrim=String[d].trim||function(){return this.replace(/^\s+|\s+$/g,"")},arrIndexOf=Array[d].indexOf||function(k){for(var j=0,h=this.length;j")&&c[0]);return a>4?a:!1}();return a},m.isInternetExplorer=function(){var a=m.isInternetExplorer.cached=typeof m.isInternetExplorer.cached!="undefined"?m.isInternetExplorer.cached:Boolean(m.getInternetExplorerMajorVersion());return a},m.emulated={pushState:!Boolean(a.history&&a.history.pushState&&a.history.replaceState&&!/ Mobile\/([1-7][a-z]|(8([abcde]|f(1[0-8]))))/i.test(e.userAgent)&&!/AppleWebKit\/5([0-2]|3[0-2])/i.test(e.userAgent)),hashChange:Boolean(!("onhashchange"in a||"onhashchange"in d)||m.isInternetExplorer()&&m.getInternetExplorerMajorVersion()<8)},m.enabled=!m.emulated.pushState,m.bugs={setHash:Boolean(!m.emulated.pushState&&e.vendor==="Apple Computer, Inc."&&/AppleWebKit\/5([0-2]|3[0-3])/.test(e.userAgent)),safariPoll:Boolean(!m.emulated.pushState&&e.vendor==="Apple Computer, Inc."&&/AppleWebKit\/5([0-2]|3[0-3])/.test(e.userAgent)),ieDoubleCheck:Boolean(m.isInternetExplorer()&&m.getInternetExplorerMajorVersion()<8),hashEscape:Boolean(m.isInternetExplorer()&&m.getInternetExplorerMajorVersion()<7)},m.isEmptyObject=function(a){for(var b in a)return!1;return!0},m.cloneObject=function(a){var b,c;return a?(b=k.stringify(a),c=k.parse(b)):c={},c},m.getRootUrl=function(){var a=d.location.protocol+"//"+(d.location.hostname||d.location.host);if(d.location.port||!1)a+=":"+d.location.port;return a+="/",a},m.getBaseHref=function(){var a=d.getElementsByTagName("base"),b=null,c="";return a.length===1&&(b=a[0],c=b.href.replace(/[^\/]+$/,"")),c=c.replace(/\/+$/,""),c&&(c+="/"),c},m.getBaseUrl=function(){var a=m.getBaseHref()||m.getBasePageUrl()||m.getRootUrl();return a},m.getPageUrl=function(){var a=m.getState(!1,!1),b=(a||{}).url||d.location.href,c;return c=b.replace(/\/+$/,"").replace(/[^\/]+$/,function(a,b,c){return/\./.test(a)?a:a+"/"}),c},m.getBasePageUrl=function(){var a=d.location.href.replace(/[#\?].*/,"").replace(/[^\/]+$/,function(a,b,c){return/[^\/]$/.test(a)?"":a}).replace(/\/+$/,"")+"/";return a},m.getFullUrl=function(a,b){var c=a,d=a.substring(0,1);return b=typeof b=="undefined"?!0:b,/[a-z]+\:\/\//.test(a)||(d==="/"?c=m.getRootUrl()+a.replace(/^\/+/,""):d==="#"?c=m.getPageUrl().replace(/#.*/,"")+a:d==="?"?c=m.getPageUrl().replace(/[\?#].*/,"")+a:b?c=m.getBaseUrl()+a.replace(/^(\.\/)+/,""):c=m.getBasePageUrl()+a.replace(/^(\.\/)+/,"")),c.replace(/\#$/,"")},m.getShortUrl=function(a){var b=a,c=m.getBaseUrl(),d=m.getRootUrl();return m.emulated.pushState&&(b=b.replace(c,"")),b=b.replace(d,"/"),m.isTraditionalAnchor(b)&&(b="./"+b),b=b.replace(/^(\.\/)+/g,"./").replace(/\#$/,""),b},m.store={},m.idToState=m.idToState||{},m.stateToId=m.stateToId||{},m.urlToId=m.urlToId||{},m.storedStates=m.storedStates||[],m.savedStates=m.savedStates||[],m.normalizeStore=function(){m.store.idToState=m.store.idToState||{},m.store.urlToId=m.store.urlToId||{},m.store.stateToId=m.store.stateToId||{}},m.getState=function(a,b){typeof a=="undefined"&&(a=!0),typeof b=="undefined"&&(b=!0);var c=m.getLastSavedState();return!c&&b&&(c=m.createStateObject()),a&&(c=m.cloneObject(c),c.url=c.cleanUrl||c.url),c},m.getIdByState=function(a){var b=m.extractId(a.url),c;if(!b){c=m.getStateString(a);if(typeof m.stateToId[c]!="undefined")b=m.stateToId[c];else if(typeof m.store.stateToId[c]!="undefined")b=m.store.stateToId[c];else{for(;;){b=(new Date).getTime()+String(Math.random()).replace(/\D/g,"");if(typeof m.idToState[b]=="undefined"&&typeof m.store.idToState[b]=="undefined")break}m.stateToId[c]=b,m.idToState[b]=a}}return b},m.normalizeState=function(a){var b,c;if(!a||typeof a!="object")a={};if(typeof a.normalized!="undefined")return a;if(!a.data||typeof a.data!="object")a.data={};b={},b.normalized=!0,b.title=a.title||"",b.url=m.getFullUrl(m.unescapeString(a.url||d.location.href)),b.hash=m.getShortUrl(b.url),b.data=m.cloneObject(a.data),b.id=m.getIdByState(b),b.cleanUrl=b.url.replace(/\??\&_suid.*/,""),b.url=b.cleanUrl,c=!m.isEmptyObject(b.data);if(b.title||c)b.hash=m.getShortUrl(b.url).replace(/\??\&_suid.*/,""),/\?/.test(b.hash)||(b.hash+="?"),b.hash+="&_suid="+b.id;return b.hashedUrl=m.getFullUrl(b.hash),(m.emulated.pushState||m.bugs.safariPoll)&&m.hasUrlDuplicate(b)&&(b.url=b.hashedUrl),b},m.createStateObject=function(a,b,c){var d={data:a,title:b,url:c};return d=m.normalizeState(d),d},m.getStateById=function(a){a=String(a);var c=m.idToState[a]||m.store.idToState[a]||b;return c},m.getStateString=function(a){var b,c,d;return b=m.normalizeState(a),c={data:b.data,title:a.title,url:a.url},d=k.stringify(c),d},m.getStateId=function(a){var b,c;return b=m.normalizeState(a),c=b.id,c},m.getHashByState=function(a){var b,c;return b=m.normalizeState(a),c=b.hash,c},m.extractId=function(a){var b,c,d;return c=/(.*)\&_suid=([0-9]+)$/.exec(a),d=c?c[1]||a:a,b=c?String(c[2]||""):"",b||!1},m.isTraditionalAnchor=function(a){var b=!/[\/\?\.]/.test(a);return b},m.extractState=function(a,b){var c=null,d,e;return b=b||!1,d=m.extractId(a),d&&(c=m.getStateById(d)),c||(e=m.getFullUrl(a),d=m.getIdByUrl(e)||!1,d&&(c=m.getStateById(d)),!c&&b&&!m.isTraditionalAnchor(a)&&(c=m.createStateObject(null,null,e))),c},m.getIdByUrl=function(a){var c=m.urlToId[a]||m.store.urlToId[a]||b;return c},m.getLastSavedState=function(){return m.savedStates[m.savedStates.length-1]||b},m.getLastStoredState=function(){return m.storedStates[m.storedStates.length-1]||b},m.hasUrlDuplicate=function(a){var b=!1,c;return c=m.extractState(a.url),b=c&&c.id!==a.id,b},m.storeState=function(a){return m.urlToId[a.url]=a.id,m.storedStates.push(m.cloneObject(a)),a},m.isLastSavedState=function(a){var b=!1,c,d,e;return m.savedStates.length&&(c=a.id,d=m.getLastSavedState(),e=d.id,b=c===e),b},m.saveState=function(a){return m.isLastSavedState(a)?!1:(m.savedStates.push(m.cloneObject(a)),!0)},m.getStateByIndex=function(a){var b=null;return typeof a=="undefined"?b=m.savedStates[m.savedStates.length-1]:a<0?b=m.savedStates[m.savedStates.length+a]:b=m.savedStates[a],b},m.getHash=function(){var a=m.unescapeHash(d.location.hash);return a},m.unescapeString=function(b){var c=b,d;for(;;){d=a.unescape(c);if(d===c)break;c=d}return c},m.unescapeHash=function(a){var b=m.normalizeHash(a);return b=m.unescapeString(b),b},m.normalizeHash=function(a){var b=a.replace(/[^#]*#/,"").replace(/#.*/,"");return b},m.setHash=function(a,b){var c,e,f;return b!==!1&&m.busy()?(m.pushQueue({scope:m,callback:m.setHash,args:arguments,queue:b}),!1):(c=m.escapeHash(a),m.busy(!0),e=m.extractState(a,!0),e&&!m.emulated.pushState?m.pushState(e.data,e.title,e.url,!1):d.location.hash!==c&&(m.bugs.setHash?(f=m.getPageUrl(),m.pushState(null,null,f+"#"+c,!1)):d.location.hash=c),m)},m.escapeHash=function(b){var c=m.normalizeHash(b);return c=a.escape(c),m.bugs.hashEscape||(c=c.replace(/\%21/g,"!").replace(/\%26/g,"&").replace(/\%3D/g,"=").replace(/\%3F/g,"?")),c},m.getHashByUrl=function(a){var b=String(a).replace(/([^#]*)#?([^#]*)#?(.*)/,"$2");return b=m.unescapeHash(b),b},m.setTitle=function(a){var b=a.title,c;b||(c=m.getStateByIndex(0),c&&c.url===a.url&&(b=c.title||m.options.initialTitle));try{d.getElementsByTagName("title")[0].innerHTML=b.replace("<","<").replace(">",">").replace(" & "," & ")}catch(e){}return d.title=b,m},m.queues=[],m.busy=function(a){typeof a!="undefined"?m.busy.flag=a:typeof m.busy.flag=="undefined"&&(m.busy.flag=!1);if(!m.busy.flag){h(m.busy.timeout);var b=function(){var a,c,d;if(m.busy.flag)return;for(a=m.queues.length-1;a>=0;--a){c=m.queues[a];if(c.length===0)continue;d=c.shift(),m.fireQueueItem(d),m.busy.timeout=g(b,m.options.busyDelay)}};m.busy.timeout=g(b,m.options.busyDelay)}return m.busy.flag},m.busy.flag=!1,m.fireQueueItem=function(a){return a.callback.apply(a.scope||m,a.args||[])},m.pushQueue=function(a){return m.queues[a.queue||0]=m.queues[a.queue||0]||[],m.queues[a.queue||0].push(a),m},m.queue=function(a,b){return typeof a=="function"&&(a={callback:a}),typeof b!="undefined"&&(a.queue=b),m.busy()?m.pushQueue(a):m.fireQueueItem(a),m},m.clearQueue=function(){return m.busy.flag=!1,m.queues=[],m},m.stateChanged=!1,m.doubleChecker=!1,m.doubleCheckComplete=function(){return m.stateChanged=!0,m.doubleCheckClear(),m},m.doubleCheckClear=function(){return m.doubleChecker&&(h(m.doubleChecker),m.doubleChecker=!1),m},m.doubleCheck=function(a){return m.stateChanged=!1,m.doubleCheckClear(),m.bugs.ieDoubleCheck&&(m.doubleChecker=g(function(){return m.doubleCheckClear(),m.stateChanged||a(),!0},m.options.doubleCheckInterval)),m},m.safariStatePoll=function(){var b=m.extractState(d.location.href),c;if(!m.isLastSavedState(b))c=b;else return;return c||(c=m.createStateObject()),m.Adapter.trigger(a,"popstate"),m},m.back=function(a){return a!==!1&&m.busy()?(m.pushQueue({scope:m,callback:m.back,args:arguments,queue:a}),!1):(m.busy(!0),m.doubleCheck(function(){m.back(!1)}),n.go(-1),!0)},m.forward=function(a){return a!==!1&&m.busy()?(m.pushQueue({scope:m,callback:m.forward,args:arguments,queue:a}),!1):(m.busy(!0),m.doubleCheck(function(){m.forward(!1)}),n.go(1),!0)},m.go=function(a,b){var c;if(a>0)for(c=1;c<=a;++c)m.forward(b);else{if(!(a<0))throw new Error("History.go: History.go requires a positive or negative integer passed.");for(c=-1;c>=a;--c)m.back(b)}return m};if(m.emulated.pushState){var o=function(){};m.pushState=m.pushState||o,m.replaceState=m.replaceState||o}else m.onPopState=function(b,c){var e=!1,f=!1,g,h;return m.doubleCheckComplete(),g=m.getHash(),g?(h=m.extractState(g||d.location.href,!0),h?m.replaceState(h.data,h.title,h.url,!1):(m.Adapter.trigger(a,"anchorchange"),m.busy(!1)),m.expectedStateId=!1,!1):(e=m.Adapter.extractEventData("state",b,c)||!1,e?f=m.getStateById(e):m.expectedStateId?f=m.getStateById(m.expectedStateId):f=m.extractState(d.location.href),f||(f=m.createStateObject(null,null,d.location.href)),m.expectedStateId=!1,m.isLastSavedState(f)?(m.busy(!1),!1):(m.storeState(f),m.saveState(f),m.setTitle(f),m.Adapter.trigger(a,"statechange"),m.busy(!1),!0))},m.Adapter.bind(a,"popstate",m.onPopState),m.pushState=function(b,c,d,e){if(m.getHashByUrl(d)&&m.emulated.pushState)throw new Error("History.js does not support states with fragement-identifiers (hashes/anchors).");if(e!==!1&&m.busy())return m.pushQueue({scope:m,callback:m.pushState,args:arguments,queue:e}),!1;m.busy(!0);var f=m.createStateObject(b,c,d);return m.isLastSavedState(f)?m.busy(!1):(m.storeState(f),m.expectedStateId=f.id,n.pushState(f.id,f.title,f.url),m.Adapter.trigger(a,"popstate")),!0},m.replaceState=function(b,c,d,e){if(m.getHashByUrl(d)&&m.emulated.pushState)throw new Error("History.js does not support states with fragement-identifiers (hashes/anchors).");if(e!==!1&&m.busy())return m.pushQueue({scope:m,callback:m.replaceState,args:arguments,queue:e}),!1;m.busy(!0);var f=m.createStateObject(b,c,d);return m.isLastSavedState(f)?m.busy(!1):(m.storeState(f),m.expectedStateId=f.id,n.replaceState(f.id,f.title,f.url),m.Adapter.trigger(a,"popstate")),!0};if(f){try{m.store=k.parse(f.getItem("History.store"))||{}}catch(p){m.store={}}m.normalizeStore()}else m.store={},m.normalizeStore();m.Adapter.bind(a,"beforeunload",m.clearAllIntervals),m.Adapter.bind(a,"unload",m.clearAllIntervals),m.saveState(m.storeState(m.extractState(d.location.href,!0))),f&&(m.onUnload=function(){var a,b;try{a=k.parse(f.getItem("History.store"))||{}}catch(c){a={}}a.idToState=a.idToState||{},a.urlToId=a.urlToId||{},a.stateToId=a.stateToId||{};for(b in m.idToState){if(!m.idToState.hasOwnProperty(b))continue;a.idToState[b]=m.idToState[b]}for(b in m.urlToId){if(!m.urlToId.hasOwnProperty(b))continue;a.urlToId[b]=m.urlToId[b]}for(b in m.stateToId){if(!m.stateToId.hasOwnProperty(b))continue;a.stateToId[b]=m.stateToId[b]}m.store=a,m.normalizeStore(),f.setItem("History.store",k.stringify(a))},m.intervalList.push(i(m.onUnload,m.options.storeInterval)),m.Adapter.bind(a,"beforeunload",m.onUnload),m.Adapter.bind(a,"unload",m.onUnload));if(!m.emulated.pushState){m.bugs.safariPoll&&m.intervalList.push(i(m.safariStatePoll,m.options.safariPollInterval));if(e.vendor==="Apple Computer, Inc."||(e.appCodeName||"")==="Mozilla")m.Adapter.bind(a,"hashchange",function(){m.Adapter.trigger(a,"popstate")}),m.getHash()&&m.Adapter.onDomLoad(function(){m.Adapter.trigger(a,"hashchange")})}},m.init()})(window) -------------------------------------------------------------------------------- /js/prettify/lang-apollo.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ebidel/html5can/0df43e2890bb122aad2f31376a8327ec2482d8ca/js/prettify/lang-apollo.js -------------------------------------------------------------------------------- /js/prettify/lang-clj.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2011 Google Inc. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | var a=null; 17 | PR.registerLangHandler(PR.createSimpleLexer([["opn",/^[([{]+/,a,"([{"],["clo",/^[)\]}]+/,a,")]}"],["com",/^;[^\n\r]*/,a,";"],["pln",/^[\t\n\r \xa0]+/,a,"\t\n\r \xa0"],["str",/^"(?:[^"\\]|\\[\S\s])*(?:"|$)/,a,'"']],[["kwd",/^(?:def|if|do|let|quote|var|fn|loop|recur|throw|try|monitor-enter|monitor-exit|defmacro|defn|defn-|macroexpand|macroexpand-1|for|doseq|dosync|dotimes|and|or|when|not|assert|doto|proxy|defstruct|first|rest|cons|defprotocol|deftype|defrecord|reify|defmulti|defmethod|meta|with-meta|ns|in-ns|create-ns|import|intern|refer|alias|namespace|resolve|ref|deref|refset|new|set!|memfn|to-array|into-array|aset|gen-class|reduce|map|filter|find|nil?|empty?|hash-map|hash-set|vec|vector|seq|flatten|reverse|assoc|dissoc|list|list?|disj|get|union|difference|intersection|extend|extend-type|extend-protocol|prn)\b/,a], 18 | ["typ",/^:[\dA-Za-z-]+/]]),["clj"]); 19 | -------------------------------------------------------------------------------- /js/prettify/lang-css.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\f\r ]+/,null," \t\r\n "]],[["str",/^"(?:[^\n\f\r"\\]|\\(?:\r\n?|\n|\f)|\\[\S\s])*"/,null],["str",/^'(?:[^\n\f\r'\\]|\\(?:\r\n?|\n|\f)|\\[\S\s])*'/,null],["lang-css-str",/^url\(([^"')]*)\)/i],["kwd",/^(?:url|rgb|!important|@import|@page|@media|@charset|inherit)(?=[^\w-]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*)\s*:/i],["com",/^\/\*[^*]*\*+(?:[^*/][^*]*\*+)*\//],["com", 2 | /^(?:<\!--|--\>)/],["lit",/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],["lit",/^#[\da-f]{3,6}/i],["pln",/^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i],["pun",/^[^\s\w"']+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[["kwd",/^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[["str",/^[^"')]+/]]),["css-str"]); 3 | -------------------------------------------------------------------------------- /js/prettify/lang-go.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ebidel/html5can/0df43e2890bb122aad2f31376a8327ec2482d8ca/js/prettify/lang-go.js -------------------------------------------------------------------------------- /js/prettify/lang-hs.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t-\r ]+/,null,"\t\n \r "],["str",/^"(?:[^\n\f\r"\\]|\\[\S\s])*(?:"|$)/,null,'"'],["str",/^'(?:[^\n\f\r'\\]|\\[^&])'?/,null,"'"],["lit",/^(?:0o[0-7]+|0x[\da-f]+|\d+(?:\.\d+)?(?:e[+-]?\d+)?)/i,null,"0123456789"]],[["com",/^(?:--+[^\n\f\r]*|{-(?:[^-]|-+[^}-])*-})/],["kwd",/^(?:case|class|data|default|deriving|do|else|if|import|in|infix|infixl|infixr|instance|let|module|newtype|of|then|type|where|_)(?=[^\d'A-Za-z]|$)/, 2 | null],["pln",/^(?:[A-Z][\w']*\.)*[A-Za-z][\w']*/],["pun",/^[^\d\t-\r "'A-Za-z]+/]]),["hs"]); 3 | -------------------------------------------------------------------------------- /js/prettify/lang-lisp.js: -------------------------------------------------------------------------------- 1 | var a=null; 2 | PR.registerLangHandler(PR.createSimpleLexer([["opn",/^\(+/,a,"("],["clo",/^\)+/,a,")"],["com",/^;[^\n\r]*/,a,";"],["pln",/^[\t\n\r \xa0]+/,a,"\t\n\r \xa0"],["str",/^"(?:[^"\\]|\\[\S\s])*(?:"|$)/,a,'"']],[["kwd",/^(?:block|c[ad]+r|catch|con[ds]|def(?:ine|un)|do|eq|eql|equal|equalp|eval-when|flet|format|go|if|labels|lambda|let|load-time-value|locally|macrolet|multiple-value-call|nil|progn|progv|quote|require|return-from|setq|symbol-macrolet|t|tagbody|the|throw|unwind)\b/,a], 3 | ["lit",/^[+-]?(?:[#0]x[\da-f]+|\d+\/\d+|(?:\.\d+|\d+(?:\.\d*)?)(?:[de][+-]?\d+)?)/i],["lit",/^'(?:-*(?:\w|\\[!-~])(?:[\w-]*|\\[!-~])[!=?]?)?/],["pln",/^-*(?:[_a-z]|\\[!-~])(?:[\w-]*|\\[!-~])[!=?]?/i],["pun",/^[^\w\t\n\r "'-);\\\xa0]+/]]),["cl","el","lisp","scm"]); 4 | -------------------------------------------------------------------------------- /js/prettify/lang-lua.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ebidel/html5can/0df43e2890bb122aad2f31376a8327ec2482d8ca/js/prettify/lang-lua.js -------------------------------------------------------------------------------- /js/prettify/lang-ml.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ebidel/html5can/0df43e2890bb122aad2f31376a8327ec2482d8ca/js/prettify/lang-ml.js -------------------------------------------------------------------------------- /js/prettify/lang-n.js: -------------------------------------------------------------------------------- 1 | var a=null; 2 | PR.registerLangHandler(PR.createSimpleLexer([["str",/^(?:'(?:[^\n\r'\\]|\\.)*'|"(?:[^\n\r"\\]|\\.)*(?:"|$))/,a,'"'],["com",/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\n\r]*)/,a,"#"],["pln",/^\s+/,a," \r\n\t\xa0"]],[["str",/^@"(?:[^"]|"")*(?:"|$)/,a],["str",/^<#[^#>]*(?:#>|$)/,a],["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,a],["com",/^\/\/[^\n\r]*/,a],["com",/^\/\*[\S\s]*?(?:\*\/|$)/, 3 | a],["kwd",/^(?:abstract|and|as|base|catch|class|def|delegate|enum|event|extern|false|finally|fun|implements|interface|internal|is|macro|match|matches|module|mutable|namespace|new|null|out|override|params|partial|private|protected|public|ref|sealed|static|struct|syntax|this|throw|true|try|type|typeof|using|variant|virtual|volatile|when|where|with|assert|assert2|async|break|checked|continue|do|else|ensures|for|foreach|if|late|lock|new|nolate|otherwise|regexp|repeat|requires|return|surroundwith|unchecked|unless|using|while|yield)\b/, 4 | a],["typ",/^(?:array|bool|byte|char|decimal|double|float|int|list|long|object|sbyte|short|string|ulong|uint|ufloat|ulong|ushort|void)\b/,a],["lit",/^@[$_a-z][\w$@]*/i,a],["typ",/^@[A-Z]+[a-z][\w$@]*/,a],["pln",/^'?[$_a-z][\w$@]*/i,a],["lit",/^(?:0x[\da-f]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+-]?\d+)?)[a-z]*/i,a,"0123456789"],["pun",/^.[^\s\w"-$'./@`]*/,a]]),["n","nemerle"]); 5 | -------------------------------------------------------------------------------- /js/prettify/lang-proto.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.sourceDecorator({keywords:"bytes,default,double,enum,extend,extensions,false,group,import,max,message,option,optional,package,repeated,required,returns,rpc,service,syntax,to,true",types:/^(bool|(double|s?fixed|[su]?int)(32|64)|float|string)\b/,cStyleComments:!0}),["proto"]); 2 | -------------------------------------------------------------------------------- /js/prettify/lang-scala.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ebidel/html5can/0df43e2890bb122aad2f31376a8327ec2482d8ca/js/prettify/lang-scala.js -------------------------------------------------------------------------------- /js/prettify/lang-sql.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ebidel/html5can/0df43e2890bb122aad2f31376a8327ec2482d8ca/js/prettify/lang-sql.js -------------------------------------------------------------------------------- /js/prettify/lang-tex.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ebidel/html5can/0df43e2890bb122aad2f31376a8327ec2482d8ca/js/prettify/lang-tex.js -------------------------------------------------------------------------------- /js/prettify/lang-vb.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ebidel/html5can/0df43e2890bb122aad2f31376a8327ec2482d8ca/js/prettify/lang-vb.js -------------------------------------------------------------------------------- /js/prettify/lang-vhdl.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ebidel/html5can/0df43e2890bb122aad2f31376a8327ec2482d8ca/js/prettify/lang-vhdl.js -------------------------------------------------------------------------------- /js/prettify/lang-wiki.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ebidel/html5can/0df43e2890bb122aad2f31376a8327ec2482d8ca/js/prettify/lang-wiki.js -------------------------------------------------------------------------------- /js/prettify/lang-yaml.js: -------------------------------------------------------------------------------- 1 | var a=null; 2 | PR.registerLangHandler(PR.createSimpleLexer([["pun",/^[:>?|]+/,a,":|>?"],["dec",/^%(?:YAML|TAG)[^\n\r#]+/,a,"%"],["typ",/^&\S+/,a,"&"],["typ",/^!\S*/,a,"!"],["str",/^"(?:[^"\\]|\\.)*(?:"|$)/,a,'"'],["str",/^'(?:[^']|'')*(?:'|$)/,a,"'"],["com",/^#[^\n\r]*/,a,"#"],["pln",/^\s+/,a," \t\r\n"]],[["dec",/^(?:---|\.\.\.)(?:[\n\r]|$)/],["pun",/^-/],["kwd",/^\w+:[\n\r ]/],["pln",/^\w+/]]),["yaml","yml"]); 3 | -------------------------------------------------------------------------------- /js/prettify/prettify.css: -------------------------------------------------------------------------------- 1 | .pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} -------------------------------------------------------------------------------- /js/prettify/prettify.js: -------------------------------------------------------------------------------- 1 | var q=null;window.PR_SHOULD_USE_CONTINUATION=!0; 2 | (function(){function L(a){function m(a){var f=a.charCodeAt(0);if(f!==92)return f;var b=a.charAt(1);return(f=r[b])?f:"0"<=b&&b<="7"?parseInt(a.substring(1),8):b==="u"||b==="x"?parseInt(a.substring(2),16):a.charCodeAt(1)}function e(a){if(a<32)return(a<16?"\\x0":"\\x")+a.toString(16);a=String.fromCharCode(a);if(a==="\\"||a==="-"||a==="["||a==="]")a="\\"+a;return a}function h(a){for(var f=a.substring(1,a.length-1).match(/\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\[0-3][0-7]{0,2}|\\[0-7]{1,2}|\\[\S\s]|[^\\]/g),a= 3 | [],b=[],o=f[0]==="^",c=o?1:0,i=f.length;c122||(d<65||j>90||b.push([Math.max(65,j)|32,Math.min(d,90)|32]),d<97||j>122||b.push([Math.max(97,j)&-33,Math.min(d,122)&-33]))}}b.sort(function(a,f){return a[0]-f[0]||f[1]-a[1]});f=[];j=[NaN,NaN];for(c=0;ci[0]&&(i[1]+1>i[0]&&b.push("-"),b.push(e(i[1])));b.push("]");return b.join("")}function y(a){for(var f=a.source.match(/\[(?:[^\\\]]|\\[\S\s])*]|\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\\d+|\\[^\dux]|\(\?[!:=]|[()^]|[^()[\\^]+/g),b=f.length,d=[],c=0,i=0;c=2&&a==="["?f[c]=h(j):a!=="\\"&&(f[c]=j.replace(/[A-Za-z]/g,function(a){a=a.charCodeAt(0);return"["+String.fromCharCode(a&-33,a|32)+"]"}));return f.join("")}for(var t=0,s=!1,l=!1,p=0,d=a.length;p=5&&"lang-"===b.substring(0,5))&&!(o&&typeof o[1]==="string"))c=!1,b="src";c||(r[f]=b)}i=d;d+=f.length;if(c){c=o[1];var j=f.indexOf(c),k=j+c.length;o[2]&&(k=f.length-o[2].length,j=k-c.length);b=b.substring(5);B(l+i,f.substring(0,j),e,p);B(l+i+j,c,C(b,c),p);B(l+i+k,f.substring(k),e,p)}else p.push(l+i,b)}a.e=p}var h={},y;(function(){for(var e=a.concat(m), 9 | l=[],p={},d=0,g=e.length;d=0;)h[n.charAt(k)]=r;r=r[1];n=""+r;p.hasOwnProperty(n)||(l.push(r),p[n]=q)}l.push(/[\S\s]/);y=L(l)})();var t=m.length;return e}function u(a){var m=[],e=[];a.tripleQuotedStrings?m.push(["str",/^(?:'''(?:[^'\\]|\\[\S\s]|''?(?=[^']))*(?:'''|$)|"""(?:[^"\\]|\\[\S\s]|""?(?=[^"]))*(?:"""|$)|'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$))/,q,"'\""]):a.multiLineStrings?m.push(["str",/^(?:'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$)|`(?:[^\\`]|\\[\S\s])*(?:`|$))/, 10 | q,"'\"`"]):m.push(["str",/^(?:'(?:[^\n\r'\\]|\\.)*(?:'|$)|"(?:[^\n\r"\\]|\\.)*(?:"|$))/,q,"\"'"]);a.verbatimStrings&&e.push(["str",/^@"(?:[^"]|"")*(?:"|$)/,q]);var h=a.hashComments;h&&(a.cStyleComments?(h>1?m.push(["com",/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,q,"#"]):m.push(["com",/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\n\r]*)/,q,"#"]),e.push(["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,q])):m.push(["com",/^#[^\n\r]*/, 11 | q,"#"]));a.cStyleComments&&(e.push(["com",/^\/\/[^\n\r]*/,q]),e.push(["com",/^\/\*[\S\s]*?(?:\*\/|$)/,q]));a.regexLiterals&&e.push(["lang-regex",/^(?:^^\.?|[!+-]|!=|!==|#|%|%=|&|&&|&&=|&=|\(|\*|\*=|\+=|,|-=|->|\/|\/=|:|::|;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|[?@[^]|\^=|\^\^|\^\^=|{|\||\|=|\|\||\|\|=|~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\s*(\/(?=[^*/])(?:[^/[\\]|\\[\S\s]|\[(?:[^\\\]]|\\[\S\s])*(?:]|$))+\/)/]);(h=a.types)&&e.push(["typ",h]);a=(""+a.keywords).replace(/^ | $/g, 12 | "");a.length&&e.push(["kwd",RegExp("^(?:"+a.replace(/[\s,]+/g,"|")+")\\b"),q]);m.push(["pln",/^\s+/,q," \r\n\t\xa0"]);e.push(["lit",/^@[$_a-z][\w$@]*/i,q],["typ",/^(?:[@_]?[A-Z]+[a-z][\w$@]*|\w+_t\b)/,q],["pln",/^[$_a-z][\w$@]*/i,q],["lit",/^(?:0x[\da-f]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+-]?\d+)?)[a-z]*/i,q,"0123456789"],["pln",/^\\[\S\s]?/,q],["pun",/^.[^\s\w"-$'./@\\`]*/,q]);return x(m,e)}function D(a,m){function e(a){switch(a.nodeType){case 1:if(k.test(a.className))break;if("BR"===a.nodeName)h(a), 13 | a.parentNode&&a.parentNode.removeChild(a);else for(a=a.firstChild;a;a=a.nextSibling)e(a);break;case 3:case 4:if(p){var b=a.nodeValue,d=b.match(t);if(d){var c=b.substring(0,d.index);a.nodeValue=c;(b=b.substring(d.index+d[0].length))&&a.parentNode.insertBefore(s.createTextNode(b),a.nextSibling);h(a);c||a.parentNode.removeChild(a)}}}}function h(a){function b(a,d){var e=d?a.cloneNode(!1):a,f=a.parentNode;if(f){var f=b(f,1),g=a.nextSibling;f.appendChild(e);for(var h=g;h;h=g)g=h.nextSibling,f.appendChild(h)}return e} 14 | for(;!a.nextSibling;)if(a=a.parentNode,!a)return;for(var a=b(a.nextSibling,0),e;(e=a.parentNode)&&e.nodeType===1;)a=e;d.push(a)}var k=/(?:^|\s)nocode(?:\s|$)/,t=/\r\n?|\n/,s=a.ownerDocument,l;a.currentStyle?l=a.currentStyle.whiteSpace:window.getComputedStyle&&(l=s.defaultView.getComputedStyle(a,q).getPropertyValue("white-space"));var p=l&&"pre"===l.substring(0,3);for(l=s.createElement("LI");a.firstChild;)l.appendChild(a.firstChild);for(var d=[l],g=0;g=0;){var h=m[e];A.hasOwnProperty(h)?window.console&&console.warn("cannot override language handler %s",h):A[h]=a}}function C(a,m){if(!a||!A.hasOwnProperty(a))a=/^\s*=o&&(h+=2);e>=c&&(a+=2)}}catch(w){"console"in window&&console.log(w&&w.stack?w.stack:w)}}var v=["break,continue,do,else,for,if,return,while"],w=[[v,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"], 18 | "catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],F=[w,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],G=[w,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"], 19 | H=[G,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"],w=[w,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"],I=[v,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"], 20 | J=[v,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],v=[v,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],K=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/,N=/\S/,O=u({keywords:[F,H,w,"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END"+ 21 | I,J,v],hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0}),A={};k(O,["default-code"]);k(x([],[["pln",/^[^]*(?:>|$)/],["com",/^<\!--[\S\s]*?(?:--\>|$)/],["lang-",/^<\?([\S\s]+?)(?:\?>|$)/],["lang-",/^<%([\S\s]+?)(?:%>|$)/],["pun",/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\S\s]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\S\s]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\S\s]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]), 22 | ["default-markup","htm","html","mxml","xhtml","xml","xsl"]);k(x([["pln",/^\s+/,q," \t\r\n"],["atv",/^(?:"[^"]*"?|'[^']*'?)/,q,"\"'"]],[["tag",/^^<\/?[a-z](?:[\w-.:]*\w)?|\/?>$/i],["atn",/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^\s"'>]*(?:[^\s"'/>]|\/(?=\s)))/],["pun",/^[/<->]+/],["lang-js",/^on\w+\s*=\s*"([^"]+)"/i],["lang-js",/^on\w+\s*=\s*'([^']+)'/i],["lang-js",/^on\w+\s*=\s*([^\s"'>]+)/i],["lang-css",/^style\s*=\s*"([^"]+)"/i],["lang-css",/^style\s*=\s*'([^']+)'/i],["lang-css", 23 | /^style\s*=\s*([^\s"'>]+)/i]]),["in.tag"]);k(x([],[["atv",/^[\S\s]+/]]),["uq.val"]);k(u({keywords:F,hashComments:!0,cStyleComments:!0,types:K}),["c","cc","cpp","cxx","cyc","m"]);k(u({keywords:"null,true,false"}),["json"]);k(u({keywords:H,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:K}),["cs"]);k(u({keywords:G,cStyleComments:!0}),["java"]);k(u({keywords:v,hashComments:!0,multiLineStrings:!0}),["bsh","csh","sh"]);k(u({keywords:I,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}), 24 | ["cv","py"]);k(u({keywords:"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["perl","pl","pm"]);k(u({keywords:J,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb"]);k(u({keywords:w,cStyleComments:!0,regexLiterals:!0}),["js"]);k(u({keywords:"all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes", 25 | hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]);k(x([],[["str",/^[\S\s]+/]]),["regex"]);window.prettyPrintOne=function(a,m,e){var h=document.createElement("PRE");h.innerHTML=a;e&&D(h,e);E({g:m,i:e,h:h});return h.innerHTML};window.prettyPrint=function(a){function m(){for(var e=window.PR_SHOULD_USE_CONTINUATION?l.now()+250:Infinity;p=0){var k=k.match(g),f,b;if(b= 26 | !k){b=n;for(var o=void 0,c=b.firstChild;c;c=c.nextSibling)var i=c.nodeType,o=i===1?o?b:c:i===3?N.test(c.nodeValue)?b:o:o;b=(f=o===b?void 0:o)&&"CODE"===f.tagName}b&&(k=f.className.match(g));k&&(k=k[1]);b=!1;for(o=n.parentNode;o;o=o.parentNode)if((o.tagName==="pre"||o.tagName==="code"||o.tagName==="xmp")&&o.className&&o.className.indexOf("prettyprint")>=0){b=!0;break}b||((b=(b=n.className.match(/\blinenums\b(?::(\d+))?/))?b[1]&&b[1].length?+b[1]:!0:!1)&&D(n,b),d={g:k,h:n,i:b},E(d))}}p0&&(g.splice(m-1,2),m-=2);m=q.pkgs[g=b[0]];b=b.join("/");m&&b===g+"/"+m.main&&(b=g)}else b.indexOf("./")=== 9 | 0&&(b=b.substring(2));return b}function l(b,f){var g=b?b.indexOf("!"):-1,m=null,a=f?f.name:null,h=b,e,d;g!==-1&&(m=b.substring(0,g),b=b.substring(g+1,b.length));m&&(m=c(m,a));b&&(m?e=(g=n[m])&&g.normalize?g.normalize(b,function(b){return c(b,a)}):c(b,a):(e=c(b,a),d=G[e],d||(d=i.nameToUrl(b,null,f),G[e]=d)));return{prefix:m,name:e,parentMap:f,url:d,originalName:h,fullName:m?m+"!"+(e||""):e}}function j(){var b=!0,f=q.priorityWait,g,a;if(f){for(a=0;g=f[a];a++)if(!s[g]){b=!1;break}b&&delete q.priorityWait}return b} 10 | function k(b,f,g){return function(){var a=ha.call(arguments,0),c;if(g&&K(c=a[a.length-1]))c.__requireJsBuild=!0;a.push(f);return b.apply(null,a)}}function t(b,f,g){f=k(g||i.require,b,f);$(f,{nameToUrl:k(i.nameToUrl,b),toUrl:k(i.toUrl,b),defined:k(i.requireDefined,b),specified:k(i.requireSpecified,b),isBrowser:d.isBrowser});return f}function p(b){var f,g,a,c=b.callback,h=b.map,e=h.fullName,ca=b.deps;a=b.listeners;var j=q.requireExecCb||d.execCb;if(c&&K(c)){if(q.catchError.define)try{g=j(e,b.callback, 11 | ca,n[e])}catch(k){f=k}else g=j(e,b.callback,ca,n[e]);if(e)(c=b.cjsModule)&&c.exports!==r&&c.exports!==n[e]?g=n[e]=b.cjsModule.exports:g===r&&b.usingExports?g=n[e]:(n[e]=g,H[e]&&(T[e]=!0))}else e&&(g=n[e]=c,H[e]&&(T[e]=!0));if(x[b.id])delete x[b.id],b.isDone=!0,i.waitCount-=1,i.waitCount===0&&(J=[]);delete M[e];if(d.onResourceLoad&&!b.placeholder)d.onResourceLoad(i,h,b.depArray);if(f)return g=(e?l(e).url:"")||f.fileName||f.sourceURL,a=f.moduleTree,f=P("defineerror",'Error evaluating module "'+e+'" at location "'+ 12 | g+'":\n'+f+"\nfileName:"+g+"\nlineNumber: "+(f.lineNumber||f.line),f),f.moduleName=e,f.moduleTree=a,d.onError(f);for(f=0;c=a[f];f++)c(g);return r}function u(b,f){return function(g){b.depDone[f]||(b.depDone[f]=!0,b.deps[f]=g,b.depCount-=1,b.depCount||p(b))}}function o(b,f){var g=f.map,a=g.fullName,c=g.name,h=N[b]||(N[b]=n[b]),e;if(!f.loading)f.loading=!0,e=function(b){f.callback=function(){return b};p(f);s[f.id]=!0;A()},e.fromText=function(b,f){var g=Q;s[b]=!1;i.scriptCount+=1;i.fake[b]=!0;g&&(Q=!1); 13 | d.exec(f);g&&(Q=!0);i.completeLoad(b)},a in n?e(n[a]):h.load(c,t(g.parentMap,!0,function(b,a){var c=[],e,m;for(e=0;m=b[e];e++)m=l(m,g.parentMap),b[e]=m.fullName,m.prefix||c.push(b[e]);f.moduleDeps=(f.moduleDeps||[]).concat(c);return i.require(b,a)}),e,q)}function y(b){x[b.id]||(x[b.id]=b,J.push(b),i.waitCount+=1)}function D(b){this.listeners.push(b)}function v(b,f){var g=b.fullName,a=b.prefix,c=a?N[a]||(N[a]=n[a]):null,h,e;g&&(h=M[g]);if(!h&&(e=!0,h={id:(a&&!c?O++ +"__p@:":"")+(g||"__r@"+O++),map:b, 14 | depCount:0,depDone:[],depCallbacks:[],deps:[],listeners:[],add:D},B[h.id]=!0,g&&(!a||N[a])))M[g]=h;a&&!c?(g=l(a),a in n&&!n[a]&&(delete n[a],delete R[g.url]),a=v(g,!0),a.add(function(){var f=l(b.originalName,b.parentMap),f=v(f,!0);h.placeholder=!0;f.add(function(b){h.callback=function(){return b};p(h)})})):e&&f&&(s[h.id]=!1,i.paused.push(h),y(h));return h}function C(b,f,a,c){var b=l(b,c),d=b.name,h=b.fullName,e=v(b),j=e.id,k=e.deps,o;if(h){if(h in n||s[j]===!0||h==="jquery"&&q.jQuery&&q.jQuery!== 15 | a().fn.jquery)return;B[j]=!0;s[j]=!0;h==="jquery"&&a&&W(a())}e.depArray=f;e.callback=a;for(a=0;a0)return r;if(q.priorityWait)if(j())A();else return r;for(h in s)if(!(h in L)&&(c=!0,!s[h]))if(b)a+=h+" ";else if(l=!0,h.indexOf("!")===-1){k=[];break}else(e=M[h]&&M[h].moduleDeps)&&k.push.apply(k,e);if(!c&&!i.waitCount)return r;if(b&&a)return b=P("timeout","Load timeout for modules: "+a),b.requireType="timeout",b.requireModules=a,b.contextName=i.contextName,d.onError(b); 18 | if(l&&k.length)for(a=0;h=x[k[a]];a++)if(h=F(h,{})){z(h,{});break}if(!b&&(l||i.scriptCount)){if((I||da)&&!X)X=setTimeout(function(){X=0;E()},50);return r}if(i.waitCount){for(a=0;h=J[a];a++)z(h,{});i.paused.length&&A();Y<5&&(Y+=1,E())}Y=0;d.checkReadyState();return r}var i,A,q={waitSeconds:7,baseUrl:"./",paths:{},pkgs:{},catchError:{}},S=[],B={require:!0,exports:!0,module:!0},G={},n={},s={},x={},J=[],R={},O=0,M={},N={},H={},T={},Z=0;W=function(b){if(!i.jQuery&&(b=b||(typeof jQuery!=="undefined"?jQuery: 19 | null))&&!(q.jQuery&&b.fn.jquery!==q.jQuery)&&("holdReady"in b||"readyWait"in b))if(i.jQuery=b,w(["jquery",[],function(){return jQuery}]),i.scriptCount)V(b,!0),i.jQueryIncremented=!0};A=function(){var b,a,c,l,k,h;i.takeGlobalQueue();Z+=1;if(i.scriptCount<=0)i.scriptCount=0;for(;S.length;)if(b=S.shift(),b[0]===null)return d.onError(P("mismatch","Mismatched anonymous define() module: "+b[b.length-1]));else w(b);if(!q.priorityWait||j())for(;i.paused.length;){k=i.paused;i.pausedCount+=k.length;i.paused= 20 | [];for(l=0;b=k[l];l++)a=b.map,c=a.url,h=a.fullName,a.prefix?o(a.prefix,b):!R[c]&&!s[h]&&((q.requireLoad||d.load)(i,h,c),c.indexOf("empty:")!==0&&(R[c]=!0));i.startTime=(new Date).getTime();i.pausedCount-=k.length}Z===1&&E();Z-=1;return r};i={contextName:a,config:q,defQueue:S,waiting:x,waitCount:0,specified:B,loaded:s,urlMap:G,urlFetched:R,scriptCount:0,defined:n,paused:[],pausedCount:0,plugins:N,needFullExec:H,fake:{},fullExec:T,managerCallbacks:M,makeModuleMap:l,normalize:c,configure:function(b){var a, 21 | c,d;b.baseUrl&&b.baseUrl.charAt(b.baseUrl.length-1)!=="/"&&(b.baseUrl+="/");a=q.paths;d=q.pkgs;$(q,b,!0);if(b.paths){for(c in b.paths)c in L||(a[c]=b.paths[c]);q.paths=a}if((a=b.packagePaths)||b.packages){if(a)for(c in a)c in L||aa(d,a[c],c);b.packages&&aa(d,b.packages);q.pkgs=d}if(b.priority)c=i.requireWait,i.requireWait=!1,A(),i.require(b.priority),A(),i.requireWait=c,q.priorityWait=b.priority;if(b.deps||b.callback)i.require(b.deps||[],b.callback)},requireDefined:function(b,a){return l(b,a).fullName in 22 | n},requireSpecified:function(b,a){return l(b,a).fullName in B},require:function(b,c,g){if(typeof b==="string"){if(K(c))return d.onError(P("requireargs","Invalid require call"));if(d.get)return d.get(i,b,c);c=l(b,c);b=c.fullName;return!(b in n)?d.onError(P("notloaded","Module name '"+c.fullName+"' has not been loaded yet for context: "+a)):n[b]}(b&&b.length||c)&&C(null,b,c,g);if(!i.requireWait)for(;!i.scriptCount&&i.paused.length;)A();return i.require},takeGlobalQueue:function(){U.length&&(ja.apply(i.defQueue, 23 | [i.defQueue.length-1,0].concat(U)),U=[])},completeLoad:function(b){var a;for(i.takeGlobalQueue();S.length;)if(a=S.shift(),a[0]===null){a[0]=b;break}else if(a[0]===b)break;else w(a),a=null;a?w(a):w([b,[],b==="jquery"&&typeof jQuery!=="undefined"?function(){return jQuery}:null]);d.isAsync&&(i.scriptCount-=1);A();d.isAsync||(i.scriptCount-=1)},toUrl:function(b,a){var c=b.lastIndexOf("."),d=null;c!==-1&&(d=b.substring(c,b.length),b=b.substring(0,c));return i.nameToUrl(b,d,a)},nameToUrl:function(b,a,g){var l, 24 | k,h,e,j=i.config,b=c(b,g&&g.fullName);if(d.jsExtRegExp.test(b))a=b+(a?a:"");else{l=j.paths;k=j.pkgs;g=b.split("/");for(e=g.length;e>0;e--)if(h=g.slice(0,e).join("/"),l[h]){g.splice(0,e,l[h]);break}else if(h=k[h]){b=b===h.name?h.location+"/"+h.main:h.location;g.splice(0,e,b);break}a=g.join("/")+(a||".js");a=(a.charAt(0)==="/"||a.match(/^[\w\+\.\-]+:/)?"":j.baseUrl)+a}return j.urlArgs?a+((a.indexOf("?")===-1?"?":"&")+j.urlArgs):a}};i.jQueryCheck=W;i.resume=A;return i}function ka(){var a,c,d;if(C&&C.readyState=== 25 | "interactive")return C;a=document.getElementsByTagName("script");for(c=a.length-1;c>-1&&(d=a[c]);c--)if(d.readyState==="interactive")return C=d;return null}var la=/(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/mg,ma=/require\(\s*["']([^'"\s]+)["']\s*\)/g,fa=/^\.\//,ba=/\.js$/,O=Object.prototype.toString,u=Array.prototype,ha=u.slice,ja=u.splice,I=!!(typeof window!=="undefined"&&navigator&&document),da=!I&&typeof importScripts!=="undefined",na=I&&navigator.platform==="PLAYSTATION 3"?/^complete$/:/^(complete|loaded)$/, 26 | ea=typeof opera!=="undefined"&&opera.toString()==="[object Opera]",L={},D={},U=[],C=null,Y=0,Q=!1,ia={require:!0,module:!0,exports:!0},d,u={},J,y,v,E,o,w,F,B,z,W,X;if(typeof define==="undefined"){if(typeof requirejs!=="undefined")if(K(requirejs))return;else u=requirejs,requirejs=r;typeof require!=="undefined"&&!K(require)&&(u=require,require=r);d=requirejs=function(a,c,d){var j="_",k;!G(a)&&typeof a!=="string"&&(k=a,G(c)?(a=c,c=d):a=[]);if(k&&k.context)j=k.context;d=D[j]||(D[j]=ga(j));k&&d.configure(k); 27 | return d.require(a,c)};d.config=function(a){return d(a)};require||(require=d);d.toUrl=function(a){return D._.toUrl(a)};d.version="1.0.8";d.jsExtRegExp=/^\/|:|\?|\.js$/;y=d.s={contexts:D,skipAsync:{}};if(d.isAsync=d.isBrowser=I)if(v=y.head=document.getElementsByTagName("head")[0],E=document.getElementsByTagName("base")[0])v=y.head=E.parentNode;d.onError=function(a){throw a;};d.load=function(a,c,l){d.resourcesReady(!1);a.scriptCount+=1;d.attach(l,a,c);if(a.jQuery&&!a.jQueryIncremented)V(a.jQuery,!0), 28 | a.jQueryIncremented=!0};define=function(a,c,d){var j,k;typeof a!=="string"&&(d=c,c=a,a=null);G(c)||(d=c,c=[]);!c.length&&K(d)&&d.length&&(d.toString().replace(la,"").replace(ma,function(a,d){c.push(d)}),c=(d.length===1?["require"]:["require","exports","module"]).concat(c));if(Q&&(j=J||ka()))a||(a=j.getAttribute("data-requiremodule")),k=D[j.getAttribute("data-requirecontext")];(k?k.defQueue:U).push([a,c,d]);return r};define.amd={multiversion:!0,plugins:!0,jQuery:!0};d.exec=function(a){return eval(a)}; 29 | d.execCb=function(a,c,d,j){return c.apply(j,d)};d.addScriptToDom=function(a){J=a;E?v.insertBefore(a,E):v.appendChild(a);J=null};d.onScriptLoad=function(a){var c=a.currentTarget||a.srcElement,l;if(a.type==="load"||c&&na.test(c.readyState))C=null,a=c.getAttribute("data-requirecontext"),l=c.getAttribute("data-requiremodule"),D[a].completeLoad(l),c.detachEvent&&!ea?c.detachEvent("onreadystatechange",d.onScriptLoad):c.removeEventListener("load",d.onScriptLoad,!1)};d.attach=function(a,c,l,j,k,o){var p; 30 | if(I)return j=j||d.onScriptLoad,p=c&&c.config&&c.config.xhtml?document.createElementNS("http://www.w3.org/1999/xhtml","html:script"):document.createElement("script"),p.type=k||c&&c.config.scriptType||"text/javascript",p.charset="utf-8",p.async=!y.skipAsync[a],c&&p.setAttribute("data-requirecontext",c.contextName),p.setAttribute("data-requiremodule",l),p.attachEvent&&!(p.attachEvent.toString&&p.attachEvent.toString().indexOf("[native code]")<0)&&!ea?(Q=!0,o?p.onreadystatechange=function(){if(p.readyState=== 31 | "loaded")p.onreadystatechange=null,p.attachEvent("onreadystatechange",j),o(p)}:p.attachEvent("onreadystatechange",j)):p.addEventListener("load",j,!1),p.src=a,o||d.addScriptToDom(p),p;else da&&(importScripts(a),c.completeLoad(l));return null};if(I){o=document.getElementsByTagName("script");for(B=o.length-1;B>-1&&(w=o[B]);B--){if(!v)v=w.parentNode;if(F=w.getAttribute("data-main")){if(!u.baseUrl)o=F.split("/"),w=o.pop(),o=o.length?o.join("/")+"/":"./",u.baseUrl=o,F=w.replace(ba,"");u.deps=u.deps?u.deps.concat(F): 32 | [F];break}}}d.checkReadyState=function(){var a=y.contexts,c;for(c in a)if(!(c in L)&&a[c].waitCount)return;d.resourcesReady(!0)};d.resourcesReady=function(a){var c,l;d.resourcesDone=a;if(d.resourcesDone)for(l in a=y.contexts,a)if(!(l in L)&&(c=a[l],c.jQueryIncremented))V(c.jQuery,!1),c.jQueryIncremented=!1};d.pageLoaded=function(){if(document.readyState!=="complete")document.readyState="complete"};if(I&&document.addEventListener&&!document.readyState)document.readyState="loading",window.addEventListener("load", 33 | d.pageLoaded,!1);d(u);if(d.isAsync&&typeof setTimeout!=="undefined")z=y.contexts[u.context||"_"],z.requireWait=!0,setTimeout(function(){z.requireWait=!1;z.scriptCount||z.resume();d.checkReadyState()},0)}})(); 34 | -------------------------------------------------------------------------------- /js/slide-controller.js: -------------------------------------------------------------------------------- 1 | (function(window) { 2 | 3 | var ORIGIN_ = location.protocol + '//' + location.host; 4 | 5 | function SlideController() { 6 | this.popup = null; 7 | this.isPopup = window.opener; 8 | 9 | if (this.setupDone()) { 10 | window.addEventListener('message', this.onMessage_.bind(this), false); 11 | 12 | // Close popups if we reload the main window. 13 | window.addEventListener('beforeunload', function(e) { 14 | if (this.popup) { 15 | this.popup.close(); 16 | } 17 | }.bind(this), false); 18 | } 19 | } 20 | 21 | SlideController.PRESENTER_MODE_PARAM = 'presentme'; 22 | 23 | SlideController.prototype.setupDone = function() { 24 | var params = location.search.substring(1).split('&').map(function(el) { 25 | return el.split('='); 26 | }); 27 | 28 | var presentMe = null; 29 | for (var i = 0, param; param = params[i]; ++i) { 30 | if (param[0].toLowerCase() == SlideController.PRESENTER_MODE_PARAM) { 31 | presentMe = param[1] == 'true'; 32 | break; 33 | } 34 | } 35 | 36 | if (presentMe !== null) { 37 | localStorage.ENABLE_PRESENTOR_MODE = presentMe; 38 | // TODO: use window.history.pushState to update URL instead of the redirect. 39 | if (window.history.replaceState) { 40 | window.history.replaceState({}, '', location.pathname); 41 | } else { 42 | location.replace(location.pathname); 43 | return false; 44 | } 45 | } 46 | 47 | var enablePresenterMode = localStorage.getItem('ENABLE_PRESENTOR_MODE'); 48 | if (enablePresenterMode && JSON.parse(enablePresenterMode)) { 49 | // Only open popup from main deck. Don't want recursive popup opening! 50 | if (!this.isPopup) { 51 | var opts = 'menubar=no,location=yes,resizable=yes,scrollbars=no,status=no'; 52 | this.popup = window.open(location.href, 'mywindow', opts); 53 | 54 | // Loading in the popup? Trigger the hotkey for turning presenter mode on. 55 | this.popup.addEventListener('load', function(e) { 56 | var evt = this.popup.document.createEvent('Event'); 57 | evt.initEvent('keydown', true, true); 58 | evt.keyCode = 'P'.charCodeAt(0); 59 | this.popup.document.dispatchEvent(evt); 60 | // this.popup.document.body.classList.add('with-notes'); 61 | // document.body.classList.add('popup'); 62 | }.bind(this), false); 63 | } 64 | } 65 | 66 | return true; 67 | } 68 | 69 | SlideController.prototype.onMessage_ = function(e) { 70 | var data = e.data; 71 | 72 | // Restrict messages to being from this origin. Allow local developmet 73 | // from file:// though. 74 | // TODO: It would be dope if FF implemented location.origin! 75 | if (e.origin != ORIGIN_ && ORIGIN_.indexOf('file://') != 0) { 76 | alert('Someone tried to postMessage from an unknown origin'); 77 | return; 78 | } 79 | 80 | // if (e.source.location.hostname != 'localhost') { 81 | // alert('Someone tried to postMessage from an unknown origin'); 82 | // return; 83 | // } 84 | 85 | if ('keyCode' in data) { 86 | var evt = document.createEvent('Event'); 87 | evt.initEvent('keydown', true, true); 88 | evt.keyCode = data.keyCode; 89 | document.dispatchEvent(evt); 90 | } 91 | }; 92 | 93 | SlideController.prototype.sendMsg = function(msg) { 94 | // // Send message to popup window. 95 | // if (this.popup) { 96 | // this.popup.postMessage(msg, ORIGIN_); 97 | // } 98 | 99 | // Send message to main window. 100 | if (this.isPopup) { 101 | // TODO: It would be dope if FF implemented location.origin. 102 | window.opener.postMessage(msg, '*'); 103 | } 104 | }; 105 | 106 | window.SlideController = SlideController; 107 | 108 | })(window); 109 | 110 | -------------------------------------------------------------------------------- /js/slides.js: -------------------------------------------------------------------------------- 1 | require(['order!../slide_config', 'order!modernizr.custom.45394', 2 | 'order!prettify/prettify', 'order!hammer', 'order!slide-controller', 3 | 'order!slide-deck', 'order!app'], function(someModule) { 4 | 5 | }); 6 | -------------------------------------------------------------------------------- /serve.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Starts a basic web server on the port specified. 4 | # 5 | # ./serve.sh 3000 -> http://localhost:3000 6 | # 7 | # Copyright 2012 Eric Bidelman 8 | 9 | port=$1 10 | if [ $# -ne 1 ] 11 | then 12 | port=8000 13 | fi 14 | 15 | open http://localhost:$port/template.html && python -m SimpleHTTPServer $port; 16 | -------------------------------------------------------------------------------- /slide_config.js: -------------------------------------------------------------------------------- 1 | var SLIDE_CONFIG = { 2 | // Slide settings 3 | settings: { 4 | title: 'The Web Can Do That!?', 5 | subtitle: 'Adventures Into HTML5', 6 | useBuilds: true, // Default: true. False will turn off slide animation builds. 7 | usePrettify: true, // Default: true 8 | enableSlideAreas: true, // Default: true. False turns off the click areas on either slide of the slides. 9 | enableTouch: true, // Default: true. If touch support should enabled. Note: the device must support touch. 10 | //analytics: 'UA-32630298-1', 11 | favIcon: 'images/chrome-logo-tiny.png', 12 | fonts: [ 13 | 'Open Sans:regular,semibold,italic,italicsemibold', 14 | 'Inconsolata', 15 | 'Cabin Sketch:400', 16 | 'Muli' 17 | ], 18 | //theme: ['mytheme'], // Add your own custom themes or styles in /theme/css. Leave off the .css extension. 19 | }, 20 | 21 | // Author information 22 | presenters: [{ 23 | name: 'Eric Bidelman', 24 | gplus: 'http://plus.ericbidelman.com', 25 | title: 'Senior Developer Programs Engineer', 26 | company: 'Google Chrome Team', 27 | twitter: '@ebidel', 28 | www: 'http://www.ericbidelman.com', 29 | github: 'https://github.com/ebidel' 30 | }] 31 | }; 32 | 33 | -------------------------------------------------------------------------------- /theme/css/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ebidel/html5can/0df43e2890bb122aad2f31376a8327ec2482d8ca/theme/css/.DS_Store -------------------------------------------------------------------------------- /theme/css/custom.css: -------------------------------------------------------------------------------- 1 | ul>li::before{content:url("../../images/chrome-logo-tiny.png");width:0.5em;margin-left:-1.2em;margin-top:3px;position:absolute}.smaller ul>li::before{margin-top:1px}@-webkit-keyframes rotateRight{from{-webkit-transform:rotate(0)}to{-webkit-transform:rotate(360deg)}}@-webkit-keyframes jitter{0%{-webkit-transform:rotate(0deg)}2%{-webkit-transform:rotate(-7deg) translateX(2px) scale(1.1)}4%{-webkit-transform:rotate(0deg)}6%{-webkit-transform:rotate(7deg) translateX(-2px)}8%{-webkit-transform:rotate(0deg)}10%{-webkit-transform:rotate(-7deg) translateX(2px) scale(1.1)}12%{-webkit-transform:rotate(0deg)}14%{-webkit-transform:rotate(7deg) translateX(-2px)}16%{-webkit-transform:rotate(0deg)}}.spin{-webkit-animation-name:rotateRight;-moz-animation-name:rotateRight;-ms-animation-name:rotateRight;-o-animation-name:rotateRight;animation-name:rotateRight;-webkit-animation-duration:15s;-webkit-animation-timing-function:linear;-webkit-transform-origin:50% 50%;-webkit-animation-iteration-count:infinite}.spin:hover{-webkit-animation-duration:0.1s}.jitter{-webkit-animation-name:jitter;-webkit-animation-duration:2s;-webkit-animation-timing-function:ease-in-out;-webkit-transform-origin:50% 50%;-webkit-animation-iteration-count:infinite}.underline{border-bottom:3px solid #2a7cdf}.rounded{-webkit-border-radius:10px;-moz-border-radius:10px;-ms-border-radius:10px;-o-border-radius:10px;border-radius:10px}.toppadding{margin-top:2em}.previewframe{display:block}.previewframe iframe{-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:none;-webkit-transform:scale(1);-moz-transform:scale(1);-ms-transform:scale(1);-o-transform:scale(1);transform:scale(1)}label.old,label.new{padding:5px 10px;-webkit-border-radius:10px;-moz-border-radius:10px;-ms-border-radius:10px;-o-border-radius:10px;border-radius:10px;color:white;margin-right:10px}label.old{background-color:#e0543e}label.old::after{content:'OLD'}label.new{background-color:#00a86d}label.new::after{content:'NEW'}.weavebg{background:-webkit-linear-gradient(63deg, #151515 5px, transparent 5px) 0 5px,-webkit-linear-gradient(243deg, #151515 5px, transparent 5px) 10px 0px,-webkit-linear-gradient(63deg, #222 5px, transparent 5px) 0px 10px,-webkit-linear-gradient(243deg, #222 5px, transparent 5px) 10px 5px,-webkit-linear-gradient(0deg, #1b1b1b 10px, transparent 10px),-webkit-linear-gradient(#1d1d1d 25%, #1a1a1a 25%, #1a1a1a 50%, transparent 50%, transparent 75%, #242424 75%, #242424);background:-moz-linear-gradient(63deg, #151515 5px, transparent 5px) 0 5px,-moz-linear-gradient(243deg, #151515 5px, transparent 5px) 10px 0px,-moz-linear-gradient(63deg, #222 5px, transparent 5px) 0px 10px,-moz-linear-gradient(243deg, #222 5px, transparent 5px) 10px 5px,-moz-linear-gradient(0deg, #1b1b1b 10px, transparent 10px),-moz-linear-gradient(#1d1d1d 25%, #1a1a1a 25%, #1a1a1a 50%, transparent 50%, transparent 75%, #242424 75%, #242424);background:-ms-linear-gradient(63deg, #151515 5px, transparent 5px) 0 5px,-ms-linear-gradient(243deg, #151515 5px, transparent 5px) 10px 0px,-ms-linear-gradient(63deg, #222 5px, transparent 5px) 0px 10px,-ms-linear-gradient(243deg, #222 5px, transparent 5px) 10px 5px,-ms-linear-gradient(0deg, #1b1b1b 10px, transparent 10px),-ms-linear-gradient(#1d1d1d 25%, #1a1a1a 25%, #1a1a1a 50%, transparent 50%, transparent 75%, #242424 75%, #242424);background-color:#131313;-webkit-background-size:20px 20px;-moz-background-size:20px 20px;-o-background-size:20px 20px;background-size:20px 20px}.weavebg .can.current ~ .backdrop{opacity:0}body.blueprint{background-image:url(../../images/slides/blueprint.jpg);background-size:cover}body.blueprint slides>slide.backdrop{background:none !important;background-color:transparent !important}body.blueprint slides>slide.blueprint h2{font-family:'Cabin Sketch';font-weight:400}body.cat .backdrop,body.nobackground .backdrop{opacity:0}body.tools{background:url(../../images/slides/tools2.jpg);background-size:cover}body.binding{background:url(../../images/slides/binding.jpg);background-size:cover}body.stream{background:url(../../images/slides/stream.jpg);background-size:cover}body.rocket{background:url(../../images/slides/rocket.jpg);background-size:cover;background-position:50% 40%}slides>slide{line-height:1.5;overflow:visible}slides>slide.can .stamp{color:#009f5d;-webkit-transform:rotateZ(-25deg) scale(1);-moz-transform:rotateZ(-25deg) scale(1);-ms-transform:rotateZ(-25deg) scale(1);-o-transform:rotateZ(-25deg) scale(1);transform:rotateZ(-25deg) scale(1);font:400 90px 'Cabin Sketch';text-transform:uppercase;position:absolute;top:40%;left:23%;-webkit-border-radius:20px;-moz-border-radius:20px;-ms-border-radius:20px;-o-border-radius:20px;border-radius:20px;border:10px solid #009f5d;-webkit-box-shadow:0 0 50px #000 inset;-moz-box-shadow:0 0 50px #000 inset;box-shadow:0 0 50px #000 inset;padding:0 30px;background:rgba(0,205,0,0.2);text-shadow:3px 3px 10px #000;-webkit-transition:-webkit-transform 0.8s cubic-bezier(0.17, 0.67, 0, 1);-webkit-transition:all 0.8s cubic-bezier(0.17, 0.67, 0, 1.25);-moz-transition:all 0.8s cubic-bezier(0.17, 0.67, 0, 1.25);-ms-transition:all 0.8s cubic-bezier(0.17, 0.67, 0, 1.25);-o-transition:all 0.8s cubic-bezier(0.17, 0.67, 0, 1.25);transition:all 0.8s cubic-bezier(0.17, 0.67, 0, 1.25);opacity:1;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:none}slides>slide.can .stamp.to-build{-webkit-transform:rotateZ(-45deg) scale(5);-moz-transform:rotateZ(-45deg) scale(5);-ms-transform:rotateZ(-45deg) scale(5);-o-transform:rotateZ(-45deg) scale(5);transform:rotateZ(-45deg) scale(5);opacity:0}slides>slide.can h2{font:normal 65px 'Muli';position:relative;text-shadow:3px 3px 10px #000}slides>slide.can h2:before{content:"#" attr(data-can-num);font-size:50px;line-height:1.7;color:#ffd14d;position:absolute;top:-25px;left:-60px}slides>slide.can.cant .stamp{color:#c00;border-color:#c00;background:rgba(205,0,0,0.2)}slides>slide.can .auto-fadein{-webkit-transition:-webkit-transform 0.6s cubic-bezier(0.17, 0.67, 0, 1);-webkit-transition:-webkit-transform 0.6s cubic-bezier(0.17, 0.67, 0, 1.25) 1s;-moz-transition:-webkit-transform 0.6s cubic-bezier(0.17, 0.67, 0, 1.25) 1s;-ms-transition:-webkit-transform 0.6s cubic-bezier(0.17, 0.67, 0, 1.25) 1s;-o-transition:-webkit-transform 0.6s cubic-bezier(0.17, 0.67, 0, 1.25) 1s;transition:-webkit-transform 0.6s cubic-bezier(0.17, 0.67, 0, 1.25) 1s;-webkit-transform:translateY(800px);-moz-transform:translateY(800px);-ms-transform:translateY(800px);-o-transform:translateY(800px);transform:translateY(800px)}slides>slide.can.current .auto-fadein{-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0);transform:translateY(0)}slides>slide hgroup{text-shadow:#fff 0px 1px 0px,rgba(0,0,0,0.2) 0 2px 5px}slides>slide hgroup span{float:right}slides>slide hgroup .spec,slides>slide hgroup .bug,slides>slide hgroup .radar{width:30px;height:30px;opacity:0.2;-webkit-transition:opacity 200ms ease-out;-moz-transition:opacity 200ms ease-out;-ms-transition:opacity 200ms ease-out;-o-transition:opacity 200ms ease-out;transition:opacity 200ms ease-out;border-bottom:none;background-position:50% 50%;-webkit-background-size:contain;-moz-background-size:contain;-o-background-size:contain;background-size:contain;background-repeat:no-repeat}slides>slide hgroup .bug,slides>slide hgroup .spec{background-image:url("../../images/icons/gears.svg");display:inline-block}slides>slide hgroup .bug{background-image:url("../../images/icons/bug.png")}slides>slide hgroup .bug.closed{background-image:url("../../images/icons/bug_closed.png")}slides>slide hgroup .radar,slides>slide hgroup .bug:hover,slides>slide hgroup .spec:hover{opacity:0.8}.demo{text-transform:uppercase;padding:6px 12px 6px 12px;text-decoration:none;background-color:#759ae9;background:-webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #4387fd), color-stop(50%, #376fe0), color-stop(50%, #242424), color-stop(100%, #2463de));background:-webkit-linear-gradient(top, #4387fd 0%,#376fe0 50%,#242424 50%,#2463de 100%);background:-moz-linear-gradient(top, #4387fd 0%,#376fe0 50%,#242424 50%,#2463de 100%);background:-o-linear-gradient(top, #4387fd 0%,#376fe0 50%,#242424 50%,#2463de 100%);background:-ms-linear-gradient(top, #4387fd 0%,#376fe0 50%,#242424 50%,#2463de 100%);background:linear-gradient(top, #4387fd 0%,#376fe0 50%,#242424 50%,#2463de 100%);border-top:1px solid #1f58cc;border-right:1px solid #1b4db3;border-bottom:1px solid #174299;border-left:1px solid #1b4db3;-webkit-border-radius:4px;-moz-border-radius:4px;-ms-border-radius:4px;-o-border-radius:4px;border-radius:4px;-webkit-box-shadow:inset 0 0 2px 0 rgba(57,140,255,0.8);-moz-box-shadow:inset 0 0 2px 0 rgba(57,140,255,0.8);box-shadow:inset 0 0 2px 0 rgba(57,140,255,0.8);color:white;text-shadow:0 -1px 1px #1a5ad9;font-weight:600}.demo:hover{color:white !important;background:-webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #4387fd), color-stop(50%, #376fe0), color-stop(50%, #1a5ad9), color-stop(100%, #2463de));background:-webkit-linear-gradient(top, #4387fd 0%,#376fe0 50%,#1a5ad9 50%,#2463de 100%);background:-moz-linear-gradient(top, #4387fd 0%,#376fe0 50%,#1a5ad9 50%,#2463de 100%);background:-o-linear-gradient(top, #4387fd 0%,#376fe0 50%,#1a5ad9 50%,#2463de 100%);background:-ms-linear-gradient(top, #4387fd 0%,#376fe0 50%,#1a5ad9 50%,#2463de 100%);background:linear-gradient(top, #4387fd 0%,#376fe0 50%,#1a5ad9 50%,#2463de 100%)}.browser-support{width:900px}.browser-support img{height:225px;opacity:0.6;margin-right:-70px;vertical-align:bottom;-webkit-filter:grayscale(1);-webkit-mask-image:-webkit-linear-gradient(bottom, rgba(255,255,255,0), rgba(255,255,255,0) 45%, #fff);-moz-mask-image:-moz-linear-gradient(bottom, rgba(255,255,255,0), rgba(255,255,255,0) 45%, #fff);-ms-mask-image:-ms-linear-gradient(bottom, rgba(255,255,255,0), rgba(255,255,255,0) 45%, #fff);-o-mask-image:-o-linear-gradient(bottom, rgba(255,255,255,0), rgba(255,255,255,0) 45%, #fff)}.browser-support img:first-of-type{height:245px}.browser-support img:nth-of-type(2){height:235px}.browser-support img:last-of-type{height:250px}.browser-support img.supported{opacity:1;-webkit-filter:grayscale(0);z-index:1;position:relative;-webkit-mask-image:-webkit-linear-gradient(bottom, rgba(255,255,255,0), rgba(255,255,255,0) 45%, #fff 65%);-moz-mask-image:-moz-linear-gradient(bottom, rgba(255,255,255,0), rgba(255,255,255,0) 45%, #fff 65%);-ms-mask-image:-ms-linear-gradient(bottom, rgba(255,255,255,0), rgba(255,255,255,0) 45%, #fff 65%);-o-mask-image:-o-linear-gradient(bottom, rgba(255,255,255,0), rgba(255,255,255,0) 45%, #fff 65%)}.author:before{content:'—'}[data-body-class] .source{bottom:0;left:0}.source a{border:none}[data-tooltip-property],[data-tooltip]{position:relative;cursor:pointer;border-bottom:none}[data-tooltip-property]:hover:before,[data-tooltip-property]:hover:after,[data-tooltip]:hover:before,[data-tooltip]:hover:after{position:absolute;z-index:100;font-size:20px;white-space:pre}[data-tooltip-property]:hover:before,[data-tooltip]:hover:before{border:solid transparent;height:0;width:0;border-bottom-color:rgba(0,0,0,0.85);border-width:10px;content:' ';top:15px;left:20px;z-index:101}[data-tooltip-property]:hover:after,[data-tooltip]:hover:after{content:attr(data-tooltip);background:rgba(0,0,0,0.85);padding:10px 15px;color:#fff;-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;-o-border-radius:3px;border-radius:3px;left:0;top:34px;width:330px;font-weight:normal;-webkit-box-shadow:3px 3px 10px #515151;-moz-box-shadow:3px 3px 10px #515151;box-shadow:3px 3px 10px #515151}[data-tooltip-property] .property,[data-tooltip] .property{border-bottom:1px dotted #515151;color:#515151}#chrome-heart .chrome-logo{display:inline-block;margin-bottom:-30px;background:url(../../images/chrome_logo.png) 50% 50% no-repeat;width:100px;height:100px;background-position:50% 50%;-webkit-background-size:cover;-moz-background-size:cover;-o-background-size:cover;background-size:cover}#chrome-heart h1{display:inline;font-size:50px}#chrome-heart h1 .jitter{cursor:none;display:inline-block}#chrome-heart h1 .jitter:before{content:'/'}#chrome-heart h1:hover .jitter:before{color:#EB0000;content:'\002665'}#who a{border:none}#who .avatar{float:right;background:url(https://lh6.googleusercontent.com/-0W5UECRQxqc/TrIv9fqjOaI/AAAAAAAACns/6Hm7wJfJKz8/IMG_20111031_121123.jpg?sz=500) -10px 0;width:365px;height:500px;-webkit-mask-size:50% 50%;-moz-mask-size:50% 50%;-ms-mask-size:50% 50%;-o-mask-size:50% 50%;mask-size:50% 50%;-webkit-mask-position:50% 50%;-moz-mask-position:50% 50%;-ms-mask-position:50% 50%;-o-mask-position:50% 50%;mask-position:50% 50%;-webkit-transition:-webkit-mask-size 0.6s cubic-bezier(0.17, 0.67, 0, 1.45);-moz-transition:-moz-mask-size 1s cubic-bezier(0.17, 0.67, 0, 1.45);-o-transition:-o-mask-size 1s cubic-bezier(0.17, 0.67, 0, 1.45);-ms-transition:-ms-mask-size 1s cubic-bezier(0.17, 0.67, 0, 1.45)}#who .avatar.to-build{opacity:1}#who .avatar.build-current,#who .avatar:hover{-webkit-mask-size:100% 100%;-moz-mask-size:100% 100%;-ms-mask-size:100% 100%;-o-mask-size:100% 100%;mask-size:100% 100%;-webkit-mask-image:url(../../images/HTML5_Badge.svg);-moz-mask-image:url(../../images/HTML5_Badge.svg);-ms-mask-image:url(../../images/HTML5_Badge.svg);-o-mask-image:url(../../images/HTML5_Badge.svg);mask-image:url(../../images/HTML5_Badge.svg)}#who img{vertical-align:middle;margin-right:10px}#legend-slide{height:auto}#legend-slide div{margin-top:1.5em}#legend-slide div:last-child{text-align:center;font-size:12pt;margin-top:5em}#legend-slide img{vertical-align:middle;height:50px;width:50px}#chrome-version-warning{font-style:italic}.flexbox-example .box{display:-webkit-flex;display:-moz-flex;display:-ms-flex;display:-o-flex;display:flex;border:5px solid #d94d3a;width:600px;height:200px;padding:5px;-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;-o-border-radius:3px;border-radius:3px;background:rgba(255,0,0,0.05);margin:1em auto auto auto;-webkit-transition:all 0.5s ease-in;-moz-transition:all 0.5s ease-in;-ms-transition:all 0.5s ease-in;-o-transition:all 0.5s ease-in;transition:all 0.5s ease-in;position:relative}.flexbox-example .box:hover:before,.flexbox-example .box:hover:after{opacity:1;-webkit-transition:opacity 200ms ease-in-out 1s;-moz-transition:opacity 200ms ease-in-out 1s;-ms-transition:opacity 200ms ease-in-out 1s;-o-transition:opacity 200ms ease-in-out 1s;transition:opacity 200ms ease-in-out 1s}.flexbox-example .box:before,.flexbox-example .box:after{opacity:0;position:absolute;font-size:25px;font-weight:bold;color:black}.flexbox-example .box:before{content:'main axis';width:120%;top:100px;left:-10%;border-top:3px dashed #d94d3a}.flexbox-example .box:after{content:'cross axis';white-space:nowrap;width:3px;height:120%;top:-10%;left:50%;border-left:3px dashed #d94d3a}.flexbox-example .box.switchmainaxis:before{content:'cross axis'}.flexbox-example .box.switchmainaxis:after{content:'main axis'}.flexbox-example .box>div{border:2px dotted blue;background:rgba(0,0,255,0.05);-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;-o-border-radius:3px;border-radius:3px;padding:10px;text-align:center;-webkit-transition:all 0.5s ease-in;-moz-transition:all 0.5s ease-in;-ms-transition:all 0.5s ease-in;-o-transition:all 0.5s ease-in;transition:all 0.5s ease-in;-webkit-flex:none;-moz-flex:none;-o-flex:none;-o-flex:none;flex:none}.flexbox-example select{-webkit-appearance:none;-moz-appearance:none;-ms-appearance:none;-o-appearance:none;border:none;background:transparent;font:inherit;color:#2a7cdf;width:auto;outline:none}.flexbox-example input{font:inherit;color:#2a7cdf;background:none;width:25px;border:none;outline:none;text-align:center}.flexbox-example input::-webkit-inner-spin-button,.flexbox-example input::-moz-inner-spin-button{display:none}.flexbox-example input:focus{-webkit-box-shadow:0 0 5px #a9a9a9 inset;-moz-box-shadow:0 0 5px #a9a9a9 inset;box-shadow:0 0 5px #a9a9a9 inset}#flexbox-bad>div{background:#2a7cdf;float:left;color:white;text-shadow:none;width:250px;margin:0 1em;padding:1em 1em 3em 1em;outline:none;font-size:60%;-webkit-transition:height 1.5s ease-in-out;-moz-transition:height 1.5s ease-in-out;-ms-transition:height 1.5s ease-in-out;-o-transition:height 1.5s ease-in-out;transition:height 1.5s ease-in-out;cursor:pointer;position:relative}#flexbox-bad>div:after{content:"height: " attr(data-height) "px";position:absolute;right:0;bottom:0;font-weight:bold;background:rgba(255,255,255,0.5);padding:10px;border-top-left-radius:10px;text-shadow:0 1px 1px #515151}#flexbox-bad>div.active{height:400px}#flexbox-bad>div.editable{min-height:400px;cursor:default;background:#0da861}#flexbox-bad>div.whoops{background:#f44a3f}#flexbox-bad>div:nth-of-type(2){width:200px}#flexbox-ex1 .box{-webkit-justify-content:center;-moz-justify-content:center;-o-justify-content:center;-o-justify-content:center;justify-content:center;-webkit-align-items:center;-moz-align-items:center;-o-align-items:center;-o-align-items:center;align-items:center}#flexbox-ex2 .box{-webkit-justify-content:center;-moz-justify-content:center;-o-justify-content:center;-o-justify-content:center;justify-content:center;-webkit-align-items:center;-moz-align-items:center;-o-align-items:center;-o-align-items:center;align-items:center}#flexbox-ex3 .box{-webkit-justify-content:center;-moz-justify-content:center;-o-justify-content:center;-o-justify-content:center;justify-content:center;-webkit-align-items:center;-moz-align-items:center;-o-align-items:center;-o-align-items:center;align-items:center}#flexbox-ex3 .box>*{-webkit-flex:1 0 auto;-moz-flex:1 0 auto;-o-flex:1 0 auto;-o-flex:1 0 auto;flex:1 0 auto}#flexbox-ex4 .box{-webkit-justify-content:center;-moz-justify-content:center;-o-justify-content:center;-o-justify-content:center;justify-content:center;-webkit-align-items:center;-moz-align-items:center;-o-align-items:center;-o-align-items:center;align-items:center;-webkit-flex-direction:row;-moz-flex-direction:row;-o-flex-direction:row;-o-flex-direction:row;flex-direction:row}#flexbox-ex4 .box:nth-child(2){-webkit-order:0;-moz-order:0;-o-order:0;-o-order:0;order:0}#flexbox-circle pre{-webkit-column-break-after:always;-moz-column-break-after:always;-ms-column-break-after:always;-o-column-break-after:always;column-break-after:always;padding:20px 0 20px 100px}#flexbox-circle div:hover{-webkit-border-radius:0;-moz-border-radius:0;-ms-border-radius:0;-o-border-radius:0;border-radius:0}#flexbox-circle div{display:-webkit-flex;display:-moz-flex;display:-ms-flex;display:-o-flex;display:flex;width:-webkit-calc(100% - 4em);height:-webkit-calc(100% - 4em);width:-moz-calc(100% - 4em);height:-moz-calc(100% - 4em);width:-o-calc(100% - 4em);height:-o-calc(100% - 4em);width:calc(100% - 4em);height:calc(100% - 4em);border:1em solid #4387fd;-webkit-border-radius:50%;-moz-border-radius:50%;-ms-border-radius:50%;-o-border-radius:50%;border-radius:50%;-webkit-align-items:center;-moz-align-items:center;-o-align-items:center;-o-align-items:center;align-items:center;-webkit-justify-content:center;-moz-justify-content:center;-o-justify-content:center;-o-justify-content:center;justify-content:center;-webkit-box-shadow:0 0 5px #515151 inset;-moz-box-shadow:0 0 5px #515151 inset;box-shadow:0 0 5px #515151 inset;margin:auto}#flexbox-circle>div{-webkit-transition:all 2000ms cubic-bezier(0.17, 0.67, 0, 1.45);-moz-transition:all 2000ms cubic-bezier(0.17, 0.67, 0, 1.45);-ms-transition:all 2000ms cubic-bezier(0.17, 0.67, 0, 1.45);-o-transition:all 2000ms cubic-bezier(0.17, 0.67, 0, 1.45);transition:all 2000ms cubic-bezier(0.17, 0.67, 0, 1.45)}#flexbox-circle div>div{border-color:#f44a3f;-webkit-transition:all 1000ms cubic-bezier(0.17, 0.67, 0, 1.45);-moz-transition:all 1000ms cubic-bezier(0.17, 0.67, 0, 1.45);-ms-transition:all 1000ms cubic-bezier(0.17, 0.67, 0, 1.45);-o-transition:all 1000ms cubic-bezier(0.17, 0.67, 0, 1.45);transition:all 1000ms cubic-bezier(0.17, 0.67, 0, 1.45)}#flexbox-circle div>div>div{border-color:#ffd14d;-webkit-transition:all 500ms cubic-bezier(0.17, 0.67, 0, 1.45);-moz-transition:all 500ms cubic-bezier(0.17, 0.67, 0, 1.45);-ms-transition:all 500ms cubic-bezier(0.17, 0.67, 0, 1.45);-o-transition:all 500ms cubic-bezier(0.17, 0.67, 0, 1.45);transition:all 500ms cubic-bezier(0.17, 0.67, 0, 1.45)}#flexbox-circle div>div>div>div{border-color:#0da861;-webkit-transition:all 250ms cubic-bezier(0.17, 0.67, 0, 1.45);-moz-transition:all 250ms cubic-bezier(0.17, 0.67, 0, 1.45);-ms-transition:all 250ms cubic-bezier(0.17, 0.67, 0, 1.45);-o-transition:all 250ms cubic-bezier(0.17, 0.67, 0, 1.45);transition:all 250ms cubic-bezier(0.17, 0.67, 0, 1.45)}#flexbox-circle .circle{width:400px;height:400px}#data-binding-example input[type="range"]{font-size:14px;height:20px}#data-binding-example input[type="range"]::after{content:attr(data-value) "/" attr(max);position:relative;left:135px;top:-30px;color:#666;font-size:30px}[list="browsers"]{padding:10px;-webkit-border-radius:7px;-moz-border-radius:7px;-ms-border-radius:7px;-o-border-radius:7px;border-radius:7px;-webkit-box-shadow:1px 1px 5px #797979 inset;-moz-box-shadow:1px 1px 5px #797979 inset;box-shadow:1px 1px 5px #797979 inset;border:none}#wrapup{font-size:25px} 2 | -------------------------------------------------------------------------------- /theme/css/phone.css: -------------------------------------------------------------------------------- 1 | slides>slide{-webkit-transition:none !important;-webkit-transition:none !important;-moz-transition:none !important;-ms-transition:none !important;-o-transition:none !important;transition:none !important} 2 | -------------------------------------------------------------------------------- /theme/scss/_base.scss: -------------------------------------------------------------------------------- 1 | @import "compass/reset"; 2 | @import "compass/css3/border-radius"; 3 | @import "compass/css3/box"; 4 | @import "compass/css3/box-shadow"; 5 | @import "compass/css3/box-sizing"; 6 | @import "compass/css3/images"; 7 | @import "compass/css3/text-shadow"; 8 | @import "compass/css3/background-size"; 9 | @import "compass/css3/transform"; 10 | @import "compass/css3/transition"; 11 | 12 | @import "variables"; 13 | 14 | /** 15 | * Base SlideDeck Styles 16 | */ 17 | html { 18 | height: 100%; 19 | overflow: hidden; 20 | } 21 | 22 | body { 23 | margin: 0; 24 | padding: 0; 25 | 26 | opacity: 0; 27 | 28 | height: 100%; 29 | min-height: 740px; 30 | width: 100%; 31 | 32 | overflow: hidden; 33 | 34 | color: #fff; 35 | @include font-smoothing(antialiased); 36 | @include transition(opacity 800ms ease-in 100ms); // Add small delay to prevent jank. 37 | 38 | &.loaded { 39 | opacity: 1 !important; 40 | } 41 | } 42 | 43 | input, button { 44 | vertical-align: middle; 45 | } 46 | 47 | slides > slide[hidden] { 48 | display: none !important; 49 | } 50 | 51 | slides { 52 | width: 100%; 53 | height: 100%; 54 | position: absolute; 55 | left: 0; 56 | top: 0; 57 | @include transform(translate3d(0, 0, 0)); 58 | @include perspective(1000); 59 | @include transform-style(preserve-3d); 60 | @include transition(opacity 800ms ease-in 100ms); // Add small delay to prevent jank. 61 | } 62 | 63 | slides > slide { 64 | display: block; 65 | position: absolute; 66 | overflow: hidden; 67 | left: 50%; 68 | top: 50%; 69 | @include box-sizing(border-box); 70 | } 71 | 72 | /* Slide styles */ 73 | 74 | 75 | /*article.fill iframe { 76 | position: absolute; 77 | left: 0; 78 | top: 0; 79 | width: 100%; 80 | height: 100%; 81 | 82 | border: 0; 83 | margin: 0; 84 | 85 | @include border-radius(10px); 86 | 87 | z-index: -1; 88 | } 89 | 90 | slide.fill { 91 | background-repeat: no-repeat; 92 | @include background-size(cover); 93 | } 94 | 95 | slide.fill img { 96 | position: absolute; 97 | left: 0; 98 | top: 0; 99 | min-width: 100%; 100 | min-height: 100%; 101 | 102 | z-index: -1; 103 | } 104 | */ 105 | -------------------------------------------------------------------------------- /theme/scss/_variables.scss: -------------------------------------------------------------------------------- 1 | $social-tags: 'htmlfivecan.com \00a0\00a0\00a0 #io12'; 2 | $brand-small-icon-size: 30px; 3 | 4 | $gray-1: #e6e6e6; 5 | $gray-2: #a9a9a9; 6 | $gray-3: #797979; 7 | $gray-4: #515151; 8 | 9 | $brand-blue: rgb(67, 135, 253); 10 | $brand-blue-secondary: #3c8ef3; 11 | $brand-blue-secondary2: #2a7cdf; 12 | 13 | $brand-red: rgb(244, 74, 63); 14 | $brand-red-secondary: #e0543e; 15 | $brand-red-secondary2: #d94d3a; 16 | 17 | $brand-yellow: rgb(255, 209, 77); 18 | $brand-yellow-secondary: #f9cc46; 19 | $brand-yellow-secondary2: #f6c000; 20 | 21 | $brand-green: rgb(13, 168, 97); 22 | $brand-green-secondary: #00a86d; 23 | $brand-green-secondary2: #009f5d; 24 | 25 | $slide-width: 900px; 26 | $slide-height: 700px; 27 | $slide-width-widescreen: 1100px; 28 | $slide-top-bottom-padding: 40px; 29 | $slide-left-right-padding: 60px; 30 | $slide-border-radius: 5px; 31 | 32 | $slide-tap-area-width: 100px; 33 | 34 | $article-content-top-padding: 45px; 35 | 36 | @mixin font-smoothing($val: antialiased) { 37 | -webkit-font-smoothing: $val; 38 | -moz-font-smoothing: $val; 39 | -ms-font-smoothing: $val; 40 | -o-font-smoothing: $val; 41 | } 42 | 43 | @mixin flexbox { 44 | display: -webkit-box !important; 45 | display: -moz-box !important; 46 | display: -ms-box !important; 47 | display: -o-box !important; 48 | display: box !important; 49 | } 50 | 51 | @mixin flex-center-center { 52 | @include box-orient(vertical); 53 | @include box-align(center); 54 | @include box-pack(center); 55 | } 56 | 57 | @mixin flex-left-center { 58 | @include box-orient(vertical); 59 | @include box-align(left); 60 | @include box-pack(center); 61 | } 62 | 63 | @mixin flex-right-center { 64 | @include box-orient(vertical); 65 | @include box-align(end); 66 | @include box-pack(center); 67 | } 68 | 69 | @mixin flex-flex($val: 0) { 70 | @include box-flex($val); 71 | } 72 | 73 | @mixin column-break-after($val) { 74 | -webkit-column-break-after: $val; 75 | -moz-column-break-after: $val; 76 | -ms-column-break-after: $val; 77 | -o-column-break-after: $val; 78 | column-break-after: $val; 79 | } 80 | -------------------------------------------------------------------------------- /theme/scss/phone.scss: -------------------------------------------------------------------------------- 1 | @import "compass/css3/transition"; 2 | 3 | 4 | /*Smartphones (portrait and landscape) ----------- */ 5 | /*@media only screen 6 | and (min-width : 320px) 7 | and (max-width : 480px) { 8 | 9 | }*/ 10 | 11 | /* Smartphones (portrait) ----------- */ 12 | //@media only screen and (max-device-width: 480px) { 13 | /* Styles */ 14 | //$slide-width: 350px; 15 | //$slide-height: 500px; 16 | 17 | slides > slide { 18 | /* width: $slide-width !important; 19 | height: $slide-height !important; 20 | margin-left: -$slide-width / 2 !important; 21 | margin-top: -$slide-height / 2 !important; 22 | */ 23 | // Don't do full slide transitions on mobile. 24 | -webkit-transition: none !important; // Bug in compass? Not sure why the below is not working 25 | @include transition(none !important); 26 | } 27 | 28 | //} 29 | 30 | /* iPhone 4 ----------- */ 31 | @media 32 | only screen and (-webkit-min-device-pixel-ratio : 1.5), 33 | only screen and (min-device-pixel-ratio : 1.5) { 34 | /* Styles */ 35 | } --------------------------------------------------------------------------------