Skip to content

Commit

Permalink
Merge pull request MozillaFoundation#1 from chris-lawton/6885-info-se…
Browse files Browse the repository at this point in the history
…ction-1

[6885] Info section 1
  • Loading branch information
chris-lawton authored Jul 5, 2021
2 parents 75f075e + 6d41340 commit 83b656e
Show file tree
Hide file tree
Showing 6 changed files with 136 additions and 25 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{% load i18n %}

<p class="mb-5 pb-3">{% trans "YouTube Regrets are primarily a result of the recommendation algorithm, meaning videos that YouTube chooses to amplify, rather than videos that people sought out." %}</p>
<h2 class="heading-2 mb-5">{% trans "71% of all regret reports came from videos recommended to our users and recommended videos were 1.4 times more likely to be regretted than videos searched for. " %}</h2>
<div class="col-12 col-lg-8 mx-auto">
<canvas class="" width="410" height="410" id="recommendations-pie-chart"></canvas>
</div>
{% blocktrans %}
<p class="mt-5 mb-lg-5 pb-lg-5">The regrets our volunteers flagged had tons of views, but it’s impossible to tell how many of those views came from YouTube’s recommendation algorithm, because <span class="fw-bold">YouTube won’t release this information</span>.</p>
{% endblocktrans %}

<div class="row flex-column-reverse flex-lg-row">
<div class="col-12 col-lg-5">
{% include "./standout-stat.html" with heading="Reported Videos" number="~5,794" label="views per day" classes="mb-5" %}
{% include "./standout-stat.html" with heading="Other Videos" number="~3,312" label="views per day" %}
</div>
<div class="col-12 col-lg-6 offset-lg-1 mt-3 mt-lg-3">
<h2 class="heading-2 mb-4">{% trans "What we do know is that reported videos seemed to accumulate views faster than those that were not." %}</h2>
<p>{% trans "At the time they were reported, YouTube Regrets had a median of 5,794 views per day they were on the platform, while other videos our volunteers watched had only 3,312 views per day." %}</p>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{% load i18n %}

<div class="standout-stat {% if classes %}{{ classes }}{% endif %}">
{% if heading %}
<p class="standout-stat__heading mb-0">{{ heading }}</p>
{% endif %}

<div class="standout-stat__wrap text-center p-4">
<p class="standout-stat__number mb-2">{{ number }}</p>
<p class="standout-stat__label mb-0">{% trans label %}</p>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,17 @@
<div id="yt-accordion-content-01" class="yt-regrets-accordion__content" data-accordion-content>
<div class="container">
<div class="row justify-content-center">
<div class="col col-md-10">
<div class="col col-md-12 offset-md-2">
<div class="row">
<div class="yt-regrets-accordion__number col-md-1">01</div>
<div class="col-12 col-md-11">
<h2 class="h2-heading">{% trans "Most videos people regret watching come from recommendations." %}</h2>
<div class="col-12 col-md-10">
<h2 class="heading-1">{% trans "Most videos people regret watching come from recommendations." %}</h2>
</div>
</div>
<div class="row justify-content-center">
<div class="col-md-10">
<p>YouTube Regrets are primarily a result of the recommendation algorithm, meaning videos that YouTube chooses to amplify, rather than videos that people sought out. </p>
<p>YouTube Regrets are primarily a result of the recommendation algorithm, meaning videos that YouTube chooses to amplify, rather than videos that people sought out. </p>
<p>YouTube Regrets are primarily a result of the recommendation algorithm, meaning videos that YouTube chooses to amplify, rather than videos that people sought out. </p>
<p>YouTube Regrets are primarily a result of the recommendation algorithm, meaning videos that YouTube chooses to amplify, rather than videos that people sought out. </p>
<p>YouTube Regrets are primarily a result of the recommendation algorithm, meaning videos that YouTube chooses to amplify, rather than videos that people sought out. </p>
<div class="row">
<div class="col-md-8 offset-md-1">
{# Section 1 content #}
{% include "./fragments/accordion-section-1.html" %}
</div>
</div>
</div>
Expand All @@ -39,15 +36,15 @@ <h2 class="h2-heading">{% trans "Most videos people regret watching come from re
<div id="yt-accordion-content-02" class="yt-regrets-accordion__content" data-accordion-content>
<div class="container">
<div class="row justify-content-center">
<div class="col col-md-10">
<div class="col col-md-12 offset-md-2">
<div class="row">
<div class="yt-regrets-accordion__number col-md-1">02</div>
<div class="col-12 col-md-11">
<h2 class="h2-heading">{% trans "YouTube recommends videos that violate their own policies." %}</h2>
<div class="col-12 col-md-10">
<h2 class="heading-1">{% trans "YouTube recommends videos that violate their own policies." %}</h2>
</div>
</div>
<div class="row justify-content-center">
<div class="col-md-10">
<div class="row">
<div class="col-md-8 offset-md-1">
<p>YouTube Regrets are primarily a result of the recommendation algorithm, meaning videos that YouTube chooses to amplify, rather than videos that people sought out.</p>
<p>YouTube Regrets are primarily a result of the recommendation algorithm, meaning videos that YouTube chooses to amplify, rather than videos that people sought out.</p>
<p>YouTube Regrets are primarily a result of the recommendation algorithm, meaning videos that YouTube chooses to amplify, rather than videos that people sought out.</p>
Expand All @@ -73,15 +70,15 @@ <h2 class="h2-heading">{% trans "YouTube recommends videos that violate their ow
<div id="yt-accordion-content-03" class="yt-regrets-accordion__content" data-accordion-content>
<div class="container">
<div class="row justify-content-center">
<div class="col col-md-10">
<div class="col col-md-12 offset-md-2">
<div class="row">
<div class="yt-regrets-accordion__number col-md-1">03</div>
<div class="col-12 col-md-11">
<h2 class="h2-heading">{% trans "The non-English speaking world is hit the hardest." %}</h2>
<div class="col-12 col-md-10">
<h2 class="heading-1">{% trans "The non-English speaking world is hit the hardest." %}</h2>
</div>
</div>
<div class="row justify-content-center">
<div class="col-md-10">
<div class="row">
<div class="col-md-8 offset-md-1">
<p>YouTube Regrets are primarily a result of the recommendation algorithm, meaning videos that YouTube chooses to amplify, rather than videos that people sought out.</p>
<p>YouTube Regrets are primarily a result of the recommendation algorithm, meaning videos that YouTube chooses to amplify, rather than videos that people sought out.</p>
<p>YouTube Regrets are primarily a result of the recommendation algorithm, meaning videos that YouTube chooses to amplify, rather than videos that people sought out.</p>
Expand All @@ -107,15 +104,15 @@ <h2 class="h2-heading">{% trans "The non-English speaking world is hit the harde
<div id="yt-accordion-content-04" class="yt-regrets-accordion__content" data-accordion-content>
<div class="container">
<div class="row justify-content-center">
<div class="col col-md-10">
<div class="col col-md-12 offset-md-2">
<div class="row">
<div class="yt-regrets-accordion__number col-md-1">04</div>
<div class="col-12 col-md-11">
<h2 class="h2-heading">{% trans "YouTube Regrets can alter people’s lives forever." %}</h2>
<div class="col-12 col-md-10">
<h2 class="heading-1">{% trans "YouTube Regrets can alter people’s lives forever." %}</h2>
</div>
</div>
<div class="row justify-content-center">
<div class="col-md-10">
<div class="row">
<div class="col-md-8 offset-md-1">
<p>YouTube Regrets are primarily a result of the recommendation algorithm, meaning videos that YouTube chooses to amplify, rather than videos that people sought out.</p>
<p>YouTube Regrets are primarily a result of the recommendation algorithm, meaning videos that YouTube chooses to amplify, rather than videos that people sought out.</p>
<p>YouTube Regrets are primarily a result of the recommendation algorithm, meaning videos that YouTube chooses to amplify, rather than videos that people sought out.</p>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import { Chart, registerables } from 'chart.js';

export const initYouTubeRegretsRecommendationsPieChart = () => {
Chart.register(...registerables);

const categoriesChart = document.getElementById('recommendations-pie-chart');
const ctx = categoriesChart.getContext('2d');

const chart = new Chart(ctx, {
type: 'doughnut',
data: {
labels: [
'Recommendation',
'Search',
'Other'
],
datasets: [{
data: [71.1, 21.5, 7.47],
backgroundColor: [
'#FC4147',
'#080708',
'#FBD5D7',
],
}]
},
options: {
plugins: {
legend: {
labels: {
font: {
size: 18,
family: 'Nunito Sans',
color: 'black',
},
}
},
tooltip: {
callbacks: {
label: (context) => `${context.parsed}%`,
},
},
},
}
});
}
2 changes: 2 additions & 0 deletions source/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import { initYouTubeRegretsCategoriesBarChart } from "./foundation/pages/youtube
import { initYoutubeRegretsReadMoreCategories } from "./foundation/pages/youtube-regrets/read-more-categories";
import { initYoutubeRegretsResearchCountUp } from "./foundation/pages/youtube-regrets/research-count-up";
import { initYoutubeRegretsAccordions } from "./foundation/pages/youtube-regrets/accordion";
import { initYouTubeRegretsRecommendationsPieChart } from "./foundation/pages/youtube-regrets/recommendations-pie-chart";

// Initializing component a11y browser console logging
if (
Expand Down Expand Up @@ -119,6 +120,7 @@ let main = {
initYoutubeRegretsReadMoreCategories();
initYoutubeRegretsResearchCountUp();
initYoutubeRegretsAccordions();
initYouTubeRegretsRecommendationsPieChart();
}

// YouTube Regrets Reporter page
Expand Down
34 changes: 34 additions & 0 deletions source/sass/views/youtube-regrets-2021.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

a {
font-weight: 700;
color: $blue;
}
}

Expand Down Expand Up @@ -327,4 +328,37 @@
font-weight: 300;
}
}

.standout-stat {
&__heading {
@include set-text-size(20px, 48px);
font-family: $font-changa;
}

&__number {
@include set-text-size(50px, 48px, 60px, 48px);
font-family: $font-changa;
color: $white;
}

&__label {
color: $white;
}

&__wrap {
background-color: $black;
position: relative;
margin-bottom: 10px;

&::after {
content: '';
width: 100%;
height: 100%;
border: 1px solid $black;
left: 10px;
top: 10px;
position: absolute;
}
}
}
}

0 comments on commit 83b656e

Please sign in to comment.