Posts Tagged ‘nablopomo’

This blog was down for a few hours this evening. I could have spent the time composing a post and having it ready to cut and paste in here now that everything is working again. I could have done that.

Oh well. Tomorrow is another day (spent at an users’ day for the CMS we use at work, held in a building that is one minute’s walk away from the office) and the it’s the weekend.


Reasons to love the joined-up-interweb: musicians you love telling you about new musicians they love, with YouTube vids embedded, etc.

Tanita Tikaram recommends Marina and the DiamondsI am Not a Robot


Just a quick one to point out that when you build a Christmas web site in October, sometimes things go a little strange…


Wargames Foundry Terror Bird

I’ve been updating my Dinosaurs in Miniature pages. The main differences have been the addition of the MegaMiniatures megafauna that I posted about previously, the continuing expansion of the Dazed Miniatures range and some new miniatures from Wargames Foundry, including the Terror Bird shown here.

BTW, Foundry have a 20% off sale until the 10th November 2009. So now’s a very good time to pick up these new goodies.

At SELWG last month I picked up a “new” Smilodon from the “old” DZ range sold by Trent Miniatures. It’s in a walking pose rather than the leaping pose that’s been available for a while. This range is now available over the web from North Star though this additional Smilodon isn’t listed.

There have also been a few additions to the 10mm DinoMight range form Magister Militum.

MY Miniatures ice age range seems to have melted away from the web with the close of Geocities. Does anyone know if they have a new web site elsewhere?

And finally, the Tusk rules are available as PDF via Wessex Games/Wargame Vault. You can still buy the paper version from Irregular but the new version has full colour photos throughout.

I am currently growing a moustache as all big game hunters should.


November has arrived accompanied by wind and rain and cold (and indeed a cold). How to spend the month?

Well mostly Lettice and I will be spending it buying a house. Or trying to. The other day we took a tame civil engineer to have a look round the place we’re hoping to buy (in a sort of “look for the massive faults before paying a surveyor” kind of way) and he could only see one potential problem. Fingers crossed that it isn’t.

Like last year, I’ll be taking part in NaBloPoMo as a form of half-hearted solidarity with the people who are attempting NoNoWriMo.

And I’ll be growing a moustache. Some banter in the office on Friday has somehow led to me agreeing at the last minute to take part in Movember. Now, despite having a silly name and being an Australian import, this is a very good cause so please make a donation. I promise to only post very occasional photos of the mo’s progress.

Finally I’ll be hiding from the bad weather and watching telly, not least Doctor Who which is back for a special on the 15th.


November. I blew it. (2008) nablopomo.com

Or National Blog Posting Month Post Mortem…

Well, it wasn’t exactly an unqualified success. Including this one, I made 27 posts in November – three short of the goal. Those 27 posts were made on only 22 days – so even further from the goal of posting every day.

That said, this was my most productive month since April 2006, which is no bad thing. For the first ten months of 2008 I’d averaged 6 posts per month, so the real goal of getting me blogging more frequently was definitely achieved.

I don’t think I’ll try it again in December but maybe sometime early next year.

 
Very True Mood: (contemplative) contemplative
Tags:

The contents of this post are a few years old now and I can’t recommend them as best practice. If you’re tempted to use this technique then bear in mind the fact that Opera 10.5 and Internet Explorer 9 now support the CSS3 border-radius property. Supporting old versions of Opera is rarely worth the effort so I would use if ($.browser.msie && $.browser.version < 9) to apply this technique to old IE versions only.

Picking up from my first attempt here’s a more methodical approach.

Objectives

  1. Buttons (both <input type="submit"/> and links masquerading as buttons that have rounded corners.
  2. Works in recent versions of Gecko, WebKit, Opera and Internet Explorer
  3. As little extra mark up as possible
  4. Any JavaScript used must be generic and not tied to one particular style of button, i.e. change element.className not element.style

HTML + CSS

Let’s start with the standards based solution that works in Gecko and WebKit based browsers.

<input class="button-rounded" type="submit" value="Go"/>

<a href="#" class="button-rounded right">Go

.button-rounded {
  font: bold 100%/1 Verdana, sans-serif;
  text-decoration: none;
  background-color: #2e4c37;
  color: #fff;
  border: 2px solid #fff;
  border-radius: 4px;
  -moz-border-radius: 4px;
  -webkit-border-radius: 4px;
}

As you can see from Example 2A this works very nicely in Gecko but has a few issues with padding and line heights in WebKit. If you examine the code of the example you’ll see some extra styles to tweak the padding so that the button and the link look the same (at least in Firefox) and also to produce examples where the buttons are floated (this variation is widely found on the web and also through up some problems during testing).


Add elements via JavaScript

As prevously we’re now going to use JavaScript (in the example code jQuery) to wrap the button in a span and then insert four extra elements into that span. We also add a new class to the button itself.

if($.browser.msie || $.browser.opera)  {
  $('.button-rounded').addClass('wrapped').wrap(
    '<span class="button-rounded"></span>'
  );
  $('span.button-rounded').append(
    '<i class="tl"></i><i class="tr"></i><i class="bl"></i><i class="br"></i>'
  );
};

.button-rounded.wrapped {
  border: none;
  background: transparent none;
  float: none;
  margin: 0;
}
span.button-rounded {
  position: relative;
}
span.button-rounded i {
  position: absolute;
  width: 4px;
  height: 4px;
  background: url(corners.png) no-repeat;
}
span.button-rounded i.tl {
  top: -2px; left: -2px;
  background-position: 0 0;
}
span.button-rounded i.tr {
  top: -2px; right: -2px;
  background-position: -4px 0;
}
span.button-rounded i.bl {
  bottom: -2px; left: -2px;
  background-position: 0 -4px;
}
span.button-rounded i.br {
  bottom: -2px; right: -2px;
  background-position: -4px -4px;
}

This removes most of the styles from the button and applies them to the wrapping span – this helps a lot as spans are more predictable than inputs.

But a quick look at Example 2B reveals that the floated elements don’t seem to be in the right place anymore. We forgot that there are two classes and hence two sets of styles on these buttons.

$('.button-rounded.right').removeClass('right').parent('span').addClass('right');
$('.button-rounded.left').removeClass('left').parent('span').addClass('left');

Okay, Example 2C is a step in the right direction but there are still a number of issues. In IE the floated buttons are two wide and the inline input is missing its bottom border. In Opera the two inline examples have a problem with the location of the right side corners.


Fine Tuning Internet Explorer

Add display: inline-block; to the styles for .button-wrapped. Simple and works brilliantly, Example 2d.


Fine Tuning Opera

As the browser with the smallest market share we’ve left Opera to last and hence it’s been the victim of a few CSS style choices that have been made with IE and Firefox in mind. We could deploy some CSS hacks to feed it different styles but this time I decided to use JavaScript instead.

if ($.browser.opera) {
  $('input.button-rounded').addClass('opPad');
  $('span.button-rounded').each( function() {
    if($(this).css('float') == 'none') {
      $(this).children('i.tr, i.br').addClass('opNoFlo');
    };
  });
};

input.button-rounded.opPad {
  padding: 1px 5px 2px 5px;
}
span.button-rounded i.opNoFlo {
  right: -4px;
}

So there we are, Example 2e.


If you want a hover effect on your buttons just add .button-rounded:hover and change the background and border properties. It may be easier to change the span.button-rounded:hover i background image but it’s probably better practice to change the background-position values instead and use a single corners.png as your CSS sprite holder for both normal and hover states. (Or take the easy way out and just change the text colour as I did in the last example.)

If you have multiple styles of buttons then use contextual selectors to set different CSS whilst keeping the JavaScript common across the entire site. In a real world case I have a common style that gets changed for a few <form id="foo">.


Now for the bad news. I’ve tested this in IE 7, FF 3, Opera 9.6, Safari 3, Chrome 0.4.154.22 on Windows XP. I’ll be testing in IE 6 and IE 8b2 shortly but would appreciate feedback regarding other platforms and browsers.

Very True Mood: geeky
Very True Music: Gang of Four – Damaged Goods

I watched the first episode of The Devil’s Whore last week but found my attention drifting. I just couldn’t be bother to watch this week’s episode. Was it any good?

My main reaction has been a wave of nostalgia for By The Sword Divided. Anyone else remember that one? I think I had an early crush on the blonde daughter but as it was over twenty years ago I’m not quite sure.


“I’m about to walk into the cathedral and it will all hit the fan.”

Tags:

On Thursday my hard drive died. Not the important one, just the one with Windows on it.

So one trip to PC World and many hours spent watching progress bars later… I have an odd situation.

I used to have a C: drive with Windows on it (part of the original configuration of the PC) and an X: drive with all my data (which I had added later). When I inserted the brand new drive in the first bay and started the Windows install it recognised that the drive in the first position was unformatted and the one in the second was formatted. Good stuff, so I told it to format and install on the first drive.

Except now it sees the first drive (the new one with Windows on it) as D: and correctly sees it as the Boot drive, and the second (i.e. the old X: drive with may data on it) as C: and sees it as a System drive.

So far only one program has been stupid enough to install itself to C:\Program Files\ rather than D:\Program Files. And googling the subject brings back lots of advice saying “if Windows installed itself with these drive letters, don’t try to change them”.

I’m not too fussed about C: and D: being the “wrong” way round, but why is D: being seen as a System drive? And what are the possible conseqences?