basic styling
This commit is contained in:
46
assets/stylesheets/course.css
Normal file
46
assets/stylesheets/course.css
Normal file
@@ -0,0 +1,46 @@
|
||||
.course-card {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
min-height: 30vh;
|
||||
padding: var(--grid-gutter);
|
||||
|
||||
border-radius: 7px;
|
||||
box-shadow: var(--card-box-shadow);
|
||||
|
||||
& > * + * {
|
||||
margin-top: var(--grid-gutter);
|
||||
}
|
||||
}
|
||||
|
||||
.course-card__categories {
|
||||
flex: 0 0 var(--line-height);
|
||||
color: var(--color-text-grey);
|
||||
}
|
||||
|
||||
.course-card__title {
|
||||
flex: 1 1 auto;
|
||||
|
||||
& h2 {
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.course-card__description {
|
||||
flex: 1 1 auto;
|
||||
|
||||
& p {
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.course-card__link {
|
||||
flex: 0 0 auto;
|
||||
|
||||
& a {
|
||||
display: inline-block;
|
||||
padding-bottom: 0.3em;
|
||||
border-bottom: 1px solid var(--color-link-content);
|
||||
text-transform: uppercase;
|
||||
color: var(--color-link-content);
|
||||
}
|
||||
}
|
||||
135
assets/stylesheets/global.css
Normal file
135
assets/stylesheets/global.css
Normal file
@@ -0,0 +1,135 @@
|
||||
body {
|
||||
background-color: var(--color-bg-default);
|
||||
color: var(--color-text-default);
|
||||
font-family: Helvetica Neue, Helvetica, Arial, sans-serif;
|
||||
font-size: 1rem;
|
||||
line-height: var(--line-height);
|
||||
}
|
||||
|
||||
.wrapper {
|
||||
max-width: 1024px;
|
||||
margin: 0 auto;
|
||||
padding: 0 2vw;
|
||||
|
||||
@media (--breakpoint-desktop) {
|
||||
padding: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.wrapper-with-sidebar {
|
||||
@media (--breakpoint-desktop) {
|
||||
display: flex;
|
||||
}
|
||||
}
|
||||
|
||||
.wrapper__sidebar {
|
||||
@media (--breakpoint-desktop) {
|
||||
flex: 0 0 220px;
|
||||
padding: var(--grid-gutter);
|
||||
border-radius: 7px;
|
||||
box-shadow: var(--card-box-shadow);
|
||||
|
||||
& > h2 {
|
||||
margin-bottom: calc(var(--grid-gutter) * 3);
|
||||
}
|
||||
}
|
||||
}
|
||||
.wrapper__content {
|
||||
padding: var(--grid-gutter) 0;
|
||||
|
||||
@media (--breakpoint-desktop) {
|
||||
flex: 1 1 auto;
|
||||
margin-left: var(--grid-gutter);
|
||||
}
|
||||
}
|
||||
|
||||
.grid-list {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: space-between;
|
||||
margin: 0 calc(var(--grid-gutter) / 2 * -1);
|
||||
|
||||
& > * {
|
||||
box-sizing: border-box;
|
||||
margin: 0 calc(var(--grid-gutter) / 2) var(--grid-gutter);
|
||||
flex: 0 0 calc(50% - var(--grid-gutter));
|
||||
|
||||
@media (--breakpoint-desktop) {
|
||||
flex: 0 0 calc(33% - var(--grid-gutter));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.grid-list-small {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: space-between;
|
||||
margin: 0 calc(var(--grid-gutter) / 2 * -1);
|
||||
|
||||
& > * {
|
||||
box-sizing: border-box;
|
||||
margin: 0 calc(var(--grid-gutter) / 2) var(--grid-gutter);
|
||||
flex: 0 0 calc(50% - var(--grid-gutter));
|
||||
}
|
||||
}
|
||||
|
||||
.table-of-contents {
|
||||
& ul {
|
||||
list-style: none;
|
||||
margin: var(--grid-gutter) 0;
|
||||
padding: 0;
|
||||
padding-left: calc(var(--grid-gutter) * 2);
|
||||
|
||||
& li {
|
||||
margin: 0 0 var(--grid-gutter);
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
& a {
|
||||
display: block;
|
||||
|
||||
&.active {
|
||||
position: relative;
|
||||
font-weight: bold;
|
||||
|
||||
&:before,
|
||||
&:after {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
}
|
||||
&:before {
|
||||
content: '';
|
||||
left: calc(var(--grid-gutter) * 3 * -1);
|
||||
bottom: 0;
|
||||
width: 3px;
|
||||
background: var(--color-course-active);
|
||||
}
|
||||
&:after {
|
||||
content: '👁';
|
||||
left: calc(var(--grid-gutter) * 2 * -1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.sidebar-menu {
|
||||
& ul {
|
||||
list-style: none;
|
||||
margin: var(--grid-gutter) 0;
|
||||
padding: 0;
|
||||
|
||||
& li {
|
||||
margin: 0 0 var(--grid-gutter);
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
& a {
|
||||
display: block;
|
||||
|
||||
&.active {
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
113
assets/stylesheets/header.css
Normal file
113
assets/stylesheets/header.css
Normal file
@@ -0,0 +1,113 @@
|
||||
.header {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
|
||||
margin-top: var(--grid-gutter);
|
||||
padding-bottom: var(--grid-gutter);
|
||||
margin-bottom: var(--grid-gutter);
|
||||
|
||||
border-bottom: 2px solid var(--color-bg-separator);
|
||||
|
||||
@media (--breakpoint-desktop) {
|
||||
flex-wrap: nowrap;
|
||||
}
|
||||
|
||||
& .header__logo,
|
||||
& .header__navarea {
|
||||
display: flex;
|
||||
flex: 0 0 100%;
|
||||
}
|
||||
|
||||
& .header__logo {
|
||||
align-items: center;
|
||||
|
||||
@media (--breakpoint-desktop) {
|
||||
flex: 0 0 200px;
|
||||
}
|
||||
}
|
||||
|
||||
& .header__navarea {
|
||||
flex-direction: column;
|
||||
justify-content: space-around;
|
||||
|
||||
@media (--breakpoint-desktop) {
|
||||
flex: 1 0 auto;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.header__navarea {
|
||||
& form {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
|
||||
@media (--breakpoint-desktop) {
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
& > * {
|
||||
flex: 0 0 auto;
|
||||
}
|
||||
|
||||
& fieldset {
|
||||
padding: 0.2em 1em;
|
||||
margin: 0;
|
||||
border: none;
|
||||
background: var(--color-bg-grey);
|
||||
color: var(--color-text-grey);
|
||||
border-radius: var(--border-radius);
|
||||
font-size: 0.8em;
|
||||
|
||||
& + fieldset {
|
||||
margin-left: var(--grid-gutter)
|
||||
}
|
||||
|
||||
& label + select {
|
||||
margin-left: 0.5em;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.navigation {
|
||||
& nav {
|
||||
& ul {
|
||||
display: flex;
|
||||
list-style: none;
|
||||
flex-wrap: wrap;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
|
||||
@media (--breakpoint-desktop) {
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
& li {
|
||||
margin: 0;
|
||||
|
||||
& + li {
|
||||
margin-left: calc(var(--grid-gutter) / 4);
|
||||
}
|
||||
|
||||
& a {
|
||||
display: block;
|
||||
text-transform: uppercase;
|
||||
font-weight: bold;
|
||||
padding: 0.7em 1em;
|
||||
color: var(--color-text-grey);
|
||||
border-radius: var(--border-radius);
|
||||
|
||||
&.active,
|
||||
&:hover {
|
||||
background: var(--color-bg-grey);
|
||||
}
|
||||
|
||||
&.active {
|
||||
color: var(--color-text-default);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
25
assets/stylesheets/homepage.css
Normal file
25
assets/stylesheets/homepage.css
Normal file
@@ -0,0 +1,25 @@
|
||||
.hero {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.hero__image {
|
||||
background-color: #20B5B6;
|
||||
width: 65%;
|
||||
height: 600px;
|
||||
border-radius: .375rem;
|
||||
box-shadow: var(--card-box-shadow);
|
||||
}
|
||||
.featured-cards-list {
|
||||
width: 30%;
|
||||
height: 600px;
|
||||
display:flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.featured-cards__list {
|
||||
background-color: #00AAE0;
|
||||
height: 150px;
|
||||
border-radius: .375rem;
|
||||
box-shadow: var(--card-box-shadow);
|
||||
}
|
||||
19
assets/stylesheets/module.css
Normal file
19
assets/stylesheets/module.css
Normal file
@@ -0,0 +1,19 @@
|
||||
.module {
|
||||
max-width: 1024px;
|
||||
margin: 0 auto;
|
||||
padding: 0 2vw;
|
||||
|
||||
@media (--breakpoint-desktop) {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
|
||||
& img {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
& + .module {
|
||||
margin-top: var(--grid-gutter);
|
||||
}
|
||||
}
|
||||
11
assets/stylesheets/style.css
Normal file
11
assets/stylesheets/style.css
Normal file
@@ -0,0 +1,11 @@
|
||||
@import 'normalize.css';
|
||||
|
||||
@import './variables';
|
||||
|
||||
@import './typography';
|
||||
@import './global';
|
||||
@import './header';
|
||||
|
||||
@import './homepage';
|
||||
@import './course';
|
||||
@import './module';
|
||||
10
assets/stylesheets/typography.css
Normal file
10
assets/stylesheets/typography.css
Normal file
@@ -0,0 +1,10 @@
|
||||
h1, h2, h3, h4, h5, h6 {
|
||||
&:first-child {
|
||||
margin-top: 0;
|
||||
}
|
||||
}
|
||||
|
||||
a {
|
||||
color: inherit;
|
||||
text-decoration: none;
|
||||
}
|
||||
23
assets/stylesheets/variables.css
Normal file
23
assets/stylesheets/variables.css
Normal file
@@ -0,0 +1,23 @@
|
||||
@custom-media --breakpoint-desktop (min-width: 700px);
|
||||
|
||||
:root {
|
||||
--grid-gutter: 1rem;
|
||||
--border-radius: 3px;
|
||||
|
||||
--line-height: 1.5em;
|
||||
|
||||
--color-text-default: #2a303a;
|
||||
--color-text-grey: #8091a5;
|
||||
|
||||
--color-link-content: #5c9fef;
|
||||
|
||||
--color-bg-default: #fff;
|
||||
--color-bg-grey: #f7f9fa;
|
||||
--color-bg-separator: #f2f5f7;
|
||||
|
||||
--color-sidebar-bg: #f7f9fa;
|
||||
|
||||
--color-course-active: #536171;
|
||||
|
||||
--card-box-shadow: 0px 1px 3px 0px rgba(0, 0, 0, .45);
|
||||
}
|
||||
16
package.json
16
package.json
@@ -6,7 +6,9 @@
|
||||
"start:watch": "nodemon ./bin/www --ignore public/",
|
||||
"start": "node ./bin/www",
|
||||
"lint": "eslint ./app.js routes",
|
||||
"format": "eslint --fix . bin --ignore public node_modules"
|
||||
"format": "eslint --fix . bin --ignore public node_modules",
|
||||
"styles": "postcss -c ./postcss.config.js ./assets/stylesheets/style.css -d ./public/stylesheets",
|
||||
"styles:watch": "npm run styles -- -w"
|
||||
},
|
||||
"dependencies": {
|
||||
"body-parser": "~1.15.2",
|
||||
@@ -16,14 +18,22 @@
|
||||
"dotenv": "^4.0.0",
|
||||
"express": "~4.14.0",
|
||||
"morgan": "~1.7.0",
|
||||
"normalize.css": "^7.0.0",
|
||||
"pug": "~2.0.0-beta6",
|
||||
"serve-favicon": "~2.3.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"nodemon": "^1.12.1",
|
||||
"eslint": "^3.16.0",
|
||||
"eslint-config-standard": "^6.2.1",
|
||||
"eslint-plugin-promise": "^3.4.2",
|
||||
"eslint-plugin-standard": "^2.0.1"
|
||||
"eslint-plugin-standard": "^2.0.1",
|
||||
"nodemon": "^1.12.1",
|
||||
"postcss": "^6.0.12",
|
||||
"postcss-browser-reporter": "^0.5.0",
|
||||
"postcss-cli": "^4.1.1",
|
||||
"postcss-cssnext": "^3.0.2",
|
||||
"postcss-import": "^11.0.0",
|
||||
"postcss-reporter": "^5.0.0",
|
||||
"postcss-url": "^7.1.2"
|
||||
}
|
||||
}
|
||||
|
||||
9
postcss.config.js
Normal file
9
postcss.config.js
Normal file
@@ -0,0 +1,9 @@
|
||||
module.exports = {
|
||||
plugins: {
|
||||
'postcss-import': {},
|
||||
'postcss-url': {},
|
||||
'postcss-cssnext': {},
|
||||
'postcss-browser-reporter': {},
|
||||
'postcss-reporter': {}
|
||||
}
|
||||
}
|
||||
BIN
public/images/logo.png
Normal file
BIN
public/images/logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.4 KiB |
File diff suppressed because it is too large
Load Diff
@@ -17,7 +17,7 @@ exports.getCourses = () => {
|
||||
|
||||
exports.getLandingPage = () => {
|
||||
// our Home page is fully configureable via contentful
|
||||
return client.getEntries({content_type: 'landingPage', 'fields.slug': 'contentful-university'})
|
||||
return client.getEntries({content_type: 'landingPage', 'fields.slug': 'contentful-university', include: 10})
|
||||
.then((response) => response.items[0])
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
extends layout
|
||||
|
||||
block content
|
||||
.wrapper
|
||||
h1= title
|
||||
p Welcome to #{title}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
extends layout
|
||||
|
||||
block content
|
||||
.wrapper
|
||||
h1= title
|
||||
p Welcome to #{title}
|
||||
|
||||
@@ -1,12 +1,21 @@
|
||||
extends layout
|
||||
|
||||
block content
|
||||
h1= course.fields.title
|
||||
if lesson
|
||||
p= lesson.fields.description
|
||||
else
|
||||
p= course.fields.description
|
||||
.wrapper.wrapper-with-sidebar
|
||||
section.wrapper__sidebar
|
||||
h2 Table of contents
|
||||
.table-of-contents
|
||||
ul
|
||||
li
|
||||
a.active(href=`/courses/${course.fields.slug}`) Course overview
|
||||
each lesson in course.fields.lessons
|
||||
li
|
||||
a(href=`/courses/${course.fields.slug}/lessons/${lesson.fields.slug}`) #{lesson.fields.title}
|
||||
section.wrapper__content
|
||||
h1= course.fields.title
|
||||
|
||||
if lesson
|
||||
h2= lesson.fields.title
|
||||
p= lesson.fields.description
|
||||
else
|
||||
p= course.fields.description
|
||||
|
||||
@@ -3,9 +3,18 @@ extends layout
|
||||
include mixins/_courseCard
|
||||
|
||||
block content
|
||||
.wrapper.wrapper-with-sidebar
|
||||
section.wrapper__sidebar
|
||||
h2 Categories
|
||||
.sidebar-menu
|
||||
ul
|
||||
li
|
||||
a.active(href=`/courses`) All courses
|
||||
each category in categories
|
||||
li
|
||||
a(href=`/courses/categories/${category.sys.id}`) #{category.fields.title}
|
||||
section.wrapper__content
|
||||
h1= title
|
||||
.courses.grid-list-small
|
||||
each course in courses
|
||||
+courseCard(course)
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
extends layout
|
||||
|
||||
block content
|
||||
.wrapper
|
||||
h1= message
|
||||
h2= error.status
|
||||
pre #{error.stack}
|
||||
|
||||
@@ -4,22 +4,36 @@ html
|
||||
title= title
|
||||
link(rel='stylesheet', href='/stylesheets/style.css')
|
||||
body
|
||||
header
|
||||
.header__navbar--logo
|
||||
a.logo--link(href='#') Contentful University
|
||||
.header__navbar--navigation
|
||||
header.header.wrapper
|
||||
section.header__logo
|
||||
a.logo--link(href='#')
|
||||
img(src='/images/logo.png' alt='Contentful University')
|
||||
section.header__navarea
|
||||
section.controls
|
||||
form(action="." method="get")
|
||||
fieldset
|
||||
label(for='api') API type:
|
||||
select(name='api' onChange='this.form.submit()')
|
||||
option(value='CDA') Delivery API
|
||||
option(value='CPA') Preview API
|
||||
fieldset
|
||||
label(for='locale') Language:
|
||||
select(name='locale' onChange='this.form.submit()')
|
||||
option(value='en-US') English
|
||||
option(value='de-DE') German
|
||||
section.navigation
|
||||
nav
|
||||
ul
|
||||
li
|
||||
a.button--navigation(href='/') Home
|
||||
a.active(href='/') Home
|
||||
li
|
||||
a.button--navigation(href='/courses') Courses
|
||||
a(href='/courses') Courses
|
||||
li
|
||||
a.button--navigation(href='/categories') Categories
|
||||
a(href='/categories') Categories
|
||||
li
|
||||
a.button--navigation(href='/about') About
|
||||
a(href='/about') About
|
||||
li
|
||||
a.button--navigation(href='/settings') Settings
|
||||
a(href='/settings') Settings
|
||||
li
|
||||
a.button--navigation(href='/sitemap') Sitemap
|
||||
a(href='/sitemap') Sitemap
|
||||
block content
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
mixin courseCard(course = {fields: {title: '', description: '', categories: [], slug: ''}})
|
||||
.course
|
||||
.course__categories
|
||||
if course.fields.categories
|
||||
.course-card
|
||||
.course-card__categories
|
||||
if(course.fields.categories)
|
||||
each category in course.fields.categories
|
||||
a.course__categories--category(href=`categories/${category.fields.slug}`) #{category.title}
|
||||
h1.course__title #{course.fields.title}
|
||||
.course__description #{course.fields.shortDescription}
|
||||
a.course__link(href=`/courses/${course.fields.slug}`) view more
|
||||
a(href=`categories/${category.fields.slug}`) #{category.title}
|
||||
.course-card__title
|
||||
h2= course.fields.title
|
||||
.course-card__description
|
||||
p= course.fields.shortDescription
|
||||
.course-card__link
|
||||
a(href=`/courses/${course.fields.slug}`) view course
|
||||
|
||||
|
||||
@@ -4,4 +4,4 @@ mixin highlightedCourseModule(module)
|
||||
.module
|
||||
.module__higlightedCourse
|
||||
h1.module__higlightedCourse__title #{module.fields.title}
|
||||
+courseCard(module.course)
|
||||
+courseCard(module.fields.course)
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
extends layout
|
||||
|
||||
block content
|
||||
.wrapper
|
||||
h1= title
|
||||
form(action=`/settings` method="POST" class="form")
|
||||
label(for="space") Space
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
extends layout
|
||||
|
||||
block content
|
||||
.wrapper
|
||||
h1= title
|
||||
p Welcome to #{title}
|
||||
|
||||
Reference in New Issue
Block a user