Permalink
Browse files

use s3 to show previews in the gallery

  • Loading branch information...
enjalot committed May 12, 2012
1 parent 00766e6 commit 643a358712bd337384d531f83eeb021d7658b0f9
Showing with 47 additions and 12 deletions.
  1. +27 −9 static/gallery.json
  2. +19 −2 templates/gallery.html
  3. +1 −1 templates/gallery_creator.html
View
@@ -5,7 +5,8 @@
"description":"Sin Waves"
,"tags": "art color",
"width": 450,
- "height": 710
+ "height": 710,
+ "splash": "http://tributary-gallery.s3.amazonaws.com/sinwaves.png"
}
,{
"gist":"2637876",
@@ -14,53 +15,60 @@
"tags": "delta animation",
"width": 450,
"height": 350,
- "delta": true
+ "delta": true,
+ "splash": "http://tributary-gallery.s3.amazonaws.com/simplesquare.png"
}
,{
"gist": "2636157",
"filename": "basics.js",
"description": "Basics"
,"tags": "learn basic",
"width": 450,
- "height": 350
+ "height": 350,
+ "splash": "http://tributary-gallery.s3.amazonaws.com/basics.png"
}
,{
"gist":"2632648",
"filename":"rgb.js",
"description":"RGB",
"tags": "learn color",
"width": 900,
- "height": 400
+ "height": 400,
+ "splash": "http://tributary-gallery.s3.amazonaws.com/rgb.png"
}
, {
"gist":"2271956",
"filename":"squarecircle.js",
"description":"Crazy Nest",
"width": 900,
- "height": 100
+ "height": 100,
+ "splash": "http://tributary-gallery.s3.amazonaws.com/crazynest.png"
}
, {
"gist":"2637883",
"filename":"circles.js",
"description":"Dancing Dots",
"width": 900,
"height": 300,
- "delta": true
+ "delta": true,
+ "splash": "http://tributary-gallery.s3.amazonaws.com/dots.png"
}
, {
"gist":"2271954",
"filename":"squarecircle.js",
"description":"Rounded Corners",
"width": 900,
- "height": 100
+ "height": 100,
+ "splash": "http://tributary-gallery.s3.amazonaws.com/roundedcorners.png"
},
{
"gist":"2330299",
"filename":"squarecircle.js",
"description":"Colors",
"width": 900,
"height": 450,
- "tags": "color"
+ "tags": "color",
+ "splash": "http://tributary-gallery.s3.amazonaws.com/colors.png"
},
{
"gist":"2272533",
@@ -69,6 +77,7 @@
"width": 450,
"height": 450
,"tags": "color"
+ ,"splash": "http://tributary-gallery.s3.amazonaws.com/colortubes.png"
}
,{
"gist":"2271952",
@@ -77,13 +86,15 @@
,"tags": "art",
"width": 450,
"height": 350
+ ,"splash": "http://tributary-gallery.s3.amazonaws.com/squarecircle.png"
},
{
"gist":"2418851",
"filename":"icon.js",
"description":"Icons",
"width": 450,
"height": 225
+ ,"splash": "http://tributary-gallery.s3.amazonaws.com/icons.png"
},
{
"gist":"2356706",
@@ -92,6 +103,7 @@
,"width": 450
,"height": 225
,"tags": "color"
+ ,"splash": "http://tributary-gallery.s3.amazonaws.com/rainbowhand.png"
},
{
"gist":"2637864",
@@ -101,20 +113,23 @@
,"height": 325
,"tags": "animation example"
,"delta": true
+ ,"splash": "http://tributary-gallery.s3.amazonaws.com/arctween.png"
},
{
"gist":"2323185",
"filename":"euler.js",
"description":"Euler vs. RK4 Numerical Integration",
"width": 450
,"height": 150
+ ,"splash": "http://tributary-gallery.s3.amazonaws.com/euler.png"
},
{
"gist":"2426346",
"filename":"squarecircle.js",
"description":"More Colors",
"width": 450
,"height": 450
+ ,"splash": "http://tributary-gallery.s3.amazonaws.com/morecolors.png"
},
{
"gist": "2504820",
@@ -123,14 +138,16 @@
,"tags": "learn visualization",
"width": 450,
"height": 150
+ ,"splash": "http://tributary-gallery.s3.amazonaws.com/bars.png"
}
,{
"gist": "2636144",
"filename": "kerning.js",
"description": "Kerning example"
,"tags": "learn design art",
"width": 450,
- "height": 450
+ "height": 150
+ ,"splash": "http://tributary-gallery.s3.amazonaws.com/kerning.png"
}
, {
"gist":"2165875",
@@ -139,6 +156,7 @@
,"tags": "art color",
"width": 450,
"height": 350
+ ,"splash": "http://tributary-gallery.s3.amazonaws.com/warp.png"
}
]
View
@@ -230,14 +230,15 @@
gallery.add(json)
//console.log(gallery);
var body = d3.select("#container")
- var divs = body.selectAll("iframe.trib")
+ var divs = body.selectAll("div.trib")
.data(gallery.models)
.enter()
.append("div")
.attr("class", function(d,i){
var tags = d.get('tags') || '';
return "tributary item example "+tags;
})
+ .classed("trib", true)
.attr("data-tribtype", function(d,i){
})
@@ -250,7 +251,22 @@
/* .attr("data-x", function(d,i){
return d.get('x') || i*1800;
})
-*/ var iframes = divs.append("html:iframe")
+ */
+ var images = divs.append("html:img")
+ .attr("src", function(d,i) {
+ if(d.get("splash")) {
+ return d.get("splash")
+ }
+ })
+ .attr("width", function(d,i){
+ return d.get('width') || 100;
+ })
+ .attr("height", function(d,i){
+ return d.get('height') || 100;
+ })
+
+ /*
+ var iframes = divs.append("html:iframe")
.attr("class", "trib")
.attr("src", function(d,i) {
if(d.get("delta")) {
@@ -265,6 +281,7 @@
.attr("height", function(d,i){
return d.get('height') || 100;
})
+ */
divs.append("div")
.attr("pointer-events", "all")
.on("click", function(d,i) {
@@ -248,7 +248,7 @@
.html(function(d,i){
var text = d.get('description') || i;
- return "<h2 class='sectiontitle' id='title"+i+"'>"+text+"</h2>";
+ //return "<h2 class='sectiontitle' id='title"+i+"'>"+text+"</h2>";
})
/* .attr("data-x", function(d,i){

0 comments on commit 643a358

Please sign in to comment.