Skip to content

Commit a05fa8d

Browse files
committed
Update animation library
1 parent b399940 commit a05fa8d

File tree

5 files changed

+33
-59
lines changed

5 files changed

+33
-59
lines changed

package-lock.json

Lines changed: 10 additions & 33 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"react-helmet": "^5.2.0",
3131
"react-jss": "^8.6.1",
3232
"react-responsive-carousel": "^3.1.33",
33-
"react-text-transition": "^0.1.8",
33+
"react-rotating-text": "^1.4.1",
3434
"typeface-roboto": "0.0.54"
3535
},
3636
"keywords": [

src/components/home/banner/BannerComponent.js

Lines changed: 5 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ import { withStyles } from '@material-ui/core/styles';
88

99
import BannerImage from '../../commons/BannerImage';
1010
import { primary, hoverPrimary } from '../../../utils/Colors';
11-
import TextTransition, { presets } from 'react-text-transition';
11+
import ReactRotatingText from 'react-rotating-text';
12+
import '../../../css/typing.css';
1213

1314
const styles = theme => ({
1415
root: {
@@ -82,21 +83,7 @@ const styles = theme => ({
8283
},
8384
});
8485

85-
const texts = ['{bits}', '1011'];
86-
8786
class BannerComponent extends Component {
88-
state = {
89-
textIndex: 0,
90-
};
91-
92-
componentDidMount() {
93-
setInterval(() => {
94-
this.setState({
95-
textIndex: this.state.textIndex + 1,
96-
});
97-
}, 4000);
98-
}
99-
10087
render() {
10188
const { title, description, btnOneText, btnOneLink } = this.props;
10289
const { classes } = this.props;
@@ -113,15 +100,9 @@ class BannerComponent extends Component {
113100
</Typography> */}
114101

115102
<Typography variant="h6" className={classes.description}>
116-
Every
117-
<TextTransition
118-
text={texts[this.state.textIndex % texts.length]}
119-
spring={presets.gentle}
120-
style={{ margin: '0 4px' }}
121-
inline
122-
overflow
123-
/>
124-
counts.
103+
{'Every '}
104+
<ReactRotatingText items={['{bids}', '10110']} />
105+
{' counts.'}
125106
</Typography>
126107

127108
<div>

src/css/typing.css

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
.react-rotating-text-cursor {
2+
animation: blinking-cursor 0.8s cubic-bezier(0.68, 0.01, 0.01, 0.99) 0s
3+
infinite;
4+
}
5+
6+
@keyframes blinking-cursor {
7+
0% {
8+
opacity: 0;
9+
}
10+
50% {
11+
opacity: 1;
12+
}
13+
100% {
14+
opacity: 0;
15+
}
16+
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
22
name: "Alexa"
3-
quote: "There is potential in every kid to become active creator of technology. This strikes me every time when I see the joy and excitement in the eyes of our students!”"
3+
quote: "“There is potential in every kid to become active creator of technology. This strikes me every time when I see the joy and excitement in the eyes of our students!”"
44
cover_img: "p3.png"
55
---

0 commit comments

Comments
 (0)