Skip to content

Commit

Permalink
Merge pull request #1006 from gymnasium/patch/hero-take5-campaign
Browse files Browse the repository at this point in the history
Take 5 evergreen hero
  • Loading branch information
jgagne authored Jan 8, 2025
2 parents 2e25020 + df9a5d0 commit 0602801
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
4 changes: 2 additions & 2 deletions _data/hero.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
current_promo: articles/hero-article.html
auth_promo: articles/hero-article.html
current_promo: evergreen/hero-take5-campaign.html
auth_promo: evergreen/hero-take5-campaign.html

# Livestream
# Set true/false (lowercase).
Expand Down
5 changes: 3 additions & 2 deletions _includes/heros/evergreen/hero-take5-campaign.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<link rel="preload" href="{{ site.url }}/img/take5/posters/gym-5019-hero.jpg?{{ site.time | date:'%s' }}" as="image" media="(min-width: 75em)">
<link rel="stylesheet" href="{{ site.url }}/css/heros/hero-take5-campaign.css?{{ site.time | date:'%s' }}" fetchpriority="high">
<script async src="{{ site.url }}/js/hero-take5-campaign.js" fetchpriority="high"></script>

<div class="hero-promo" id="hero-take5-campaign">
<div class="hero-content-art">
Expand All @@ -14,10 +15,10 @@
<header>
<h2><span class="take5-brand-kern">Take 5</span></h2>
<h1>Learn A New Skill in 5 Minutes</h1>
<p class="description">Watch free video tutorials on design, development, accessibility, prototyping, UX, and career skills.</p>
<p class="description">Watch free video tutorials on design, development, UX, prototyping, accessibility, and career skills.</p>
</header>
<div class="cta">
<a class="gym-button natural" href="https://thegymnasium.com/courses/take5"><b>Learn Something New</b></a>
<a class="gym-button natural" id="cta-take5" href="https://thegymnasium.com/courses/take5"><b>Learn Something New</b></a>
</div>
</div>
</div>
Expand Down
12 changes: 12 additions & 0 deletions js/hero-take5-campaign.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
var cta = document.getElementById('cta-take5');
var randomNum = Math.floor(Math.random() * 2) + 1;
var baseUrl = 'https://thegymnasium.com/courses/take5';
var baseUtm = '?utm_medium=banner&utm_source=hero&utm_content=';

if (randomNum === 1) {
cta.innerHTML = '<b>Learn Something New</b>';
cta.setAttribute('href', baseUrl + baseUtm + 'learn-something-new');
} else {
cta.innerHTML = '<b>Start Learning</b>';
cta.setAttribute('href', baseUrl + baseUtm + 'start-learning');
}

0 comments on commit 0602801

Please sign in to comment.