<?xml version="1.0" encoding="utf-8"?><?xml-stylesheet title="XSL formatting" type="text/xsl" href="http://blog.romulusetrem.us/feed/rss2/xslt" ?><rss version="2.0"
  xmlns:dc="http://purl.org/dc/elements/1.1/"
  xmlns:wfw="http://wellformedweb.org/CommentAPI/"
  xmlns:content="http://purl.org/rss/1.0/modules/content/"
  xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
  <title>PRANDIVM‧GRATIS‧NON‧EST</title>
  <link>http://blog.romulusetrem.us/</link>
  <atom:link href="http://blog.romulusetrem.us/feed/rss2" rel="self" type="application/rss+xml"/>
  <description></description>
  <language>en</language>
  <pubDate>Tue, 31 Aug 2010 18:53:08 +0200</pubDate>
  <copyright>Copyright © mmx consulting.romulusetrem.us</copyright>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Dotclear</generator>
  
    
  <item>
    <title>Kaleidoscope updated for Firefox</title>
    <link>http://blog.romulusetrem.us/post/2010/01/26/Kaleidoscope-updated-for-Firefox</link>
    <guid isPermaLink="false">urn:md5:a32c92f0e00ae2885f7633f9d4e07616</guid>
    <pubDate>Tue, 26 Jan 2010 20:39:00 +0100</pubDate>
    <dc:creator>Julien</dc:creator>
        <category>kaleidoscope</category><category>secretlab</category><category>video</category>    
    <description>    &lt;p&gt;The &lt;a href=&quot;http://secretlab.romulusetrem.us/kaleidoscope/&quot;&gt;video
kaleidoscope&lt;/a&gt; now works in Firefox (at least from version 3.5+.) In my
&lt;a href=&quot;http://blog.romulusetrem.us/post/2010/01/20/A-video-kaleidoscope&quot;&gt;previous post&lt;/a&gt;, I mentioned
some cross-browser issues; let’s have another look at them.&lt;/p&gt;
&lt;p class=&quot;indent&quot;&gt;First, media format issues: since Firefox and Safari do not
support the same formats, I needed at least a “default” video in Ogg format,
which I found on &lt;a href=&quot;http://tinyvid.tv/&quot;&gt;TinyVid&lt;/a&gt;. Then, instead of
simply specifying an &lt;code&gt;src&lt;/code&gt; attribute on the &lt;code&gt;video&lt;/code&gt;
element, we skip that attribute and add two child source nodes for the
&lt;code&gt;video&lt;/code&gt; element, one for an H.264-encoded movie, the other for an
Ogg Theora-encoded movie. Normally, we would want to provide the same movie in
different formats, but until I provide my own movies for this demo, we'll just
use interesting videos that we find online.&lt;/p&gt;
&lt;p class=&quot;indent&quot;&gt;Second, I noted how I could not get the
&lt;code&gt;canplaythrough&lt;/code&gt; event from the video element in Firefox, even
though a playable video was provided. The problem lies in the fact that Safari
buffers the video by default, even when the &lt;code&gt;autobuffer&lt;/code&gt; attribute
is not present, whereas Firefox doesn’t. After adding this attribute, things
work the same in both browsers.&lt;/p&gt;
&lt;p class=&quot;indent&quot;&gt;Get the new Firefox 3.6 and see for yourself!&lt;/p&gt;</description>
    
    
    
          <comments>http://blog.romulusetrem.us/post/2010/01/26/Kaleidoscope-updated-for-Firefox#comment-form</comments>
      <wfw:comment>http://blog.romulusetrem.us/post/2010/01/26/Kaleidoscope-updated-for-Firefox#comment-form</wfw:comment>
      <wfw:commentRss>http://blog.romulusetrem.us/feed/atom/comments/479113</wfw:commentRss>
      </item>
    
  <item>
    <title>Youtube HTML5 Video Player</title>
    <link>http://blog.romulusetrem.us/post/2010/01/21/Youtube-HTML5-Video-Player</link>
    <guid isPermaLink="false">urn:md5:238c1ac08b94279fddebde116c93edcd</guid>
    <pubDate>Thu, 21 Jan 2010 11:51:00 +0100</pubDate>
    <dc:creator>Julien</dc:creator>
        <category>video</category>    
    <description>    &lt;p&gt;&lt;a href=&quot;http://blog.romulusetrem.us/public/youtube.png&quot;&gt;&lt;img title=&quot;youtube.png, Jan 2010&quot; style=&quot;width: 40em; margin: 0 auto; display: block;&quot; alt=&quot;Youtube HTML5 Video Player&quot; src=&quot;http://blog.romulusetrem.us/public/youtube.png&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Youtube now has &lt;a href=&quot;http://www.youtube.com/html5&quot;&gt;an open beta for
their HTML5 video player&lt;/a&gt;. Because they use H.264 it really only works in
Chrome and Safari and not all features are available (not to mention not all
videos are playable, in which case they fall back to Flash.) Well worth a look
anyway.&lt;/p&gt;</description>
    
    
    
          <comments>http://blog.romulusetrem.us/post/2010/01/21/Youtube-HTML5-Video-Player#comment-form</comments>
      <wfw:comment>http://blog.romulusetrem.us/post/2010/01/21/Youtube-HTML5-Video-Player#comment-form</wfw:comment>
      <wfw:commentRss>http://blog.romulusetrem.us/feed/atom/comments/477601</wfw:commentRss>
      </item>
    
  <item>
    <title>A video kaleidoscope</title>
    <link>http://blog.romulusetrem.us/post/2010/01/20/A-video-kaleidoscope</link>
    <guid isPermaLink="false">urn:md5:368f8e9a14632e299ce4b07b28c8ad0a</guid>
    <pubDate>Wed, 20 Jan 2010 16:48:00 +0100</pubDate>
    <dc:creator>Julien</dc:creator>
        <category>canvas</category><category>css-2d-transforms</category><category>kaleidoscope</category><category>secretlab</category><category>video</category>    
    <description>    &lt;p&gt;Another short demo before we move on to more complex applications. In this
one I wanted to do something with the HTML5 &lt;code&gt;video&lt;/code&gt; element; I had
probably seen something about kaleidoscopes recently so I thought about doing a
video kaleidoscope. Something that would like the screenshot below... That
should be easy!&lt;/p&gt;
&lt;img title=&quot;kaleidoscope.png, Jan 2010&quot; style=&quot;margin: 0 auto; display: block;&quot; alt=&quot;Kaleidoscope screenshot&quot; src=&quot;http://blog.romulusetrem.us/public/kaleidoscope.png&quot; /&gt;&lt;br /&gt;
&lt;p&gt;Actually, &lt;a style=&quot;&quot; href=&quot;http://secretlab.romulusetrem.us/kaleidoscope/&quot;&gt;it wasn’t too bad&lt;/a&gt;.
Although I suspect that it could be done more concisely in SVG (something for a
next episode, I guess) this implementation based on &lt;code&gt;video&lt;/code&gt; and
&lt;code&gt;canvas&lt;/code&gt;, with an additional help of &lt;a href=&quot;http://www.w3.org/TR/css3-2d-transforms/&quot;&gt;CSS 2D Transforms&lt;/a&gt;, is really
simple conceptually. And it will exercise your processor quite a bit in the
process...&lt;/p&gt;
&lt;h3&gt;Sampling video&lt;/h3&gt;
&lt;p&gt;As the screenshot above shows, our kaleidoscope is a circle rotating on its
own or following the cursor, divided in six “slices”, where each slice contains
the same picture, rotating on its own, and flipped. A first approach was to
have six video elements playing the same content at once, but it proved clearly
impractical to synchronize, and without looking too much into it, masking and
overlaying different videos seemed pretty tricky.&lt;/p&gt;
&lt;p class=&quot;indent&quot;&gt;Fortunately, we can easily sample the video by drawing the
current frame in a canvas element (with the &lt;code&gt;&lt;a href=&quot;http://dev.w3.org/html5/canvas-api/canvas-2d-api.html#dom-context-2d-drawimage&quot;&gt;
drawImage()&lt;/a&gt;&lt;/code&gt; method of a 2D drawing context, and using a
&lt;code&gt;video&lt;/code&gt; element as the first argument.) We can draw our kaleidoscope
in a &lt;code&gt;canvas&lt;/code&gt; element, with a single video playing in the
background. The video is playing behind the &lt;code&gt;canvas&lt;/code&gt; so that we
don’t see it but can still hear it and of course sample it. And although we
could draw all six slices in the same &lt;code&gt;canvas&lt;/code&gt;, I have chosen to
draw the same picture in six different canvases and let CSS do the rest. We can
describe the full process in four steps.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Set up a &lt;code&gt;video&lt;/code&gt; element, and wait for it to start (see
below.)&lt;/li&gt;
&lt;li&gt;Set up six &lt;code&gt;canvas&lt;/code&gt; elements. For each &lt;code&gt;canvas&lt;/code&gt;,
we’ll have an initial clipping mask which will produce the shape of the slice.
This needs to be done only once as it operates on the drawing context of the
canvas. The tricky part here is to understand how to use the &lt;code&gt;&lt;a href=&quot;http://dev.w3.org/html5/canvas-api/canvas-2d-api.html#dom-context-2d-arcto&quot;&gt;arcTo()&lt;/a&gt;&lt;/code&gt;
drawing primitive, and honestly I’m not quite sure that I do but it seems to
work out well enough.&lt;/li&gt;
&lt;li&gt;At a given rate (something like 15-30 frames per seconds, which is
sufficient for video), draw the current video image in every
&lt;code&gt;canvas&lt;/code&gt;. We set a new context before drawing where we apply a
rotation incrementally so that the image in each slice appears to rotate on its
own.&lt;/li&gt;
&lt;li&gt;Set the &lt;code&gt;transform&lt;/code&gt; style property (or rather
&lt;code&gt;-webkit-transform&lt;/code&gt; property) of each &lt;code&gt;canvas&lt;/code&gt; element to
rotate by increments 60 degrees, and flip around the X-axis for every other
&lt;code&gt;canvas&lt;/code&gt; (so that the symmetry is respected.) Since the whole
kaleidoscope rotates, we add the current rotation angle of the kaleidoscope to
every slice to achieve global rotation.&lt;/li&gt;
&lt;/ol&gt;
&lt;h3&gt;Cross-browser issues&lt;/h3&gt;
&lt;p&gt;The current demo only supports Safari. I haven’t had much success playing
audio or video in Chrome, so maybe some day it will work. Firefox
&lt;em&gt;should&lt;/em&gt; work, but needs a few fixes:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The main issue is that Safari and Firefox do not support the same media
formats. This means that a fallback OGG video is necessary for Firefox.&lt;/li&gt;
&lt;li&gt;Media elements generate an awful lot of events, and because they can be
quite large it means that we need to wait for enough data to be available
before we can start playback. It may take a while even knowing what the size of
the video is, which is necessary to set up the canvases, drawing contexts,
&amp;amp;c. In the current implementation I wait for the
&lt;code&gt;canplaythrough&lt;/code&gt; event before starting playback, which means that
the whole video should be playable. Unfortunately I wasn’t able to catch that
event in Firefox. I will write a bit more on this topic later and hopefully fix
this demo to work in Firefox.&lt;/li&gt;
&lt;li&gt;As in the &lt;a href=&quot;http://blog.romulusetrem.us/post/2010/01/18/Fridge-magnets-with-CSS-transformations&quot;&gt;poetry magnets
demo&lt;/a&gt;, we need to add support for the &lt;code&gt;-moz-transform&lt;/code&gt; style
property for CSS transforms.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;That’s all for now; on the next episode we’ll see more canvas animation
action.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;: these issues &lt;a href=&quot;http://blog.romulusetrem.us/post/2010/01/26/Kaleidoscope-updated-for-Firefox&quot;&gt;have now been
addressed&lt;/a&gt;.&lt;/p&gt;</description>
    
    
    
          <comments>http://blog.romulusetrem.us/post/2010/01/20/A-video-kaleidoscope#comment-form</comments>
      <wfw:comment>http://blog.romulusetrem.us/post/2010/01/20/A-video-kaleidoscope#comment-form</wfw:comment>
      <wfw:commentRss>http://blog.romulusetrem.us/feed/atom/comments/477331</wfw:commentRss>
      </item>
    
  <item>
    <title>うわー</title>
    <link>http://blog.romulusetrem.us/post/2010/01/18/%E3%81%86%E3%82%8F%E3%83%BC</link>
    <guid isPermaLink="false">urn:md5:e1fd39b29f356513f22933272bc85756</guid>
    <pubDate>Mon, 18 Jan 2010 18:13:00 +0100</pubDate>
    <dc:creator>Julien</dc:creator>
        <category>art</category><category>meta</category>    
    <description>    &lt;p&gt;&lt;img title=&quot;tomato13.png, Jan 2010&quot; style=&quot;margin: 0 auto; display: block;&quot; alt=&quot;&quot; src=&quot;http://blog.romulusetrem.us/public/tomato13.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Sorry about all this text, next entry should be the same — here's a picture
of a tomato in the meantime.&lt;/p&gt;</description>
    
    
    
          <comments>http://blog.romulusetrem.us/post/2010/01/18/%E3%81%86%E3%82%8F%E3%83%BC#comment-form</comments>
      <wfw:comment>http://blog.romulusetrem.us/post/2010/01/18/%E3%81%86%E3%82%8F%E3%83%BC#comment-form</wfw:comment>
      <wfw:commentRss>http://blog.romulusetrem.us/feed/atom/comments/476773</wfw:commentRss>
      </item>
    
  <item>
    <title>Fridge magnets with CSS transformations</title>
    <link>http://blog.romulusetrem.us/post/2010/01/18/Fridge-magnets-with-CSS-transformations</link>
    <guid isPermaLink="false">urn:md5:8de6f3db1029b9b4b617a5f332f6ca01</guid>
    <pubDate>Mon, 18 Jan 2010 17:18:00 +0100</pubDate>
    <dc:creator>Julien</dc:creator>
        <category>css-2d-transforms</category><category>magnets</category><category>secretlab</category>    
    <description>    &lt;p&gt;I put together &lt;a href=&quot;http://secretlab.romulusetrem.us/magnets/&quot;&gt;this
demo&lt;/a&gt; quickly last summer to experiment with &lt;a href=&quot;http://www.w3.org/TR/css3-2d-transforms/&quot;&gt;CSS 2D Transforms&lt;/a&gt; as they were
being implemented in Webkit and Firefox. (We’ll see about &lt;a href=&quot;http://www.w3.org/TR/2009/WD-css3-3d-transforms-20090320/&quot;&gt;3D transforms&lt;/a&gt;
soon, BTW.) Since I have always liked the idea of poetry magnets, this seemed
like an ideal little project to get started with those. Here is what it looks
like now, as seen by Safari on Mac OS 10.6:&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://blog.romulusetrem.us/public/magnets.png&quot;&gt;&lt;img title=&quot;CSS Poetry Magnets&quot; style=&quot;margin: 0 auto; display: block; width: 448px;&quot; alt=&quot;Two suns suddenly without shape...&quot; src=&quot;http://blog.romulusetrem.us/public/magnets.png&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;Scattering the magnets&lt;/h3&gt;
&lt;p&gt;The implementation is very simple: a magnet is a just a &lt;code&gt;div&lt;/code&gt;
element on the &lt;del&gt;document&lt;/del&gt; fridge door. We just need a little bit of
style such as a border, a soft shadow, and some colors, &lt;a href=&quot;http://www.w3.org/TR/2009/CR-css3-background-20091217/#the-border-radius&quot;&gt;rounded
corners&lt;/a&gt; of course, and here we have our first magnet:&lt;/p&gt;
&lt;div style=&quot;padding: 4px; border: thin solid rgb(0, 255, 68); font-family: Futura,sans-serif; display: inline-block; background-color: rgb(136, 255, 136); -moz-border-radius: 7px 7px 7px 7px; -moz-box-shadow: 2px 2px 2px rgb(170, 170, 170); -webkit-border-radius: 7px; border-radius: 7px; -webkit-box-shadow: 2px 2px 2px rgb(170, 170, 170); box-shadow: 2px 2px 2px rgb(170, 170, 170); color: black;&quot;&gt;
anathema&lt;/div&gt;
&lt;p&gt;At first, I wanted to do as much as possible with transformations. So I just
threw in a bunch of magnets in a parent &lt;code&gt;div&lt;/code&gt; and set a CSS
&lt;code&gt;transform&lt;/code&gt; property with a random translation and rotation to
scatter the magnets everywhere. Which was fine... except that if for some
reason the original position of a magnet changed (for instance when resizing
the browser window) then the translated position would also change in a
sometimes unpredictable way. It was also difficult to keep track of the magnets
when letting the user move them around, so I decided to stick with the
old-school approach of absolute positioning for the magnets, and using the
&lt;code&gt;transform&lt;/code&gt; property for rotations only.&lt;/p&gt;
&lt;p class=&quot;indent&quot;&gt;In the end, magnets share the same &lt;code&gt;magnet&lt;/code&gt; class,
with some additional classes for custom styles. The position (&lt;code&gt;top&lt;/code&gt;,
&lt;code&gt;left&lt;/code&gt;, and &lt;code&gt;z-index&lt;/code&gt; properties) and rotation
(&lt;code&gt;transform&lt;/code&gt; property with a &lt;code&gt;rotate(&lt;em&gt;θ&lt;/em&gt; deg)&lt;/code&gt;
value) are set programmatically through Javascript so that the user can drag
them around the fridge door surface. Dragging can either change the position or
the rotation of the magnet; we catch the &lt;code&gt;mousedown&lt;/code&gt; events on
magnets and decide to change the position if the pointer close to the center of
the magnet, or change the rotation if the pointer was closer to the
corners.&lt;/p&gt;
&lt;p class=&quot;indent&quot;&gt;A note about browser compatibility: since transforms are
pretty new, both Webkit and Firefox implement the property with their own
names, which means that we have to set both &lt;code&gt;-webkit-transform&lt;/code&gt; and
&lt;code&gt;-moz-transform&lt;/code&gt; for every element to work across both browsers and
their derivative, such as Safari and Chrome for Webkit. (Opera 10.50 implements
their own &lt;code&gt;-o-transform&lt;/code&gt; attribute, so we throw that into the mix as
well; and the less said about IE, the better.) Fortunately, they all seem to
agree on the syntax and semantics of the values. So let’s see our above magnet
again, this time translated and rotated, using the translate CSS transform now
because I do want to translate it relative to its normal position:&lt;/p&gt;
&lt;div style=&quot;padding: 4px; border: thin solid rgb(0, 255, 68); font-family: Futura,sans-serif; display: inline-block; background-color: rgb(136, 255, 136); -moz-border-radius: 7px 7px 7px 7px; -moz-box-shadow: 2px 2px 2px rgb(170, 170, 170); -webkit-border-radius: 7px; border-radius: 7px; -webkit-box-shadow: 2px 2px 2px rgb(170, 170, 170); box-shadow: 2px 2px 2px rgb(170, 170, 170); color: black;-moz-transform: translate(63px, 12px) rotate(5deg); -o-transform: translate(63px, 12px) rotate(5deg); -webkit-transform: translate(63px, 12px) rotate(5deg);&quot;&gt;
anathema&lt;/div&gt;
&lt;p&gt;Finally, I know that I should say something about &lt;code&gt;z-index&lt;/code&gt;,
which was a bit tricky to make work correctly across different browsers, but I
forget what the trick was. Also I’m still not sure that I understand how
&lt;code&gt;z-index&lt;/code&gt; &lt;em&gt;actually&lt;/em&gt; works (or most of CSS, for that
matter.)&lt;/p&gt;
&lt;h3&gt;Generating magnets&lt;/h3&gt;
&lt;p&gt;Now we need to generate sets of words to have interesting magnets to play
with. I started by downloading &lt;a href=&quot;http://www.gutenberg.org/etext/1041&quot;&gt;Shakespeare’s sonnets&lt;/a&gt; and &lt;a href=&quot;http://www.gutenberg.org/etext/1322&quot;&gt;Walt Whitman’s Leaves of Grass&lt;/a&gt; from
Project Gutenberg, fed these to a very naive tokenizer written in Perl and
extracted all words that had more occurrences than a given threshold (I forget
what the threshold was set to, but something quite low.) I threw in Perl’s
keywords and operators and a bunch of Unicode symbols for good measure, did a
little bit of editing, and generated hundreds of poetry magnets with little
effort.&lt;/p&gt;
&lt;p class=&quot;indent&quot;&gt;In the future I will try and add different languages; the
problem here is that the very naive approach taken here works well for English,
but shows its limit very quickly when moving to other languages. There are two
main issues: first, we need a real morphological analyzer for other languages,
and not such a quick and dirty, regular-expression based tokenizer. This is not
so bad because we can find good quality, open-source tools for this job. The
second issue is a bit trickier as we need to worry about conjugation, plural,
gender, agreement, &amp;amp;c. so this part requires some experimentation.&lt;/p&gt;
&lt;p class=&quot;indent&quot;&gt;Another source of words to play with is not famous poets, but
anonymous ones: the users themselves. Since we don’t deal with actual magnets
but virtual ones, we can make them editable. This is as simple as setting the
&lt;code&gt;contentEditable&lt;/code&gt; property of the magnet’s &lt;code&gt;div&lt;/code&gt; element
to &lt;code&gt;true&lt;/code&gt; when a blank magnet is created, and setting it back to
&lt;code&gt;false&lt;/code&gt; when done (&lt;em&gt;i.e.&lt;/em&gt;, when the return key is pressed.)
The only issue left was to deal with positioning of a magnet that can change
size, because transforms are relative to the center of the magnets. So every
time a key is pressed, while the magnet is editable, we check for its new size
and change to position so that its center does not move. This is where
&lt;code&gt;getBoundingClientRect()&lt;/code&gt; comes in very handy, by the way. (And this
needs to be fixed for Opera, actually.)&lt;/p&gt;
&lt;h3&gt;&lt;code&gt;localStorage&lt;/code&gt; to the rescue&lt;/h3&gt;
&lt;p&gt;Another nifty new feature that I wanted to experiment with was the new
storage features of HTML5, &lt;em&gt;i.e.&lt;/em&gt;, &lt;a href=&quot;http://dev.w3.org/html5/webstorage/&quot;&gt;Web Storage&lt;/a&gt;. At first I tried the
&lt;a href=&quot;http://www.whatwg.org/specs/web-apps/current-work/multipage/section-sql.html&quot;&gt;client-side
database API&lt;/a&gt;, which worked well in Webkit but not in other browsers (even
Chrome, although based on Webkit, didn’t implement any storage API at that
point) and in retrospect seems like a misguided effort to specify &lt;a href=&quot;http://www.sqlite.org/&quot;&gt;SQLite&lt;/a&gt; as part of HTML5. (Nothing against SQLite,
which is a great piece of software.)&lt;/p&gt;
&lt;p class=&quot;indent&quot;&gt;So I switched to the &lt;code&gt;window.localStorage&lt;/code&gt;
interface where I simply stored some JSON strings with the position of every
magnet. It seems to be consistently implemented all-around (it took some time
for Chrome to catch up though) and allowed the user’s fridge door to become
persistent. As soon as a magnet is moved or rotated, everything gets saved and
is ready to be restored by the time the next session starts.&lt;/p&gt;
&lt;p class=&quot;indent&quot;&gt;The last piece of the puzzle was to implement a little server
back-end to allow users to share their poetry. Because the browser’s local
storage is not accessible to the outside world, we need to save the data on
some shared resource to make it accessible to others. By associating a unique
identifier to every saved session, they can now be easily shared by URLs, such
as &lt;a href=&quot;http://secretlab.romulusetrem.us/magnets/xbqSb9CL&quot;&gt;the one in the
screenshot above&lt;/a&gt;.&lt;/p&gt;
&lt;h3&gt;Dragging again&lt;/h3&gt;
&lt;p&gt;Another new HTML5 feature that I experimented on during development was
&lt;a href=&quot;http://dev.w3.org/html5/spec/Overview.html#dnd&quot;&gt;HTML5 drag and
drop&lt;/a&gt;. In the end it was not a very good fit for my use case and I ended up
dropping it, if you will, although it will make a come back in a future post
about a different application.&lt;/p&gt;
&lt;p class=&quot;indent&quot;&gt;Implementing dragging of the magnets was not too bad,
although handling rotation added a bit of complexity (see above.) Dropping was
another matter, because I wanted to be able to drop magnets over the trash can
as a way to discard them. I ended up using the &lt;code&gt;elementFromPoint&lt;/code&gt;
method to check whether my drop-off point was the trash can element; but in
order for that to work, the magnet that was being dragged had to be momentarily
hidden, by setting its &lt;code&gt;visibility&lt;/code&gt; style property to
&lt;code&gt;hidden&lt;/code&gt;, so that it wouldn’t interfere with
&lt;code&gt;elementFromPoint&lt;/code&gt;. I even threw in some sounds for the trash can,
but I’ll write in more details about the &lt;code&gt;audio&lt;/code&gt; element very
soon.&lt;/p&gt;
&lt;p class=&quot;indent&quot;&gt;That’s all for now; next time we’ll see some more usages of
CSS 2D transforms but this time we’ll throw in some video as well.&lt;/p&gt;</description>
    
    
    
          <comments>http://blog.romulusetrem.us/post/2010/01/18/Fridge-magnets-with-CSS-transformations#comment-form</comments>
      <wfw:comment>http://blog.romulusetrem.us/post/2010/01/18/Fridge-magnets-with-CSS-transformations#comment-form</wfw:comment>
      <wfw:commentRss>http://blog.romulusetrem.us/feed/atom/comments/476683</wfw:commentRss>
      </item>
    
  <item>
    <title>It’s 2010!</title>
    <link>http://blog.romulusetrem.us/post/2010/01/16/It-s-2010%21</link>
    <guid isPermaLink="false">urn:md5:ec3f17f7642803eb9ba23990e6c65060</guid>
    <pubDate>Sat, 16 Jan 2010 18:30:00 +0100</pubDate>
    <dc:creator>Julien</dc:creator>
        <category>meta</category><category>secretlab</category>    
    <description>    &lt;p&gt;So it’s 2010 and I’m treating myself to a first-year consulting anniversary
with a blog to give some more technical details about what I’m working on while
I'm working on it. I’ve found a lot of useful, and way more really stupid
information on technical blogs and I hope to give some back in the future. The
first posts will be about the HTML5/Javascript demos that can be seen in my
&lt;a href=&quot;http://secretlab.romulusetrem.us/&quot;&gt;secret lab&lt;/a&gt;. Enjoy!&lt;/p&gt;</description>
    
    
    
          <comments>http://blog.romulusetrem.us/post/2010/01/16/It-s-2010%21#comment-form</comments>
      <wfw:comment>http://blog.romulusetrem.us/post/2010/01/16/It-s-2010%21#comment-form</wfw:comment>
      <wfw:commentRss>http://blog.romulusetrem.us/feed/atom/comments/476032</wfw:commentRss>
      </item>
    
</channel>
</rss>