forked from mozilla/bedrock
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d80b758
commit d080de3
Showing
9 changed files
with
282 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
{# | ||
This Source Code Form is subject to the terms of the Mozilla Public | ||
License, v. 2.0. If a copy of the MPL was not distributed with this | ||
file, You can obtain one at https://mozilla.org/MPL/2.0/. | ||
#} | ||
|
||
{% extends 'includes/banners/basic.html' %} | ||
|
||
{% block banner_id %}fundraising-banner{% endblock %} | ||
|
||
{% block banner_class %}c-banner-fundraising{% endblock %} | ||
|
||
{% if LANG =="de" %} | ||
{% set banner_title = 'Giving Tuesday: Spende jetzt an Mozilla' %} | ||
{% set banner_tagline = 'Gemeinsam können wir das Internet von Tech-Riesen zurückerobern. Jetzt spenden.' %} | ||
{% set banner_button_a = 'Spenden' %} | ||
{% set banner_button_b = 'Jetzt spenden' %} | ||
{% set banner_button_c = 'Beitragen' %} | ||
{% elif LANG == "fr" %} | ||
{% set banner_title = 'Soutenez Mozilla pour le Giving Tuesday' %} | ||
{% set banner_tagline = 'Ensemble, nous pouvons empêcher les géants de la tech de s’accaparer Internet.' %} | ||
{% set banner_button_a = 'Je fais un don' %} | ||
{% set banner_button_b = 'Je fais un geste' %} | ||
{% set banner_button_c = 'Je fais une contribution' %} | ||
{% else %} | ||
{% set banner_title = 'Donate to Mozilla for Giving Tuesday' %} | ||
{% set banner_tagline = 'Together we can reclaim the internet from Big Tech. Donate now.' %} | ||
{% set banner_button_a = 'Donate' %} | ||
{% set banner_button_b = 'Give now' %} | ||
{% set banner_button_c = 'Contribute' %} | ||
{% endif %} | ||
|
||
{% if variant == "a" %} | ||
{% set banner_link = 'https://foundation.mozilla.org/?form=gt-banner-a' %} | ||
{% set banner_button = banner_button_a %} | ||
{% set banner_ga_label = 'Donate' %} | ||
{% elif variant == "b" %} | ||
{% set banner_link = 'https://foundation.mozilla.org/?form=gt-banner-b' %} | ||
{% set banner_button = banner_button_b %} | ||
{% set banner_ga_label = 'Give now' %} | ||
{% elif variant == "c" %} | ||
{% set banner_link = 'https://foundation.mozilla.org/?form=gt-banner-c' %} | ||
{% set banner_button = banner_button_c %} | ||
{% set banner_ga_label = 'Contribute' %} | ||
{% else %} | ||
{% set banner_button = banner_button_a %} | ||
{% set banner_ga_label = 'Donate' %} | ||
{% set banner_link = 'https://foundation.mozilla.org/?form=gt-banner-d' %} | ||
{% endif %} | ||
|
||
{% block banner_content %} | ||
<div class="mzp-l-content mzp-t-content-xl"> | ||
<div class="c-banner-inner"> | ||
<div class="c-banner-copy"> | ||
<h2 class="c-banner-title">{{ banner_title }}</h2> | ||
<p class="c-banner-tagline">{{ banner_tagline }}</p> | ||
<a class="c-banner-button mzp-c-button mzp-t-lg" href="{{ banner_link }}" data-cta-text="{{ banner_ga_label }}"> | ||
{{ banner_button }} | ||
</a> | ||
</div> | ||
{{ picture( | ||
url='img/banners/fundraiser/eoy-2024-photo-200.png', | ||
sources=[ | ||
{ | ||
'media': '(min-width: 688px)', | ||
'srcset': { | ||
'img/banners/fundraiser/eoy-2024-photo-200.png': '200w', | ||
'img/banners/fundraiser/eoy-2024-photo-200.png': '400w', | ||
} | ||
}, | ||
{ | ||
'media': '(max-width: 687px)', | ||
'srcset': { | ||
'img/placeholder.png': 'default' | ||
} | ||
} | ||
], | ||
optional_attributes={ | ||
'height': '200', | ||
'width': '200', | ||
'class': 'c-banner-media' | ||
} | ||
) }} | ||
</div> | ||
</div> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
// This Source Code Form is subject to the terms of the Mozilla Public | ||
// License, v. 2.0. If a copy of the MPL was not distributed with this | ||
// file, You can obtain one at https://mozilla.org/MPL/2.0/. | ||
|
||
$font-path: '/media/protocol/fonts'; | ||
$image-path: '/media/protocol/img'; | ||
|
||
@import '~@mozilla-protocol/core/protocol/css/includes/lib'; | ||
@import 'includes/basic'; | ||
|
||
.c-banner-fundraising { | ||
background: $color-green-20; | ||
color: $color-black; | ||
|
||
.mzp-l-content { | ||
padding-top: $spacing-md; | ||
padding-bottom: $spacing-md; | ||
} | ||
|
||
.c-banner-title { | ||
color: $color-black; | ||
display: block; | ||
width: auto; | ||
margin-bottom: $spacing-sm; | ||
@include text-display-md; | ||
} | ||
|
||
.c-banner-tagline { | ||
margin-bottom: $spacing-md; | ||
@include text-body-md; | ||
} | ||
|
||
.c-banner-media { | ||
display: none; | ||
} | ||
|
||
.c-banner-button { | ||
background-color: $color-green-80; | ||
border-color: $color-green-80; | ||
margin: 0; | ||
width: 100%; | ||
@include text-body-lg; | ||
|
||
&::after { | ||
@include bidi(((content, ' ♥', '♥ '),)); | ||
} | ||
|
||
&:hover, | ||
&:focus { | ||
background-color: $color-green-90; | ||
border-color: $color-green-90; | ||
color: $color-white; | ||
} | ||
} | ||
|
||
.c-banner-close { | ||
background-image: url('#{$image-path}/icons/close.svg'); | ||
} | ||
|
||
@media #{$mq-md} { | ||
.c-banner-inner { | ||
align-items: center; | ||
display: flex; | ||
flex-flow: row nowrap; | ||
gap: 48px; | ||
justify-content: space-between; | ||
} | ||
|
||
.c-banner-copy { | ||
flex: 1 1 auto; | ||
} | ||
|
||
.c-banner-tagline { | ||
@include text-body-lg; | ||
} | ||
|
||
picture { | ||
display: block; | ||
flex: 0 0 200px; | ||
} | ||
|
||
.c-banner-media { | ||
display: block; | ||
} | ||
|
||
.c-banner-button { | ||
width: auto; | ||
} | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/* | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. | ||
*/ | ||
|
||
import TrafficCop from '@mozmeao/trafficcop'; | ||
import { isApprovedToRun } from '../experiment-utils.es6'; | ||
|
||
const href = window.location.href; | ||
|
||
if (typeof window.dataLayer === 'undefined') { | ||
window.dataLayer = []; | ||
} | ||
|
||
const init = () => { | ||
if (href.indexOf('v=a') !== -1) { | ||
window.dataLayer.push({ | ||
event: 'experiment_view', | ||
id: 'home-fundraiser-giving-tues-2024', | ||
variant: 'home-fundraiser-giving-tues-2024-va' | ||
}); | ||
} else if (href.indexOf('v=b') !== -1) { | ||
window.dataLayer.push({ | ||
event: 'experiment_view', | ||
id: 'home-fundraiser-giving-tues-2024', | ||
variant: 'home-fundraiser-giving-tues-2024-vb' | ||
}); | ||
} else if (href.indexOf('v=c') !== -1) { | ||
window.dataLayer.push({ | ||
event: 'experiment_view', | ||
id: 'home-fundraiser-giving-tues-2024', | ||
variant: 'home-fundraiser-giving-tues-2024-vc' | ||
}); | ||
} else if (TrafficCop) { | ||
if (isApprovedToRun()) { | ||
const cop = new TrafficCop({ | ||
variations: { | ||
'v=a': 33, | ||
'v=b': 33, | ||
'v=c': 33 | ||
} | ||
}); | ||
cop.init(); | ||
} | ||
} | ||
}; | ||
|
||
init(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/* | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. | ||
*/ | ||
|
||
import MozBanner from './mozilla-banner.es6'; | ||
|
||
function onLoad() { | ||
MozBanner.init('fundraising-banner', true); | ||
} | ||
|
||
window.Mozilla.run(onLoad); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters