-
Notifications
You must be signed in to change notification settings - Fork 35
Expand file tree
/
Copy pathHero.js
More file actions
49 lines (39 loc) · 1.19 KB
/
Hero.js
File metadata and controls
49 lines (39 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import React from 'react';
class Hero extends React.Component {
constructor(){
super();
this.fetchHero = this.fetchHero.bind(this)
this.state ={
movie: []
}
}
fetchHero(){
fetch("http://www.omdbapi.com/?apikey=8d5ab09&i=tt1270797")
.then(response => response.json())
.then(body => {(console.log(body))
this.setState({
movie: body
})
})
}
componentDidMount(){
this.fetchHero()
}
render(){
return (
<div>
<h2 className='hero-heading'>Today's Featured Film </h2>
<p className='scroll-heading'>VENOM</p>
<p className='scroll-heading'>In Theatres Soon!</p>
<h3 className='scroll-heading'>Scroll down to watch the trailer</h3>
<div className='hero-landing'>
<img onClick={this.handleClick} className='hero-image' src={this.state.movie.Poster} />
</div>
<div className='hero-video'>
<iframe width="560" height="315" src="https://www.youtube.com/embed/xLCn88bfW1o?autoplay=1&mute=1&enablejsapi=1" frameBorder="0" allowFullScreen></iframe>
</div>
</div>
);
}
}
export default Hero;