Skip to content

Commit

Permalink
Convert coffeescript to javascript
Browse files Browse the repository at this point in the history
  • Loading branch information
redhotvengeance committed Apr 10, 2014
1 parent 51d4a30 commit bb297ea
Show file tree
Hide file tree
Showing 5 changed files with 80 additions and 98 deletions.
1 change: 0 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,3 @@ gem 'rack'
gem 'thin'
gem 'sinatra'
gem 'jekyll'
gem 'coffee-script'
5 changes: 0 additions & 5 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@ GEM
specs:
classifier (1.3.3)
fast-stemmer (>= 1.0.0)
coffee-script (2.2.0)
coffee-script-source
execjs
coffee-script-source (1.6.3)
colorator (0.1)
commander (4.1.5)
highline (~> 1.6.11)
Expand Down Expand Up @@ -64,7 +60,6 @@ PLATFORMS
ruby

DEPENDENCIES
coffee-script
jekyll
rack
rake
Expand Down
24 changes: 0 additions & 24 deletions _plugins/coffeescript_converter.rb

This file was deleted.

68 changes: 0 additions & 68 deletions scripts/main.coffee

This file was deleted.

80 changes: 80 additions & 0 deletions scripts/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
(function() {
function setMessage() {
var messages = $('.message-bar > h1');

if ($('.message-bar').length > 0) {
var randomMessageIndex = Math.floor(Math.random() * messages.length);
for (var i = 0; i < messages.length; i++) {
$(messages[i]).hide();

if (i === randomMessageIndex) {
$(messages[i]).show();
}
}
}
}

function setAbout() {
if ($('.about-content').length > 0) {
// i do
var iWrite = $('#i-write > li');
var iLike = $('#i-like > li');
var iUse = $('#i-use > li');

iWrite.hide();
iLike.hide();
iUse.hide();

iWrite = _.shuffle(iWrite);
iLike = _.shuffle(iLike);
iUse = _.shuffle(iUse);

rotateItemList(iWrite, 0, .65);
rotateItemList(iLike, 250, .65);
rotateItemList(iUse, 500, .65);

// i live
var myWife = $('#my-wife > li');
var myCorgi = $('#my-corgi > li');
var myCat = $('#my-cat > li');

myWife.hide();
myCorgi.hide();
myCat.hide();

myWife = _.shuffle(myWife);
myCorgi = _.shuffle(myCorgi);
myCat = _.shuffle(myCat);

rotateItemList(myWife, 0, 0);
rotateItemList(myCorgi, 0, 0);
rotateItemList(myCat, 0, 0);

// my work
var myWork = $('#my-work > li');
myWork.hide();
myWork = _.shuffle(myWork);
rotateItemList(myWork, 0, 0);
}
}

function rotateItemList(itemList, delay, duration) {
setTimeout(function() {
$(itemList[0]).css("top", -$(itemList[0]).height());
$(itemList[0]).show();
TweenLite.to($(itemList[itemList.length - 1]), duration, {css:{top:$(itemList[0]).height()}, ease:Back.easeInOut, onComplete:hideItem, onCompleteParams:[$(itemList[itemList.length - 1])]});
TweenLite.to($(itemList[0]), duration, {css:{top:0}, ease:Back.easeInOut});
itemList.push(itemList.splice(0, 1)[0]);
rotateItemList(itemList, (Math.random() * 5000) + 2000, .65);
}, delay);
}

function hideItem(item) {
$(item).hide();
}

$(document).ready(function() {
setMessage();
setAbout();
});
}).call(this);

0 comments on commit bb297ea

Please sign in to comment.