diff --git a/app/assets/stylesheets/base.css.scss b/app/assets/stylesheets/base.css.scss index 9b8fe7a..b7feb37 100644 --- a/app/assets/stylesheets/base.css.scss +++ b/app/assets/stylesheets/base.css.scss @@ -179,18 +179,6 @@ section::after { visibility: hidden; } -.play-button { - position: absolute; - left: 50%; - top: 50%; - width: 0; - - .arrow { - text-align: center; - font-weight: bold; - } -} - ul.delimited { border-bottom: 1px solid rgba(255, 255, 255, 0.7); border-top: 1px solid rgba(0, 0, 0, 0.12); diff --git a/app/assets/stylesheets/player.css.scss b/app/assets/stylesheets/player.css.scss new file mode 100644 index 0000000..c4c6948 --- /dev/null +++ b/app/assets/stylesheets/player.css.scss @@ -0,0 +1,5 @@ +/* +*= require normalize +*= require player/colors +*= require player/player +*/ diff --git a/app/assets/stylesheets/player/player.css.scss b/app/assets/stylesheets/player/player.css.scss index c30faae..0eed9ee 100644 --- a/app/assets/stylesheets/player/player.css.scss +++ b/app/assets/stylesheets/player/player.css.scss @@ -79,6 +79,11 @@ $color5: #EDC951; cursor: pointer; .play-button { + position: absolute; + left: 50%; + top: 50%; + width: 0; + .arrow { color: white; font-size: 140px; @@ -86,6 +91,8 @@ $color5: #EDC951; margin-left: -75px; margin-top: -100px; -webkit-font-smoothing: none; + text-align: center; + font-weight: bold; &:hover { text-shadow: 2px 2px 5px $main-color; diff --git a/app/controllers/asciicasts_controller.rb b/app/controllers/asciicasts_controller.rb index 950fc01..9725e39 100644 --- a/app/controllers/asciicasts_controller.rb +++ b/app/controllers/asciicasts_controller.rb @@ -1,7 +1,7 @@ class AsciicastsController < ApplicationController PER_PAGE = 15 - before_filter :load_resource, :only => [:show, :edit, :update, :destroy] + before_filter :load_resource, :only => [:show, :raw, :edit, :update, :destroy] before_filter :count_view, :only => [:show] before_filter :ensure_authenticated!, :only => [:edit, :update, :destroy] before_filter :ensure_owner!, :only => [:edit, :update, :destroy] @@ -50,7 +50,12 @@ class AsciicastsController < ApplicationController end end end + end + def raw + @asciicast = AsciicastDecorator.new(@asciicast) + @asciicast_author = UserDecorator.new(@asciicast.user) + render :layout => 'raw' end def edit diff --git a/app/views/asciicasts/raw.html.erb b/app/views/asciicasts/raw.html.erb new file mode 100644 index 0000000..c2ff8c7 --- /dev/null +++ b/app/views/asciicasts/raw.html.erb @@ -0,0 +1 @@ +<%= player @asciicast %> diff --git a/app/views/layouts/raw.html.erb b/app/views/layouts/raw.html.erb new file mode 100644 index 0000000..ecad73b --- /dev/null +++ b/app/views/layouts/raw.html.erb @@ -0,0 +1,25 @@ + + + + + <%= page_title %> + + + + + <%= stylesheet_link_tag "player", :media => "all" %> + <%= javascript_include_tag "application" %> + <%= javascript_include_tag "player" %> + + + + + + <%= yield %> + + diff --git a/config/routes.rb b/config/routes.rb index 69ffd58..d8d71c3 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -3,7 +3,11 @@ AsciiIo::Application.routes.draw do match "/browse" => "asciicasts#index", :as => :browse match "/browse/popular" => "asciicasts#popular", :as => :popular - resources :asciicasts, :path => 'a' + resources :asciicasts, :path => 'a' do + member do + get :raw + end + end match "/~:nickname" => "users#show", :as => :profile