Update footer to expand grey bar to bottom of page

This commit is contained in:
2020-03-10 07:31:46 +00:00
parent 20bbffd3b5
commit 00c89d770b
66 changed files with 6403 additions and 26 deletions

View File

@@ -0,0 +1,56 @@
/* adjust header styling */
.article-section-header h1, .year-header h1 {
margin-block-start: 0;
margin-block-end: 0;
margin: 6px;
display: inline;
}
.article-section-header, .year-header {
background-color: rgba(0,0,0,0.5);
padding-top: 12px;
padding-bottom: 12px;
}
/* main list of articles */
.articles {
padding-top: 12px;
padding-bottom: 12px;
}
/* make cards display next to each other with correct dimensions and adjust styling */
.main-content .mdc-card {
display: inline-flex;
width: calc((100% / 3) - 18px);
box-shadow: none;
margin: 6px 6px 10px 6px;
background: none;
cursor: pointer;
}
/* style cards */
.mdc-card-content {
margin: 5px 15px 5px 15px;
}
.mdc-card .mdc-typography--headline6, .mdc-card .mdc-typography--subtitle2 {
margin: 0;
}
.mdc-card .mdc-typography--headline6 {
text-transform: capitalize;
}
.article-description {
margin-top: 6px;
font-style: italic;
}
/* change number of articles in each row depending on screen size */
@media screen and (max-width: 600px) {
.article-section .mdc-card {
width: calc((100% / 2) - 18px);
}
}
@media screen and (max-width: 350px) {
.article-section .mdc-card {
width: calc((100% / 1) - 18px);
}
}

View File

@@ -0,0 +1,70 @@
/* make text look nice */
.mdc-typography--headline3, .mdc-typography--subtitle1 {
text-transform: capitalize;
}
.mdc-typography--headline3, .mdc-typography--subtitle1, figure {
margin: 5px;
}
.mdc-typography--caption-text {
font-style: italic;
margin: 5px;
}
.mdc-typography--headline5 {
margin-bottom: 5px;
}
/* change background */
.article-content {
background-color: var(--mdc-theme-background);
padding-top: 10px;
padding-bottom: 10px;
}
/* hide empty black bar if there is no content to the article */
.article-content:empty {
display: none;
}
/* position headline in middle of image */
.parallax-section {
text-align: center;
vertical-align: middle;
padding: 200px 15px;
}
/* audio */
.article-content audio {
width: 100%;
}
/* adjust video dimensions depending on screen size */
iframe {
width: 100%;
height: calc(68.8vw / 16 * 9);
}
@media screen and (max-width: 1550px) {
iframe {
width: 100%;
height: calc(70vw / 16 * 9 - 6px);
}
}
@media screen and (max-width: 800px) {
iframe {
height: calc(90vw / 16 * 9 - 5px);
}
.mdc-typography--headline3, .mdc-typography--headline5 {
font-size: 2.5rem;
line-height: 2.625rem;
}
}
@media screen and (max-width: 400px) {
.mdc-typography--headline3, .mdc-typography--headline5 {
font-size: 2rem;
line-height: 2.125rem;
}
}
@media screen and (max-width: 600px) {
iframe {
height: calc(93.5vw / 16 * 9);
}
}

218
_site/css/global.css Normal file
View File

@@ -0,0 +1,218 @@
html {
height: 100%;
}
html, body, .mdc-drawer-app-content {
display: flex;
flex-direction: column;
}
.footer-container, .mdc-drawer-app-content, body {
flex-grow: 1;
}
/* change theme */
:root {
--mdc-theme-primary: #253a67;
--mdc-theme-secondary: #ea6343;
--mdc-theme-background: #181a1b;
}
body {
font-family: 'Roboto', sans-serif;
margin: 0;
display: flex;
background-color: var(--mdc-theme-primary);
color: #ffffff;
}
.mdc-drawer {
background-color: var(--mdc-theme-background);
}
.mdc-drawer *, .mdc-drawer .material-icons, .mdc-drawer h3 {
color: #ddd;
}
.mdc-drawer .mdc-list-group__subheader {
color: #ccc;
}
.mdc-button:not(:disabled) {
color: var(--mdc-theme-secondary);
border-color: var(--mdc-theme-secondary);
}
.mdc-button::before, .mdc-button::after {
background-color: var(--mdc-theme-secondary);
}
a {
color: var(--mdc-theme-secondary);
}
/* navbar buttons */
.mdc-text-field--focused:not(.mdc-text-field--disabled) .mdc-floating-label, .mdc-list-item--activated .mdc-list-item__text, .mdc-drawer .mdc-list-item--activated .mdc-list-item__graphic {
color: var(--mdc-theme-secondary);
}
:not(.mdc-list--non-interactive)>:not(.mdc-list-item--disabled).mdc-list-item--activated::before, :not(.mdc-list--non-interactive)>:not(.mdc-list-item--disabled).mdc-list-item--activated::after {
background-color: var(--mdc-theme-secondary);
}
.mdc-list-item.year::before, .mdc-list-item.year::after {
background: none !important;
}
.mdc-list-item.year, .mdc-list-item.year {
margin: 0;
padding: 0;
display: initial;
}
/* change cursor on top app bar */
.mdc-top-app-bar__title {
cursor: pointer;
}
/* remove margin above main content */
.mdc-top-app-bar--short-fixed-adjust {
padding-top: 41px;
}
/* make content display properly */
.mdc-list-group h3 {
margin: 20px 16px auto 16px;
font-weight: normal;
}
.mdc-drawer-app-content {
flex: auto;
overflow: auto;
}
.mdc-drawer {
width: 350px;
}
.main-content {
margin: 15px 0;
overflow: auto;
}
.app-bar {
position: absolute;
}
/* parallax backgrounds */
.parallax-section {
position: relative;
z-index: 0;
}
.parallax-section > div:last-child > div {
background-color: rgba(50,50,50,0.75);
background-blend-mode: multiply;
}
/* splitter for between sections */
.splitter {
height: 15px;
width: 100%;
background-color: var(--mdc-theme-primary);
}
/* responsive side margins */
.article-section .articles, .article-section-header, .footer-container, .article-content, .article-title-section ~ .mdc-typography--caption-text, .article-title-section, .mdc-typography--subtitle1, .mdc-typography--headline3 {
padding-left: 15%;
padding-right: 15%;
}
@media screen and (max-width: 1000px) {
.article-section .articles, .article-section-header, .footer-container, .article-content, .footer-container, .article-title-section ~ .mdc-typography--caption-text, .article-title-section, .mdc-typography--subtitle1, .mdc-typography--headline3 {
padding-left: 8%;
padding-right: 8%;
}
}
@media screen and (max-width: 800px) {
.article-section .articles, .article-section-header, .article-content, .footer-container, .article-title-section ~ .mdc-typography--caption-text, .article-title-section, .mdc-typography--subtitle1, .mdc-typography--headline3 {
padding-left: 2%;
padding-right: 2%;
}
}
/* footer */
.footer-container {
background: var(--mdc-theme-background);
padding: 5px 15%;
}
footer {
margin: 15px;
display: flex;
justify-content: space-between;
align-items: center;
}
/* edit footer depending on screen size - edits alignment & changes switches between center- and left- aligned BBC Young Reporter logos */
footer img {
width: 125px;
content: url("/images/young-reporter-logo.png");
}
@media screen and (max-width: 800px) {
footer {
flex-direction: column;
justify-content: center;
}
footer img {
content: url("/images/young-reporter-logo-centered.png");
width: 200px;
padding-bottom: 10px;
order: 1;
}
footer span {
order: 2;
}
}
/* cookie notice */
#cookies {
display: none;
width: 100%;
position: fixed;
background: var(--mdc-theme-primary);
color: var(--mdc-theme-background);
text-align: center;
bottom: -100px;
left: 0;
z-index: 1;
}
#cookies p {
margin: 10px;
}
#cookies p a {
color: var(--mdc-theme-secondary);
text-decoration: none;
}
/* scroll-to-top button */
.top-scroll-button {
width: 50px;
height: 50px;
text-align: center;
font-size: 25px;
-webkit-border-radius: 50%;
-moz-border-radius: 50%;
border-radius: 50%;
position: fixed;
right: 20px;
bottom: 20px;
background-color: #273967;
display: none;
-webkit-transition-duration: 0.25s;
-moz-transition-duration: 0.25s;
-o-transition-duration: 0.25s;
transition-duration: 0.25s;
}
.top-scroll-button img {
position: relative;
top: 7px;
width: 35px;
height: auto;
-webkit-transition-duration: 0.25s;
-moz-transition-duration: 0.25s;
-o-transition-duration: 0.25s;
transition-duration: 0.25s;
}
.top-scroll-button:hover, .top-scroll-button:focus {
background-color: #1C2E56;
}
.top-scroll-button:hover img {
top: 3px;
}

50
_site/css/home.css Normal file
View File

@@ -0,0 +1,50 @@
/* centre contents vertically */
.article-section-header {
min-height: 100px;
display: flex;
align-items: center;
}
/* place button on right */
.article-section-header button {
display: inline;
padding: 5px 14px;
position: relative;
margin-left: auto;
top: 3.5px;
}
/* animate button on hover */
.article-section-header button span {
position: relative;
left: 0;
top: 1.25px;
transition: left 0.1s linear;
font-size: inherit;
}
.article-section-header button:hover span {
left: 4px;
}
/* alternate section backgrounds */
.article-section:nth-of-type(3n) {
background: var(--mdc-theme-background);
}
.article-section:nth-of-type(3n) > div:nth-of-type(3), .article-section:nth-of-type(3n+2) > div:nth-of-type(3) {
display: none;
}
.article-section:nth-of-type(3n+2) {
background: var(--mdc-theme-primary);
}
/* hide articles on smaller screen sizes */
@media screen and (max-width: 600px) {
.article-section .mdc-card:nth-of-type(3) {
display: none;
}
}
@media screen and (max-width: 350px) {
.article-section .mdc-card:nth-of-type(2) {
display: none;
}
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,23 @@
/* fallback */
@font-face {
font-family: 'Material Icons';
font-style: normal;
font-weight: 400;
src: url(https://fonts.gstatic.com/s/materialicons/v41/flUhRq6tzZclQEJ-Vdg-IuiaDsNc.woff2) format('woff2');
}
.material-icons {
font-family: 'Material Icons';
font-weight: normal;
font-style: normal;
font-size: 24px;
line-height: 1;
letter-spacing: normal;
text-transform: none;
display: inline-block;
white-space: nowrap;
word-wrap: normal;
direction: ltr;
-webkit-font-feature-settings: 'liga';
-webkit-font-smoothing: antialiased;
}

56
_site/css/roboto.css Normal file
View File

@@ -0,0 +1,56 @@
/* cyrillic-ext */
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 400;
src: local('Roboto'), local('Roboto-Regular'), url(https://fonts.gstatic.com/s/roboto/v18/KFOmCnqEu92Fr1Mu72xKOzY.woff2) format('woff2');
unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
/* cyrillic */
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 400;
src: local('Roboto'), local('Roboto-Regular'), url(https://fonts.gstatic.com/s/roboto/v18/KFOmCnqEu92Fr1Mu5mxKOzY.woff2) format('woff2');
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* greek-ext */
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 400;
src: local('Roboto'), local('Roboto-Regular'), url(https://fonts.gstatic.com/s/roboto/v18/KFOmCnqEu92Fr1Mu7mxKOzY.woff2) format('woff2');
unicode-range: U+1F00-1FFF;
}
/* greek */
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 400;
src: local('Roboto'), local('Roboto-Regular'), url(https://fonts.gstatic.com/s/roboto/v18/KFOmCnqEu92Fr1Mu4WxKOzY.woff2) format('woff2');
unicode-range: U+0370-03FF;
}
/* vietnamese */
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 400;
src: local('Roboto'), local('Roboto-Regular'), url(https://fonts.gstatic.com/s/roboto/v18/KFOmCnqEu92Fr1Mu7WxKOzY.woff2) format('woff2');
unicode-range: U+0102-0103, U+0110-0111, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 400;
src: local('Roboto'), local('Roboto-Regular'), url(https://fonts.gstatic.com/s/roboto/v18/KFOmCnqEu92Fr1Mu7GxKOzY.woff2) format('woff2');
unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 400;
src: local('Roboto'), local('Roboto-Regular'), url(https://fonts.gstatic.com/s/roboto/v18/KFOmCnqEu92Fr1Mu4mxK.woff2) format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

10
_site/css/year.css Normal file
View File

@@ -0,0 +1,10 @@
/* position heading in middle of image */
.parallax-section {
text-align: center;
vertical-align: middle;
padding: 150px 15px;
}
/* list of articles */
.articles {
background-color: var(--mdc-theme-background);
}