Skip to content

Commit 0b861fe

Browse files
geoffreydhuyvettersCompuIves
authored andcommitted
Homepage: visual switch for web applications section on mobile (codesandbox#297)
* Switch intro for mobile screen size * Pure flexbox solution * Removed comment * Add @duivvv as a contributor * Update @duivvv as a contributor * Update @duivvv as a contributor * Moved styling to sc definition
1 parent b2a64ad commit 0b861fe

File tree

3 files changed

+80
-55
lines changed

3 files changed

+80
-55
lines changed

.all-contributorsrc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,16 @@
188188
"design",
189189
"ideas"
190190
]
191+
},
192+
{
193+
"login": "duivvv",
194+
"name": "Geoffrey Dhuyvetters",
195+
"avatar_url": "https://avatars3.githubusercontent.com/u/89046?v=4",
196+
"profile": "https://github.com/duivvv",
197+
"contributions": [
198+
"design",
199+
"code"
200+
]
191201
}
192202
]
193203
}

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# [CodeSandbox](https://codesandbox.io) [![Chat](https://img.shields.io/badge/chat-on%20discord-7289da.svg)](https://discord.gg/KE3TbEZ) [![All Contributors](https://img.shields.io/badge/all_contributors-18-orange.svg?style=flat-square)](#contributors) [![Build Status](https://travis-ci.org/CompuIves/codesandbox-client.svg?branch=master)](https://travis-ci.org/CompuIves/codesandbox-client) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com) [![first-timers-only Friendly](https://img.shields.io/badge/first--timers--only-friendly-blue.svg)](http://www.firsttimersonly.com/)
1+
# [CodeSandbox](https://codesandbox.io) [![Chat](https://img.shields.io/badge/chat-on%20discord-7289da.svg)](https://discord.gg/KE3TbEZ) [![All Contributors](https://img.shields.io/badge/all_contributors-19-orange.svg?style=flat-square)](#contributors) [![Build Status](https://travis-ci.org/CompuIves/codesandbox-client.svg?branch=master)](https://travis-ci.org/CompuIves/codesandbox-client) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com) [![first-timers-only Friendly](https://img.shields.io/badge/first--timers--only-friendly-blue.svg)](http://www.firsttimersonly.com/)
22

33
An online code editor with a focus on React.
44

@@ -30,5 +30,5 @@ Thanks goes to these wonderful people ([emoji key](https://github.com/kentcdodds
3030
| [<img src="https://avatars0.githubusercontent.com/u/587016?v=3" width="100px;"/><br /><sub>Ives van Hoorne</sub>](http://ivesvh.com)<br />[💬](#question-CompuIves "Answering Questions") [📝](#blog-CompuIves "Blogposts") [🐛](https://github.com/CompuIves/codesandbox-client/issues?q=author%3ACompuIves "Bug reports") [💻](https://github.com/CompuIves/codesandbox-client/commits?author=CompuIves "Code") [🎨](#design-CompuIves "Design") [📖](https://github.com/CompuIves/codesandbox-client/commits?author=CompuIves "Documentation") [💡](#example-CompuIves "Examples") [🚇](#infra-CompuIves "Infrastructure (Hosting, Build-Tools, etc)") [👀](#review-CompuIves "Reviewed Pull Requests") [⚠️](https://github.com/CompuIves/codesandbox-client/commits?author=CompuIves "Tests") [🔧](#tool-CompuIves "Tools") | [<img src="https://avatars0.githubusercontent.com/u/887639?v=3" width="100px;"/><br /><sub>Donavon West</sub>](http://donavon.com)<br />[💻](https://github.com/CompuIves/codesandbox-client/commits?author=donavon "Code") | [<img src="https://avatars0.githubusercontent.com/u/5266810?v=3" width="100px;"/><br /><sub>Jeff Allen</sub>](http://www.jeffallen.io/)<br />[💻](https://github.com/CompuIves/codesandbox-client/commits?author=vueu "Code") | [<img src="https://avatars0.githubusercontent.com/u/1089897?v=3" width="100px;"/><br /><sub>Ben Gummer</sub>](https://github.com/bengummer)<br />[💻](https://github.com/CompuIves/codesandbox-client/commits?author=bengummer "Code") | [<img src="https://avatars3.githubusercontent.com/u/154732?v=3" width="100px;"/><br /><sub>James Gillmore</sub>](http://twitter.com/faceyspacey)<br />[💻](https://github.com/CompuIves/codesandbox-client/commits?author=faceyspacey "Code") [🐛](https://github.com/CompuIves/codesandbox-client/issues?q=author%3Afaceyspacey "Bug reports") | [<img src="https://avatars1.githubusercontent.com/u/9636410?v=4" width="100px;"/><br /><sub>Ade Viankakrisna Fadlil</sub>](https://musify.id)<br />[💻](https://github.com/CompuIves/codesandbox-client/commits?author=viankakrisna "Code") | [<img src="https://avatars1.githubusercontent.com/u/1854763?v=4" width="100px;"/><br /><sub>Tushar Sonawane</sub>](https://twitter.com/tushkiz)<br />[💬](#question-Tushkiz "Answering Questions") [💻](https://github.com/CompuIves/codesandbox-client/commits?author=Tushkiz "Code") [📖](https://github.com/CompuIves/codesandbox-client/commits?author=Tushkiz "Documentation") [🤔](#ideas-Tushkiz "Ideas, Planning, & Feedback") |
3131
| :---: | :---: | :---: | :---: | :---: | :---: | :---: |
3232
| [<img src="https://avatars3.githubusercontent.com/u/1239401?v=4" width="100px;"/><br /><sub>Johann Hubert Sonntagbauer</sub>](https://github.com/johann-sonntagbauer)<br />[🐛](https://github.com/CompuIves/codesandbox-client/issues?q=author%3Ajohann-sonntagbauer "Bug reports") [💻](https://github.com/CompuIves/codesandbox-client/commits?author=johann-sonntagbauer "Code") | [<img src="https://avatars2.githubusercontent.com/u/9586897?v=4" width="100px;"/><br /><sub>Joachim Seminck</sub>](https://github.com/jseminck)<br />[💻](https://github.com/CompuIves/codesandbox-client/commits?author=jseminck "Code") | [<img src="https://avatars3.githubusercontent.com/u/5210019?v=4" width="100px;"/><br /><sub>Subramanya Chakravarthy</sub>](http://chakrihacker.github.io)<br />[💻](https://github.com/CompuIves/codesandbox-client/commits?author=chakrihacker "Code") | [<img src="https://avatars3.githubusercontent.com/u/23088?v=4" width="100px;"/><br /><sub>Robert (Robby) O'Connor</sub>](http://robby.oconnor.ninja)<br />[🚇](#infra-robbyoconnor "Infrastructure (Hosting, Build-Tools, etc)") | [<img src="https://avatars0.githubusercontent.com/u/2083930?v=4" width="100px;"/><br /><sub>Bogdan Luca</sub>](https://github.com/lbogdan)<br />[🐛](https://github.com/CompuIves/codesandbox-client/issues?q=author%3Albogdan "Bug reports") [💻](https://github.com/CompuIves/codesandbox-client/commits?author=lbogdan "Code") | [<img src="https://avatars3.githubusercontent.com/u/6177621?v=4" width="100px;"/><br /><sub>Divjot Singh</sub>](http://bogas04.github.io)<br />[💻](https://github.com/CompuIves/codesandbox-client/commits?author=bogas04 "Code") | [<img src="https://avatars3.githubusercontent.com/u/5249539?v=4" width="100px;"/><br /><sub>Jason Nall</sub>](http://www.jsonnull.com)<br />[💻](https://github.com/CompuIves/codesandbox-client/commits?author=jsonnull "Code") |
33-
| [<img src="https://avatars3.githubusercontent.com/u/784056?v=4" width="100px;"/><br /><sub>Lionel</sub>](https://elrumordelaluz.com)<br />[💻](https://github.com/CompuIves/codesandbox-client/commits?author=elrumordelaluz "Code") [🎨](#design-elrumordelaluz "Design") | [<img src="https://avatars3.githubusercontent.com/u/170500?v=4" width="100px;"/><br /><sub>Philipp Brumm</sub>](https://github.com/brumm)<br />[💻](https://github.com/CompuIves/codesandbox-client/commits?author=brumm "Code") | [<img src="https://avatars2.githubusercontent.com/u/2678610?v=4" width="100px;"/><br /><sub>Valentin Hervieu</sub>](http://valentin-hervieu.fr)<br />[💻](https://github.com/CompuIves/codesandbox-client/commits?author=ValentinH "Code") [🐛](https://github.com/CompuIves/codesandbox-client/issues?q=author%3AValentinH "Bug reports") | [<img src="https://avatars0.githubusercontent.com/u/1499218?v=4" width="100px;"/><br /><sub>Anenth</sub>](http://anenth.js.org)<br />[💻](https://github.com/CompuIves/codesandbox-client/commits?author=Anenth "Code") [🎨](#design-Anenth "Design") [🤔](#ideas-Anenth "Ideas, Planning, & Feedback") |
33+
| [<img src="https://avatars3.githubusercontent.com/u/784056?v=4" width="100px;"/><br /><sub>Lionel</sub>](https://elrumordelaluz.com)<br />[💻](https://github.com/CompuIves/codesandbox-client/commits?author=elrumordelaluz "Code") [🎨](#design-elrumordelaluz "Design") | [<img src="https://avatars3.githubusercontent.com/u/170500?v=4" width="100px;"/><br /><sub>Philipp Brumm</sub>](https://github.com/brumm)<br />[💻](https://github.com/CompuIves/codesandbox-client/commits?author=brumm "Code") | [<img src="https://avatars2.githubusercontent.com/u/2678610?v=4" width="100px;"/><br /><sub>Valentin Hervieu</sub>](http://valentin-hervieu.fr)<br />[💻](https://github.com/CompuIves/codesandbox-client/commits?author=ValentinH "Code") [🐛](https://github.com/CompuIves/codesandbox-client/issues?q=author%3AValentinH "Bug reports") | [<img src="https://avatars0.githubusercontent.com/u/1499218?v=4" width="100px;"/><br /><sub>Anenth</sub>](http://anenth.js.org)<br />[💻](https://github.com/CompuIves/codesandbox-client/commits?author=Anenth "Code") [🎨](#design-Anenth "Design") [🤔](#ideas-Anenth "Ideas, Planning, & Feedback") | [<img src="https://avatars3.githubusercontent.com/u/89046?v=4" width="100px;"/><br /><sub>Geoffrey Dhuyvetters</sub>](https://github.com/duivvv)<br />[🎨](#design-duivvv "Design") [💻](https://github.com/CompuIves/codesandbox-client/commits?author=duivvv "Code") |
3434
<!-- ALL-CONTRIBUTORS-LIST:END -->

src/homepage/src/screens/home/Frameworks/index.js

Lines changed: 68 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ const Container = styled.div`
3939
display: flex;
4040
flex-direction: row;
4141
height: 255px;
42+
flex: 1;
4243
4344
${media.tablet`
4445
margin-top: 1rem;
@@ -67,17 +68,32 @@ const Pane = styled(MaxWidth)`
6768
const Flex = styled.div`
6869
display: flex;
6970
flex-direction: row;
71+
flex-wrap: wrap;
7072
7173
${media.phone`
7274
flex-direction: column;
7375
`};
7476
`;
7577

78+
const Intro = styled(Column)`
79+
flex: 1;
80+
81+
${media.phone`
82+
order: -1;
83+
`};
84+
`;
85+
7686
const Icons = styled.div`
7787
display: flex;
7888
justify-content: space-around;
7989
margin-top: 1rem;
8090
margin-bottom: 4rem;
91+
flex: 1;
92+
min-width: 100%;
93+
94+
${media.phone`
95+
margin: 2rem 0;
96+
`};
8197
`;
8298

8399
const IconContainer = styled.div`
@@ -208,67 +224,66 @@ export default class Frameworks extends React.Component {
208224

209225
return (
210226
<Pane width={1280}>
211-
<Icons>
212-
{templates.map(({ Icon }, i) => (
213-
<IconContainer
214-
key={i}
215-
selected={templates[i] === template}
216-
template={templates[i]}
217-
onClick={() => {
218-
this.setTemplate(templates[i]);
219-
}}
220-
>
221-
<Icon width={80} height={80} />
222-
</IconContainer>
223-
))}
224-
</Icons>
225-
226227
<Flex>
227-
<Column style={{ marginRight: '2rem' }} flex={4}>
228+
<Icons>
229+
{templates.map(({ Icon }, i) => (
230+
<IconContainer
231+
key={i}
232+
selected={templates[i] === template}
233+
template={templates[i]}
234+
onClick={() => {
235+
this.setTemplate(templates[i]);
236+
}}
237+
>
238+
<Icon width={80} height={80} />
239+
</IconContainer>
240+
))}
241+
</Icons>
242+
243+
<Intro style={{ marginRight: '2rem' }}>
228244
<Heading3>Tailored for web applications</Heading3>
229245
<p>
230246
We know how overwhelming JavaScript development can be. With
231247
CodeSandbox we specifically focus on web application development
232248
to make the experience as smooth as possible. Just open your
233249
browser and start coding.
234250
</p>
235-
</Column>
236-
<Column flex={4}>
237-
<Container color={template.color}>
238-
<RollingText
239-
style={{
240-
display: 'flex',
241-
height: '100%',
242-
alignItems: 'center',
243-
}}
244-
updateCheck={template}
245-
>
246-
<TemplateName color={template.color}>
247-
<template.Icon width={96} height={96} />
248-
<h4>{template.niceName}</h4>
249-
</TemplateName>
250-
</RollingText>
251-
<Padding style={{ width: '100%' }} top={1}>
252-
<HeaderTitle>Supported Loaders</HeaderTitle>
253-
<TemplateIcons color={template.color}>
254-
{TEMPLATE_SUPPORT[template.name].loaders.map((data, i) => (
255-
<FileType
256-
key={template.name + data.title}
257-
iconSrc={data.svg}
258-
title={data.title}
259-
extension={data.extension}
260-
i={i}
261-
/>
262-
))}
263-
</TemplateIcons>
264-
265-
<HeaderTitle>CSS Scoping Support</HeaderTitle>
266-
<CSSTypes>
267-
{TEMPLATE_SUPPORT[template.name].css.join(', ')}
268-
</CSSTypes>
269-
</Padding>
270-
</Container>
271-
</Column>
251+
</Intro>
252+
253+
<Container color={template.color}>
254+
<RollingText
255+
style={{
256+
display: 'flex',
257+
height: '100%',
258+
alignItems: 'center',
259+
}}
260+
updateCheck={template}
261+
>
262+
<TemplateName color={template.color}>
263+
<template.Icon width={96} height={96} />
264+
<h4>{template.niceName}</h4>
265+
</TemplateName>
266+
</RollingText>
267+
<Padding style={{ width: '100%' }} top={1}>
268+
<HeaderTitle>Supported Loaders</HeaderTitle>
269+
<TemplateIcons color={template.color}>
270+
{TEMPLATE_SUPPORT[template.name].loaders.map((data, i) => (
271+
<FileType
272+
key={template.name + data.title}
273+
iconSrc={data.svg}
274+
title={data.title}
275+
extension={data.extension}
276+
i={i}
277+
/>
278+
))}
279+
</TemplateIcons>
280+
281+
<HeaderTitle>CSS Scoping Support</HeaderTitle>
282+
<CSSTypes>
283+
{TEMPLATE_SUPPORT[template.name].css.join(', ')}
284+
</CSSTypes>
285+
</Padding>
286+
</Container>
272287
</Flex>
273288

274289
<Centered horizontal>

0 commit comments

Comments
 (0)