Skip to content

Commit 0e0105c

Browse files
committed
Add sound and adapt animation
This changes the animation duration to ~8 seconds to fit the sounds. There are two sounds: * sound_a -> With echo effect * sound_b -> Without echo effect (cleaner) Access `src/constants` to try out the other sound :-)
1 parent db8a71a commit 0e0105c

File tree

9 files changed

+23
-3
lines changed

9 files changed

+23
-3
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,5 @@ jspm_packages
3535

3636
# Optional REPL history
3737
.node_repl_history
38+
39+
.DS_Store

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"normalize.css": "^5.0.0",
1010
"react": "^15.4.1",
1111
"react-dom": "^15.4.1",
12+
"react-sound": "^0.5.2",
1213
"styled-components": "^1.1.1"
1314
},
1415
"scripts": {

public/sound_a.aif

60.6 MB
Binary file not shown.

public/sound_a.mp3

215 KB
Binary file not shown.

public/sound_b.aif

60.6 MB
Binary file not shown.

public/sound_b.mp3

215 KB
Binary file not shown.

src/components/App/index.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
import React from 'react';
2+
import Sound from 'react-sound';
23
import {Wrapper, Group, BlueText, RedText} from './styles';
4+
import constants from '../../constants';
35
import Logo from '../Logo';
46

5-
67
const App = () => (
78
<Wrapper>
9+
<Sound
10+
url={constants.sound}
11+
playStatus={Sound.status.PLAYING}
12+
/>
813
<Group>
914
<BlueText>React</BlueText>
1015
<Logo width={320} height={320} />

src/constants.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
const constants = {
2-
animationDuration: '1.75s',
2+
animationDuration: '6.8s',
33
animationEasing: 'ease-in-out',
4+
sound: 'sound_b.mp3',
45
};
56

67
export default constants;

yarn.lock

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4405,7 +4405,14 @@ [email protected]:
44054405
optionalDependencies:
44064406
fsevents "1.0.14"
44074407

4408-
react@^15.4.1:
4408+
react-sound@^0.5.2:
4409+
version "0.5.2"
4410+
resolved "https://registry.yarnpkg.com/react-sound/-/react-sound-0.5.2.tgz#8514a44b1500feefca85ef87670dc65e26ea0720"
4411+
dependencies:
4412+
react ">=0.13.3 <16.0.0"
4413+
soundmanager2 "^2.97.20150601-a"
4414+
4415+
"react@>=0.13.3 <16.0.0", react@^15.4.1:
44094416
version "15.4.1"
44104417
resolved "https://registry.yarnpkg.com/react/-/react-15.4.1.tgz#498e918602677a3983cd0fd206dfe700389a0dd6"
44114418
dependencies:
@@ -4802,6 +4809,10 @@ sort-keys@^1.0.0:
48024809
dependencies:
48034810
is-plain-obj "^1.0.0"
48044811

4812+
soundmanager2@^2.97.20150601-a:
4813+
version "2.97.20150601"
4814+
resolved "https://registry.yarnpkg.com/soundmanager2/-/soundmanager2-2.97.20150601.tgz#673edacb9b52bbcfa57712c370b011f6983c6f36"
4815+
48054816
source-list-map@^0.1.4, source-list-map@~0.1.0:
48064817
version "0.1.6"
48074818
resolved "https://registry.yarnpkg.com/source-list-map/-/source-list-map-0.1.6.tgz#e1e6f94f0b40c4d28dcf8f5b8766e0e45636877f"

0 commit comments

Comments
 (0)