Skip navigation.

exploreopera

| Help

Sign up | Help

Fyrdility

A blog about Web Development, Web Standards, Opera, and Related Pleasantries

Still around

,

No, I'm not dead. Just very busy with work at work and with baby at home. Okay, and I've been wasting time on facebook.

More bloggage may continue at some point, though. :smile:

IE8 beta 1 first impressions

, , , ...

Anyone who cares has heared that IE8 beta 1 has just been released, with quite a bit of documentation.

Mark "Tarquin" Wilton-Jones offers a pretty good overview of the changes. Many are good, and I'm especially happy with the Acid2 support and the decision to make the IE8 rendering mode the default. It is also important to note that there is still "much more" expected in beta 2.

For now, some of my personally biggest peeves with this beta:
  • Oddly enough, IE8 does not ignore the IE5/Mac Band Pass Filter hack. I've used this in a few places on my site, so I'm not too happy about that. But not a huge issue, I suppose
  • The "clear" style fails. I use this a lot too.
  • Data URIs are limited to images, won't work in the address bar, and have a size limit of 32kb.
  • Generated content is limited, not allowing images or background images, which was one of my main purposes for using it.
  • No SVG, XHTML, or CSS3 (aside from box-sizing and vertical text).
  • Some new proprietary features have been added.


It rather seems like they aimed at passing Acid2 first, supporting the absolute minimum amount of features to pass it. This seems to be the opposite of the IE team's initial view of Acid2, which basically was that it would focus on supporting features first, which would then result in Acid2 support.

I'm optimistic though, that this was done just out of laziness, but rather to quickly show the web developing community their new dedication to supporting standards. I strongly suspect the limitations will be gone by the time IE8 ships. They're definitely on the right track, and I'm delighted they decided to make this beta public, which didn't seem to be the plan initially.

eduMap widget

, , , ...

I am happy to announce the release of my second Opera widget: eduMap!

This 100% SVG-based widget lets you learn the location of countries, states and capitals around the world. It currently doesn't work in Opera 9.5 for some reason (weird, since that's where I tested it on most!), but I hope to resolve that shortly.

Inspiration for this widget came from the excellent website purposegames.com, which has the same basic premise. However, all its games are Flash, and I wanted to make an SVG version. Also, I wanted to add more modes and options to the games (for example, where the country is highlighted and you select its name from a list).

Basic knowledge of the location of other countries seems to be sadly lacking in the United States, and I believe this may be a small, but great way to help change that. As an added bonus, it might help inspire other developers to use SVG over Flash.

Feel free to leave any feedback and bug reports on the widget's page, and stay tuned for updates.

Enjoy!

Sad day for web standards

,

Update: Less sad since IE7 mode is no longer the default mode

It is a sad day for web standards.

Winners: Microsoft and lazy web developers
Losers: Alternate browsers and forward-thinking web developers

An update

I became a (very proud) father last week of a beautiful baby boy, which is why I've been rather quiet here lately. :smile: Also, while that happened, I was rewarded an Opera goody bag for my Arkanoid widget. Thank you Opera!

More bloggage to come eventually, but don't know yet as to when.

Operanoid Widget

, , , ...


I'm happy to resport that the Operanoid game is now also available as widget.

The gameplay is basically the same as for the DS version, except you use the mouse to move the paddle. The widget also features a minimize button and a spiffy logo. I know, just what you've been waiting for.

Enjoy!

Browser selection in Windows Installer

, , , ...

As a result of Opera's antitrust complaint against Microsoft, I started thinking about how Microsoft might allow a selection of web browsers for Windows.
Then, I made this mockup image:



Note the following problems with this scenario:


  1. Internet Explorer will be mostly recognized by people, and is bound to be highlighted some way or another (mainly by being the only one supported by MS)

  2. Who decides which browsers make the cut to this list? Just about anyone can make a Gecko based browser or an Internet Explorer shell

  3. Do, in fact, Internet Explorer shells like Maxthon and Avant Browser make the list? They use IE's engine (trident), and thus suffer many of the same shortcomings

  4. Which browser(s) get to be installed for mass installations?

  5. Should browser makers be allowed to add a short blurb about their browser?



If Microsoft were forced to comply with a ruling requiring this, it would be interesting to see how these issues are dealt with.

Operanoid! An Arkanoid/Breakout game for the DS Browser

, , , ...

A few months ago I learned about this excellent set of games created by rkm for the Nintendo DS browser.

Inspired by this, I thought I'd try my hand and at creating a game of my own for the system. Here, finally, is the result of that work. The game is fairly straightforward, move the paddle around to bounce back the ball, break all blocks to proceed to next level. Bonuses can fall and can be good or bad. Currently only four levels available, more (and further game improvements) may come later.

The bad news is that neither me nor rkm were able to find a way to get the dragging effect of the stylus to be recognized, presumably since this is caught for the window panning instead. Thus, to move the paddle you just tap the place where you want to go. A little annoying, but you get used to it. Another note, the game works best in SSR mode, so make sure you set your browser to that before you start.

It's also occured to me that this game might make a nifty widget, too, so I may release an Operanoid widget later.

Without further ado: Operanoid!

SVG Image and Background Image Replacer

, , , ...

It's here! A working version of the SVG image replacement script.

Purpose

This script substitutes specified images and background images with SVG images for web browsers that support them. This makes it perfect for anyone who would like to start using SVG for their site design, but wants to make sure it will look okay for browsers that do not yet support it.

Features

  • Future-proof - Checks for actual support, no browser sniffing
  • Unobtrusive - Only affects browsers with support, uses fallback content without support or if javascript is disabled
  • Simple to use - Just include one javascript file to your pages and use the appropriate image names
  • Small file - Only 1.8 KB!

Usage

  1. Make sure you have matching SVG and fallback images.
  2. Rename your fallback images in this format: "filename.svg.jpg" for "filename.svg". Note that any image type can be used as alternative (jpg, png, gif, etc).
  3. Make sure your file names are correct in you HTML and CSS files
  4. Add the script inside your HEAD element like this:
    <script type="text/javascript" src="svgreplace2.js"></script>
    and of course upload the script to your server.
  5. If you already have a script with an onload event, you can remove that line in the script, then just call SvgReplace(); where it needs to load. Note that the script will also work when the DOM is loaded, so it should work fine (actually better, since the images will be replaced faster) if you if you want to call it then.

How it works

First, the script checks if the browser recognizes SVG files as images. It does this by loading a small data URI SVG file, then checks if it loads properly and if it returns it's width. When true, it looks through all CSS rules, and replaces image background names that contain '.svg'. Then it does the same for all images that appear in the HTML.

Browsers tested

To make sure the script will work for future browsers, the script was rewritten to check support for PNG files. The following browsers were able to check for this support and replace the images successfully. When tested for SVG image support, all displayed the fallback images as expected.
  • Opera 9.2
  • Firefox 2
  • Safari 1.2
  • Safari 3
  • Internet Explorer 6
  • Internet Explorer 7

Opera 9.5 beta 1 and two different developer snapshot builds were used to test the SVG support, which also works as expected. This leaves the following browsers that should successfully replace specified images with their SVG counterparts:
  • Opera 9.5 alpha / beta 1
  • Wii Internet Channel

As for support by other browsers...

Webkit (Safari) apparently supported SVG as images in its nightly builds for a while, but the feature was disabled for stability reasons. Hopefully they'll manage to stabilize it soon, in which case it should appear in an upcoming release of Safari in the near future. See bug report

Gecko (Firefox) has the feature reported as a bug, both for images as well as CSS backgrounds. Unfortunately, no priority or target milestone has been set for either, though quite a few people have voted for them. So it might be while before we see any support there.

Internet Explorer does not support SVG natively at all right now, and the only thing we know for future support comes from this comment by IE Platform Architect Chris Wilson: "I think SVG is gaining momentum as part of the interoperable web standards platform, and as such I expect we will add support for it in the future". Who knows, maybe they'll support SVG as images when they get to it?

Notes

  • While other browsers do support SVG files using the "embed" or "object" elements, this script currently only checks for support as "img" elements and CSS background images.
  • Theoretically a future browser might support SVG as images, but not as CSS backgrounds, or vice-versa. I've been unable to find a way to differentiate these different supports, so the script will just assume support for both if support for "img" elements is found.
  • As mentioned, a data URI file is used to check support. This was done to eliminate the need for an additional file. All modern browser support data URIs, except for Internet Explorer. Then again, all modern browsers support SVG to some degree, while IE does not. Hopefully by the time IE supports SVG and SVG as images/css backgrounds, it will also support data URIs. If you don't expect this to be the case, you can play it safe by using an external SVG file instead. Just change the "testImg" value to the location of a small SVG file.
  • Opera 9.5 appears to have a strange bug where it occasionally gets unhappy when you try to use the same SVG image as both a CSS background as well as a regular image. Doing so using this script may make Opera use the fallback image, or worse, hide the background entirely.


Web Standards, the real Flash killer

, , , ...

There's changes in the wind in the world of visual web technologies, and they show a beautiful future for what might soon (and to some degree now) be possible with the use of web standards.

Specifically, I'm talking about web alternatives to that ever popular Adobe Flash plug-in. Note that I won't be talking about Microsoft's Silverlight here, since it has many of the same shortcomings as Flash does.

There seem to be three major ways Flash is being used today: For online videos, as a web page interface, and for web-based games. Upcoming standards being developed and implemented for each of these uses.

Video


The HTML 5 specification includes an actual <video> element, that can run a video much like the <img> element displays an image. Javascript can be used for the user to set any the actions (stop, pause, play, etc.). What's more, videos can also be referenced to in SVG, allowing nifty effects like Reflection and filtering. There are experimental builds of Opera, Firefox, and now Safari that all support this feature to some degree.

Interface


Flash allows for all sorts of tricks to make cool looking (albeit often irritating and unnecessary) web page interfaces, occasionally bypassing HTML altogether. Some of these effects can already be somewhat reproduced using CSS and javascript in today's current browsers, as for example is shown in this jQuery UI demo. More complex effects are also possible using SVG and/or the HTML 5 <canvas> element, both of which are seeing increasing support in the same three browsers.

Additionally, Safari is experimenting with effects that just use CSS properties. These allow for animation, and transformation (allowing things like scaling, rotating and skewing). Think about it, combined these would allow you to specify any HTML element and have it do all sorts of crazy things, without a single line of javascript. Somebody was quick to mention how the Cover Flow effect might even be possible this way.

Games


Primarily Canvas/SVG should eventually be able to handle anything Flash games already do, and possibly more with the recent introduction of 3D Canvas. This could possibly appear in Firefox 3, and is also available (apparently in a different form) in the previously mentioned experimental build by Opera. An example game is this amazing 3D version of Snake.

Some might ask "but...why? Flash already does so much of this! Why reinvent the wheel?".

Well, there's several reasons. Flash is a proprietary and not part of any W3 standard, which prevents a lot of things like easy and free ways for developers to create SWF files. It also causes many accessibility problems, because Flash files are just single binary files, unreadable (mostly) to anything but Adobe's Flash player. Several other problems exist too.

All these issues are addressed in the various methods mentioned above. And that's great news for the future of the web. The fact that we're seeing all these cross-browser implementations already bodes very well for the future. Of course, it's yet to be seen how much and how fast Microsoft will incorporate these features in Internet Explorer. I'm pretty optimistic, however, that they will find it in their best interest to keep up with these technologies eventually.

Web standards have done a lot for the web so far, and it's great to get a glimpse of how far they can take us into the future.

SVG Background Replacement Script

, , ,

UPDATE: I've managed to create a working version! See here.

I've written this excellent script that will replace specified background images with an SVG image, whenever support for this is detected. It will go through all CSS rules looking for "filename.svg.jpg" and replace it with "filename.svg". This should be ideal for anyone who would prefer to use SVG backgrounds whenever possible.

There's one problem: It doesn't work in the one browser that supports SVG background images! Homer: Doh!

Since the script does work when detecting support for/replacing, say, PNG files, I can only assume this is an issue in Opera. I have thus reported this issue in the forums.

Hopefully this will be fixed before Opera 9.5 goes final, if not, it's back to the drawing board to write a script that's more forgiving!

Beware the List Item Eater

, ,

Apparently there's an Opera blog bug where some list items suddenly disappear. Because of this I have decided to replace my list items in previous blog posts with lines prepended by a hyphen.

I realize the severity and enormity of this change, so I ask for your sympathy and understanding. It was this, or leave approximately four innocent list items in pain and suffering. You understand. Please understand. Thanks.

UPDATE: Daryl Ducharme was nice enough to inform me that regular HTML lists work too. So I'm using those instead.

DS Browser image sizes

, ,

Recently I've been playing around with the Nintendo DS web browser. One of my discoveries was that it automatically resizes any image beyond a certain width (768px), height (768px), or dimension (307200 sq. px).

To show the actual image sizes this allows, I've created this handy SVG file. Easy numbers to remember are displayed, though anything that does not extend the curved line at the bottom right will work too. Additionally, this page shows all numerical options.

How is this useful? Well, the resizing isn't too big a deal for most photographs, but if you have larger images with text on them (comics for example), they will look pretty ugly and become hard if not impossible to read. So if you care at all about your DS browsing public, you can use this information to keep your images within these limits.

Where are the decent Wii games?

, , , ...

I like to play games. Don't play much, don't own many consoles. I do own a Wii. The Wii seemed very cool and exciting at first, and certainly has some cool games for it. I do not regret buying a Wii.

However. What disappoints me is that there are so few decent Wii games, especially compared to the Xbox 360 and PS3. And yet it's the best-selling console of this generation. Let me give you some statistics from Metacritic, a site that takes scores on games from a variety of review sites, and then mashes them together into a single number.

For "decent" games, I'll look at games that have at least a score of 75. Sound fair? Usually a game with a score of 75 is kind of a "meh" game that you would pick up if you could find it cheaply. So I think I'm being quite generous calling a 75 game "decent".

Here are the statistics for games that scored 75+, as of September 17, 2007.
  • Wii: 15
  • PS3: 36
  • Xbox 360: 110

I could draw a little pie chart to illustrate how frikkin' FEW Wii games this is, but for these numbers I really don't have to. It normally takes quite a lot for me to complain about something like this, but come on! There are more Wiis sold than 360's, and yet the 360 has more than 7 times as many games! I'd almost feel sorry for Microsoft. Didn't they have this "It's the games, stupid" mentality when they came out with the original Xbox? A (game system) generation later and they're actually taking an incredible lead in "playable" games, while the Wii outsells their system. Do gamers just not care that much about the games anyway? Yes, I know, the Xbox 360 has been out longer than the Wii has, so more games are obvious. But this many? And the PS3 was released at the same time, and STILL has over twice as many decent games.

So really, why are things the way they are?

Maybe there really are more playable games, but the reviewers are biased against the Wii?
Maybe it's just too hard to make a good Wii game?
Maybe developers are too lazy to put too much effort into making a great Wii game, knowing it will probably sell easily anyway?
Maybe there aren't enough hard core Wii gamers to cater to?

The first point is hard too imagine, the second is unlikely based on the handful of good games that DO exist...so I suspect it's the last two. The Wii is hot, and is being played by people young and old. Why bother making anything better than some cartoony mini-game filled piece of crap? Nintendo knows better than to really dumb down their games, but few other developers seem to really care about the needs of the real gamers.

Surely I'm not the only one who feels disappointed by this?

CSS/SVG Rounded corners for multiple browsers

, ,

Here's a demo of a div with a simple 10px radius 1px border that works in Opera 9.5, Firefox 2+ and Safari 3 beta. It uses -moz-border-radius for Firefox, -webkit-border-radius for Safari and an SVG background for Opera 9.5. The SVG file this time is actually a modified version of a new method Holger Will came up with.

Of course, it doesn't work quite that easily. The CSS3 corner method uses a border, but for Opera we don't want that border to appear because it already exists in the SVG file. Additionally, we'll have to change the position and padding slightly so the border appears in the exact same place.

One way to solve the problem would be javascript browser-sniffing, but that's an "evil" solution, and I'd like to avoid using javascript if at all possible. Instead, I used O9.5's :nth-child() pseudo-selector with a value of 1n to target every instance. Other browsers (except Konqueror) don't support this (yet), so until they do, this method should work.

So obviously this is just a temporary solution until either Opera supports rounded corners, other browsers support SVG backgrounds, or other browsers support the selectors that Opera does (which would break my "hack").

Oh, and to allow support in IE, I'd recommend a javascript trick (there are several out there) inside a conditional comment tag. It may also be possible to use VML to achieve a similar effect as the SVG background, but I'm not sure.

More SVG background demos

,

I just found out about someone else also working on SVG background demos with impressive results! On this forum thread, Holger Will has been demonstrating his attempts, which include rounded corners.

After a quick look at his SVG files, it seems he solved the stroke problem basically by drawing each corner as filled shapes, rather than use stroke at all. Frankly, this makes too much sense and I can't believe I didn't think of doing that. The one drawback is more complicated code (it would appear more difficult to modify than my method), but the effect is certainly worth it.

SVG Multiple Images and Rounded Corners

, , ,

One of the geekier things that excite me (okay, I guess there's a lot of those) are upcoming features in web browsers. Specifically when it comes to new and improved support for things like CSS3, Javascript and SVG.

The recently released Opera 9.5 alpha is known for it's improved CSS support, but what excited me most was the ability to use an SVG file as a background image. Why is this great? It allows for all sorts of neat things. Small file scaling gradients, multiple raster images, even animation!

Sure, no other browser supports this yet, but I'm not going to let that ruin my fun in designing for the future. Besides, one could always use javascript to fix stuff for other browsers if really necessary.

So, even before Kestel was released I tried my hand at a multiple image SVG background. CSS3 allows multiple images to be specified as background, but so far only Safari supports that. I'd noticed an example of this a while back, and since this seemed very useful to me, I based my example on it as accurately as I could.



The first 9.5 alpha ALMOST displays it correctly...unfortunately it displays a black box for the top and bottom "border". This strikes me as odd since it works fine as standalone file, but I'm sure it will be fixed eventually.

Since I made this, Opera's Chief Web Opener David Storey made some excellent demos showing other new options, including SVG rounded corners. Rounded corners, too, are a CSS3 property, which work in Firefox (for example). Opera currently lacks support for this web 2.0-riffic display trick, so it's cool to now have a way to emulate them without a need for Javascript or nested DIVs.

David's example shows an easy to make single color background with rounded corners. However, what if you only wanted to have the border? The obvious answer would be to add a "stroke" to the SVG rectangle. Unfortunately, the stroke sits right on top of the edge of the rectangle, and so parts will be clipped off when putting it in a box. You might be able to get away with a 1-pixel border, but beyond that is just not acceptable.

Lacking the ability to display the stroke on the inside of the box, one would have to give the inner box a certain margin from the outer box. Ideally using an absolute value like 5px, rather than a percentage. For my multiple background image I kind of dealt with this when needing to position the right and bottom border. With HTML one would use CSS to do "position:fixed" and "right:5px". Alas, this won't work in SVG, where you can only specify a top and left position.

So, what I did was give it an "x" value of 100%, and then use the transform="translate()" attribute to move it back to the left using a pixel value. Ta da, an image stuck to the right border. This, however, was using multiple images, not one great big rectangle.

Eventually, however, I found the solution using USE elements, clipping areas, and four different rectangles. Crazy? Yes. But it works quite well, allowing different radii for each corner, any given margin, any color and any stroke width.

Here is the result, which I'm quite proud of:
The standalone SVG file

I hope to add more examples later, including using the image as background, and some documentation on modifying the file.

I wouldn't be at all surprised if someone comes up with a more efficient way of doing this, if you do, please let me know!

My First Opera blog post

Hullo, you are reading the first post of this blog.

In the future I hope to post stuff about web design and other miscellania. I tend to be pretty bad at regular updates, however, so don't hold your breath waiting for new entries.

That will be all for now!