File tree Expand file tree Collapse file tree 7 files changed +102
-34
lines changed Expand file tree Collapse file tree 7 files changed +102
-34
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " create-react-webpack" ,
3
- "version" : " 0.1.1 " ,
3
+ "version" : " 0.1.2 " ,
4
4
"description" : " create-react-webpack " ,
5
5
"main" : " scripts/create.js" ,
6
6
"bin" : {
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ const DEV_DEPENDENCIES = [
13
13
"css-loader" ,
14
14
"eslint" ,
15
15
"eslint-plugin-react" ,
16
+ "file-loader" ,
16
17
"html-webpack-plugin" ,
17
18
"husky" ,
18
19
"jest" ,
Original file line number Diff line number Diff line change @@ -10,24 +10,68 @@ html {
10
10
box-sizing : inherit;
11
11
}
12
12
13
- .app {
14
- background-color : antiquewhite;
15
- display : flex;
16
- flex-direction : column;
17
- align-items : center;
18
- justify-content : center;
19
- height : 98vh ;
13
+ .App {
14
+ font-family : sans-serif;
15
+ text-align : center;
16
+ width : 100% ;
17
+ height : 100vh ;
18
+ }
19
+
20
+ .black {
21
+ background-color : rgb (46 , 43 , 43 );
20
22
width : 100% ;
23
+ height : 30% ;
21
24
}
22
25
23
26
.button {
24
- background-color : red;
25
- border-radius : 20px ;
26
- color : white;
27
- font-size : 20px ;
28
- font-weight : bold;
27
+ border-radius : 50% ;
28
+ font-size : 30px ;
29
29
margin : 10px ;
30
+ width : 40px ;
31
+ height : 40px ;
30
32
outline : none;
31
- padding-left : 20px ;
32
- padding-right : 20px ;
33
+ }
34
+ .loaderContainer {
35
+ position : relative;
36
+ display : flex;
37
+ justify-content : center;
38
+ align-items : center;
39
+ background-position : center;
40
+ background-size : 160px ;
41
+ background-repeat : no-repeat;
42
+ height : 180px ;
43
+ top : -90px ;
44
+ animation : counterClock 3s linear infinite;
45
+ filter : brightness (0.93 );
46
+ }
47
+
48
+ .loader {
49
+ width : 100px ;
50
+ height : 100px ;
51
+ animation : clock 2s linear infinite;
52
+ background-size : 150% ;
53
+ background-position : center;
54
+ }
55
+
56
+ .text {
57
+ font-size : 24px ;
58
+ padding : 10px ;
59
+ }
60
+
61
+ @keyframes clock {
62
+ 0% {
63
+ transform : rotate (0deg );
64
+ }
65
+ 100% {
66
+ transform : rotate (360deg );
67
+ }
68
+ }
69
+
70
+ @keyframes counterClock {
71
+ 0% {
72
+ transform : rotate (360deg );
73
+ }
74
+ 100% {
75
+ transform : rotate (0deg );
76
+ }
33
77
}
Original file line number Diff line number Diff line change 1
1
import React , { Component } from "react" ;
2
2
import { hot } from "react-hot-loader" ;
3
3
import "./App.css" ;
4
+ import logo from "../logo/logo.svg" ;
5
+ import border from "../logo/border.svg" ;
4
6
5
7
class App extends Component {
6
8
constructor ( props ) {
@@ -10,28 +12,31 @@ class App extends Component {
10
12
} ;
11
13
}
12
14
15
+ handleCount ( input ) {
16
+ this . setState ( prevState => ( { count : prevState . count + input } ) ) ;
17
+ }
18
+
13
19
render ( ) {
14
20
return (
15
- < div className = "app" >
16
- < h1 > Hello World!</ h1 >
17
- < h2 > { `Count : ${ this . state . count } ` } </ h2 >
18
- < div >
19
- < button
20
- className = "button"
21
- onClick = { ( ) => {
22
- this . setState ( state => ( { count : state . count + 1 } ) ) ;
23
- } }
24
- >
25
- +
26
- </ button >
27
- < button
28
- className = "button"
29
- onClick = { ( ) => {
30
- this . setState ( state => ( { count : state . count - 1 } ) ) ;
31
- } }
21
+ < div >
22
+ < div className = "App" >
23
+ < div className = "black" />
24
+ < div
25
+ className = "loaderContainer"
26
+ style = { { backgroundImage : `url(${ border } )` } }
32
27
>
33
- -
34
- </ button >
28
+ < img className = "loader" src = { logo } width = { 100 } height = { 100 } />
29
+ </ div >
30
+ < div className = "text" > Hello World!</ div >
31
+ < div className = "text" > { this . state . count } </ div >
32
+ < div className = "buttons" >
33
+ < button className = "button" onClick = { ( ) => this . handleCount ( 1 ) } >
34
+ +
35
+ </ button >
36
+ < button className = "button" onClick = { ( ) => this . handleCount ( - 1 ) } >
37
+ -
38
+ </ button >
39
+ </ div >
35
40
</ div >
36
41
</ div >
37
42
) ;
Original file line number Diff line number Diff line change @@ -20,6 +20,10 @@ module.exports = {
20
20
test : / \. c s s $ / ,
21
21
use : [ "style-loader" , "css-loader" ] ,
22
22
exclude : / n o d e _ m o d u l e s /
23
+ } ,
24
+ {
25
+ test : / \. s v g $ / ,
26
+ use : "file-loader"
23
27
}
24
28
]
25
29
} ,
You can’t perform that action at this time.
0 commit comments