Skip to content

Commit

Permalink
Feature/responsive fixes (oSoc17#93)
Browse files Browse the repository at this point in the history
* Responsive fixes for homepage

* responsive floating steps

* Knutseltips styling fixes

* Small styling fixes

* add polyfill for flexbox

* fix border radius on cards

* use background cover for images
  • Loading branch information
Elias Meire authored and Brysen Ackx committed Jul 27, 2017
1 parent 66459d7 commit 8d55ee9
Show file tree
Hide file tree
Showing 19 changed files with 147 additions and 122 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"connected-react-router": "^4.2.3",
"deep-equal": "^1.0.1",
"firebase": "^4.1.3",
"flexibility": "^2.0.1",
"google-map-react": "^0.24.0",
"jquery": "^3.2.1",
"moment": "^2.18.1",
Expand Down
2 changes: 1 addition & 1 deletion src/components/difficulty/Difficulty.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const Difficulty = props => {

return (
<div className="difficulty tip-difficulty-card">
<p className="card-text tip-difficulty">Moeilijkheidsgraad:</p>
<h3 className="card-text tip-difficulty">Moeilijkheidsgraad</h3>
{data}
</div>
);
Expand Down
9 changes: 8 additions & 1 deletion src/components/modules/ImageModule.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,14 @@ import React from 'react';
const ImageModule = ({ module: { resources, text } }) =>
<article className="container module">
<figure>
<img alt={text.substring(0, 10)} src={resources[0]} />
<div
style={{
backgroundImage: `url(${resources[0]})`,
backgroundPosition: 'center',
backgroundSize: 'cover'
}}
className="img-mask"
/>
<figcaption>
{text}
</figcaption>
Expand Down
9 changes: 6 additions & 3 deletions src/components/modules/QuizModule.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,12 @@ const QuizModule = ({ module, handleChange, users }) => {
<article className="container module module--quiz">
<div className="question-picture-container ">
{module.resources &&
<img
src={module.resources[0]}
alt="QuizImage"
<div
style={{
backgroundImage: `url(${module.resources[0]})`,
backgroundPosition: 'center',
backgroundSize: 'cover'
}}
className="img-mask"
/>}
<p className="quiz-text">
Expand Down
11 changes: 7 additions & 4 deletions src/components/modules/TextblockModule.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@ import React from 'react';

const TextblockModule = ({ module: { resources, text } }) =>
<article className="container module article-centering">
<img
className="img-fluid img-mask"
src={resources[0]}
alt="TextBlockImage"
<div
style={{
backgroundImage: `url(${resources[0]})`,
backgroundPosition: 'center',
backgroundSize: 'cover'
}}
className="img-mask"
/>
<div className="module-text text-centering">
<p>
Expand Down
17 changes: 10 additions & 7 deletions src/components/nav/Navbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import Navlink from './Navlink';
import Button from '../button/Button';
import Navlogo from '../../containers/views/Home/assets/menu-logo.png';
import './Navlink.css';
import { Menu } from 'react-feather';

const Navbar = ({ fixed = true }) => {
return (
Expand All @@ -20,16 +21,18 @@ const Navbar = ({ fixed = true }) => {
aria-expanded="false"
aria-label="Toggle navigation"
>
<span className="navbar-toggler-icon" />
<Menu color="#3274ff" size="36" />
</button>

<div className="navbar-brand nav-logo">
<Navlink to="/">
<img src={Navlogo} alt="nav logo" width="80px" />
<span>Snipstory</span>
</Navlink>
</div>

<div className="collapse navbar-collapse" id="navbarSupportedContent">
<ul className="navbar-nav mr-auto">
<li className="nav-item nav-logo">
<Navlink to="/">
<img src={Navlogo} alt="nav logo" width="80px" />
<span>Snipstory</span>
</Navlink>
</li>
<li className="nav-item">
<Navlink to="/snippers">Snippers bekijken</Navlink>
</li>
Expand Down
12 changes: 9 additions & 3 deletions src/components/nav/Navlink.scss
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,16 @@

.navbar {
background-color: white;
}

.navbar {
justify-content: center;
box-shadow: 0 0 40px 4px $brand-blue--darker;
&-toggler {
border-color: transparent !important;
}
.show {
.nav-item + .nav-item {
margin-top: 1rem;
}
}
}

.navbar-toggler {
Expand Down
16 changes: 14 additions & 2 deletions src/components/step-indicator/FloatingSteps.scss
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,16 @@
.floating-step {
width: 100%;
transition: all $transition-timing;
flex-direction: column;
padding: 1rem 1.5rem;
display: flex;
align-items: center;
flex-direction: row;
.checkmark {
display: none;
}
&__icon {
display: flex;
margin-right: .8rem;
margin-bottom: .8rem;
padding: 1rem;
border-radius: 50%;
box-shadow: $box-shadow;
Expand Down Expand Up @@ -63,3 +63,15 @@
}
}
}

@media (min-width: 90rem) {
.floating-steps {
.floating-step {
flex-direction: row;
&__icon {
margin-right: .8rem;
margin-bottom: 0;
}
}
}
}
27 changes: 10 additions & 17 deletions src/containers/App.scss
Original file line number Diff line number Diff line change
@@ -1,26 +1,19 @@
@import '../variables.scss';
.knutseltips {
.card {
background-color: $brand-blue;
color: white;
}
.difficulty {
.difficulty-counter {
border: 3px solid $brand-red--lighter;
display: inline-block;
margin-left: 1em;
}
.difficulty-counter.filled {
background-color: $brand-red--lighter;
border: 3px solid transparent;
}
}
}

.module {
margin: 7em 0;
}

*:focus {
outline-color: $brand-blue !important;
}
.card {
border-radius: 2.5rem;
img {
border: .5rem $brand-blue solid;
}
}

.room {
margin-top: 3em;
}
Expand Down
12 changes: 7 additions & 5 deletions src/containers/views/Home/Home.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,26 +161,28 @@ class Home extends React.Component {

<div className="container">
<div className="row creations-position">
<div className="col-6">
<div className="col-md-6">
<Creations1 snipper={randomSnippers[0]} />
</div>
<div className="col-6">
<div className="col-md-6">
<Creations1 snipper={randomSnippers[1]} />
</div>
</div>

<div className="row creations-position">
<div className="col-6">
<div className="col-md-6">
<Creations1 snipper={randomSnippers[2]} />
</div>
<div className="col-6">
<div className="col-md-6">
<Creations1 snipper={randomSnippers[3]} />
</div>
</div>
</div>
</section>}
<section className="button-section button-section--white">
<Button size="small" to="/story/select">Start je verhaal hier</Button>
<Button size="small" to="/story/select">
Start je verhaal hier
</Button>
</section>
</main>

Expand Down
18 changes: 17 additions & 1 deletion src/containers/views/Home/Home.scss
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
color: $brand-blue;
font-size: 2rem;
font-weight: 700;
text-align: center;
}

.header-paraf {
Expand Down Expand Up @@ -250,7 +251,6 @@
font-family: $brand-font-stack;
font-size: 1.4rem;
color: $brand-blue;
padding: 2rem 8rem;
text-align: center;
}

Expand All @@ -271,3 +271,19 @@
opacity: 0;
}
}
@media (min-width: 30rem) {
.creation-description {
padding: 2rem 1rem;
}
}
@media (min-width: 60rem) {
.creation-description {
padding: 2rem 4rem;
}
}

@media (min-width: 90rem) {
.creation-description {
padding: 2rem 8rem;
}
}
63 changes: 0 additions & 63 deletions src/containers/views/KnutselTips.js

This file was deleted.

21 changes: 14 additions & 7 deletions src/containers/views/KnutselTips/KnutselTips.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,10 @@ class KnutselTips extends React.Component {
{knutseltips.isFetching
? <Spinner page size="large" />
: <div className="page">
{!storyId && <h1 className="creation-title" style={{ textAlign: 'center' }}>Knutseltips</h1>}
{!storyId &&
<h1 className="creation-title" style={{ textAlign: 'center' }}>
Knutseltips
</h1>}
<div
className="knutseltips"
style={{
Expand Down Expand Up @@ -83,9 +86,9 @@ class KnutselTips extends React.Component {
alt={tip.name}
/>
<div className="card-block">
<h4 className="card-title">
<h2 className="card-title">
{tip.name}
</h4>
</h2>
</div>
<div
className={`${this.state.openedTip !== i
Expand All @@ -96,10 +99,14 @@ class KnutselTips extends React.Component {
{tip.text}
</p>
<Difficulty amount={tip.difficulty} />
<p className="card-text">
Benodigdheden:<br/>
{tip.requirements}
</p>
<div className="card-text">
<h3 className="knutseltip__requirements__title">
Benodigdheden
</h3>
<p>
{tip.requirements}
</p>
</div>
</div>
</div>
)}
Expand Down
Loading

0 comments on commit 8d55ee9

Please sign in to comment.