Skip to content

Commit

Permalink
added responsive layout
Browse files Browse the repository at this point in the history
  • Loading branch information
Jordan Schroter committed Jan 27, 2013
1 parent ab7af6e commit 3f01db3
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 5 deletions.
43 changes: 43 additions & 0 deletions assests/jquery.fittext.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/*global jQuery */
/*!
* FitText.js 1.1
*
* Copyright 2011, Dave Rupert http://daverupert.com
* Released under the WTFPL license
* http://sam.zoy.org/wtfpl/
*
* Date: Thu May 05 14:23:00 2011 -0600
*/

(function( $ ){

$.fn.fitText = function( kompressor, options ) {

// Setup options
var compressor = kompressor || 1,
settings = $.extend({
'minFontSize' : Number.NEGATIVE_INFINITY,
'maxFontSize' : Number.POSITIVE_INFINITY
}, options);

return this.each(function(){

// Store the object
var $this = $(this);

// Resizer() resizes items based on the object width divided by the compressor * 10
var resizer = function () {
$this.css('font-size', Math.max(Math.min($this.width() / (compressor*10), parseFloat(settings.maxFontSize)), parseFloat(settings.minFontSize)));
};

// Call once to set.
resizer();

// Call on resize. Opera debounces their resize by default.
$(window).on('resize', resizer);

});

};

})( jQuery );
7 changes: 7 additions & 0 deletions assests/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -299,10 +299,17 @@ a:hover {
.grid-pad {
padding: 20px 0 20px 20px;
}

.grid-pad [class*='col-']:last-of-type {
padding-right: 20px;
}

@media (max-width: 767px) {
[class*='col-'] {
width: 100%;
}
}

/* FORM
*********/

Expand Down
16 changes: 11 additions & 5 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,17 @@ <h2>Playground</h2>
<div class="col-1-1 viewport">
<div class="tlt">Grumpy wizards make toxic brew for the evil Queen and Jack.</div>
</div>
<div class="col-1-1 controls">
<div class="col-1-1 controls" style="padding-right: 0">
<form class="grid grid-pad">
<div class="control col-1-2">
<label>In Animation</label>
<select class="col-1-2" data-key="effect" data-type="in"></select>
<select data-key="effect" data-type="in" style="width: 50%"></select>
<label class="inline checkbox"><input type="checkbox" data-key="sync" data-type="in" /> Sync</label>
<label class="inline checkbox"><input type="checkbox" data-key="shuffle" data-type="in" /> Shuffle</label>
</div>
<div class="control col-1-2">
<label>Out Animation</label>
<select class="col-1-2" data-key="effect" data-type="out"></select>
<select data-key="effect" data-type="out" style="width: 50%"></select>
<label class="inline checkbox"><input type="checkbox" data-key="sync" data-type="out" /> Sync</label>
<label class="inline checkbox"><input type="checkbox" data-key="shuffle" data-type="out" checked="checked" /> Shuffle</label>
</div>
Expand Down Expand Up @@ -94,6 +94,7 @@ <h2>Dependencies</h2>
</html>

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
<script src="assests/jquery.fitText.js"></script>
<script src="assests/jquery.lettering.js"></script>
<script src="jquery.textillate.js"></script>
<script>
Expand Down Expand Up @@ -136,8 +137,13 @@ <h2>Dependencies</h2>
$form.find('[data-key="effect"][data-type="in"]').val('fadeInLeftBig');
$form.find('[data-key="effect"][data-type="out"]').val('hinge');

$('.jumbotron h1').textillate({ in: { effect: 'flipInY' }});
$('.jumbotron p').textillate({ initialDelay: 1000, in: { delay: 2, delayScale: 1, shuffle: true } });
$('.jumbotron h1')
.fitText(0.5)
.textillate({ in: { effect: 'flipInY' }});

$('.jumbotron p')
.fitText(5, { minFontSize: 14 })
.textillate({ initialDelay: 1000, in: { delay: 2, delayScale: 1, shuffle: true } });

setTimeout(function () {
$('.fade').addClass('in');
Expand Down

0 comments on commit 3f01db3

Please sign in to comment.