Better alignment and space distribution on wordclouds

- also removes "Common" from the "Frustrations and Problems" and "Best" from "Educational Resources" to make things align better?
This commit is contained in:
Sharyn 2018-07-19 11:22:55 +02:00
parent 0b1c145f53
commit f8512a1d7b
4 changed files with 79 additions and 61 deletions

View File

@ -2,6 +2,7 @@
$smallMobile: 375px; $smallMobile: 375px;
$bigMobile: 480px; $bigMobile: 480px;
$tablet: 768px; $tablet: 768px;
$toTablet: 767px;
$toDesktop: 1023px; $toDesktop: 1023px;
$desktop: 1024px; $desktop: 1024px;
$monitor: 1200px; $monitor: 1200px;

View File

@ -1,16 +1,16 @@
import React from 'react'; import React from 'react';
import Parser from 'html-react-parser';
import { PropTypes } from 'prop-types'; import { PropTypes } from 'prop-types';
import './style.scss'; import './style.scss';
const WordCloud = props => ( const WordCloud = props => (
<div <div className="wordcloud" data-index={props.index}>
className="wordcloud" <div className="wordcloud-header">
data-index={props.index}
>
<div>
<p className="number">{ (props.index + 1).toString().padStart(3, '0') }</p> <p className="number">{ (props.index + 1).toString().padStart(3, '0') }</p>
<h3>{ props.words.title }</h3> <h3>{ Parser(props.words.title) }</h3>
</div>
<div className="words-wrap"> <div className="words-wrap">
<div>
{ props.words.cloud.map(word => ( { props.words.cloud.map(word => (
<span <span
key={word.word} key={word.word}

View File

@ -1,21 +1,20 @@
@import './assets/styles/global.scss'; @import './assets/styles/global.scss';
.wordcloud { .wordcloud {
display: flex; padding: calculateRem(32) 0 calculateRem(40) calculateRem(24);
align-items: center;
padding: calculateRem(24) 0 calculateRem(24) calculateRem(24);
outline: none; outline: none;
background-color: $navy; background-color: $navy;
display: flex;
flex-direction: column;
@media (min-width: $tablet) { @media (min-width: $tablet) {
padding-top: calculateRem(40); padding-top: calculateRem(40);
padding-bottom: calculateRem(40);
} }
h3 { h3 {
@include hasRedUnderline; @include hasRedUnderline;
position: relative; position: relative;
margin: calculateRem(-24) 0 calculateRem(60) calculateRem(40); margin: calculateRem(-24) 0 calculateRem(40) calculateRem(40);
color: #fff; color: #fff;
font-family: $secondary-font; font-family: $secondary-font;
font-size: calculateRem(22); font-size: calculateRem(22);
@ -26,12 +25,20 @@
@media (min-width: $tablet) { @media (min-width: $tablet) {
font-size: calculateRem(38); font-size: calculateRem(38);
margin-bottom: calculateRem(60);
} }
&::before { &::before {
z-index: 0; z-index: 0;
bottom: calculateRem(-8); bottom: calculateRem(-8);
} }
br {
@media (max-width: $toTablet) {
display: none;
}
}
} }
p { p {
@ -42,10 +49,14 @@
} }
.words-wrap { .words-wrap {
display: flex;
flex-direction: column;
justify-content: center;
flex-grow: 1;
text-align: center; text-align: center;
padding-right: calculateRem(24); padding-right: calculateRem(24);
> span { > div > span {
display: inline-block; display: inline-block;
line-height: 1.2; line-height: 1.2;
padding: calculateRem(4) calculateRem(12); padding: calculateRem(4) calculateRem(12);

View File

@ -1,6 +1,6 @@
const data = [ const data = [
{ {
title: 'Common Frustrations and Problems', title: 'Frustrations <br/>and Problems',
cloud: [ cloud: [
{ {
'word': 'Testing', 'word': 'Testing',
@ -50,7 +50,7 @@ const data = [
], ],
}, },
{ {
title: 'Commonly Used Tools', title: 'Commonly <br/>Used Tools',
cloud: [ cloud: [
{ {
'word': 'Truffle', 'word': 'Truffle',
@ -110,28 +110,33 @@ const data = [
], ],
}, },
{ {
title: 'Best Educational Resources', title: 'Educational <br/>Resources',
cloud: [ cloud: [
{ {
'word': 'Cryptozombies', 'word': 'Cryptozombies',
'size': 1, 'size': 1,
'url': '//cryptozombies.io', 'url': '//cryptozombies.io',
}, },
{
'word': 'Ethernauts',
'size': 2,
'url': '//ethernaut.zeppelin.solutions',
},
{ {
'word': 'Gas Golf', 'word': 'Gas Golf',
'size': 4, 'size': 4,
'url': '//g.solidity.cc', 'url': '//g.solidity.cc',
}, },
{
'word': 'Ethernauts',
'size': 2,
'url': '//ethernaut.zeppelin.solutions',
},
{ {
'word': 'Readthedocs', 'word': 'Readthedocs',
'size': 1, 'size': 1,
'url': '//solidity.readthedocs.io/en/latest', 'url': '//solidity.readthedocs.io/en/latest',
}, },
{
'word': 'Reddit',
'size': 3,
'url': '//www.reddit.com/r/ethereum',
},
{ {
'word': 'Ethresear.ch', 'word': 'Ethresear.ch',
'size': 1, 'size': 1,
@ -152,11 +157,7 @@ const data = [
'size': 4, 'size': 4,
'url': '//cryptoeconomics.study', 'url': '//cryptoeconomics.study',
}, },
{
'word': 'Reddit',
'size': 3,
'url': '//www.reddit.com/r/ethereum',
},
{ {
'word': 'Stackexchange', 'word': 'Stackexchange',
'size': 3, 'size': 3,
@ -170,48 +171,53 @@ const data = [
], ],
}, },
{ {
title: 'Other Great Ideas', title: 'Other <br/>Great Ideas',
cloud: [ cloud: [
{
'word': 'Event Monitoring Service',
'size': 4,
'url': '',
},
{ {
'word': 'Mainnet Fork Testing Instance', 'word': 'Mainnet Fork Testing Instance',
'size': 1, 'size': 1,
'url': '', 'url': '',
}, },
{
'word': 'Solidity IDE with Visual Debugger',
'size': 2,
'url': '',
},
{
'word': 'Solidity Interpreter',
'size': 2,
'url': '',
},
{
'word': 'Better Debuggers',
'size': 1,
'url': '',
},
{ {
'word': 'Fuzz Testing Tools', 'word': 'Fuzz Testing Tools',
'size': 3, 'size': 3,
'url': '', 'url': '',
}, },
{ {
'word': 'Decentralized Infura', 'word': 'Better Debuggers',
'size': 3, 'size': 1,
'url': '',
},
{
'word': 'Event Monitoring Service',
'size': 4,
'url': '', 'url': '',
}, },
{ {
'word': 'Dappnode', 'word': 'Dappnode',
'size': 4, 'size': 4,
'url': '//github.com/dappnode/DAppNode', 'url': '//github.com/dappnode/DAppNode',
}, },
{
'word': 'Solidity IDE with Visual Debugger',
'size': 2,
'url': '',
},
{
'word': 'Decentralized Infura',
'size': 3,
'url': '',
},
{
'word': 'Solidity Interpreter',
'size': 2,
'url': '',
},
], ],
}, },
]; ];