Skip to content

Commit

Permalink
Better warmup
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom32i committed Dec 5, 2017
1 parent 7a1da54 commit d9b98e2
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 5 deletions.
25 changes: 24 additions & 1 deletion src/Tricot.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,29 @@ export default class Tricot extends Component {
return `active ${errorClass}`;
}

/**
* Get page title
*
* @return {String|null}
*/
getTitle() {
const { answers, index, tempo } = this.state;

if (index === null && answers.length === 0) {
return <h1>Appuie en rythme sur les touches pour tricoter</h1>;
}

if (index < 0) {
return <h1>Préparez-vous ...</h1>;
}

if (index < 4) {
return <h1 className="fade">C&apos;est parti !</h1>;
}

return null;
}

render() {
const { partition, lines, answers, index, pressed, tempo, warmup, audio, loop, bpm, delay, ready } = this.state;
const { privacy, credits } = this.modals;
Expand All @@ -201,7 +224,7 @@ export default class Tricot extends Component {

return (
<div>
{beforeStart && <h1>Appuie en rythme sur les touches pour tricoter</h1>}
{this.getTitle(index, answers)}
{end && <End answers={answers} replay={this.onKey} ready={ready} />}
<div className="options">
<SongSelector songs={Songs} disabled={playing} onChange={this.loadSong} />
Expand Down
2 changes: 1 addition & 1 deletion src/track/DeckTheHalls.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ export const audio = deckTheHalls;
export const bpm = 95;
export const tempo = Math.round(60000 / 95);
export const delay = 98 + (tempo / 4);
export const warmup = [null, null, 1, '.', '.', '.', 2, '.', '.', '.', 3, '.', '.', '.', 1, 2, 3, 4];
export const warmup = [null, null, 3, null, null, null, 2, null, null, null, 1, null, null, null, 1, 2, 3, 4];
export const duration = 64500;
2 changes: 1 addition & 1 deletion src/track/JingleBells.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ export const audio = jingleBells;
export const bpm = 98;
export const tempo = Math.round(60000 / 190);
export const delay = 106;
export const warmup = [1, 2, 3, 4, 1, 2, 3, 4];
export const warmup = [1, null, 2, null, 1, 2, 3, 4];
export const duration = 83000;
2 changes: 1 addition & 1 deletion src/track/JoyToTheWorld.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ export const audio = joyToTheWorld;
export const bpm = 85;
export const tempo = Math.round(60000 / 120);
export const delay = 98;
export const warmup = [1, '.', '.', '.', 2, '.', '.', '.', 3, '.', '.', '.', 1, 2, 3, 4];
export const warmup = [3, null, null, null, 2, null, null, null, 1, null, null, null, 1, 2, 3, 4];
export const duration = 78000;
5 changes: 5 additions & 0 deletions style/base/_layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ h1 {
transform: translateX(-50%);
width: 100%;
font-weight: 400;
transition: opacity 400ms 1s ease-in;

&.fade {
opacity: 0;
}
}

#root {
Expand Down
1 change: 0 additions & 1 deletion style/components/_animation.scss
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@
}
}


@keyframes slide {
0% {
transform: translate3d(0, -200%, 0);
Expand Down
1 change: 1 addition & 0 deletions style/components/_arrow-tunnel.scss
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
vertical-align: bottom;
box-sizing: border-box;
justify-content: center;
color: $text;

&.success {
animation: puff-out 400ms cubic-bezier(0.165, 0.840, 0.440, 1.000) both;
Expand Down

0 comments on commit d9b98e2

Please sign in to comment.