-
Notifications
You must be signed in to change notification settings - Fork 153
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FE/BE] - Mozfest Hero updates #7585
Merged
Merged
Changes from 43 commits
Commits
Show all changes
47 commits
Select commit
Hold shift + click to select a range
652255b
Create integration branch for frontend and backend
SharmaineLim 2f2e68c
Bump wagtailmedia to 0.8.0
SharmaineLim 69afb22
Add EmbeddedVideoBlock
SharmaineLim 439e59a
Add WagtailVideoChooserBlock
SharmaineLim d66cf8c
Add BannerCarouselSlideBlock
SharmaineLim c09a705
Set new banner_video_type 'featured' instead of 'hardcoded'
SharmaineLim 1ca62ce
Add banner_carousel and banner_video to MozfestHomepage model
SharmaineLim 28f4050
Add new banner_video_type 'featured' in HTML templates
SharmaineLim 28a0aa4
Add faker for MozfestHomepage carousel
SharmaineLim 3f8fcbb
Add faker for MozfestHomepage banner video
SharmaineLim 0c10510
Make migrations
SharmaineLim 287eefc
Fix spacing in HTML file
SharmaineLim 3aeafb3
Merge pull request #7573 from SharmaineLim/feature/be-7531-mozfest-hero
26080e5
[7533] - FE Mozfest homepage hero (#7589)
stevedya 9c98d51
Only show carousel if there are carousels
stevedya 092175b
Remove uneeded carousel check
stevedya ec93611
Merge branch 'main' into feature/fe-be-mozfest-hero-updates
9bce112
Update migrations
0b43be5
Fix template
5839a96
Add thumbnail
62f7624
Fix video thumbnail overlay fade out for external videos
stevedya 4a39a9d
Remove unused template blocks, simplify external_video
585303b
Update fake data
9193b7c
CI fixes
a6a1c84
Use brand colors instead of rgb values
495ccde
Add stylelint-disable
f13e2c7
Add wagtailcore_tags
de6ab70
Fix video conditionals on front end, remove minimum requirement on ca…
stevedya 2d46332
Fix issue on FE template when there is no video thumbnail
stevedya 82cda8e
Update migrations
b934712
Add help texts for banner_carousel and banner_video
7add0fb
Scroll to video with offset through JS
stevedya 60ef9e4
Still autoplay after interacting with banner carousel
stevedya 8f0b895
Merge branch 'feature/fe-be-mozfest-hero-updates' of github.com:mozil…
stevedya 2bea443
Add blue hover to CTA button
stevedya 9f48b1a
Change selector to string instead of function for hero carousel
stevedya 5792841
Merge branch 'main' into feature/fe-be-mozfest-hero-updates
b476f4a
Fix eslint issues
eb81ac5
Fix Percy issues
e3da22e
Update comment on `banner_video_type` https://github.com/mozilla/foun…
46c0fc6
Remove fallback text for <video> https://github.com/mozilla/foundatio…
65867a3
Run npm run optimize:svg on play-circle-grey https://github.com/mozil…
44e1c62
Merge branch 'main' into feature/fe-be-mozfest-hero-updates
32a90db
Change "PLAY VIDEO" and "PAUSE VIDEO" to normal case, use text-transf…
b9615af
Merge branch 'main' into feature/fe-be-mozfest-hero-updates
9e00969
Use template literals for query selectors, use forEach instead of for
44e2d5e
Merge branch 'main' into feature/fe-be-mozfest-hero-updates
danielfmiranda File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
27 changes: 27 additions & 0 deletions
27
...rk-api/networkapi/mozfest/migrations/0022_mozfesthomepage_banner_carousel_banner_video.py
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,27 @@ | ||
# Generated by Django 3.1.11 on 2021-10-15 16:07 | ||
|
||
from django.db import migrations | ||
import networkapi.wagtailpages.pagemodels.customblocks.video_block | ||
import wagtail.core.blocks | ||
import wagtail.core.fields | ||
import wagtail.images.blocks | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('mozfest', '0021_add_spaces_cards'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='mozfesthomepage', | ||
name='banner_carousel', | ||
field=wagtail.core.fields.StreamField([('slide', wagtail.core.blocks.StructBlock([('image', wagtail.images.blocks.ImageChooserBlock()), ('heading', wagtail.core.blocks.CharBlock(required=False)), ('description', wagtail.core.blocks.CharBlock(required=False))]))], blank=True, help_text='The slides shown on the new Hero. Please ensure that there are exactly 3 slides. The old Hero will be shown if there are no slides present.', null=True), | ||
), | ||
migrations.AddField( | ||
model_name='mozfesthomepage', | ||
name='banner_video', | ||
field=wagtail.core.fields.StreamField([('CMS_video', networkapi.wagtailpages.pagemodels.customblocks.video_block.WagtailVideoChooserBlock()), ('external_video', wagtail.core.blocks.StructBlock([('video_url', wagtail.core.blocks.URLBlock(help_text='For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979')), ('thumbnail', wagtail.images.blocks.ImageChooserBlock(help_text='The image to show before the video is played.'))]))], blank=True, help_text='The video to play when users click "Watch Video". This is only shown on the new Hero.', null=True), | ||
), | ||
] |
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
25 changes: 25 additions & 0 deletions
25
network-api/networkapi/mozfest/templates/fragments/carousel_navigation.html
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,25 @@ | ||
<div class="tw-flex tw-justify-center tw-items-start tw-flex-col tw-mb-5 medium:tw-flex-row medium:tw-justify-between medium:tw-items-center"> | ||
<h2 class="font-weight-bold h3-heading tw-font-semibold tw-mb-4">{{ title }}</h2> | ||
<div class="tw-flex tw-flex-row tw-justify-between tw-items-center"> | ||
<div class="swiper-button-prev"> | ||
<svg class="swiper-button-prev__icon" viewBox="0 0 21 21" fill="none" xmlns="http://www.w3.org/2000/svg"> | ||
<path fill-rule="evenodd" clip-rule="evenodd" | ||
d="M20.75 10.5c0-.70761-.5099-1.28125-1.1389-1.28125H1.38889C.759899 9.21875.25 9.79239.25 10.5c0 .7076.509899 1.2812 1.13889 1.2812H19.6111c.629 0 1.1389-.5736 1.1389-1.2812Z" | ||
fill="currentColor"/> | ||
<path fill-rule="evenodd" clip-rule="evenodd" | ||
d="M10.1664.625269c-.44474-.500359-1.16584-.500359-1.6106 0L.583572 9.59402c-.444763.50038-.444763 1.31158 0 1.81198L8.5558 20.3747c.44476.5004 1.16586.5004 1.6106 0 .4448-.5003.4448-1.3116 0-1.8119L2.99952 10.5l7.16688-8.06277c.4448-.50036.4448-1.3116 0-1.811961Z" | ||
fill="currentColor"/> | ||
</svg> | ||
</div> | ||
<div class="swiper-button-next"> | ||
<svg class="swiper-button-next__icon" viewBox="0 0 21 21" fill="none" xmlns="http://www.w3.org/2000/svg"> | ||
<path fill-rule="evenodd" clip-rule="evenodd" | ||
d="M.25 10.5c0-.70761.509898-1.28125 1.13889-1.28125H19.6111c.629 0 1.1389.57364 1.1389 1.28125 0 .7076-.5099 1.2812-1.1389 1.2812H1.38889C.759898 11.7812.25 11.2076.25 10.5Z" | ||
fill="currentColor"/> | ||
<path fill-rule="evenodd" clip-rule="evenodd" | ||
d="M10.8336.625269c.4447-.500359 1.1658-.500359 1.6106 0l7.9722 8.968751c.4448.50038.4448 1.31158 0 1.81198l-7.9722 8.9687c-.4448.5004-1.1659.5004-1.6106 0-.4448-.5003-.4448-1.3116 0-1.8119L18.0005 10.5l-7.1669-8.06277c-.4448-.50036-.4448-1.3116 0-1.811961Z" | ||
fill="currentColor"/> | ||
</svg> | ||
</div> | ||
</div> | ||
</div> |
69 changes: 69 additions & 0 deletions
69
network-api/networkapi/mozfest/templates/fragments/hero/carousel_hero.html
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,69 @@ | ||
{% load i18n wagtailimages_tags %} | ||
<div data-mozfest-hero-carousel> | ||
<div class="tw-relative tw-pt-[120px] tw-flex tw-flex-col tw-justify-end{% if not page.banner_video %} tw-pb-6 medium:tw-pb-[120px]{% endif %}"> | ||
|
||
{# Background images slider #} | ||
<div class="tw-absolute tw-inset-0"> | ||
<div class="tw-absolute tw-inset-0 tw-bg-black tw-z-20 tw-opacity-40"></div> | ||
<div class="tw-bg-gradient-to-t tw-from-festival-blue-100 tw-via-festival-blue-100 tw-to-festival-purple-100 tw-w-full tw-h-full tw-absolute tw-inset-0 tw-z-10 tw-opacity-75"></div> | ||
</div> | ||
|
||
{# Background Images slider #} | ||
<div class="tw-absolute tw-w-full tw-h-full tw-top-0 tw-left-0"> | ||
<div class="swiper-hero-carousel tw-h-full tw-overflow-hidden"> | ||
<div class="swiper-wrapper"> | ||
{% for slide_block in page.specific.banner_carousel %} | ||
{% with slide=slide_block.value %} | ||
{% image slide.image fill-1600x900 as img %} | ||
<div class="swiper-slide tw-bg-cover tw-bg-center tw-bg-no-repeat tw-filter tw-grayscale" style="background-image: url({{ img.url }});"></div> | ||
{% endwith %} | ||
{% endfor %} | ||
</div> | ||
</div> | ||
</div> | ||
|
||
{# Text slider #} | ||
<div class="tw-container tw-relative tw-z-20 tw-text-white"> | ||
<div> | ||
<h1 class="tw-text-white tw-font-bold tw-mb-5">{{ page.banner_heading }}</h1> | ||
{% if page.banner_video %} | ||
<button id="mozfest-hero-video-cta" class="btn btn-primary tw-bg-white tw-text-black hover:tw-bg-blue hover:tw-text-white">{% trans "Watch last year’s recap video" %}</button> | ||
{% endif %} | ||
</div> | ||
|
||
<div class="tw-relative tw-pt-[60px] medium:tw-pt-[100px] tw-hidden medium:tw-block"> | ||
|
||
{# pagination progress bars on desktop #} | ||
<div class="swiper-hero-pagination tw-bottom-3 tw-relative tw-z-40 tw-grid tw-grid-cols-3 tw-gap-3 medium:tw-gap-4"></div> | ||
|
||
{# Text #} | ||
<div class="tw-grid tw-grid-cols-3 tw-gap-3 medium:tw-gap-4"> | ||
{% for slide_block in page.specific.banner_carousel %} | ||
{% with slide=slide_block.value %} | ||
<div> | ||
<span class="tw-font-zilla tw-font-bold tw-inline-block h4-heading tw-text-white">{{ slide.heading }}</span> | ||
<p class="tw-text-white">{{ slide.description }}</p> | ||
</div> | ||
{% endwith %} | ||
{% endfor %} | ||
</div> | ||
</div> | ||
|
||
{# mobile slider #} | ||
{% include 'fragments/hero/hero_mobile_slider.html' with items=page.hero_slides %} | ||
</div> | ||
|
||
{# Video block #} | ||
{% if page.banner_video %} | ||
{% include 'fragments/hero/featured_video.html' %} | ||
{% endif %} | ||
|
||
</div> | ||
</div> | ||
|
||
{# Spacing for top of content section when there is no video #} | ||
{% if not page.banner_video %} | ||
<div class="tw-w-full tw-bg-white tw-h-7"></div> | ||
{% endif %} | ||
|
||
|
52 changes: 52 additions & 0 deletions
52
network-api/networkapi/mozfest/templates/fragments/hero/featured_video.html
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,52 @@ | ||
{% load i18n static wagtailcore_tags wagtailimages_tags %} | ||
<div id="mozfest-hero-video" class="tw-relative tw-z-20 tw-pb-5 medium:tw-pb-[60px] tw-mt-7 medium:tw-mt-[60px]"> | ||
|
||
{# Overlay spacer #} | ||
<div class="tw-bg-white tw-absolute tw-w-full tw-h-[80%] medium:tw-h-[90%] tw-bottom-0"></div> | ||
|
||
{# Video Container #} | ||
<div class="container"> | ||
{% for block in page.banner_video %} | ||
<div style="padding-bottom: 56.25%;" class="embed-responsive tw-bg-black tw-text-black"> | ||
|
||
{# Thumbnail and overlay #} | ||
<button | ||
id="mozfest-home-watch-featured-video-button" | ||
aria-label="{% trans "Watch Video" %}" | ||
class="tw-bg-black tw-w-full tw-h-full tw-absolute tw-inset-0 tw-group tw-z-10 tw-bg-cover tw-bg-center tw-transition tw-duration-500" | ||
{% if block.block_type == 'external_video' %} | ||
{% image block.value.thumbnail fill-1200x600 as img %} | ||
data-video-url="{{ block.value.video_url }}?&autoplay=1" | ||
style="background-image: url({{ img.url }});" | ||
{% endif %} | ||
{% if block.block_type == 'CMS_video' %} | ||
{% if block.value.thumbnail %} | ||
style="background-image: url({{ block.value.thumbnail.url }});" | ||
{% endif %} | ||
{% endif %} | ||
> | ||
<span class="tw-relative tw-w-full tw-h-full tw-flex tw-justify-center tw-items-center"> | ||
{# Opacity layer #} | ||
<div class="tw-absolute tw-bg-black tw-opacity-25 tw-inset-0 tw-w-full tw-h-full"></div> | ||
{# Play Icon #} | ||
<img src="{% static "_images/mozfest/play-circle-grey.svg" %}" | ||
class="group-hover:tw--translate-y-1 tw-relative tw-z-10 tw-transition tw-w-[75px] tw-h-[75px] medium:tw-w-[108px] medium:tw-h-[108px]" alt=""/> | ||
</span> | ||
</button> | ||
|
||
{# Video #} | ||
{% if block.block_type == 'external_video' %} | ||
<iframe | ||
src="" | ||
frameborder="0" | ||
class="embed-responsive-item" | ||
allow="autoplay; encrypted-media" | ||
allowfullscreen> | ||
</iframe> | ||
{% else %} | ||
{{ block }} | ||
{% endif %} | ||
</div> | ||
{% endfor %} | ||
</div> | ||
</div> |
43 changes: 43 additions & 0 deletions
43
network-api/networkapi/mozfest/templates/fragments/hero/hardcoded_video_hero.html
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,43 @@ | ||
{% load i18n wagtailcore_tags %} | ||
<div class="banner"> | ||
<div class="background-wrapper"> | ||
<div class="overlay"></div> | ||
<video class="banner-video" playsinline muted loop preload | ||
poster="https://s3.amazonaws.com/mofo-assets/foundation/video/mozfest-banner-video-poster.jpg"> | ||
<source | ||
src="https://s3.amazonaws.com/mofo-assets/foundation/video/mozfest-banner-video.mp4" | ||
type="video/mp4"> | ||
</video> | ||
|
||
<div class="video-control-wrapper dark-theme"> | ||
<div class="container"> | ||
<div class="row"> | ||
<div class="col-12"> | ||
<button class="btn btn-video-control btn-pause btn-secondary d-none"> | ||
<span>{% trans "PAUSE VIDEO" context "Pause button for video" %}</span> | ||
</button> | ||
<button class="btn btn-video-control btn-play btn-secondary d-none"> | ||
<span>{% trans "PLAY VIDEO" context "Play button for video" %}</span> | ||
</button> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<div class="homepage-banner-content container"> | ||
<div class="row"> | ||
<div class="col-10 col-lg-8 dark-theme"> | ||
<h1 class="h1-heading">{{ page.banner_heading }}</h1> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
{# Bottom overlaping spacing bar #} | ||
<div class="container"> | ||
<div class="row cutout-wrapper-row"> | ||
<div class="cutout col-12 pt-4"> | ||
</div> | ||
</div> | ||
</div> |
16 changes: 16 additions & 0 deletions
16
network-api/networkapi/mozfest/templates/fragments/hero/hero_mobile_slider.html
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,16 @@ | ||
<div class="swiper-hero-mobile tw-overflow-hidden medium:tw-hidden tw-mt-7"> | ||
|
||
<div class="swiper-wrapper"> | ||
{% for slide_block in page.banner_carousel %} | ||
{% with slide=slide_block.value %} | ||
<div class="swiper-slide"> | ||
<div class="swiper-mobile-progress-bar"></div> | ||
<span class="tw-font-zilla tw-font-bold tw-inline-block h4-heading tw-text-white tw-mt-4">{{ slide.heading }}</span> | ||
<p class="tw-text-white">{{ slide.description }}</p> | ||
</div> | ||
{% endwith %} | ||
{% endfor %} | ||
</div> | ||
</div> | ||
|
||
|
50 changes: 0 additions & 50 deletions
50
network-api/networkapi/mozfest/templates/fragments/hero/large.html
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A nit, but: can we make this a normal-cased phrase and instead force it to be presented as all caps with a CSS
text-transform
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gotcha, fixed in 32a90db!