Skip to content

Commit

Permalink
cleanup demo copy
Browse files Browse the repository at this point in the history
  • Loading branch information
nickhs committed Oct 23, 2017
1 parent 61ddaf2 commit e192cc2
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 8 deletions.
8 changes: 5 additions & 3 deletions demo.css
Expand Up @@ -170,8 +170,10 @@ html, body, .container {
}

#add-bookmarklet .explanation {
margin: 1rem auto;
text-align: center;
position: relative;
top: -0.5rem;
font-size: 0.5em;
}

#add-bookmarklet > a > span {
display: block;
}
10 changes: 6 additions & 4 deletions demo.html
Expand Up @@ -22,10 +22,12 @@ <h1>boom.js</h1>
<div id="info">
<a href="http://github.com/nickhs/boom" class="button">View Code on Github</a>
<div id="add-bookmarklet">
<a href="/build/bookmarklet.js" class="button">Boom Bookmarklet</a>
<div class="explanation">
<p>drag me to your bookmarks bar</p>
</div>
<a href="/build/bookmarklet.js" class="button">
<span>Boom Bookmarklet</span>
<span class="explanation">
drag me to your bookmarks bar
</span>
</a>
</div>
</div>
</div>
Expand Down
7 changes: 6 additions & 1 deletion src/demo/main.js
Expand Up @@ -88,8 +88,12 @@ class Tempter {
this.el = document.createElement('div');
this.el.className = 'tempter';
this.el.textContent = 'Go on. Click me.';

this.parentEl.appendChild(this.el);
this.onClick = this.onClick.bind(this);
}

onClick() {
this.el.textContent = 'Click to release. Scroll to size.';
}
}

Expand Down Expand Up @@ -123,6 +127,7 @@ class BombContainer {

let bomb = new Bomb({inert: false});
document.body.appendChild(bomb.createBomb());
this.tempter.onClick();

setTimeout(() =>
window.addEventListener('click', this.listeners.handleBombDrop),
Expand Down

0 comments on commit e192cc2

Please sign in to comment.