Skip to content

Commit

Permalink
styled load more button, close #1, update test
Browse files Browse the repository at this point in the history
  • Loading branch information
moebiusmania committed Sep 18, 2018
1 parent 92de874 commit 84d5803
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 8 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"themeColor": "#2a2a2a"
},
"description": "In order to successfully develop and apply innovative technology you need to be able to look beyond the horizon, anticipating trends and recognizing the next standards.",
"version": "1.1.0",
"version": "1.2.0",
"main": "index.js",
"repository": "git@github.com:bitrockteam/bitrock-website.git",
"author": "Salvatore Laisa <moebiusmania@gmail.com>",
Expand Down
14 changes: 9 additions & 5 deletions src/components/pages/home.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,16 @@ export default class HomePage extends HTMLElement {
<main class$="wrapper ${optimistic}">
${this.posts.map(e => posts(e))}
${this.more ?
html`<button on-click=${this._loadMore.bind(this)}>
Load more
</button>` : ''}
</main>
${this.more ?
html`
<div class="load-more">
<button on-click=${this._loadMore.bind(this)}>
Load more
</button>
</div>
` : ''}
`;

render(markup, this);
Expand Down
24 changes: 24 additions & 0 deletions src/styles/mobile.scss
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,30 @@ main{
}
}

.load-more {
button {
display: block;
font-size: 16px;
letter-spacing: 1px;
text-transform: uppercase;
color: #ffffff; /* $white */
background: #e74e0f; /* $basic01 */
padding: 12px 40px;
border-radius: 24px;
cursor: pointer;
transition: all 250ms ease;
text-decoration: none;
margin: 0 auto;
text-align: center;
outline: none;
margin-bottom: 40px;

&:hover {
background: #eb6608;
}
}
}

.content{
&.loading {
@extend %optimistic;
Expand Down
4 changes: 2 additions & 2 deletions test/consts.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ test('API base url', t => {

test('PATHS properties & methods', t => {
const id = 42;
const posts = 'posts?per_page=30&_embed=';
const posts = 'posts?per_page=12&_embed=';
const post = `posts/${id}?_embed=`;
const page = `pages/${id}?_embed=`;

t.is(PATHS.tags, 'tags');
t.is(PATHS.menu, 'menus/nav');
t.is(PATHS.pages, 'pages');
t.true(PATHS.posts.indexOf(posts) > -1);
t.true(PATHS.posts().indexOf(posts) > -1);
t.true(PATHS.post(id).indexOf(post) > -1);
t.true(PATHS.page(id).indexOf(page) > -1);
});

0 comments on commit 84d5803

Please sign in to comment.