Web Design Patterns - layout
http://webdesignpatterns.org/taxonomy/term/8
en069
http://webdesignpatterns.org/pattern/069
<div class="field field-name-taxonomy-vocabulary-1 field-type-taxonomy-term-reference field-label-inline clearfix"><div class="field-label">With respect to: </div><div class="field-items"><div class="field-item even"><a href="/taxonomy/term/1" typeof="skos:Concept" property="rdfs:label skos:prefLabel">design</a></div><div class="field-item odd"><a href="/taxonomy/term/8" typeof="skos:Concept" property="rdfs:label skos:prefLabel">layout</a></div></div></div><div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even" property="content:encoded"><p>The modern <strong>belief</strong> can explain many different things. One amongst them is the reason why you are here. Whilst the majority of great minds are facing other important challenges such as exploring different planets and struggling with the main proof for an abstract pleasure and it's relevance to subjective life, I will not try to to continue the line! Instead let me bring you really good news!</p>
<p>We're gonna understand what are web design patterns! It will take some time to achieve this goal, but we're on a mercy of civilization / modernization / etc.. aren't we?</p>
<p>So before we start, please note that this website, is under development. Not heavy devlopment, not construction - as it was told long time ago - but, under development, which means, it builds itself!</p>
<p>Now, let's talk about the well known 960 grid system. <br />
If you don't know what it is, great. But if you really wanna learn something new, please <a href="http://www.960.gs" rel="nofollow"> visit here</a>.<br />
It's a really nice system. But the question to be asked, is this: how useful will it be to me? And the answer is: it depends. But my statistical intuition whispers, the chance that you'll need it for your <em>own</em> website is nearing zero, unless you wanna to prove me the opposite :) <br />
960 is great for big portals, and the reason for it's greatness is of course - the ability to quickly rearrange your visual representations from say, 3 columns to 5, without calculating much pixels. <br />
Anyway.<br />
I have two other ways to propose you doing the same and you decide what's good for you. <br />
This system is called wdp-1 (who cares about the name, anyway?).<br />
First you need to decide what's the width of your website will be. Say, it will be 900px. Then you decide how many columns you want. Say 3. Then you divide 900 by three, and get 300. Great!<br />
But what if you get a remainder after division? What if you choose 7 damned columns instead of the blessed 3??? - I told you I will give you two solutions, so please be patient...<br />
Well, you can't divide nine hundreds by seven, but you can use... <b>modulo</b>! So, 900 mod 7 gives us 4! So we extract these four from nine hundred and we get 896. Now we can divide it by seven and get 128!!! It's not a coincidence that we got a number equal to two in the power of seven! But I want to leave this philosophy for the future! <br />
Let's get familiar with the second method. If you came here, then probably you've heard about <a href="https://addons.mozilla.org/firefox/addon/1843" rel="nofollow">Firebug</a>. <br />
I want to share with you a piece of code that I wrote, which takes two parameters, that you can play with:<br /><strong>maxWidth</strong> is the width of your planned page, and <strong>minDivisors</strong> is the minimal number of divisors that you want to get between 1 and up to <strong>maxWidth</strong>. I mean, if you take 1 as minDivisors, then you'll get all the results.<br /><br /><strong> var maxWidth = 1400; //px<br />
var minDivisors = 25;<br /><br />
for (iWidth=0; iWidth < maxWidth; iWidth++) {<br />
var numDivisors=0;<br />
for (iDivisor=0; iDivisor < iWidth; iDivisor++) {<br />
if (iWidth % iDivisor == 0) {<br />
numDivisors++;<br />
}<br />
}<br />
if (numDivisors >= minDivisors) {<br />
console.log('w:' +iWidth+ ' | ' + 'd:' + numDivisors );<br />
}<br />
}<br /></strong> <br />
Isn't it great!?<br />
So, for example with the default parameters, just if you copy-paste this code, you will get this output:<br /><strong> w:720 | d:29<br />
w:840 | d:31<br />
w:900 | d:26<br />
w:960 | d:27<br />
w:1008 | d:29<br />
w:1080 | d:31<br />
w:1200 | d:29<br />
w:1260 | d:35<br />
w:1320 | d:31<br />
w:1344 | d:27<br /></strong> Which means, that for width of 840px there are 31 possibilities to arrange columns in an equal way - 5 possibilities more that in 960 system!<br />
Well well...<br />
If it's not nice, then what it is?<br />
I hope you enjoyed this short intro to Web Design Patterns. Sorry if you didn't learn much out of it (after all I hope that you enjoyed!). <br />
So see you in the next tutorial, and don't forget to bookmark this page if you liked it!</p></div></div></div>Fri, 18 Jun 2010 23:13:27 +0000valk2 at http://webdesignpatterns.org