mirror of
https://github.com/mgrove36/bbc-young-reporter.git
synced 2026-03-03 03:17:07 +00:00
Finish redesigning site
This commit is contained in:
51
css/article-list.css
Normal file
51
css/article-list.css
Normal file
@@ -0,0 +1,51 @@
|
||||
/* 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(24,26,27,0.5);
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
/* 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);
|
||||
}
|
||||
}
|
||||
@@ -32,20 +32,17 @@
|
||||
padding: 150px 15px;
|
||||
}
|
||||
|
||||
|
||||
/* 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);
|
||||
@@ -55,14 +52,12 @@ iframe {
|
||||
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);
|
||||
|
||||
@@ -4,15 +4,6 @@
|
||||
--mdc-theme-secondary: #ea6343;
|
||||
--mdc-theme-background: #181a1b;
|
||||
}
|
||||
|
||||
.mdc-top-app-bar--short-fixed-adjust {
|
||||
padding-top: 41px;
|
||||
}
|
||||
|
||||
.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-primary);
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: 'Roboto', sans-serif;
|
||||
display: flex;
|
||||
@@ -29,7 +20,17 @@ body {
|
||||
.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);
|
||||
}
|
||||
@@ -37,33 +38,37 @@ body {
|
||||
background-color: var(--mdc-theme-secondary);
|
||||
}
|
||||
|
||||
a {
|
||||
color: var(--mdc-theme-secondary);
|
||||
/* 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;
|
||||
}
|
||||
|
||||
/* footer */
|
||||
.footer-container {
|
||||
background: var(--mdc-theme-background);
|
||||
padding: 5px 0;
|
||||
@@ -73,15 +78,6 @@ footer {
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
/* change button colours */
|
||||
.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);
|
||||
}
|
||||
|
||||
/* parallax backgrounds */
|
||||
.parallax-section {
|
||||
position: relative;
|
||||
@@ -93,6 +89,15 @@ footer {
|
||||
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, .footer-container, .article-title-section ~ .mdc-typography--caption-text, .article-title-section, .mdc-typography--subtitle1, .mdc-typography--headline3 {
|
||||
padding-left: 15%;
|
||||
@@ -116,7 +121,6 @@ footer span {
|
||||
position: relative;
|
||||
top: 19px;
|
||||
}
|
||||
|
||||
footer img {
|
||||
display: block;
|
||||
width: 125px;
|
||||
@@ -124,7 +128,6 @@ footer img {
|
||||
content: url("/images/young-reporter-logo.png");
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
@media screen and (max-width: 800px) {
|
||||
footer {
|
||||
text-align: center;
|
||||
@@ -141,7 +144,7 @@ footer img {
|
||||
}
|
||||
}
|
||||
|
||||
/* for cookie notice */
|
||||
/* cookie notice */
|
||||
#cookies {
|
||||
display: none;
|
||||
width: 100%;
|
||||
@@ -153,18 +156,15 @@ footer img {
|
||||
left: 0;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
#cookies p {
|
||||
margin: 10px;
|
||||
}
|
||||
|
||||
#cookies p a {
|
||||
color: var(--mdc-theme-secondary);
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
|
||||
/* for scroll-to-top button */
|
||||
/* scroll-to-top button */
|
||||
.top-scroll-button {
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
@@ -183,7 +183,6 @@ footer img {
|
||||
-o-transition-duration: 0.25s;
|
||||
transition-duration: 0.25s;
|
||||
}
|
||||
|
||||
.top-scroll-button img {
|
||||
position: relative;
|
||||
top: 7px;
|
||||
@@ -194,11 +193,9 @@ footer img {
|
||||
-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;
|
||||
}
|
||||
|
||||
44
css/home.css
44
css/home.css
@@ -1,23 +1,4 @@
|
||||
.main-content .mdc-card {
|
||||
float: left;
|
||||
width: calc((100% / 3) - 12px);
|
||||
box-shadow: none;
|
||||
}
|
||||
.mdc-card {
|
||||
margin: 6px 6px 10px 6px;
|
||||
background: none;
|
||||
}
|
||||
.article-section-header {
|
||||
background-color: rgba(24,26,27,0.5);
|
||||
padding-top: 12px;
|
||||
padding-bottom: 12px;
|
||||
}
|
||||
.article-section-header h1 {
|
||||
margin-block-start: 0;
|
||||
margin-block-end: 0;
|
||||
margin: 6px;
|
||||
display: inline;
|
||||
}
|
||||
/* place button on right */
|
||||
.article-section-header button {
|
||||
display: inline;
|
||||
padding: 5px 14px;
|
||||
@@ -25,6 +6,8 @@
|
||||
float: right;
|
||||
top: 3.5px;
|
||||
}
|
||||
|
||||
/* animate button on hover */
|
||||
.article-section-header button span {
|
||||
position: relative;
|
||||
left: 0;
|
||||
@@ -33,33 +16,28 @@
|
||||
font-size: inherit;
|
||||
}
|
||||
.article-section-header button:hover span {
|
||||
left: 3px;
|
||||
}
|
||||
.splitter {
|
||||
height: 15px;
|
||||
width: 100%;
|
||||
background-color: var(--mdc-theme-primary);
|
||||
left: 4px;
|
||||
}
|
||||
|
||||
/* alternate section backgrounds */
|
||||
.article-section:nth-of-type(3n) {
|
||||
background: var(--mdc-theme-background);
|
||||
}
|
||||
.article-section:nth-of-type(3n) #jarallax-container-1 {
|
||||
.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;
|
||||
}
|
||||
.article-section .mdc-card {
|
||||
width: calc((100% / 2) - 12px);
|
||||
}
|
||||
}
|
||||
@media screen and (max-width: 350px) {
|
||||
.article-section .mdc-card:nth-of-type(2) {
|
||||
display: none;
|
||||
}
|
||||
.article-section .mdc-card {
|
||||
width: calc((100% / 1) - 12px);
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
/* make article cards look nice by altering margins */
|
||||
.mdc-card {
|
||||
margin: 2px 2px 10px 2px;
|
||||
}
|
||||
|
||||
.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;
|
||||
}
|
||||
@@ -1,63 +0,0 @@
|
||||
/* automatically display articles on either side of the page, alternating */
|
||||
.main-content .mdc-card {
|
||||
float: right;
|
||||
clear: right;
|
||||
width: calc(50% - 6px);
|
||||
}
|
||||
|
||||
.main-content .mdc-card:nth-of-type(even) {
|
||||
float: left;
|
||||
clear: left;
|
||||
}
|
||||
|
||||
|
||||
/* make first article full-width */
|
||||
.main-content .mdc-card:first-of-type {
|
||||
float: none;
|
||||
clear: both;
|
||||
width: auto;
|
||||
}
|
||||
|
||||
|
||||
/* makes last article full-width if it is on its own in a row - i.e. if there is an even number of articles in total */
|
||||
.main-content .mdc-card:nth-of-type(odd):nth-last-of-type(2) ~ .mdc-card:last-of-type {
|
||||
float: none;
|
||||
clear: both;
|
||||
width: auto;
|
||||
}
|
||||
|
||||
|
||||
/* styling for when 1 article present */
|
||||
.main-content .mdc-card:first-of-type:last-of-type {
|
||||
float: none;
|
||||
clear: both;
|
||||
width: auto;
|
||||
}
|
||||
|
||||
|
||||
/* styling for when 2 articles present & small screen is detected */
|
||||
@media screen and (max-width: 1000px) {
|
||||
.main-content .mdc-card:nth-child(1):nth-last-of-type(2), .main-content .mdc-card:nth-of-type(2):last-of-type {
|
||||
float: none;
|
||||
clear: both;
|
||||
width: auto;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* styling for when 3 articles present */
|
||||
.main-content .mdc-card:first-of-type:nth-last-of-type(3) {
|
||||
float: none;
|
||||
clear: both;
|
||||
width: auto;
|
||||
}
|
||||
|
||||
.main-content .mdc-card:nth-of-type(3):last-of-type {
|
||||
float: right;
|
||||
clear: right;
|
||||
}
|
||||
|
||||
.main-content .mdc-card:nth-of-type(2):nth-last-of-type(2) {
|
||||
float: left;
|
||||
clear: left;
|
||||
}
|
||||
12
css/year.css
Normal file
12
css/year.css
Normal file
@@ -0,0 +1,12 @@
|
||||
/* 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);
|
||||
padding-top: 12px;
|
||||
padding-bottom: 12px;
|
||||
}
|
||||
Reference in New Issue
Block a user