Repository navigation
Expand file tree
/
Copy pathLesson13_DOMManipulation.html
More file actions
105 lines (93 loc) · 2.37 KB
/
Copy pathLesson13_DOMManipulation.html
File metadata and controls
105 lines (93 loc) · 2.37 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
<head>
<script crossorigin src="https://unpkg.com/react@16/umd/react.development.js"></script>
<script crossorigin src="https://unpkg.com/react-dom@16/umd/react-dom.development.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/babel-standalone/6.26.0/babel.min.js"></script>
<link href="https://fonts.googleapis.com/css?family=Roboto+Slab" rel="stylesheet">
<script src="https://cdnjs.cloudflare.com/ajax/libs/vanilla-tilt/1.4.1/vanilla-tilt.min.js"></script>
</head>
<style>
#root{
display: flex;
flex-direction: column;
justify-content: space-around;
align-items: center;
color: white;
background: url('images/darkwood.jpg') no-repeat center;
background-size: cover;
font-family: 'Roboto Slab', serif;
}
.title{
font-size: calc(35px + 1vw);
}
.mainDiv{
display: flex;
flex-direction: column;
justify-content: space-around;
align-items: center;
height: 50vh;
}
button{
border-radius: 50px;
background: transparent;
color: white;
padding: 20px;
min-width: 100px;
font-family: 'Roboto Slab', serif;
font-size: 30px
}
label{
font-size: 35px;
}
button:hover{
cursor: pointer;
}
button:focus {
outline: none;
}
</style>
<body id="root"></body>
<script type="text/babel">
class Tilt extends React.Component{
VanillaTilt.init(this.rootNode,
{
max: 25,
speed: 400,
glare: true,
'max-glare': 0.5
}
);
componentDidMount(){
console.log(this.rootNode);
}
// passing reference to element references the DOM node
render(){
return (
<div
ref={node => (this.rootNode = node)}
className="tilt-root"
>
<div className="tilt-child">
<div {...this.props}/>
</div>
</div>
)
}
const element = (
<div className="totally-centered">
<Tilt>
<div className="totally-centered">
vanilla-tilt.js
</div>
</Tilt>
</div>
)
render(){
return (
)
}
}
ReactDOM.render(
element,
document.getElementById('root')
)
</script>