[ Launch Inlet ]
-
-
Save ejfox/3901799 to your computer and use it in GitHub Desktop.
just another inlet to tributary
This file contains hidden or 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
| {"endpoint":"","display":"svg","public":true,"require":[],"tab":"edit","display_percent":0.7,"play":false,"loop":false,"restart":false,"autoinit":true,"pause":true,"loop_type":"period","bv":false,"nclones":15,"clone_opacity":0.4,"duration":3000,"ease":"linear","dt":0.01} |
This file contains hidden or 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
| var svg = d3.select('svg'); | |
| svg.append("svg:rect").attr({width: 2842, height: 1573, fill: "#F0F0F0" }) | |
| //$('head').append($("<link href='http://fonts.googleapis.com/css?family=Molle:400italic' rel='stylesheet' type='text/css' id='google-webfont'>")) | |
| var shadowtext = "HTML5"; | |
| var shadows = d3.range(230); | |
| var shadowgx = -58; | |
| var shadowgy = -129; | |
| var shadowoffsety = 1.52; | |
| var shadowoffsetx = 2; | |
| var shadowopacity = 1; | |
| var fontsize = 114; | |
| var colors = [ | |
| "#351D3F" | |
| , "#C9083D" | |
| , "#04062A" | |
| , "#03FFFF" | |
| , "#37373A" | |
| , "#D7D9E0" | |
| ] | |
| var color_scale = function(i) { | |
| var num_interps = colors.length -1 | |
| var n = shadows.length | |
| var ord = d3.scale.linear() | |
| .domain([0, n]) | |
| .range([0, num_interps]) | |
| var section = parseInt(ord(i)) | |
| //console.log("section", section) | |
| var section_size = n / num_interps | |
| //get the two colors we want to interpolate between | |
| var col_range = [colors[section], colors[section+1]] | |
| var col_scale = d3.scale.linear() | |
| .domain([section * section_size, (section+1) * section_size]) | |
| //.interpolate(d3.interpolateRgb) | |
| .interpolate(d3.interpolateHsl) | |
| .range(col_range) | |
| return col_scale(i) | |
| } | |
| var color = color_scale; | |
| shadowg = svg.append("g").attr({ | |
| id: 'shadowtext', | |
| transform: 'translate('+shadowgx+','+shadowgy+')' | |
| }) | |
| shadowg.selectAll(".shadowtext").data(shadows) | |
| .enter() | |
| .append("text").text(shadowtext).attr({ | |
| x: function(d,i){ | |
| return 61 + (i * shadowoffsetx); | |
| }, | |
| y: function(d,i){ | |
| return 247 + ( i * shadowoffsety); | |
| }, | |
| 'class': 'shadowtext', | |
| 'font-size': fontsize, | |
| 'font-family': 'Helvetica Neue', | |
| 'font-weight': 'bold', | |
| fill: function(d,i){ | |
| return color(i); | |
| }, | |
| 'opacity': shadowopacity | |
| }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment