Change overall layout and style

pull/1/head^2
MAGIC 2017-08-19 23:18:04 +02:00
parent b6de980119
commit 48a335d9b8
Signed by: magic
GPG Key ID: A40EE5665510C9D5
8 changed files with 45 additions and 14 deletions

View File

@ -48,7 +48,9 @@
"prop-types": "^15.5.10", "prop-types": "^15.5.10",
"react": "^15.6.1", "react": "^15.6.1",
"react-dom": "^15.6.1", "react-dom": "^15.6.1",
"react-fontawesome": "^1.6.1",
"react-helmet": "^5.1.3", "react-helmet": "^5.1.3",
"react-router": "^4.1.2" "react-router": "^4.1.2",
"webfontloader": "^1.6.28"
} }
} }

View File

@ -5,9 +5,19 @@ import Countdown from './Countdown';
import Header from './Header'; import Header from './Header';
import ProgressCircle from './ProgressCircle'; import ProgressCircle from './ProgressCircle';
import getUpcomingDate from './getUpcomingDate'; import getUpcomingDate from './getUpcomingDate';
import FontAwesome from 'react-fontawesome';
import WebFont from 'webfontloader';
import style from './App.sass'; import style from './App.sass';
WebFont.load({
google: {
families: ['Titillium Web:300,400,700', 'sans-serif']
}
});
class App extends React.Component { class App extends React.Component {
static propTypes = { static propTypes = {
getNow: PropTypes.func, getNow: PropTypes.func,
@ -60,10 +70,13 @@ class App extends React.Component {
<div className={style.content}> <div className={style.content}>
<div className={style.contentContainer}> <div className={style.contentContainer}>
<p> <p>
The next VIzon draw is on {nextUpcomingDate.format('dddd')}, {nextUpcomingDate.format('L LT')}. The next VIzon draw is on {nextUpcomingDate.format('dddd')}, {nextUpcomingDate.format('L LT z')}.
</p> </p>
<Countdown date={nextUpcomingDate} /> <Countdown date={nextUpcomingDate} />
</div> </div>
<div className={style.footer}>
Made by Icedream & MAGIC
</div>
</div> </div>
</div> </div>
); );

View File

@ -1,15 +1,16 @@
.app .app
background-color: #f8f8f8 background: radial-gradient(ellipse at bottom, #1c2837 0%, #050608 100%)
background: -webkit-radial-gradient(ellipse at bottom, #1c2837 0%, #050608 100%)
min-height: 100vh min-height: 100vh
font-size: 24px font-size: 24px
font-family: 'Titillium Web', sans-serif
display: flex display: flex
flex-direction: column flex-direction: column
justify-content: stretch justify-content: stretch
align-items: center align-items: center
.content .content
color: #222 color: #838383
line-height: 1.5 line-height: 1.5
width: 100% width: 100%
max-width: 1024px max-width: 1024px
@ -17,3 +18,16 @@
box-sizing: content-box box-sizing: content-box
flex-grow: 1 flex-grow: 1
text-align: center text-align: center
.footer
color: #fff
position: absolute
right: 0
bottom: 0
left: 0
padding: 5px
border: 0
border-top: 1px solid white
opacity: .1
font-size: 20px
text-align: right

View File

@ -8,7 +8,7 @@ import style from './Countdown.sass';
export default class Countdown extends React.Component { export default class Countdown extends React.Component {
static propTypes = { static propTypes = {
date: PropTypes.object.isRequired, date: PropTypes.instanceOf(moment).isRequired,
locale: PropTypes.string, locale: PropTypes.string,
minimumIntegerDigits: PropTypes.number, minimumIntegerDigits: PropTypes.number,
useGrouping: PropTypes.bool, useGrouping: PropTypes.bool,
@ -59,7 +59,7 @@ export default class Countdown extends React.Component {
const { locale, minimumIntegerDigits, useGrouping } = this.props; const { locale, minimumIntegerDigits, useGrouping } = this.props;
return ( return (
<div className={style.countdown}> <div className={style.countdown}>
<ProgressCircle size={size} max={3} progress={days} stroke="rgb(60, 90, 128)"> <ProgressCircle size={size} max={3} progress={days} stroke="rgb(76,114,163)">
<DigitBlock suffix="d"> <DigitBlock suffix="d">
{days.toLocaleString(locale, { {days.toLocaleString(locale, {
minimumIntegerDigits, minimumIntegerDigits,
@ -83,7 +83,7 @@ export default class Countdown extends React.Component {
})} })}
</DigitBlock> </DigitBlock>
</ProgressCircle> </ProgressCircle>
<ProgressCircle size={size} max={60} progress={seconds} stroke="rgb(155, 50, 70)"> <ProgressCircle size={size} max={60} progress={seconds} stroke="rgb(193,63,88)">
<DigitBlock suffix="s"> <DigitBlock suffix="s">
{durationMoment.seconds().toLocaleString(locale, { {durationMoment.seconds().toLocaleString(locale, {
minimumIntegerDigits, minimumIntegerDigits,

View File

@ -1,10 +1,9 @@
.header .header
background-color: #222
color: #f8f8f8 color: #f8f8f8
font-family: 'Titillium Web', sans-serif
font-weight: bold font-weight: bold
font-size: 1.5em font-size: 1.5em
text-align: center text-align: center
box-shadow: 0px 4px 4vh 4px rgba(34,34,34,0.9)
z-index: 2 z-index: 2
padding: 12px 0 padding: 12px 0
width: 100% width: 100%

View File

@ -70,7 +70,7 @@ ProgressCircle.propTypes = {
ProgressCircle.defaultProps = { ProgressCircle.defaultProps = {
stroke: '#444', stroke: '#444',
backStroke: '#eee', backStroke: 'rgba(102, 166, 229, 0.12)',
strokeWidth: 10, strokeWidth: 10,
progress: 0.5, progress: 0.5,
min: 0, min: 0,

View File

@ -4,10 +4,10 @@
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta http-equiv="x-ua-compatible" content="ie=edge"> <meta http-equiv="x-ua-compatible" content="ie=edge">
<title>my-app</title> <title>VIzon Countdown</title>
<meta name="description" content=""> <meta name="description" content="">
</head> </head>
<body> <body>
<div id="app"></div> <noscript>This website requires JavaScript, please enable it.</noscript>
</body> </body>
</html> </html>

View File

@ -4,4 +4,7 @@ import { render } from 'react-dom';
import './index.sass'; import './index.sass';
import App from './App'; import App from './App';
render(<App />, document.querySelector('#app')); // Create div node to render app in
const rootContainer = document.createElement('div');
document.body.appendChild(rootContainer);
render(<App />, rootContainer);