require 'rubygems' require 'atchoum' require 'utils' class Home < Atchoum::Website include Utils def layout html do head do title "Marc-AndrĂ© Cournoyer - Look 'ma, I'm on the Internet!" tag! :link, :rel => "stylesheet", :href => "stylesheets/home.css", :type => "text/css" style :type => 'text/css' do %w(blog code mail).each do |l| self << "a.#{l}, .preload-#{l} {background: url(images/#{l}.png) no-repeat}" self << "a.#{l}:hover, a.#{l}:focus {background: url(images/_#{l}.png) no-repeat}" end end end body do self << yield stats end end end def index_page img.logo! :src => 'images/logo.png', :title => 'Marc-AndrĂ© Cournoyer' # Image preloading div :style => 'display: none' do %w(blog code mail).each do |l| div l, :class => "preload-#{l}" end end ul.nav! do li { link 'blog', 'http://macournoyer.wordpress.com' } li { link 'code', 'http://code.macournoyer.com' } li { link 'mail', 'mailto:macournoyer@gmail.com' } end end private def link(title, link) a(:href => link, :title => title, :class => title) { text ' ' } end end