Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

added gaussian blur. very messy, requires external JAR

  • Loading branch information...
commit 5a42b33508c5e614351851b34f8b2da2e5127058 1 parent 81ee59f
Giles authored
Showing with 30 additions and 18 deletions.
  1. +27 −16 bit101_style.erb
  2. +3 −2 bit101_style.rb
43 bit101_style.erb
View
@@ -4,6 +4,14 @@
<svg width="1280" height="720" viewBox="0 0 1280 720"
xmlns="http://www.w3.org/2000/svg" version="1.1">
<desc>tweeeeeen</desc>
+
+ <!-- filter -->
+ <defs>
+ <filter id="blur">
+ <feGaussianBlur in="SourceGraphic" stdDeviation="<%= rand(10) + 1 %>"/>
+ </filter>
+ </defs>
+
<!-- background -->
<rect x="0"
y="0"
@@ -11,21 +19,24 @@
height="720"
fill="black"/>
- <% @circles.each do |circle| %>
- <circle cx="<%= circle.x %>"
- cy="<%= circle.y %>"
- r="<%= circle.radius %>"
- fill="black"
- stroke="black"
- stroke-width="10" />
- <% next unless circle.connections %>
- <% circle.connections.each do |connection| %>
- <line x1="<%= circle.x %>"
- y1="<%= circle.y %>"
- x2="<%= connection.x %>"
- y2="<%= connection.y %>"
- stroke="blue"
- stroke-width="3" />
+ <!-- animation -->
+ <g filter="url(#blur)">
+ <% @circles.each do |circle| %>
+ <circle cx="<%= circle.x %>"
+ cy="<%= circle.y %>"
+ r="<%= circle.radius %>"
+ fill="black"
+ stroke="black"
+ stroke-width="10" />
+ <% next unless circle.connections %>
+ <% circle.connections.each do |connection| %>
+ <line x1="<%= circle.x %>"
+ y1="<%= circle.y %>"
+ x2="<%= connection.x %>"
+ y2="<%= connection.y %>"
+ stroke="blue"
+ stroke-width="3" />
+ <% end %>
<% end %>
- <% end %>
+ </g>
</svg>
5 bit101_style.rb
View
@@ -63,7 +63,8 @@ def graphic(number)
File.open("#{frame_id(number)}.svg", "w") do |file|
file.write render("bit101_style.erb")
end
- system("convert #{frame_id(number)}.svg #{frame_id(number)}.jpg")
+ # system("convert #{frame_id(number)}.svg #{frame_id(number)}.jpg")
+ system("java -jar ~/Downloads/batik-1.7/batik-rasterizer.jar #{frame_id(number)}.svg")
File.unlink("#{frame_id(number)}.svg")
print "+"
end
@@ -86,7 +87,7 @@ def start
# here we go
start
-(0..90).each do |number|
+(0..30).each do |number|
@circles.each {|circle| circle.move}
@circles.stepwise do |circle1, circle2|
Please sign in to comment.
Something went wrong with that request. Please try again.