Permalink
Browse files

added songs

  • Loading branch information...
andy andy
andy authored and andy committed Dec 21, 2012
1 parent 538a567 commit 82e833d02c3edd38b3baa2bb9ee39c2b3436e02a
View
BIN .DS_Store
Binary file not shown.
View
@@ -7,7 +7,9 @@ gem 'rails', '3.2.6'
gem 'sqlite3'
-# Gems used only for assets and not required
+gem "therubyracer"
+gem "less-rails" #Sprockets (what Rails 3.1 uses for its asset pipeline) supports LESS
+gem "twitter-bootstrap-rails"# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', '~> 3.2.3'
View
@@ -37,6 +37,7 @@ GEM
coffee-script-source
execjs
coffee-script-source (1.4.0)
+ commonjs (0.2.6)
erubis (2.7.0)
execjs (1.4.0)
multi_json (~> 1.0)
@@ -47,6 +48,12 @@ GEM
railties (>= 3.1.0, < 5.0)
thor (~> 0.14)
json (1.7.5)
+ less (2.2.2)
+ commonjs (~> 0.2.6)
+ less-rails (2.2.6)
+ actionpack (>= 3.1)
+ less (~> 2.2.0)
+ libv8 (3.3.10.4)
mail (2.4.4)
i18n (>= 0.4.0)
mime-types (~> 1.16)
@@ -89,11 +96,17 @@ GEM
rack (~> 1.0)
tilt (~> 1.1, != 1.3.0)
sqlite3 (1.3.6)
+ therubyracer (0.10.2)
+ libv8 (~> 3.3.10)
thor (0.16.0)
tilt (1.3.3)
treetop (1.4.12)
polyglot
polyglot (>= 0.3.1)
+ twitter-bootstrap-rails (2.1.6)
+ actionpack (>= 3.1)
+ execjs
+ railties (>= 3.1)
tzinfo (0.3.35)
uglifier (1.3.0)
execjs (>= 0.3.0)
@@ -105,7 +118,10 @@ PLATFORMS
DEPENDENCIES
coffee-rails (~> 3.2.1)
jquery-rails
+ less-rails
rails (= 3.2.6)
sass-rails (~> 3.2.3)
sqlite3
+ therubyracer
+ twitter-bootstrap-rails
uglifier (>= 1.0.3)
View
Binary file not shown.
@@ -12,4 +12,5 @@
//
//= require jquery
//= require jquery_ujs
+//= require twitter/bootstrap
//= require_tree .
@@ -0,0 +1,4 @@
+jQuery ->
+ $("a[rel=popover]").popover()
+ $(".tooltip").tooltip()
+ $("a[rel=tooltip]").tooltip()
@@ -9,13 +9,17 @@ playlistHandler = ->
totalTracks = $(".song").length
$(".song").click ->
+ console.log($(this).attr('data-track'))
if $(".mp3player").attr('data-current') == $(this).attr('data-track') && $(".mp3player")[0].paused == false
+ console.log("clicked current track playing. it should pause")
turnOffSongImage()
pausePlayer()
else if $(".mp3player").attr('data-current') == $(this).attr('data-track')
+ console.log("clicked current track playing. it should unpause")
turnOnSongImage($(this).attr('data-track'))
unPausePlayer()
else
+ console.log("clicked track not playing. should start playing")
turnOffSongImage()
playSong($(this).attr('data-track'))
@@ -38,15 +42,18 @@ playlistHandler = ->
turnOffSongImage = ->
trackNumber = $(".mp3player").attr('data-current')
- $("img[id=#{trackNumber}]").attr('src', "/assets/play_button_black.png")
+ trackNumber ||= "boom"
+ $("img#" + trackNumber + ".play").attr('src', "/assets/play_button_black.png")
turnOnSongImage = (trackNumber) ->
- $("img[id=#{trackNumber}]").attr('src', "/assets/play_button_white.png")
+ $("img#" + trackNumber + ".play").attr('src', "/assets/play_button_white.png")
pausePlayer = ->
- $(".mp3player")[0].pause();
+ console.log("stoppin")
+ $(".mp3player").trigger('stop');
unPausePlayer = ->
- $(".mp3player")[0].play();
+ console.log("playin")
+ $(".mp3player").trigger('play');
View
Binary file not shown.
@@ -0,0 +1,31 @@
+@import "twitter/bootstrap/bootstrap";
+@import "twitter/bootstrap/responsive";
+
+// Set the correct sprite paths
+@iconSpritePath: asset-path("twitter/bootstrap/glyphicons-halflings");
+@iconWhiteSpritePath: asset-path("twitter/bootstrap/glyphicons-halflings-white");
+
+// Set the Font Awesome (Font Awesome is default. You can disable by commenting below lines)
+// Note: If you use asset_path() here, your compiled boostrap_and_overrides.css will not
+// have the proper paths. So for now we use the absolute path.
+@fontAwesomeEotPath: asset-path("fontawesome-webfont.eot");
+@fontAwesomeWoffPath: asset-path("fontawesome-webfont.woff");
+@fontAwesomeTtfPath: asset-path("fontawesome-webfont.ttf");
+@fontAwesomeSvgPath: asset-path("fontawesome-webfont.svg");
+
+// Font Awesome
+@import "fontawesome";
+
+// Glyphicons
+//@import "twitter/bootstrap/sprites.less";
+
+// Your custom LESS stylesheets goes here
+//
+// Since bootstrap was imported above you have access to its mixins which
+// you may use and inherit here
+//
+// If you'd like to override bootstrap's own variables, you can do so here as well
+// See http://twitter.github.com/bootstrap/customize.html#variables for their names and documentation
+//
+// Example:
+// @linkColor: #ff0000;
@@ -3,12 +3,19 @@
// You can use Sass (SCSS) here: http://sass-lang.com/
+#whale-container { display: block; float: left; margin: 6% 0 0 6%; }
+#song-container { display: block; float: left; margin: 10% 0 50px 12px;}
+
+#whale-img { max-width: 450px; width: 100%;}
+
+#album { max-height: 75px; margin: 20px auto 50px auto; display: block;}
+
+#songs { list-style-type: none; float: left;}
+
+.songname { max-height: 55px; width: 70%; margin-left: 10px; display: inline-block;}
+.play { height: 55px; display: inline-block;}
+.download { height: 55px; display: inline-block;}
+
+#credits { width: 70%; margin-left: auto; margin-right: auto; display: block;}
-#songs { list-style-type: none; }
-#whale-container { float: left; display: inline; padding-top: 15px; width: 400px; }
-#whale-img { width: 450px; margin-top: 75px; }
-#song-container { width: 850px; display:inline; float: right;}
-.songname { height: 65px; margin-left: 10px;}
-#footer { width: 800px; margin-left: 175px; margin-top: 60px;}
-#album { margin-left: 100px; margin-bottom: 15px;}
.mp3player { display: none;}
@@ -1,2 +1,7 @@
class WelcomeController < ApplicationController
+
+ def download
+ song_name = params[:song_name]
+ send_file("public/assets/songs/#{song_name}.mp3")
+ end
end
@@ -1,45 +1,68 @@
-<div id="container">
- <div id="whale-container">
+<%= link_to "Download", "/assets/six.mp3", :target => "blank" %>
+<div id="container row-fluid show-grid">
+ <div id="whale-container" class="span5">
<%= image_tag "whale.png", :id => "whale-img" %>
</div>
- <div id="song-container">
- <%= image_tag "album.png", :width => "550px", :id => "album" %>
+ <div id="song-container" class="span7">
+ <%= image_tag "album.png", :id => "album" %>
<ul id="songs">
<li>
- <a class="song" data-track="1" data-song="https://s3.amazonaws.com/personalsitesongs/01+A+Song+For+Our+Fathers.mp3" data-title="A Song For Our Fathers">
- <%= image_tag "play_button_black.png", :id => "1" %>
- <%= image_tag "download.png" %>
- <%= image_tag "frog_pie.png", :class => "songname" %>
- </a>
+ <%= link_to image_tag("play_button_black.png", :class => "play", :id => "1"),
+ "#", :class => "song", :data => {:track => "1",
+ :song => "/assets/songs/Frog_Pie.mp3"} %>
+
+ <%= link_to image_tag("download.png", :class => "download"), {:controller => "welcome", :action => "download", :song_name => "Frog_Pie" }%>
+
+ <%= link_to image_tag("frog_pie.png", :class => "songname", :id => "1"),
+ "#", :class => "song", :data => {:track => "1",
+ :song => "/assets/songs/Frog_Pie.mp3"} %>
</li>
<li>
- <a class="song" data-track="2" data-song="https://s3.amazonaws.com/personalsitesongs/03+Tribulations.mp3" data-title="Tribulations">
- <%= image_tag "play_button_black.png", :id => "2" %>
- <%= image_tag "selfish.png", :class => "songname" %>
- </a>
+ <%= link_to image_tag("play_button_black.png", :class => "play", :id => "2"),
+ "#", :class => "song", :data => {:track => "2",
+ :song => "/assets/songs/I_Know_This_Is_Selfish_But.mp3"} %>
+
+ <%= link_to image_tag("download.png", :class => "download"), {:controller => "welcome", :action => "download", :song_name => "I_Know_This_Is_Selfish_But" }%>
+
+ <%= link_to image_tag("selfish.png", :class => "songname", :id => "2"),
+ "#", :class => "song", :data => {:track => "2",
+ :song => "/assets/songs/I_Know_This_Is_Selfish_But.mp3"} %>
</li>
<li>
- <a class="song" data-track="3" data-song="https://s3.amazonaws.com/personalsitesongs/05+Phoney+Phranchise+(Domino+Remix).mp3" data-title="Phoney Phranchise">
- <%= image_tag "play_button_black.png", :id => "3" %>
- <%= image_tag "recollection.png", :class => "songname" %>
- </a>
+ <%= link_to image_tag("play_button_black.png", :class => "play", :id => "3"),
+ "#", :class => "song", :data => {:track => "3",
+ :song => "/assets/songs/Your_Recollection_Not_Mine.mp3"} %>
+
+ <%= link_to image_tag("download.png", :class => "download"), {:controller => "welcome", :action => "download", :song_name => "Your_Recollection_Not_Mine" }%>
+
+ <%= link_to image_tag("recollection.png", :class => "songname", :id => "3"),
+ "#", :class => "song", :data => {:track => "3",
+ :song => "/assets/songs/Your_Recollection_Not_Mine.mp3"} %>
</li>
<li>
- <a class="song" data-track="4" data-song="https://s3.amazonaws.com/personalsitesongs/05+Phoney+Phranchise+(Domino+Remix).mp3" data-title="Phoney Phranchise">
- <%= image_tag "play_button_black.png", :id => "4" %>
- <%= image_tag "formal_leftovers.png", :class => "songname" %>
- </a>
+ <%= link_to image_tag("play_button_black.png", :class => "play", :id => "4"),
+ "#", :class => "song", :data => {
+ :track => "4",
+ :song => "/assets/songs/Formal_Leftovers.mp3"} %>
+
+ <%= link_to image_tag("download.png", :class => "download"), {:controller => "welcome", :action => "download", :song_name => "Formal_Leftovers" }%>
+
+ <%= link_to image_tag("formal_leftovers.png", :class => "songname", :id => "4"),
+ "#", :class => "song", :data => {
+ :track => "4",
+ :song => "/assets/songs/Formal_Leftovers.mp3",
+ :title => "Phoney Phranchise"} %>
</li>
</ul>
</div>
<div id="footer">
- <%= image_tag "credits.png", :id => "credits" %>
+ <%= image_tag "credits.png", :id =>"credits" %>
</div>
</div>
- <audio class="mp3player" width="300" height="32" src="" controls="controls" data-current="" preload="auto" autoplay="false" autobuffer=""></audio>
+ <audio id="player" class="mp3player" width="300" height="32" src="" controls="controls" data-current="" preload="auto" autoplay="false" autobuffer=""></audio>
<!-- <button onclick="document.getElementById('player').play()">Play</button>
-->
View
@@ -3,6 +3,7 @@
resources :welcome, :only => [:index]
root :to => 'welcome#index'
+ match 'welcome/download' => 'welcome#download', :as => :download
# The priority is based upon order of creation:
# first created -> highest priority.
View
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
Binary file not shown.
View
Binary file not shown.
View
@@ -0,0 +1,20 @@
+---
+album.png: album-1e6089ecc1a762af11c69ebd0de0f2f6.png
+credits.png: credits-b587134c2497ff03ee8af4b60680d03f.png
+download.png: download-84b55eb3bba6d1cf58bc6febf4b017b3.png
+formal_leftovers.png: formal_leftovers-53734abd1a72f6767724c329161d9990.png
+frog_pie.png: frog_pie-547e58bffdc2fc73eeb7e611b3c041ef.png
+play_button_black.png: play_button_black-be41f17abfbb4111fd6dc75fa0b8a93e.png
+play_button_white.png: play_button_white-6ed267ba0042fb391e19bfcbcfeba96e.png
+recollection.png: recollection-9cff0d83cc44fc8f7386d835cd9c5d31.png
+selfish.png: selfish-d715e33e1aef216a9f5dbd8a4afab58f.png
+whale.png: whale-267d810a3b742d8b5553f6c6d6ac9be1.png
+application.js: application-2444276d49cb79de2ffef8ec42847896.js
+six.mp3: six-55c2ff44b35db22683473227fc14196b.mp3
+application.css: application-6af154fe0a1395fa5d6f2dad2b8c0e70.css
+fontawesome-webfont.eot: fontawesome-webfont-7cf1b0de49e2f8672c9ad6d9e382115f.eot
+fontawesome-webfont.svg: fontawesome-webfont-4d19fdd70a080778557b652cb4868557.svg
+fontawesome-webfont.ttf: fontawesome-webfont-1e29be0bb354c9f664cbca7df9a966d8.ttf
+fontawesome-webfont.woff: fontawesome-webfont-9c0e35b95bf9cea29c77678ebf71a29d.woff
+twitter/bootstrap/glyphicons-halflings-white.png: twitter/bootstrap/glyphicons-halflings-white-13553a5bf21ae3cc374006592488ec64.png
+twitter/bootstrap/glyphicons-halflings.png: twitter/bootstrap/glyphicons-halflings-ab3144065a860d198f1d7d9a4882640c.png
Binary file not shown.
Binary file not shown.
Binary file not shown.
View
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
View
Binary file not shown.

0 comments on commit 82e833d

Please sign in to comment.