Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ch/browser graphic #467

Merged
merged 8 commits into from
Jan 9, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions packages/microcosm-www-next/src/components/browser-graphic.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import React from 'react'
import { cat } from '../images'

const BrowserGraphic = () => (
<div className="browser-graphic">
<header>
<p>Quizzfeed</p>
</header>
<main>
<div className="content">
<ol className="content__list">
<li>Cool</li>
<li>Curious</li>
<li>Calm</li>
<li>Cautious</li>
</ol>
</div>
<div className="graphic">
<img src={cat} className="graphic__img" alt="TODO" />
</div>
</main>
</div>
)

export default BrowserGraphic
16 changes: 10 additions & 6 deletions packages/microcosm-www-next/src/components/graphic.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React from 'react'
import BrowserGraphic from './browser-graphic'

const Graphic = ({ section, microcosmView }) => (
<figure
Expand All @@ -7,12 +8,15 @@ const Graphic = ({ section, microcosmView }) => (
data-module="ObserveGraphic"
data-section={section}
>
<img
src={
microcosmView ? `/${section}-microcosm.png` : `/${section}-browser.png`
}
alt="TODO"
/>
{microcosmView || section === 0 || section == 9 ? (
<img
src={`/${section}-microcosm.png`}
className="microcosm-graphic"
alt="TODO"
/>
) : (
<BrowserGraphic />
)}
</figure>
)

Expand Down
2 changes: 2 additions & 0 deletions packages/microcosm-www-next/src/data/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"num": "Introduction",
"heading": "Welcome to Microcosm",
"microcosmText": "Intro lorem ipsum",
"browserText": "Intro lorem ipsum",
"bookend": true
},
"1": {
Expand Down Expand Up @@ -57,6 +58,7 @@
"num": "Conclusion",
"heading": "Conclusion",
"microcosmText": "So that's a quick recap of Microcosm's players and how they work together. How Presenters push Actions up the hierarchy, how History watches over the Actions as they move through their status lifecycle, how Repos/Domains respond to keep state up to date, and how Presenters (completing the cycle) consume that state.<br>This is one of the simplest explanations of the functionality available when using Microcosm. Check out the documentation for examples and explanations of some of the more powerful features.<br>Under the hood there are loads of performance optimizations to ensure duplicate calculations are kept to a minimum, helping your application run as quickly as possible, leaving you to worry about the business logic. We have big plans for the future of Microcosm along these lines, aiming to maintain a strong balance between hyper-optimized and easy-to-use.",
"browserText": "So that's a quick recap of Microcosm's players and how they work together. How Presenters push Actions up the hierarchy, how History watches over the Actions as they move through their status lifecycle, how Repos/Domains respond to keep state up to date, and how Presenters (completing the cycle) consume that state.<br>This is one of the simplest explanations of the functionality available when using Microcosm. Check out the documentation for examples and explanations of some of the more powerful features.<br>Under the hood there are loads of performance optimizations to ensure duplicate calculations are kept to a minimum, helping your application run as quickly as possible, leaving you to worry about the business logic. We have big plans for the future of Microcosm along these lines, aiming to maintain a strong balance between hyper-optimized and easy-to-use.",
"bookend": true
}
}
Expand Down
Binary file added packages/microcosm-www-next/src/images/cat.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion packages/microcosm-www-next/src/images/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import menu from './menu.png'
import cat from './cat.png'
import VigetLogo from './viget-logo.js'
import microcosmLogo from './microcosm-logo.png'
import BrowserIcon from './browser-icon.js'
import PlanetIcon from './planet-icon.js'

export { menu, VigetLogo, microcosmLogo, BrowserIcon, PlanetIcon }
export { menu, cat, VigetLogo, microcosmLogo, BrowserIcon, PlanetIcon }
6 changes: 5 additions & 1 deletion packages/microcosm-www-next/src/pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,11 @@ export default class IndexPage extends React.Component {

<div className="section__graphic">
{this.state.numSections.map(num => (
<Graphic key={num} section={num} microcosmView={microcosmView} />
<Graphic
key={num}
section={parseInt(num)}
microcosmView={microcosmView}
/>
))}
</div>
</section>
Expand Down
3 changes: 2 additions & 1 deletion packages/microcosm-www-next/src/stylesheets/app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,6 @@
@import 'structure/footer';

// components (page level blocks and components)
@import 'components/browser-graphic';
@import 'components/side-nav';
@import 'components/toggle-container';
@import 'components/toggle-container';
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
$header-height-sm: 60px;
$header-height-lg: 100px;
$left-padding-sm: rem(20);
$left-padding-lg: rem(40);

.browser-graphic {
@include font-family-medium;
background: #fff;
border-color: #e4e4e4;
border-radius: 10px;
border-style: solid;
border-width: 40px 20px 20px;
height: 76vw;
max-height: inherit;
text-transform: uppercase;

&::before {
color: #bebebe;
content: "\2022\2022\2022";
font-size: rem(33);
position: absolute;
top: -2px;
}

header {
align-items: center;
border-bottom: 5px solid #e4e4e4;
color: #ff0000;
display: flex;
font-size: rem(20);
height: $header-height-sm;
padding-left: $left-padding-sm;

@include breakpoint(small-tablet-up) {
font-size: rem(27);
height: $header-height-lg;
padding-left: $left-padding-lg;
}
}

main {
display: flex;
height: calc(100% - #{$header-height-sm});

@include breakpoint(small-tablet-up) {
height: calc(100% - #{$header-height-lg});
}
}

.content,
.graphic {
flex-basis: 50%;
}

.graphic {
background: linear-gradient(#5385e1 70%, #3a69c0 70%);
}

.graphic__img {
margin: 0 auto;
max-width: 90%;
position: relative;
top: 43%;
}

.content {
align-items: center;
display: flex;
}

.content__list {
list-style-type: upper-alpha;
padding-left: $left-padding-sm * 2;

@include breakpoint(small-tablet-up) {
padding-left: $left-padding-lg * 2;
}

li {
color: #646464;
margin: rem(10) 0;

@media screen and (min-width: 472px) {
font-size: rem(23);
margin: rem(20) 0;
}

@include breakpoint(small-tablet-up) {
font-size: rem(30);
margin: rem(30) 0;
}

@include breakpoint(large-tablet-up) {
font-size: rem(34);
padding-left: rem(20);
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ $section-top-padding-desktop: $nav-height + 110px;
}
}

img {
.microcosm-graphic {
height: 100%;
width: 100%;
}
Expand Down