v.plonk!

new design coming soon...

Mass Effect 2 skin

, , ,

With the upcoming video game Mass Effect 2 made by BioWare, which will get released in January 2010, I thought it might be a nice idea to setup a new skin for My Opera and try to implement some new ideas.


a folder for each skin
With this skin being my 5th theme now I wanted to keep the files in the future to make it easier to switch to different skins. The first step was to create a folder (called /skin5) for the new skin inside the files folder of My Opera. There I could put the central CSS file (called skin.css) and link the user.css directly to it:
@import url("files/skin5/skin.css");
That's all. From now on I will be able to switch my skins within seconds. wizard

to be or not to be - sprites and images size
At first I thought about using sprites again, but when I realised that the file size of the whole image would easily exceed 350kB I went back to the more classic way and included the image for each subpage of my blog seperately. That way each page will load faster, while the image quality is still good.
#top2 { background: transparent url('files/skin5/head_01.jpg') no-repeat; height: 665px; }

.top-blog #top2 { background-image: url('files/skin5/head_01.jpg');}
.top-archive #top2 { background-image: url('files/skin5/head_02.jpg');}
.top-albums #top2 { background-image: url('files/skin5/head_03.jpg');}
.top-links #top2 { background-image: url('files/skin5/head_04.jpg');}
.top-friends #top2 { background-image: url('files/skin5/head_05.jpg');}
.top-favorites #top2 { background-image: url('files/skin5/head_06.jpg');}
.top-unite #top2 { background-image: url('files/skin5/head_07.png');}
.top-about #top2 { background-image: url('files/skin5/head_08.jpg');}
You may notice, that all images use the JPEG file format except for one. This was due to file size optimizing. So whenever you save an image to be used in the web make sure to use the smallest possible file that still looks good enough.

different skin different basic theme
As I wanted to create some cool space graphics to the left and right of the page image I decided to use a different basic design. So I switched from "Silver" to "Leaves", which also comes with the most important colors I need for my skin. This way I don't need to code every single tag, class and id, I just modify the things I want to look and behave differently.

@font-face
The key feature I wanted to try this time was web embedded fonts. Therefor you define a new font at the beginning of your CSS, add the font as a font-family and upload it on your My Opera files folder. I ran into some trouble as the examples I found didn't do what I wanted, but I found a very good article by Paul Irish and an awesome @font-face generator that even includes the code you need. Afterwards I uploaded all the font files required and included the following CSS code:
@font-face {
	font-family: 'Slider';
	src: url('slider.eot');
	src: local('Slider Regular'), local('Slider'), url('slider.woff') format('woff'), url('slider.ttf') format('truetype'), url('slider.svg#Slider') format('svg');
}

#wrap1 { font-family: "Slider", "Arial", sans-serif; }
This SHOULD work in any browser, but right now it seems that it doesn't work on Firefox (no idea why, the code should be okay) and on a few systems it doesn't work at all. eek
I will have another look at it later on... hopefully finding the solution to this very soon. coffee

Touch my WACOM!The backpacker's guide to CSS - lesson 2: CSS basics

Comments

Robert Jacobsenrobertj Friday, November 20, 2009 12:43:13 PM

Hmm, using Opera on Mac OS X, the font looks a bit messed up.

http://img.ipwn.se/Skjermbilde%202009-11-20%20kl.%2013.42.14.png -

Reposted this in the correct place to post it smile

DavidSchalandra Friday, November 20, 2009 12:48:06 PM

Weird... the fallback should be Arial or any sans-serif font. I'll have a look at it.

edit: a collegue of mine just had a look at it on his MacBook and it looks just as intended... confused

Robert Jacobsenrobertj Friday, November 20, 2009 5:56:35 PM

It's just at some pages, like the front page. I'll look into it.

Robert Jacobsenrobertj Friday, November 20, 2009 11:50:01 PM

It's bugged in Windows 7 too. Perhaps due to the lack of the original font? *shrug*

DavidSchalandra Saturday, November 21, 2009 3:33:57 AM

I tested it today on 6 different PCs... 1 Linux, 2 MacOSX (10.5/10.6), 1 Windows XP, 2 Windows Vista (32/64bit). It looks good on Opera and Safari/Chrome. Both engines load the font (called "Slider", the original font for Mass Effect) and assign it to the font-face correctly.

Firefox will not load the font due to HTTP access control, which prevents Firefox from loading fonts from sources that are not exactly the same domain as the website itself. I'll try to find a work-around, but that will take some time. Aside from that Firefox loads Arial instead (that worked this way on all 6 different systems).

I'm not really sure, why you're running in such enormous trouble, but I'll check the CSS again this weekend. Maybe I find a fix. left

Robert Jacobsenrobertj Saturday, November 21, 2009 10:31:19 AM

What version of Opera are you testing btw? I'm testing the lastest snapshot of 10.10. However, it works nicely now when I just accessed this entry, but when I go to the /Schalandra/blog/ it seems to mess up.

Just a comment: I see you have written "Slider", "Arial", sans-serif, and while I'm not certain it works the same way for web fonts, you don't need to quote one-word fonts. For instance, you can write Times but you need to quote Times New Roman.
font-family: Georgia, Times, "Times New Roman", serif;

Robert Jacobsenrobertj Saturday, November 21, 2009 10:33:58 AM

Just checked your code further. Is it correct to have two src-es?

@font-face {
	font-family: 'Slider';
	src: url('slider.eot');
	src: local('Slider Regular'), local('Slider'), url('slider.woff') format('woff'), url('slider.ttf') format('truetype'), url('slider.svg#Slider') format('svg');
}

DavidSchalandra Saturday, November 21, 2009 11:19:46 AM

The first source is for IE (works correctly). As IE doesn't read lines with multiple sources it skips the next line, while all other browsers read and interpret it.

I found a line where I forgot to include Arial, maybe that does the trick. smile

KimberlySqueakeyCat Sunday, November 29, 2009 2:50:48 AM

Robert Jacobsenrobertj Sunday, November 29, 2009 1:31:01 PM

I just found this typo in your code:

#wrap4 { background: #FFFFFF url('bg.png') repeat-y 0px 0px; width: 920px; position: absole; padding: 0px; }


It should be absolute, not absole. smile

DavidSchalandra Monday, November 30, 2009 3:33:09 PM

Hey SqueakeyCat! Good to see you around. smile

@Amnith
It is in fact a typo, but an intended one. I just forgot to delete the whole position-rule. I will fix it as soon as I'm back home.

Robert Jacobsenrobertj Monday, November 30, 2009 8:19:08 PM

“Intended typo”. I need to use that statement sometime wink

KimberlySqueakeyCat Thursday, December 3, 2009 2:39:43 AM

i get around everywhere, once in a while...not every day, but i eventually get to everyone in my friends list...lol

Sami Serolaserola Wednesday, December 23, 2009 5:56:39 AM

Oh, this messed up issue been already noticed. I get the messed up text when using Opera 10.10 on Ubuntu Hardy. It's strange that it works every now and then if I just reload the page.

DavidSchalandra Thursday, December 24, 2009 1:24:47 PM

I think it's a issue with my.opera.com when not loading the special font file I added to the style. I think I'll have to move the whole design (CSS, images, fonts) to my own server. sad

Sami Serolaserola Monday, December 28, 2009 9:08:32 AM

Any chance this could be caused because of relative URL addresses used when calling for images of special fonts? I just still wonder why pages sometimes looks okay but then messed up fonts shown on most of of the time. Sometimes reloading page fixes the layout, and next time it does not. Very odd indeed.

ArturMithos Wednesday, December 30, 2009 2:18:48 PM

http://files.myopera.com/Mithos/files/capture_30122009_151643.jpg

I have Windows XP and the latest official Opera 10 version.

DavidSchalandra Tuesday, January 12, 2010 11:00:28 AM

Seems like the issue is fixed by now. I saw the problems for some days, but since yesterday it doesn't happen anymore. Can anybody confirm this?

Sami Serolaserola Tuesday, January 12, 2010 11:21:04 AM

I'm still having messed up pages on Opera 10.10 worried

ArturMithos Tuesday, January 12, 2010 2:11:21 PM

Originally posted by Schalandra:

Seems like the issue is fixed by now. I saw the problems for some days, but since yesterday it doesn't happen anymore. Can anybody confirm this?


It works for me now on this page ^^

edit:

Or not. As i posted the comment, the page looks like before with this strange changing text everywhere. Dunno why it now isn't like before.

Sami Serolaserola Tuesday, January 12, 2010 2:35:52 PM

Yes, it's always seem to work on first page load, but as soon as I try to open another page on David's blog, then it's messed up. Sometimes reloading fixes the view on one page but usually not. I still wonder if it could help to use absolute URL addresses instead of relative ones. It looks like something no longer found after page URL changes.

DavidSchalandra Wednesday, January 13, 2010 9:17:52 AM

Too bad. sad
At the end of this month I'll create a new skin and get rid of this problem.

ArturMithos Wednesday, January 13, 2010 11:40:41 AM

Originally posted by Schalandra:

Too bad. :frown:
At the end of this month I'll create a new skin and get rid of this problem.


Still wondering what's the problem. Is the new skin darker or lighter than this one?

DavidSchalandra Wednesday, January 13, 2010 1:49:09 PM

No... the next skin won't use an embedded font anymore, which causes the trouble (even though it shouldn't - in theory).

Sami Serolaserola Thursday, February 4, 2010 9:57:22 AM

About embedded fonts... I'm planning to test embedded fonts on page titles, although this experiment proved there are some problems when using them here on MyOpera. What comes to Firefox, I think fonts like .otf anf .ttf should work also on FF.

DavidSchalandra Thursday, February 4, 2010 10:31:25 AM

Firefox blocks fonts that do not come from exactly the same domain as the page (see HTTP access control).

Sami Serolaserola Thursday, February 4, 2010 10:46:13 AM

Thanks David smile

ArturMithos Saturday, February 6, 2010 6:40:32 PM

Oh, the new design looks really great :3

Tengwar Blogtengwarblog Saturday, March 27, 2010 12:30:04 PM

Hi David

I run into the same problem with Firefox not embedding the @font-face font. For one, I was told by peter.reisio at mozillaZine that there is a workaround by including the font within the very CSS via base64, see for instance my own user.css. This has the drawback that it significantly embiggens the CSS size.

I also filed a bug at mozilla.org: Cross-Site @font-face embedding with cross-site CSS possible with base64, impossible with own file, since I believe this odd Firefox behaviour should be corrected. Let's see what'll become of it.

DavidSchalandra Saturday, March 27, 2010 10:35:44 PM

Ouch... that's evil! But if it works, I'll use it next time! YAY!
Thanks for that great hint! yes

Phạm Thành Dươngphamthanhduong Tuesday, November 9, 2010 9:24:58 PM

Can you share your current theme with me ?Thank you.

DavidSchalandra Monday, November 15, 2010 2:06:24 PM

You can include my current theme easily... just include the CSS file in your user.css.

Write a comment

New comments have been disabled for this post.