Skip to content

Commit

Permalink
update suggestor example app (markup/styles)
Browse files Browse the repository at this point in the history
- clean up index.html
  • Loading branch information
carloluis committed May 4, 2018
1 parent 5530a65 commit 0802a2d
Show file tree
Hide file tree
Showing 9 changed files with 142 additions and 76 deletions.
36 changes: 36 additions & 0 deletions example/components/app/App.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import React from 'react';
import Example from '../example/Example';
import styles from './app.css';

const App = () => (
<React.Fragment>
<header className={styles.header}>
<div className={styles.title}>
<h1>{'<ssuggestor>'}</h1>
<h2>React Simple Suggestor</h2>
</div>
<a
className={styles.link}
href="https://github.com/carloluis/ssuggestor"
target="_blank"
rel="noopener noreferrer"
>
Code and Docs on GitHub
</a>
</header>
<section className={styles.container}>
<Example />
</section>
<footer className={styles.footer}>
<span>
MIT &copy;{' '}
<a href="https://twitter.com/carloluis_" target="_blank" rel="noopener noreferrer">
Carloluis
</a>{' '}
2017
</span>
</footer>
</React.Fragment>
);

export default App;
72 changes: 72 additions & 0 deletions example/components/app/app.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
@import '../../styles/palette.css';

.header {
background-color: var(--blue);
text-align: center;
padding: 24px 24px 0;
margin-bottom: 24px;
position: sticky;
top: -50px;
z-index: 11;
}

.header::after {
position: absolute;
content: '';
display: block;
left: 0;
bottom: -24px;
border-style: solid;
border-width: 0 100vw 24px 0;
border-color: transparent var(--blue) transparent transparent;
}

.title {
padding: 16px 0;
text-align: center;
color: var(--white);
margin: 0 auto;
}

.title h2 {
font-size: 24px;
}

.link {
display: inline-block;
background-color: var(--grey);
color: var(--blue);
text-align: center;
padding: 8px 16px;
transition: all 0.3s ease-in-out;
}

.link:hover {
text-decoration: none;
font-weight: 500;
}

.container {
max-width: 640px;
width: 90%;
margin: 0 auto;
padding: 16px;
}

.footer {
position: fixed;
bottom: 0;
left: 0;
right: 0;
z-index: 11;
text-align: center;
background-color: var(--grey);
padding: 8px 16px;
color: var(--blue);
}

.footer a:hover {
text-decoration: none;
color: var(--blue);
font-weight: 500;
}
1 change: 1 addition & 0 deletions example/components/example/Example.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import Suggestor from '../../../src';
import Section from '../section/Section';
import Update from '../update/Update';
import { countries, suggestions, numbers } from '../../data';
import './example.css';

const valueSelected = (value, item) => console.info('select: %s -> %o', value, item);
const valueChanged = value => console.info('change to:', value);
Expand Down
15 changes: 15 additions & 0 deletions example/components/example/example.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
:global .suggestor input {
font-weight: 600;
font-size: 20px;
height: 40px;
}

:global .suggestor li {
font-size: 16px;
height: 26px;
}

:global .suggestor ::-webkit-input-placeholder {
font-weight: normal;
font-size: 18px;
}
4 changes: 2 additions & 2 deletions example/components/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import Example from './example/Example';
import App from './app/App';

export default Example;
export default App;
21 changes: 7 additions & 14 deletions example/index.css
Original file line number Diff line number Diff line change
@@ -1,19 +1,12 @@
@import './styles/palette.css';

* {
box-sizing: border-box;
}

:global .suggestor input {
font-weight: 600;
font-size: 20px;
height: 40px;
}

:global .suggestor li {
font-size: 16px;
height: 26px;
}

:global .suggestor ::-webkit-input-placeholder {
font-weight: normal;
font-size: 18px;
body {
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
font-size: 14px;
line-height: 1.42857143;
overflow-x: hidden;
}
59 changes: 1 addition & 58 deletions example/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,67 +10,10 @@
<meta name="description" content="ssuggestor - React Simple Suggestor">
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u"
crossorigin="anonymous">
<style>
:root {
--light-blue: #5EBDF7;
--blue: #1187B9;
--grey: #eaeaea;
--white: #FFF;
}

.container {
padding: 24px 0 0;
margin: 0 auto;
max-width: 640px;
}

header {
background-color: var(--blue);
}

header .container {
padding: 20px 0 40px;
text-align: center;
color: var(--white);
}

.info {
background-color: var(--grey);
height: 40px;
text-align: center;
padding: 10px;
}

@media only screen and (max-width: 720px) {
.container {
padding: 24px 4px 0;
max-width: 90%;
}
}
</style>
</head>

<body>
<header>
<div class="container">
<h1>&LeftAngleBracket; ssuggestor &RightAngleBracket;</h1>
<h3>React Simple Suggestor</h3>
</div>
<div class="info">
<span>
<a href="https://github.com/carloluis/ssuggestor" target="_blank">Code and Docs on GitHub</a>
</span>
</div>
</header>
<section class="container">
<div id="example">Loading...</div>
</section>
<footer>
<div class="info">
<span>Copyright &copy;
<a href="https://twitter.com/carloluis_" target="_blank">Carloluis</a> 2017. MIT Licensed.</span>
</div>
</footer>
<div id="app">loading...</div>
</body>

</html>
4 changes: 2 additions & 2 deletions example/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import ReactDOM from 'react-dom';
import Example from './components';
import App from './components';
import './index.css';

ReactDOM.render(<Example />, document.getElementById('example'));
ReactDOM.render(<App />, document.getElementById('app'));
6 changes: 6 additions & 0 deletions example/styles/palette.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
:root {
--light-blue: #5ebdf7;
--blue: #1187b9;
--grey: #eaeaea;
--white: #fff;
}

0 comments on commit 0802a2d

Please sign in to comment.