Skip to content

Instantly share code, notes, and snippets.

View jdlich's full-sized avatar

Jacob Lichner jdlich

View GitHub Profile
preprocess do
def generate_gallery_pages
counter = 1
photos = Dir['assets/images/interiors/*'].
reject { |p| p.match /thumbnail/ }.
map { |p| p.gsub('assets','') }
photos.each do |photo|
site = Nanoc3::Site.new('.')
site.data_sources[0].create_item(
// first thumbnail is always the current image, so it
// should start out being selected
$('#photo_gallery ul li:first-child img').addClass('selected');
// set the last thumbnail's margin to 0
$('#photo_gallery ul li:last-child').addClass('last');
// all thumbnails should begin with lower opacity
$('#photo_gallery ul img').animate({ opacity: 0.75 }).hover(
<div id="photo_gallery" class="home">
<img id="main" class="preload" src="<%= home.main_photo %>" />
<ul>
<% home.photos.each do |photo| %>
<li><img src="<%= photo.path %>" alt="<%= home.thumbnail_alt_text %> - <%= photo.caption %>"></li>
<% end %>
</ul>
</div>
#photo_gallery
margin-bottom: 18px
img#main
width: 870px
height: 570px
margin-bottom: 5px
ul
height: 47px
//
// Gallery Script
//
// first thumbnail starts out as being selected
$('#photo_gallery ul li:first-child img').addClass('selected');
// set the last thumbnail's margin to 0
$('#photo_gallery ul li:last-child').addClass('last');
<ul id="navigation2" class="append-bottom-8">
<li class="lh"><a href="/<%= @item[:section] %>/"><%= titleize_section(@item) %></a></li>
<%= section_items path_to(@item) %>
</ul>
#navigation2
margin-top: -5px
a:link,
a:visited
color: #666666
.lh
a:link,
a:visited,
$(document).ready(function() {
(function ($, fluid) {
fluid.reorderListWithHandlers = function (container, options) {
options = options || {};
var addHandlers = function(element) {
$(element).children().prepend('<a class="handle" href="#"></a>');
};
function wrapEveryFour(children) {
for (var i = 0; i < (children.length / 4); i++) {
children.splice(0,4).wrapAll(container);
}
}
$('#content > section').each(function() {
var children = $(this).children('section');
wrapEveryFour(children);
<div id="content">
<section>
<h2>Quarterly Reports</h2>
<h3>4th Quarter 2010</h3>
<section>
<h4>Ticket Count Reports</h4>
<ul>