Skip navigation.

exploreopera

| Help

Sign up | Help

Posts tagged with "SVG"

Acid (3) drops

, , , ...

When I was a kid, this meant sweets that were usually lemon flavoured. Then I discovered that before I was a kid this could also mean taking a particular drug. But now I am a geek most of the time, so it means dealing with very complicated tests.

This week's tempest in geekland was about the Acid3 test - we were first to announce we had got to 98/98, and just afterward first to score 100/100 on the test (with Webkit in each case hot on our heels). Now you can get a special preview testing build (for Windows or Linux) that gets the right rendering and 100/100 on the test.

But what does that really mean...?

Read more...

While you were out...

, , , ...

I've been on a travel-meeting-travel-talk-travel jag for what seems like forever (but it was really only three weeks).

While I was away, a whole lot of cool Opera things came out. MathML, Mini 4, A video build with 3D canvas, ...

So in roughly chronological order...

Read more...

Tokyo is open for SVG

, , ,

The SVG event of the year is the SVG Open. At least some years - unfortunately last year's conference was cancelled. This year, it was in Tokyo...

Read more...

It's a code... jag...

, , ,

I have been playing with programming again.

Read more...

Wii, Austin...

, , ,

An entry got wiped by user error. This is a reconstruction made using the best scientific principes available (Who said "Make-it-up"? :whistle: )

Read more...

The wrong stuff...

, ,

Well, on balance I am a bit annoyed. Maybe I am just paranoid, but I get the impression that Microsoft tend to serve Opera users slightly worse than average. (And in terms of the stuff they put on the Web, that isn't kind).

Microsoft uses SVG in a service of theirs (thanks Jeff Schiller for pointing it out). But only gives it to Firefox, despite Opera's SVG implementation being generally ahead of Firefox at the moment. Opera users are stuck with old fashioned images that take a lot longer to load...

Tic toc tic toc

, ,

One of the rites of passage, I suppose, for people developing code, is to make a clock. When you're doing SVG, it should look cool, or do something funky. Well, I am not much of a designer. So I am not convinced that I can really claim my clock looks cool. I started playing with it to put it in a widget (I'll post the simple version after a little tweak, and the final version as a widget later when I am happy with it).

Of course, you need an SVG-capable browser that handles simple javascript and a reasonable level of animation to see the full clock. As I write, that rules out Firefox, means that you need a build of Opera Merlin (technical preview 2 or one of the more recent weekly builds), or it should work in any browser with the old Adobe SVG viewer.

Frog green?! The cool thing is that the basic code is simple. There is one javascript (mostly, admittedly, because I am bad at writing javascript), and the rest is done with declarative animation. It has a few nifty features - clicking on the background changes it (this is one short line per skin, although with a couple of lines I could do a funky flip effect), and you can adjust it with the winder button (like a real clock). Because SMIL Animation 1.0 has no pause/resume function, adjusting it multiple times might feel a bit wierd unless you reset it. And it needs some work still - no metadata or description yet :frown:

I made it mostly as a learning exercise for an article that should be ready in a couple of weeks, about SVG animation, but if you can't wait, check out the source code. With some comments, an attempt to keep it reasonably clean, an embedded PNG and no compression the thing is all of 8k. If I wanted to reduce the codesize it would be easy enough to halve that.

And if this all seems too technical and dull, but you still got this far, here are some more screenshots...

Faded pink and grey? Doesn't he know the 80s are over!?!?! Phew! After those two, boring black and white is a relief, really.

Funny thing is, the winder was easy to code, but I spent a long time spec-reading to understand why it behaves funny if you go forward or backward more than once each without resetting. (Because there is no pause - you have to change the old adjustment for a new one if you use it again). Until then, I racked my brains over the reset button and javascript wierdness. But once I understood what was happening, the reset button literally took me less than 15 seconds to code and test. The hard part turned out to be putting the red rectangle in the right place - 3 seconds of thinking time required...

The hardest coding bit of the lot was getting the little dots for minutes and seconds. The price of two short lines of elegant code was half an hour with a calculator. Still, now I know how to do it right the first time, and can repeat it in about 5 minutes. And two lines of code is a cheap way of making it happen.

Hope you enjoy it. There are, of course, other SVG clocks out there. If I had seen Doug Schepers' efforts earlier I might not have been motivated to learn quite as much as I did. So I am glad I started with my head in the sand for this exercise.