Skip to content

Commit

Permalink
optimized sprites
Browse files Browse the repository at this point in the history
- move mobile icons to mobile-folder, so they aren't included in the
  icons-sprite
- move logos to branding/logos, and create a logos-sprite without the
  big other branding-images
- delete duplicate images

closes #6004
  • Loading branch information
SuperTux88 authored and jhass committed May 29, 2015
1 parent 247e9ef commit 604ffb4
Show file tree
Hide file tree
Showing 58 changed files with 50 additions and 49 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public/500.html

# Sprites
app/assets/images/branding-*.png
app/assets/images/branding/logos-*.png
app/assets/images/icons-*.png
app/assets/images/social_media_logos-*.png

Expand Down
1 change: 1 addition & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
* Improve the logging of Eyes output [#5989](https://github.com/diaspora/diaspora/pull/5989)
* Gracefully handle XML parse errors within federation [#5991](https://github.com/diaspora/diaspora/pull/5991)
* Remove zip-zip workaround gem [#6001](https://github.com/diaspora/diaspora/pull/6001)
* Cleanup and reorganize image assets [#6004](https://github.com/diaspora/diaspora/pull/6004)

## Bug fixes
* Disable auto follow back on aspect deletion [#5846](https://github.com/diaspora/diaspora/pull/5846)
Expand Down
Binary file removed app/assets/images/branding/asterisk.png
Binary file not shown.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Binary file removed app/assets/images/icons/deletelabel.png
Binary file not shown.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
2 changes: 1 addition & 1 deletion app/assets/stylesheets/footer.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ footer {
border-top: 1px solid $border-grey;
}

.branding-powered_by_diaspora {
.logos-powered_by_diaspora {
display: inline-block;
margin-top: 3px;
height: 11px;
Expand Down
16 changes: 8 additions & 8 deletions app/assets/stylesheets/mobile/mobile.scss
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ code {

body {
background: {
image: image-url('texture/hatched-light.jpg');
image: image-url("mobile/hatched-light.jpg");
position: fixed;
/* scale background image down for iOS retina display */
size: 200px;
Expand Down Expand Up @@ -398,7 +398,7 @@ h3 {
right: 14px;
}
background: {
image: image-url("icons/arrow_down_small.png");
image: image-url("mobile/arrow_down_small.png");
position: center right;
repeat: no-repeat;
}
Expand Down Expand Up @@ -486,23 +486,23 @@ h3 {
}

.reshare_action {
background-image: image-url("icons/reshare_mobile.png");
background-image: image-url("mobile/reshare_mobile.png");
&.active {
background-image: image-url("icons/reshare_mobile_active.png");
background-image: image-url("mobile/reshare_mobile_active.png");
}
}

.like_action {
background-image: image-url("icons/heart_mobile_grey.png");
background-image: image-url("mobile/heart_mobile_grey.png");
&.active {
background-image: image-url("icons/heart_mobile_red.png");
background-image: image-url("mobile/heart_mobile_red.png");
}
}

.comment_action.image_link {
background-image: image-url("icons/pencil_mobile_grey_active.png");
background-image: image-url("mobile/pencil_mobile_grey_active.png");
&.inactive {
background-image: image-url("icons/pencil_mobile_grey.png");
background-image: image-url("mobile/pencil_mobile_grey.png");
}
}

Expand Down
2 changes: 1 addition & 1 deletion app/assets/stylesheets/new_styles/_login.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#reset_password {
padding-top: 25px;

.branding-asterisk {
.logos-asterisk {
margin: auto;
width: 154px;
height: 154px;
Expand Down
4 changes: 2 additions & 2 deletions app/assets/stylesheets/sprites.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* ===== sprites ===== */
@import 'icons/*.png';
@import 'branding/*.png';
@import 'branding/logos/*.png';
@import 'social_media_logos/*.png';
@include all-icons-sprites;
@include all-branding-sprites;
@include all-logos-sprites;
@include all-social_media_logos-sprites;
2 changes: 1 addition & 1 deletion app/assets/templates/header_tpl.jst.hbs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div class="container" style="position:relative;">

<a href="/stream">
<div alt="Logo_small" class="diaspora_header_logo branding-header-logo">
<div alt="logo" class="diaspora_header_logo logos-header-logo">
</div>
</a>

Expand Down
9 changes: 4 additions & 5 deletions app/helpers/open_graph_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ def og_general_tags
def og_page_post_tags(post)
tags = og_common_tags


if post.message
tags.concat [
*tags,
Expand All @@ -63,7 +62,7 @@ def og_page_post_tags(post)
og_description(post.message.plain_text_without_markdown truncate: 1000)
]
end

tags.join("\n").html_safe
end

Expand Down Expand Up @@ -96,10 +95,10 @@ def oembed_image_tag(cache, prefix)

# This method compensates for hosting assets off of s3
def default_image_url
if image_path('asterisk.png').include?("http")
image_path('asterisk.png')
if image_path("branding/logos/asterisk.png").include?("http")
image_path("branding/logos/asterisk.png")
else
"#{root_url.chop}#{image_path('asterisk.png')}"
"#{root_url.chop}#{image_path('branding/logos/asterisk.png')}"
end
end
end
2 changes: 1 addition & 1 deletion app/views/comments/_comment.mobile.haml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
.remove_comment
.right
- if user_signed_in? && comment.author == current_user.person
= link_to(image_tag('deletelabel.png'), comment_path(comment), :method => :delete, :data => { :confirm => "#{t('are_you_sure')}" }, :class => "remove")
= link_to(image_tag("mobile/deletelabel.png"), comment_path(comment), method: :delete, data: { confirm: "#{t('are_you_sure')}" }, class: "remove")
.from
= person_image_link(comment.author)
= person_link(comment.author)
Expand Down
2 changes: 1 addition & 1 deletion app/views/conversations/_show.mobile.haml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
.conversation_participants
.right
= link_to(image_tag('deletelabel.png'), conversation_visibility_path(conversation), :method => 'delete', :data => { :confirm => "#{t('.delete')}?" }, :class => "remove")
= link_to(image_tag("mobile/deletelabel.png"), conversation_visibility_path(conversation), method: :delete, data: { confirm: "#{t('.delete')}?" }, class: "remove")

%h3{ :class => direction_for(conversation.subject) }
= conversation.subject
Expand Down
2 changes: 1 addition & 1 deletion app/views/devise/passwords/edit.haml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#reset_password
.container-fluid
.text-center
.branding-asterisk
.logos-asterisk
%h1
= AppConfig.settings.pod_name

Expand Down
2 changes: 1 addition & 1 deletion app/views/devise/passwords/new.haml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#forgot_password
.container-fluid
.text-center
.branding-asterisk
.logos-asterisk
%h1
= AppConfig.settings.pod_name

Expand Down
2 changes: 1 addition & 1 deletion app/views/errors/error_500.haml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
We're sorry, but something went wrong (500)

%header
= image_tag "branding/white2x.png", id: "diaspora_logo"
= image_tag "branding/logos/white2x.png", id: "diaspora_logo"

%h1
500: Internal server error.
Expand Down
8 changes: 4 additions & 4 deletions app/views/home/default.haml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#page.container
%header#header
%a#login-link.btn{href: "login"} Log In
= image_tag "branding/logo.png"
= image_tag "branding/logos/logo.png"

#banner.row
%h1 Welcome, friend.
Expand All @@ -15,7 +15,7 @@
%h2
Configure your
%abbr.helpful{title: "A Diaspora installation"} pod
= image_tag "icons/cog.png"
= image_tag "landing/cog.png"

%p
Look at
Expand All @@ -28,15 +28,15 @@

.span4
%h2 Try it out
= image_tag "icons/smiley_laughing.png"
= image_tag "landing/smiley_laughing.png"

%p
Start by
= link_to "creating an account", new_user_registration_path

.span4
%h2 Make a contribution!
= image_tag "icons/pen_write.png"
= image_tag "landing/pen_write.png"

%p
Make Diaspora even better! Fork the project on
Expand Down
2 changes: 1 addition & 1 deletion app/views/layouts/_footer.html.haml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
%footer
.container
.branding-powered_by_diaspora
.logos-powered_by_diaspora
%ul#footer_nav
= render :partial =>'shared/links'
2 changes: 1 addition & 1 deletion app/views/layouts/_header.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
%header
- unless current_user
.container{style: "position:relative;"}
= link_to content_tag(:div, nil, class: 'diaspora_header_logo branding-header-logo'), root_path
= link_to content_tag(:div, nil, class: 'diaspora_header_logo logos-header-logo'), root_path

%ul#landing_nav
- if AppConfig.settings.enable_registrations? && !current_page?(controller: '/registrations', action: :new)
Expand Down
10 changes: 5 additions & 5 deletions app/views/layouts/application.mobile.haml
Original file line number Diff line number Diff line change
Expand Up @@ -54,21 +54,21 @@
#nav_badges
-# Notifications
= link_to notifications_path, class: "badge", id: "notification_badge" do
= image_tag('icons/notifications_white.png')
= image_tag("mobile/notifications_white.png")
- if current_user.unread_notifications.size > 0
%span.badge_count{id: "notification"}
= current_user.unread_notifications.size
-# Conversations
= link_to conversations_path, class: "badge", id: "conversations_badge" do
= image_tag('icons/mail_white.png', id: 'conversation_icon')
= image_tag("mobile/mail_white.png", id: "conversation_icon")
- if current_user.unread_message_count > 0
%span.badge_count{id: "conversation"}
= current_user.unread_message_count
-# Publisher
= link_to(image_tag('icons/compose_mobile.png'), new_status_message_path, class: "badge", id: "compose_badge")
= link_to(image_tag("mobile/compose_mobile.png"), new_status_message_path, class: "badge", id: "compose_badge")
-# Menu
= link_to(image_tag('icons/menu.png'), "#", id: "menu_badge", class: "badge")
= link_to(image_tag('icons/asterisk_white_mobile.png'), stream_path, id: 'header_title')
= link_to(image_tag("mobile/menu.png"), "#", id: "menu_badge", class: "badge")
= link_to(image_tag("mobile/asterisk_white_mobile.png"), stream_path, id: "header_title")

- if user_signed_in?
#drawer
Expand Down
2 changes: 1 addition & 1 deletion app/views/layouts/notifier.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<table cellspacing="0" cellpadding="0" border="0" align="center" width="100%" style="font-family:'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:14px;color:#333;">
<tr>
<td style="text-align:center;padding:30px;">
<img src="<%=AppConfig.pod_uri.to_s %>assets/branding/logo_small.png" alt="diaspora*" width="59px" height="14px"/>
<img src="<%=AppConfig.pod_uri.to_s %>assets/branding/logos/logo_small.png" alt="diaspora*" width="59px" height="14px"/>
</td>
</tr>
</table>
Expand Down
4 changes: 2 additions & 2 deletions app/views/photos/show.mobile.haml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
%tr
%td
- if previous_photo != additional_photos.last
= link_to(image_tag('arrow-left.png', :id => 'arrow-left'), person_photo_path(previous_photo.author, previous_photo), :rel => 'prefetch', :class => 'arrow', :id => 'left')
= link_to(image_tag("mobile/arrow-left.png", id: "arrow-left"), person_photo_path(previous_photo.author, previous_photo), rel: "prefetch", class: "arrow", id: "left")
%td{:width => '100%'}
%td
- if next_photo == additional_photos[additional_photos.index(photo)+1]
= link_to(image_tag('arrow-right.png', :id => 'arrow-right'), person_photo_path(next_photo.author, next_photo), :rel => 'prefetch', :class => 'arrow', :id => 'right')
= link_to(image_tag("mobile/arrow-right.png", id: "arrow-right"), person_photo_path(next_photo.author, next_photo), rel: "prefetch", class: "arrow", id: "right")
4 changes: 2 additions & 2 deletions app/views/publisher/_publisher.mobile.haml
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@
- current_user.aspects.each do |aspect|
%option{:value => aspect.id}
= "· #{aspect.name}"

.clear
#publisher_textarea_wrapper
%ul#photodropzone
#fileInfo-publisher

#file-upload-publisher{:title => t('shared.publisher.upload_photos'), :class => 'btn'}
= image_tag 'icons/camera.png', alt: t('shared.publisher.upload_photos').titleize
= image_tag "mobile/camera.png", alt: t("shared.publisher.upload_photos").titleize
#publisher_mobile
= submit_tag t('shared.publisher.share'), :class => 'btn primary', :id => "submit_new_message"

Expand Down
2 changes: 1 addition & 1 deletion app/views/registrations/new.mobile.haml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
= form_for(resource, :as => resource_name, :html => {:class => 'new_user_form'}, :url => registration_path(resource_name)) do |f|
%fieldset
%legend
= image_tag('branding/header-logo2x.png', :height => 40, :width => 40)
= image_tag("branding/logos/header-logo2x.png", height: 40, width: 40)
= t('aspects.aspect_stream.make_something')

.control-group
Expand Down
2 changes: 1 addition & 1 deletion app/views/sessions/new.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

.container-fluid#login
.text-center
.branding-asterisk
.logos-asterisk
%h1
= AppConfig.settings.pod_name

Expand Down
2 changes: 1 addition & 1 deletion app/views/sessions/new.mobile.haml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
= form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f|
%fieldset
%legend
= image_tag('branding/header-logo2x.png', :height => 40, :width => 40)
= image_tag("branding/logos/header-logo2x.png", height: 40, width: 40)
= t('devise.sessions.new.login')

.control-group
Expand Down
2 changes: 1 addition & 1 deletion app/views/shared/_post_info.mobile.haml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

.remove_post
- if user_signed_in? && post.author == current_user.person
= link_to(image_tag('deletelabel.png'), post_path(post), :method => :delete, :data => { :confirm => "#{t('are_you_sure')}" }, :class => "remove")
= link_to(image_tag("mobile/deletelabel.png"), post_path(post), method: :delete, data: { confirm: "#{t('are_you_sure')}" }, class: "remove")

.info
%span
Expand Down
8 changes: 4 additions & 4 deletions app/views/shared/_post_stats.mobile.haml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

%li.comment.add_comment_bottom_link_container
= link_to "#", class: "show_comments bottom_collapse active" do
= image_tag "icons/arrow_up_small.png"
- if user_signed_in?
= link_to t("comments.new_comment.comment"), new_post_comment_path(@post), class: "add_comment_bottom_link btn comment_action inactive"
= image_tag "mobile/arrow_up_small.png"

- if user_signed_in?
= link_to t("comments.new_comment.comment"), new_post_comment_path(@post), class: "add_comment_bottom_link btn comment_action inactive"
4 changes: 2 additions & 2 deletions app/views/users/getting_started.mobile.haml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
= text_field_tag 'profile[first_name]', current_user.first_name
= image_tag 'ajax-loader.gif', :id => "gs-name-form-spinner", :class => "hidden"
%span.saved{:class => "hidden"}
= image_tag 'icons/check_yes_ok.png'
= image_tag "mobile/check_yes_ok.png"
= t(".saved")

= label_tag :your_photo, t('profiles.edit.your_photo'), :class => "bootstrapped"
Expand All @@ -77,7 +77,7 @@
%fieldset
= label_tag 'follow_tags', t('.hashtag_suggestions'), :class => "bootstrapped"
= text_field_tag 'follow_tags', nil, :class => "nostrap"

.center
= link_to "#{t('.awesome_take_me_to_diaspora')} »", stream_path, :id => "awesome_button", :class => "button creation"

0 comments on commit 604ffb4

Please sign in to comment.