A Pen by Sven Neumann on CodePen.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Uncaught Error: Assertion failed | |
assert @ assert.js:24 | |
ItemView.getStatusText_ @ item_view.js:355 | |
ItemView.update @ item_view.js:24 | |
1Item.render @ item.js:46 | |
Manager.updateAll @ manager.js:58 | |
Manager.updateAll @ manager.js:206 | |
(anonymous function) @ VM2125:1 |
A Pen by Sven Neumann on CodePen.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html><head><script> | |
var loituma_ogg, audio, frame1, frame2, frame3, frame4, playButtonHtml, bodyCss, playing = false; | |
var imgUrls = new Array(4); | |
var frames = new Array(4); | |
document.addEventListener('DOMContentLoaded', function() { | |
document.body.parentNode.style.height = '100%'; | |
document.body.style.cssText = bodyCss; | |
var i = frames.length; while (i--) { | |
frames[i] = new Image(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html><head><script> | |
var map = Array.prototype.map; | |
var toArray = [].slice.apply.bind([].slice); | |
var p = Promise.resolve(); | |
var htmlStyle = 'height: 100%; background: #000;'; | |
var bodyStyle = | |
'height: 100%; margin: 0;'+ | |
'text-align: center;'+ | |
'color: grey;'+ | |
'background-repeat: no-repeat;'+ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function fetchRemoteImage(id) { | |
console.log('fetchRemoteImage(%s);', id); | |
var card = cards[id]; | |
if(card === undefined) throw new Error('Card "'+id+'" not found.'); | |
var url = 'http://hearthstone.gamepedia.com/'+encodeURIComponent(card.name.replace(/ /g, '_')); | |
return fetch(url) | |
.then(function(body) { | |
var m = body.toString('utf8').match(/<img alt="" src="([^"]+)" width="[^"]+" height="[^"]+" class="thumbimage"/); | |
var url = m[1].replace(/(\?.*)/, ''); | |
m = url.match(/\.(png|jpg)$/); |
A Pen by Sven Neumann on CodePen.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<style> | |
/* | |
@import url(http://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,700italic,300,400,700); | |
body { | |
font-family: 'Open Sans', sans-serif; | |
} | |
*/ | |
body { | |
margin: 0; |
Encoding assets into pure HTML
A Pen by Sven Neumann on CodePen.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function extrudeProfileOnPath(profileVs, outlineVs, sharedUVs) { | |
/* | |
TODO: | |
- if sharedUVs == false, create multiple UV layers | |
- Smooth according to edge angles | |
- Accept Shapes/CurvePaths directly | |
- Don't scale UVs along profile. Reuse reference profile | |
*/ | |
var upVector = new THREE.Vector3(0, 1, 0); | |
var backVector = new THREE.Vector3(0, 0, -1); |
OlderNewer