Skip to content

Commit

Permalink
Merge pull request #2983 from schalkneethling/bug1164572-update-logo-…
Browse files Browse the repository at this point in the history
…and-header-wom

Fix Bug 1164572, add higher res hero image and SVG logo with fallback
  • Loading branch information
Schalk Neethling committed May 14, 2015
2 parents d151a02 + 53cdd45 commit bf44229
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 2 deletions.
6 changes: 5 additions & 1 deletion bedrock/mozorg/templates/mozorg/contribute/friends.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
{% block contrib_page_title %}{{ _('Join Firefox Friends today!') }}{% endblock %}

{% block alt_header %}
<img src="{{ static('img/contribute/friends/firefox-friends-logo.png') }}" width="186" class="ff-logo" alt="{{_('Firefox Friends logo')}}" />
<img src="{{ static('img/contribute/friends/firefox-friends-logo.svg') }}" width="186" class="ff-logo" data-png="{{ static('img/contribute/friends/firefox-friends-logo.png') }}" data-fallback="true" alt="{{_('Firefox Friends logo')}}" />
<div class="ff-header-content">
<h1>{{_('Join Firefox Friends today!')}}</h1>
<p>{{_('Step to the frontline to help us tell the world how awesome Firefox is and about all the important work Mozilla does every day.')}}</p>
Expand Down Expand Up @@ -52,3 +52,7 @@ <h3 class="rewarded">{{_('Get rewarded')}}</h3>
{% endblock contrib_content %}

{% block contrib_footer %}{% endblock contrib_footer %}

{% block site_js %}
{% javascript 'contribute-friends' %}
{% endblock %}
7 changes: 7 additions & 0 deletions bedrock/settings/static_media.py
Original file line number Diff line number Diff line change
Expand Up @@ -970,6 +970,13 @@
),
'output_filename': 'js/contribute-form-bundle.js',
},
'contribute-friends': {
'source_filenames': (
'js/libs/jquery-1.11.0.min.js',
'js/mozorg/contribute/friends.js',
),
'output_filename': 'js/contribute-friends-bundle.js'
},
'contribute-studentambassadors-landing': {
'source_filenames': (
'js/base/social-widgets.js',
Expand Down
3 changes: 2 additions & 1 deletion media/css/mozorg/contribute/friends.less
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
width: 100%;
}
#masthead {
background: #373737 url(/media/img/contribute/friends/header-img-wide.jpg) 50% 0 no-repeat;
background: #373737 url(/media/img/contribute/friends/hero-image-home.jpg) 50% 0 no-repeat;
padding: 0 180px;
width: 100%;
.border-box();
Expand All @@ -24,6 +24,7 @@
}

@media only screen and (max-width: @breakMobileLandscape) {
background-image: url(/media/img/contribute/friends/hero-image-home-mobile.jpg);
padding: 0 20px;
}
}
Expand Down
1 change: 1 addition & 0 deletions media/img/contribute/friends/firefox-friends-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed media/img/contribute/friends/header-img-wide.jpg
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/img/contribute/friends/hero-image-home.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions media/js/mozorg/contribute/friends.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
$(function() {

function supportsSVG() {
return document.implementation.hasFeature('http://www.w3.org/TR/SVG11/feature#Image', '1.1');
}

// fallback to .png for browsers that don't support .svg as an image.
if (!supportsSVG()) {
$('img[src*="svg"][data-fallback="true"]').attr('src', function() {
return $(this).attr('data-png');
});
}
});

0 comments on commit bf44229

Please sign in to comment.