├── .gitignore
├── LICENSE
├── README.md
├── package-lock.json
├── package.json
├── public
├── colorpicker.png
├── css.png
├── csspicker.png
├── favicon-16x16.png
├── favicon-32x32.png
├── github-bg.png
├── index.html
└── manifest.json
├── src
├── App.css
├── App.js
├── App.test.js
├── components
│ ├── ColorPicker
│ │ └── ColorPicker.js
│ ├── EffectBoard
│ │ ├── EffectBoard.css
│ │ └── EffectBoard.js
│ ├── Header
│ │ ├── Header.css
│ │ └── Header.js
│ └── SingleEffect
│ │ ├── SingleEffect.css
│ │ └── SingleEffect.js
├── css-letter.png
├── csswand.png
├── effects
│ ├── 3DShadow.js
│ ├── GrowBtn.js
│ ├── Input1.js
│ ├── Opacity.js
│ ├── PressDown.js
│ ├── Ripple.js
│ ├── Rotate30.js
│ ├── Shrink.js
│ ├── Spinner1.js
│ ├── Spinner2.js
│ ├── Spinner3.js
│ ├── Spinner4.js
│ ├── Spinner5.js
│ ├── SquaretoCircle.js
│ └── Swing.js
├── index.css
├── index.js
├── logo.svg
└── serviceWorker.js
└── yarn.lock
/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | /node_modules
5 | /.pnp
6 | .pnp.js
7 |
8 | # testing
9 | /coverage
10 |
11 | # production
12 | /build
13 |
14 | # misc
15 | .DS_Store
16 | .env.local
17 | .env.development.local
18 | .env.test.local
19 | .env.production.local
20 |
21 | npm-debug.log*
22 | yarn-debug.log*
23 | yarn-error.log*
24 |
25 |
26 | .firebaserc
27 | firebase.json
28 | ../public/manifest.json
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2019 Oliver Gomes
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
158 |
167 |
181 |
182 |
191 |
198 |
199 |
208 |
215 |
216 |
225 |
232 |
233 |
242 |
250 |
251 |
260 |
267 |
268 | {/* Row 2 */}
269 | {/*
*/}
270 |
279 |
286 |
287 |
296 |
303 |
304 |
313 |
320 |
321 |
322 |
331 |
337 |
338 |
347 |
354 |
355 |
364 |
371 |
372 |
381 |
388 |
389 |
400 |
407 |
408 |
417 |
424 |
425 |
426 | >
427 | );
428 | }
429 | }
430 |
--------------------------------------------------------------------------------
/src/components/Header/Header.css:
--------------------------------------------------------------------------------
1 | .header-main {
2 | display: grid;
3 | grid-auto-columns: 1fr 200px;
4 | }
5 |
6 | .grid-header {
7 | display: grid;
8 | min-height: 100px;
9 | grid-auto-flow: column;
10 | padding-top: 20px;
11 | }
12 |
13 | .item2 {
14 | display: grid;
15 | justify-content: center;
16 | align-content: center;
17 | align-items: center;
18 | grid-auto-flow: column;
19 | }
20 |
21 | .product-header {
22 | display: block;
23 | min-height: 50px;
24 | }
25 |
26 |
27 | @media (max-width: 576px) {
28 | .product-header {
29 | display: none;
30 | }
31 | }
--------------------------------------------------------------------------------
/src/components/Header/Header.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 |
3 | // import cssWand from "../../css-wand.png";
4 | import cssWand from "../../csswand.png";
5 | import { TwitterShareButton } from "react-twitter-embed";
6 |
7 | import "./Header.css";
8 |
9 | export default function HeaderNew() {
10 | return (
11 |
12 |
38 |
39 |
40 |
41 |
42 |
43 |
51 |
52 |
53 |
57 |
58 |
59 |
60 |
61 | );
62 | }
63 |
--------------------------------------------------------------------------------
/src/components/SingleEffect/SingleEffect.css:
--------------------------------------------------------------------------------
1 | .ant-modal-header {
2 | border-bottom: 1px solid #1d9af2;
3 | }
4 |
5 | .ant-modal-content,
6 | .ant-modal-header {
7 | font-family: "Fira Sans", sans-serif;
8 | background-color: rgb(19, 25, 51);
9 | color: #fff;
10 | }
11 |
12 | .ant-modal-body p,
13 | .ant-modal-title {
14 | color: #fff;
15 | }
16 |
17 | .ant-modal-footer {
18 | border-top: 1px solid #1d9af2;
19 | }
20 |
21 | .ant-btn-ghost {
22 | background-color: none;
23 | border-color: #1d9af2;
24 | color: #1d9af2;
25 | }
26 |
27 | .hl {
28 | font-family: "Fira Sans", sans-serif;
29 | font-size: 18px;
30 | }
31 |
32 | .hl-bracket {
33 | color: #6bc8f8;
34 | }
35 |
36 | .hl-class {
37 | color: #c9a067;
38 | }
39 |
40 | .hl-attribute {
41 | color: #ff5572;
42 | }
43 |
44 | .hl-property {
45 | color: #7fc9c2;
46 | }
47 |
48 | .hl-value {
49 | color: #ae81ff;
50 | }
51 |
52 | transition: all 0.2s ease-in-out !important;
53 |
54 | &:hover {
55 | transform: scale(1.1) !important;
56 | }
57 |
58 | .ant-modal-close-x {
59 | color: white;
60 | }
61 |
62 |
63 | input {
64 | color: black;
65 | }
66 |
67 |
68 |
69 |
70 |
71 |
72 | /* Input Effects Start Here*/
73 |
74 | :focus {
75 | outline: none;
76 | }
77 |
78 | .col-3 {
79 | float: left;
80 | width: 27.33%;
81 | margin: 40px 3%;
82 | position: relative;
83 | }
84 |
85 |
86 | /* necessary to give position: relative to parent. */
87 | input[type="text"] {
88 | font: 15px/24px "Lato", Arial, sans-serif;
89 | color: #1d9af2;
90 | width: 70%;
91 | box-sizing: border-box;
92 | letter-spacing: 1px;
93 | background-color: rgb(19, 23, 44)
94 | }
95 |
96 | .effect-1,
97 | .effect-2,
98 | .effect-3 {
99 | border: 0;
100 | padding: 7px 0;
101 | border-bottom: 1px solid #ccc;
102 |
103 | }
104 |
105 | .effect-1~.focus-border {
106 | position: absolute;
107 | bottom: 0;
108 | left: 25px;
109 | width: 0;
110 | height: 2px;
111 | background-color: #3399FF;
112 | transition: 0.4s;
113 | }
114 |
115 | .effect-1:focus~.focus-border {
116 | width: 70%;
117 | transition: 0.4s;
118 | }
119 |
120 | .input-top {
121 | padding: 15px;
122 | }
123 |
124 | .input-top:hover {
125 | cursor: pointer;
126 | background-color: rgb(19, 25, 51);
127 | }
--------------------------------------------------------------------------------
/src/components/SingleEffect/SingleEffect.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from "react";
2 |
3 | import { Modal, Button, Icon } from "antd";
4 | import "./SingleEffect.css";
5 | import { css } from "emotion";
6 |
7 | import { CopyToClipboard } from "react-copy-to-clipboard";
8 |
9 | export default class SingleEffect extends Component {
10 | state = { visible: false };
11 |
12 | showModal = () => {
13 | this.setState({
14 | visible: true,
15 | copiedHTML: false,
16 | copiedCSS: false
17 | });
18 | };
19 |
20 | handleOk = e => {
21 | this.setState({
22 | visible: false
23 | });
24 | };
25 |
26 | handleCancel = e => {
27 | this.setState({
28 | visible: false
29 | });
30 | };
31 | render() {
32 | // var myJSON = JSON.stringify(this.props.Code);
33 | console.log(this.props.Code);
34 | return (
35 |
36 |
40 | {this.props.Title === "Input" ? (
41 |
event.stopPropagation()}>
42 |
47 |
48 |
49 | ) : (
50 |
55 | {this.props.Title === "Spinner" ? null : this.props.Title}
56 |
57 | )}
58 |
59 |
60 |
66 | {/* HTML Copy */}
67 | this.setState({ copiedHTML: true })}
70 | >
71 | {this.state.copiedHTML ? (
72 |
99 | Copied
100 |
101 | ) : (
102 |
109 | )}
110 |
111 |
112 | <>{this.props.Code}>
113 |
114 | {/* CSS Copy */}
115 | this.setState({ copiedCSS: true })}
118 | >
119 | {this.state.copiedCSS ? (
120 |
181 | Copied
182 |
183 | ) : (
184 |
204 | )}
205 |
206 |
207 |
208 | );
209 | }
210 | }
211 |
--------------------------------------------------------------------------------
/src/css-letter.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oliver-gomes/csswand/84b073c4d5bd70cf81e7fff45e803b86a224acfa/src/css-letter.png
--------------------------------------------------------------------------------
/src/csswand.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oliver-gomes/csswand/84b073c4d5bd70cf81e7fff45e803b86a224acfa/src/csswand.png
--------------------------------------------------------------------------------
/src/effects/3DShadow.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { css } from "emotion";
3 |
4 | const tdshadow = () => {
5 | return (
6 |
7 |
HTML
8 |
15 | {`<`}
16 | {`button`}
17 | {`>`}
18 | {`Shadow`}
19 | {`<`}
20 | {`/`}
21 | {`button `}
22 | {`>`}
23 |
24 |
25 |
26 |
CSS
27 |
34 |
{`button `}
35 |
{`{`}
36 |
37 | color:
38 | #1D9AF2;
39 |
40 | background-color:
41 | #292D3E;
42 |
43 | border:
44 | 1px solid #1D9AF2;
45 |
46 | border-radius:
47 | 4px;
48 |
49 | padding:
50 | 0 15px;
51 |
52 | cursor:
53 | pointer;
54 |
55 | height:
56 | 32px;
57 |
58 | font-size:
59 | 14px;
60 |
61 | transition:
62 | all 0.2s ease-in-out;
63 |
64 |
65 |
{`}`}
66 |
67 |
{`button:hover `}
68 |
{`{`}
69 |
70 | box-shadow:
71 |
72 | 1px 1px #53a7ea, 2px 2px #53a7ea, 3px 3px #53a7ea;
73 |
74 |
75 | transform:
76 | translateX(-3px);
77 |
78 |
{`}`}
79 |
80 |
81 | );
82 | };
83 |
84 | const tdshadowStyle = css`
85 | transition: all 0.2s ease-in-out !important;
86 |
87 | &:hover {
88 | box-shadow: 1px 1px #53a7ea, 2px 2px #53a7ea, 3px 3px #53a7ea;
89 | transform: translateX(-3px);
90 | }
91 | `;
92 |
93 | const tdshadowHtmlVariable = `
Shadow `;
94 |
95 | const tdshadowCssVariable = `
96 | button {
97 | color: #1D9AF2;
98 | background-color: #292D3E;
99 | border: 1px solid #1D9AF2;
100 | border-radius: 4px;
101 | padding: 0 15px;
102 | cursor: pointer;
103 | height: 32px;
104 | font-size: 14px;
105 | transition: all 0.2s ease-in-out;
106 | }
107 | button:hover {
108 | box-shadow: 1px 1px #53a7ea, 2px 2px #53a7ea, 3px 3px #53a7ea;
109 | transform: translateX(-3px);
110 | }
111 | `;
112 |
113 | export { tdshadow, tdshadowStyle, tdshadowHtmlVariable, tdshadowCssVariable };
114 |
--------------------------------------------------------------------------------
/src/effects/GrowBtn.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 |
3 | import { css } from "emotion";
4 |
5 | const growBtn = () => {
6 | return (
7 |
8 |
HTML
9 |
16 | {`<`}
17 | {`button`}
18 | {`>`}
19 | {`Grow`}
20 | {`<`}
21 | {`/`}
22 | {`button `}
23 | {`>`}
24 |
25 |
26 |
27 |
CSS
28 |
35 |
{`button `}
36 |
{`{`}
37 |
38 | color:
39 | #1D9AF2;
40 |
41 | background-color:
42 | #292D3E;
43 |
44 | border:
45 | 1px solid #1D9AF2;
46 |
47 | border-radius:
48 | 4px;
49 |
50 | padding:
51 | 0 15px;
52 |
53 | cursor:
54 | pointer;
55 |
56 | height:
57 | 32px;
58 |
59 | font-size:
60 | 14px;
61 |
62 | transition:
63 | all 0.2s ease-in-out;
64 |
65 |
66 |
{`}`}
67 |
68 |
{`button:hover `}
69 |
{`{`}
70 |
71 | transform:
72 | scale(1.1);
73 |
74 |
{`}`}
75 |
76 |
77 | );
78 | };
79 |
80 | const growBtnStyle = css`
81 | transition: all 0.2s ease-in-out !important;
82 | &:hover {
83 | transform: scale(1.1) !important;
84 | }
85 | `;
86 |
87 | const growHtmlVariable = `
Grow `;
88 |
89 | const growCssVariable = `
90 | button {
91 | color: #1D9AF2;
92 | background-color: #292D3E;
93 | border: 1px solid #1D9AF2;
94 | border-radius: 4px;
95 | padding: 0 15px;
96 | cursor: pointer;
97 | height: 32px;
98 | font-size: 14px;
99 | transition: all 0.2s ease-in-out;
100 | }
101 | button:hover {
102 | transform: scale(1.1);
103 | }
104 | `;
105 |
106 | export { growBtn, growBtnStyle, growHtmlVariable, growCssVariable };
107 |
--------------------------------------------------------------------------------
/src/effects/Input1.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { css } from "emotion";
3 |
4 | const input1 = () => {
5 | return (
6 |
7 |
HTML
8 |
15 |
{`<`}
16 |
{`div`}
17 |
{`class=`}
21 |
{`"input-container"`}
22 |
{`/`}
23 |
{`>`}
24 |
25 |
26 |
27 |
28 | {`<`}
29 | {`input `}
30 | {`class=`}
31 | {`"effect-1" `}
32 | {`type=`}
33 | {`"text"`}
34 | {` placeholder=`}
38 | {`"Placeholder here"`}
39 | {`/`}
40 | {`>`}
41 |
42 | {`<`}
43 | {`span `}
44 | {`class=`}
45 | {`"focus-border"`}
46 | {`>`}
47 |
48 | {`<`}
49 | {`/`}
50 | {`span`}
51 | {`>`}
52 |
53 |
{`<`}
54 |
{`/`}
55 |
{`div`}
56 |
{`>`}
57 |
58 |
59 |
60 |
CSS
61 |
68 | {/* focus start */}
69 |
{`:focus`}
70 |
{`{`}
71 |
72 | outline:
73 | none;
74 |
75 |
{`}`}
76 | {/* focus end */}
77 |
78 |
{`.input-container`}
79 |
{`{`}
80 |
81 | float:
82 | left;
83 |
84 | width:
85 | 27.33%;
86 |
87 | margin:
88 | 42px 3%;
89 |
90 | position:
91 | relative;
92 |
93 |
{`}`}
94 | {/* focus start */}
95 |
96 |
{`input[type="text"]`}
97 |
{`{`}
98 |
99 | color:
100 | #1d9af2;
101 |
102 | width:
103 | 70%;
104 |
105 | box-sizing:
106 | border-box;
107 |
108 | letter-spacing:
109 | 1px;
110 |
111 | background-color:
112 | rgb(19, 23, 44);
113 |
114 | border:
115 | none;
116 |
117 |
{`}`}
118 | {/* focus end */}
119 |
120 | {/* focus start */}
121 |
{`.effect-1~.focus-border`}
122 |
{`{`}
123 |
124 | position:
125 | absolute;
126 |
127 | bottom:
128 | 0;
129 |
130 | left:
131 | 0;
132 |
133 | width:
134 | 0;
135 |
136 | height:
137 | 2px;
138 |
139 | background-color:
140 | #3399FF;
141 |
142 | transition:
143 | 0.4s;
144 |
145 |
{`}`}
146 | {/* focus end */}
147 |
148 | {/* focus start */}
149 |
{`.effect-1:focus~.focus-border `}
150 |
{`{`}
151 |
152 | width:
153 | 70%;
154 |
155 | transition:
156 | 0.4s;
157 |
158 |
{`}`}
159 | {/* focus end */}
160 |
161 |
162 | );
163 | };
164 |
165 | const input1HtmlVariable = `
166 |
167 |
168 |
169 |
`;
170 |
171 | const input1CssVariable = `
172 | :focus{outline: none;}
173 |
174 | .input-container{float: left; width: 27.33%; margin: 42px 3%; position: relative;}
175 |
176 | input[type="text"] {
177 | font: 15px/24px "Lato", Arial, sans-serif;
178 | color: #1d9af2;
179 | width: 70%;
180 | box-sizing: border-box;
181 | letter-spacing: 1px;
182 | background-color: rgb(19, 23, 44);
183 | border: none;
184 | }
185 |
186 | .effect-1~.focus-border {
187 | position: absolute;
188 | bottom: 0;
189 | left: 0;
190 | width: 0;
191 | height: 2px;
192 | background-color: #3399FF;
193 | transition: 0.4s;
194 | }
195 |
196 | .effect-1:focus~.focus-border {
197 | width: 70%;
198 | transition: 0.4s;
199 | }
200 | `;
201 | export { input1, input1HtmlVariable, input1CssVariable };
202 |
--------------------------------------------------------------------------------
/src/effects/Opacity.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { css } from "emotion";
3 |
4 | const opacity = () => {
5 | return (
6 |
7 |
HTML
8 |
15 | {`<`}
16 | {`button`}
17 | {`>`}
18 | {`Opacity`}
19 | {`<`}
20 | {`/`}
21 | {`button `}
22 | {`>`}
23 |
24 |
25 |
26 |
CSS
27 |
34 |
{`button `}
35 |
{`{`}
36 |
37 | color:
38 | #1D9AF2;
39 |
40 | background-color:
41 | #292D3E;
42 |
43 | border:
44 | 1px solid #1D9AF2;
45 |
46 | border-radius:
47 | 4px;
48 |
49 | padding:
50 | 0 15px;
51 |
52 | cursor:
53 | pointer;
54 |
55 | height:
56 | 32px;
57 |
58 | font-size:
59 | 14px;
60 |
61 | transition:
62 | all 0.2s ease-in-out;
63 |
64 | opacity:
65 | 0.5;
66 |
67 |
68 |
{`}`}
69 |
70 |
{`button:hover `}
71 |
{`{`}
72 |
73 | opacity:
74 | 1;
75 |
76 |
{`}`}
77 |
78 |
79 | );
80 | };
81 |
82 | const opacityStyle = css`
83 | transition: all 0.2s ease-in-out;
84 | opacity: 0.5;
85 | &:hover {
86 | opacity: 1;
87 | }
88 | `;
89 |
90 | const opacityHtmlVariable = `
Opacity `;
91 |
92 | const opacityCssVariable = `
93 | button {
94 | color: #1D9AF2;
95 | background-color: #292D3E;
96 | border: 1px solid #1D9AF2;
97 | border-radius: 4px;
98 | padding: 0 15px;
99 | cursor: pointer;
100 | height: 32px;
101 | font-size: 14px;
102 | transition: all 0.2s ease-in-out;
103 | opacity: 0.5;
104 | }
105 | button:hover{
106 | opacity: 1;
107 | }
108 | `;
109 |
110 | export { opacity, opacityStyle, opacityHtmlVariable, opacityCssVariable };
111 |
--------------------------------------------------------------------------------
/src/effects/PressDown.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { css } from "emotion";
3 |
4 | const pressDown = () => {
5 | return (
6 |
7 |
HTML
8 |
15 | {`<`}
16 | {`button`}
17 | {`>`}
18 | {`Press Down`}
19 | {`<`}
20 | {`/`}
21 | {`button `}
22 | {`>`}
23 |
24 |
25 |
26 |
CSS
27 |
34 |
{`button `}
35 |
{`{`}
36 |
37 | color:
38 | #1D9AF2;
39 |
40 | background-color:
41 | #292D3E;
42 |
43 | border:
44 | 1px solid #1D9AF2;
45 |
46 | border-radius:
47 | 4px;
48 |
49 | padding:
50 | 0 15px;
51 |
52 | cursor:
53 | pointer;
54 |
55 | height:
56 | 32px;
57 |
58 | font-size:
59 | 14px;
60 |
61 |
62 | background-position:
63 | center;
64 |
65 | transition:
66 | background 0.8s;
67 |
68 |
69 |
{`}`}
70 |
71 |
{`button:active `}
72 |
{`{`}
73 |
74 | box-shadow:
75 | 0 3px 0 #00823f;
76 |
77 |
78 | top:
79 | 3px;
80 |
81 |
{`}`}
82 |
83 |
84 | );
85 | };
86 |
87 | const pressDownStyle = css`
88 | &:active {
89 | box-shadow: 0 3px 0 #1d9af2 !important;
90 | top: 3px;
91 | }
92 | `;
93 |
94 | const pressDownHtmlVariable = `
Press Down `;
95 |
96 | const pressDownCssVariable = `
97 | button {
98 | display: inline-block;
99 | position: relative;
100 | color: #1D9AF2;
101 | background-color: #292D3E;
102 | border: 1px solid #1D9AF2;
103 | border-radius: 4px;
104 | padding: 0 15px;
105 | cursor: pointer;
106 | height: 32px;
107 | font-size: 14px;
108 |
109 | }
110 | button:active {
111 | box-shadow: 0 3px 0 #1D9AF2;
112 | top: 3px;
113 | }
114 | `;
115 | export {
116 | pressDown,
117 | pressDownStyle,
118 | pressDownHtmlVariable,
119 | pressDownCssVariable
120 | };
121 |
--------------------------------------------------------------------------------
/src/effects/Ripple.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { css } from "emotion";
3 |
4 | const ripple = () => {
5 | return (
6 |
7 |
HTML
8 |
15 | {`<`}
16 | {`button`}
17 | {`>`}
18 | {`Ripple`}
19 | {`<`}
20 | {`/`}
21 | {`button `}
22 | {`>`}
23 |
24 |
25 |
26 |
CSS
27 |
34 |
{`button `}
35 |
{`{`}
36 |
37 | color:
38 | #1D9AF2;
39 |
40 | background-color:
41 | #292D3E;
42 |
43 | border:
44 | 1px solid #1D9AF2;
45 |
46 | border-radius:
47 | 4px;
48 |
49 | padding:
50 | 15px 18px 30px 15px
51 |
52 | cursor:
53 | pointer;
54 |
55 | height:
56 | 32px;
57 |
58 | font-size:
59 | 14px;
60 |
61 | box-shadow:
62 | 0 0 4px #999;
63 |
64 | background-position:
65 | center;
66 |
67 | transition:
68 | background 0.8s;
69 |
70 |
71 |
{`}`}
72 |
73 |
{`button:hover `}
74 |
{`{`}
75 |
76 | background:
77 |
78 | #47a7f5 radial-gradient(circle, transparent 1%, #47a7f5 1%)
79 | center/15000%;
80 |
81 |
82 | color:
83 | white;
84 |
85 |
{`}`}
86 |
87 |
{`button:active`}
88 |
{`{`}
89 |
90 | background-color:
91 | #292d3e;
92 |
93 | background-size:
94 | 100%;
95 |
96 | transition:
97 | background 0s;
98 |
99 |
{`}`}
100 |
101 |
102 | );
103 | };
104 |
105 | const rippleStyle = css`
106 | padding: 15px 18px 30px 15px;
107 | box-shadow: 0 0 4px #999;
108 | outline: none;
109 | background-position: center;
110 | transition: background 0.8s;
111 |
112 | &:hover {
113 | background: #47a7f5 radial-gradient(circle, transparent 1%, #47a7f5 1%)
114 | center/15000%;
115 | color: white;
116 | }
117 | &:active {
118 | background-color: #292d3e;
119 | background-size: 100%;
120 | transition: background 0s;
121 | }
122 | `;
123 |
124 | const rippleHtmlVariable = `
Ripple `;
125 |
126 | const rippleCssVariable = `
127 | button {
128 | color: #1D9AF2;
129 | background-color: #292D3E;
130 | border: 1px solid #1D9AF2;
131 | border-radius: 4px;
132 | padding: 15px 18px 30px 15px;
133 | cursor: pointer;
134 | height: 32px;
135 | font-size: 14px;
136 |
137 | box-shadow: 0 0 4px #999;
138 | outline: none;
139 | background-position: center;
140 | transition: background 0.8s;
141 | }
142 | button:hover{
143 | background: #47a7f5 radial-gradient(circle, transparent 1%, #47a7f5 1%)
144 | center/15000%;
145 | color: white;
146 | }
147 |
148 | button:active{
149 | background-color: #292d3e;
150 | background-size: 100%;
151 | transition: background 0s;
152 | }
153 | `;
154 | export { ripple, rippleStyle, rippleHtmlVariable, rippleCssVariable };
155 |
--------------------------------------------------------------------------------
/src/effects/Rotate30.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { css } from "emotion";
3 |
4 | const rotate = () => {
5 | return (
6 |
7 |
HTML
8 |
15 | {`<`}
16 | {`button`}
17 | {`>`}
18 | {`Rotate`}
19 | {`<`}
20 | {`/`}
21 | {`button `}
22 | {`>`}
23 |
24 |
25 |
26 |
CSS
27 |
34 |
{`button `}
35 |
{`{`}
36 |
37 | color:
38 | #1D9AF2;
39 |
40 | background-color:
41 | #292D3E;
42 |
43 | border:
44 | 1px solid #1D9AF2;
45 |
46 | border-radius:
47 | 4px;
48 |
49 | padding:
50 | 0 15px;
51 |
52 | cursor:
53 | pointer;
54 |
55 | height:
56 | 32px;
57 |
58 | font-size:
59 | 14px;
60 |
61 | transition:
62 | all 0.2s ease-in-out;
63 |
64 | opacity:
65 | 0.5;
66 |
67 |
68 |
{`}`}
69 |
70 |
{`button:hover `}
71 |
{`{`}
72 |
73 | transform:
74 | rotateZ(-30deg);
75 |
76 |
{`}`}
77 |
78 |
79 | );
80 | };
81 |
82 | const rotateStyle = css`
83 | transition: all 0.2s ease-in-out !important;
84 | &:hover {
85 | transform: rotateZ(-30deg);
86 | }
87 | `;
88 |
89 | const rotateHtmlVariable = `
Rotate `;
90 |
91 | const rotateCssVariable = `
92 | button {
93 | color: #1D9AF2;
94 | background-color: #292D3E;
95 | border: 1px solid #1D9AF2;
96 | border-radius: 4px;
97 | padding: 0 15px;
98 | cursor: pointer;
99 | height: 32px;
100 | font-size: 14px;
101 | transition: all 0.2s ease-in-out;
102 | }
103 | button:hover{
104 | transform: rotateZ(-30deg);
105 | }
106 | `;
107 | export { rotate, rotateStyle, rotateHtmlVariable, rotateCssVariable };
108 |
--------------------------------------------------------------------------------
/src/effects/Shrink.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { css } from "emotion";
3 |
4 | const shrink = () => {
5 | return (
6 |
7 |
HTML
8 |
15 | {`<`}
16 | {`button`}
17 | {`>`}
18 | {`Shrink`}
19 | {`<`}
20 | {`/`}
21 | {`button `}
22 | {`>`}
23 |
24 |
25 |
26 |
CSS
27 |
34 |
{`button `}
35 |
{`{`}
36 |
37 | color:
38 | #1D9AF2;
39 |
40 | background-color:
41 | #292D3E;
42 |
43 | border:
44 | 1px solid #1D9AF2;
45 |
46 | border-radius:
47 | 4px;
48 |
49 | padding:
50 | 0 15px;
51 |
52 | cursor:
53 | pointer;
54 |
55 | height:
56 | 32px;
57 |
58 | font-size:
59 | 14px;
60 |
61 | transition:
62 | all 0.2s ease-in-out;
63 |
64 |
65 |
{`}`}
66 |
67 |
{`button:hover `}
68 |
{`{`}
69 |
70 | transform:
71 | scale(0.8);
72 |
73 |
{`}`}
74 |
75 |
76 | );
77 | };
78 |
79 | const shrinkStyle = css`
80 | transition: all 0.2s ease-in-out !important;
81 | &:hover {
82 | transform: scale(0.8);
83 | }
84 | `;
85 |
86 | const shrinkHtmlVariable = `
Shrink `;
87 |
88 | const shrinkCssVariable = `
89 | button {
90 | color: #1D9AF2;
91 | background-color: #292D3E;
92 | border: 1px solid #1D9AF2;
93 | border-radius: 4px;
94 | padding: 0 15px;
95 | cursor: pointer;
96 | height: 32px;
97 | font-size: 14px;
98 | transition: all 0.2s ease-in-out;
99 | }
100 | button:hover {
101 | transform: scale(0.8);
102 | }
103 | `;
104 |
105 | export { shrink, shrinkStyle, shrinkHtmlVariable, shrinkCssVariable };
106 |
--------------------------------------------------------------------------------
/src/effects/Spinner1.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { css } from "emotion";
3 |
4 | const spinner1 = () => {
5 | return (
6 |
7 |
HTML
8 |
15 | {`<`}
16 | {`button`}
17 | {`>`}
18 |
19 | {`<`}
20 | {`/`}
21 | {`button `}
22 | {`>`}
23 |
24 |
25 |
26 |
CSS
27 |
34 |
{`button `}
35 |
{`{`}
36 |
37 | height:
38 | 40px;
39 |
40 | width:
41 | 40px;
42 |
43 | background:
44 | #151825;
45 |
46 | border-radius:
47 | 50%;
48 |
49 | border:
50 | 1px solid #1D9AF2;
51 |
52 | border-top:
53 | 2px solid #fff;
54 |
55 | animation:
56 | spinner1 600ms linear infinite;
57 |
58 | {`}`}
59 |
60 |
{`@keyframes spinner1 `}
61 |
{`{`}
62 |
63 |
to
64 |
{`{`}
65 |
66 | transform: rotate(360deg);
67 |
68 |
{`}`} {" "}
72 |
73 |
{`}`}
74 |
75 |
76 |
77 | );
78 | };
79 |
80 | const spinner1Style = css`
81 | height: 40px;
82 | width: 40px;
83 | background: rgba(0, 0, 0, 0.2);
84 | border-radius: 50%;
85 | border-top: 2px solid #fff;
86 | animation: spinner1 600ms linear infinite;
87 | @keyframes spinner1 {
88 | to {
89 | transform: rotate(360deg);
90 | }
91 | }
92 | `;
93 |
94 | const spinner1CssVariable = `
95 | button {
96 | height: 40px;
97 | width: 40px;
98 | background: #151825;
99 | border-radius: 50%;
100 | border: 1px solid #1D9AF2;
101 | border-top: 2px solid #fff;
102 | animation: spinner1 600ms linear infinite;
103 | }
104 |
105 | @keyframes spinner1 {
106 | to {
107 | transform: rotate(360deg);
108 | }
109 | }
110 | `;
111 |
112 | const spinner1HtmlVariable = `
113 |
114 | `;
115 | export { spinner1, spinner1Style, spinner1CssVariable, spinner1HtmlVariable };
116 |
--------------------------------------------------------------------------------
/src/effects/Spinner2.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { css } from "emotion";
3 |
4 | const spinner2 = () => {
5 | return (
6 |
7 |
HTML
8 |
15 | {`<`}
16 | {`button`}
17 | {`>`}
18 |
19 | {`<`}
20 | {`/`}
21 | {`button `}
22 | {`>`}
23 |
24 |
25 |
26 |
CSS
27 |
34 |
{`button `}
35 |
{`{`}
36 |
37 | height:
38 | 40px;
39 |
40 | width:
41 | 40px;
42 |
43 | background:
44 | rgba(0, 0, 0, 0.2);
45 |
46 | border-radius:
47 | 50%;
48 |
49 | border:
50 | 2px solid rgba(0, 0, 0, 0.4);
51 |
52 | border-top-color:
53 | #fff;
54 |
55 | animation:
56 | spinner2 600ms linear infinite;
57 |
58 | {`}`}
59 |
60 |
{`@keyframes spinner2 `}
61 |
{`{`}
62 |
63 |
to
64 |
{`{`}
65 |
66 | transform: rotate(360deg);
67 |
68 |
{`}`} {" "}
72 |
73 |
{`}`}
74 |
75 |
76 |
77 | );
78 | };
79 |
80 | const spinner2Style = css`
81 | height: 40px;
82 | width: 40px;
83 | background: rgba(0, 0, 0, 0.2);
84 | border-radius: 50%;
85 | border: 2px solid rgba(0, 0, 0, 0.4);
86 | border-top-color: #fff;
87 | animation: spinner2 600ms linear infinite;
88 | }
89 | @keyframes spinner2 {
90 | to {
91 | transform: rotate(360deg);
92 | }
93 | }
94 | `;
95 |
96 | const spinner2HtmlVariable = `
`;
97 |
98 | const spinner2CssVariable = `
99 | button {
100 | height: 40px;
101 | width: 40px;
102 | background: rgba(0, 0, 0, 0.2);
103 | border-radius: 50%;
104 | border: 2px solid rgba(0, 0, 0, 0.4);
105 | border-top-color: #fff;
106 | animation: spinner2 600ms linear infinite;
107 | }
108 |
109 | @keyframes spinner2 {
110 | to {
111 | transform: rotate(360deg);
112 | }
113 | }
114 | `;
115 | export { spinner2, spinner2Style, spinner2HtmlVariable, spinner2CssVariable };
116 |
--------------------------------------------------------------------------------
/src/effects/Spinner3.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { css } from "emotion";
3 |
4 | const spinner3 = () => {
5 | return (
6 |
7 |
HTML
8 |
15 | {`<`}
16 | {`button`}
17 | {`>`}
18 |
19 | {`<`}
20 | {`/`}
21 | {`button `}
22 | {`>`}
23 |
24 |
25 |
26 |
CSS
27 |
34 |
{`button `}
35 |
{`{`}
36 |
37 | height:
38 | 40px;
39 |
40 | width:
41 | 40px;
42 |
43 | background:
44 | rgba(0, 0, 0, 0.2);
45 |
46 | border-radius:
47 | 50%;
48 |
49 | border:
50 | 2px solid rgba(0, 0, 0, 0.4);
51 |
52 | border-top-color:
53 | #fff;
54 |
55 | border-bottom-color:
56 | #fff;
57 |
58 | animation:
59 | spinner3 800ms ease infinite;
60 |
61 | {`}`}
62 |
63 |
{`@keyframes spinner3 `}
64 |
{`{`}
65 |
66 |
to
67 |
{`{`}
68 |
69 | transform: rotate(360deg);
70 |
71 |
{`}`} {" "}
75 |
76 |
{`}`}
77 |
78 |
79 |
80 | );
81 | };
82 |
83 | const spinner3Style = css`
84 | height: 40px;
85 | width: 40px;
86 | background: rgba(0, 0, 0, 0.2);
87 | border: 2px solid rgba(0, 0, 0, 0.4);
88 | border-radius: 50%;
89 | border-bottom-color: #fff;
90 | border-top-color: #fff;
91 | animation: spinner3 800ms ease infinite;
92 | }
93 | @keyframes spinner3 {
94 | to {
95 | transform: rotate(360deg);
96 | }
97 | }
98 | `;
99 |
100 | const spinner3HtmlVariable = `
`;
101 |
102 | const spinner3CssVariable = `
103 | button {
104 | height: 40px;
105 | width: 40px;
106 | background: rgba(0, 0, 0, 0.2);
107 | border-radius: 50%;
108 | border: 2px solid rgba(0, 0, 0, 0.4);
109 | border-top-color: #fff;
110 | border-bottom-color: #fff;
111 | animation: spinner3 800ms ease infinite;
112 | }
113 |
114 | @keyframes spinner3 {
115 | to {
116 | transform: rotate(360deg);
117 | }
118 | }
119 | `;
120 |
121 | export { spinner3, spinner3Style, spinner3HtmlVariable, spinner3CssVariable };
122 |
--------------------------------------------------------------------------------
/src/effects/Spinner4.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { css } from "emotion";
3 |
4 | const spinner4 = () => {
5 | return (
6 |
7 |
HTML
8 |
15 | {`<`}
16 | {`button`}
17 | {`>`}
18 |
19 | {`<`}
20 | {`/`}
21 | {`button `}
22 | {`>`}
23 |
24 |
25 |
26 |
CSS
27 |
34 |
{`button `}
35 |
{`{`}
36 |
37 | height:
38 | 40px;
39 |
40 | width:
41 | 40px;
42 |
43 | background:
44 | rgba(0, 0, 0, 0.8);
45 |
46 | border-radius:
47 | 50%;
48 |
49 | border:
50 | 1px solid #1D9AF2;
51 |
52 | opacity:
53 | 1;
54 |
55 | animation:
56 | spinner4 800ms linear infinite;
57 |
58 | {`}`}
59 |
60 |
{`@keyframes spinner4 `}
61 |
{`{`}
62 |
63 |
to
64 |
{`{`}
65 |
66 | transform: scale(1.5);
67 |
68 | opacity: 0;
69 |
70 |
{`}`} {" "}
74 |
75 |
{`}`}
76 |
77 |
78 |
79 | );
80 | };
81 |
82 | const spinner4Style = css`
83 | height: 40px;
84 | width: 40px;
85 | transform: scale(0);
86 | background: rgba(0, 0, 0, .8);
87 | opacity: 1;
88 | animation: spinner4 800ms linear infinite;
89 | border-radius: 50%;
90 | }
91 | @keyframes spinner4 {
92 | to {
93 | transform: scale(1.5);
94 | opacity: 0;
95 | }
96 | }
97 | `;
98 |
99 | const spinner4HtmlVariable = `
`;
100 |
101 | const spinner4CssVariable = `
102 | button {
103 | height: 40px;
104 | width: 40px;
105 | background: rgba(0, 0, 0, .8);
106 | border-radius: 50%;
107 | border: 1px solid #1D9AF2;
108 | opacity: 1;
109 | animation: spinner4 800ms linear infinite;
110 | transform: scale(0);
111 | }
112 |
113 | @keyframes spinner4 {
114 | to {
115 | transform: scale(1.5);
116 | opacity: 0;
117 | }
118 | }
119 | `;
120 |
121 | export { spinner4, spinner4Style, spinner4HtmlVariable, spinner4CssVariable };
122 |
--------------------------------------------------------------------------------
/src/effects/Spinner5.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { css } from "emotion";
3 |
4 | const spinner5 = () => {
5 | return (
6 |
7 |
HTML
8 |
15 | {`<`}
16 | {`button`}
17 | {`>`}
18 |
19 | {`<`}
20 | {`/`}
21 | {`button `}
22 | {`>`}
23 |
24 |
25 |
26 |
CSS
27 |
34 |
{`button `}
35 |
{`{`}
36 |
37 | height:
38 | 40px;
39 |
40 | width:
41 | 40px;
42 |
43 | background:
44 | rgba(0, 0, 0, 0.4);
45 |
46 | border-radius:
47 | 50%;
48 |
49 | border-top:
50 | 2px solid #1D9AF2;
51 |
52 | border-right:
53 | 2px solid transparent;
54 |
55 | border-bottom:
56 | none;
57 |
58 | border-left:
59 | none;
60 |
61 | animation:
62 | spinner5 700ms linear infinite;
63 |
64 | {`}`}
65 |
66 |
{`@keyframes spinner5 `}
67 |
{`{`}
68 |
69 |
to
70 |
{`{`}
71 |
72 | transform: rotate(360deg);
73 |
74 |
{`}`} {" "}
78 |
79 |
{`}`}
80 |
81 |
82 |
83 | );
84 | };
85 |
86 | const spinner5Style = css`
87 | height: 40px;
88 | width: 40px;
89 | background: rgba(0, 0, 0, .4);
90 | border-top: 2px solid #1D9AF2;
91 | border-radius: 50%;
92 | border-left:none;
93 | border-bottom:none;
94 | border-right: 2px solid transparent;
95 | animation: spinner5 700ms linear infinite;
96 | }
97 | @keyframes spinner5 {
98 | to {
99 | transform: rotate(360deg);
100 | }
101 | }
102 | `;
103 |
104 | const spinner5HtmlVariable = `
`;
105 |
106 | const spinner5CssVariable = `
107 | button {
108 | height: 40px;
109 | width: 40px;
110 | background: rgba(0, 0, 0, .4);
111 | border-radius: 50%;
112 | border-top: 2px solid #1D9AF2;
113 | border-right: 2px solid transparent;
114 | border-bottom:none;
115 | border-left:none;
116 | animation: spinner5 700ms linear infinite;
117 | }
118 |
119 | @keyframes spinner5 {
120 | to {
121 | transform: rotate(360deg);
122 | }
123 | }
124 | `;
125 |
126 | export { spinner5, spinner5Style, spinner5HtmlVariable, spinner5CssVariable };
127 |
--------------------------------------------------------------------------------
/src/effects/SquaretoCircle.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { css } from "emotion";
3 |
4 | const squarecircle = () => {
5 | return (
6 |
7 |
HTML
8 |
15 | {`<`}
16 | {`button`}
17 | {`>`}
18 | {`Square to Circle`}
19 | {`<`}
20 | {`/`}
21 | {`button `}
22 | {`>`}
23 |
24 |
25 |
26 |
CSS
27 |
34 |
{`button `}
35 |
{`{`}
36 |
37 | color:
38 | #1D9AF2;
39 |
40 | background-color:
41 | #292D3E;
42 |
43 | border:
44 | 1px solid #1D9AF2;
45 |
46 | border-radius:
47 | 4px;
48 |
49 | padding:
50 | 0 15px;
51 |
52 | cursor:
53 | pointer;
54 |
55 | height:
56 | 32px;
57 |
58 | font-size:
59 | 14px;
60 |
61 | transition:
62 | all 0.2s ease-in-out;
63 |
64 |
65 |
{`}`}
66 |
67 |
{`button:hover `}
68 |
{`{`}
69 |
70 | border-radius:
71 | 50%;
72 |
73 |
{`}`}
74 |
75 |
76 | );
77 | };
78 |
79 | const squarecircleStyle = css`
80 | transition: all 0.2s ease-in-out !important;
81 | &:hover {
82 | border-radius: 50%;
83 | }
84 | `;
85 |
86 | const squarecircleHtmlVariable = `
Square to Circle `;
87 |
88 | const squarecircleCssVariable = `
89 | button {
90 | color: #1D9AF2;
91 | background-color: #292D3E;
92 | border: 1px solid #1D9AF2;
93 | border-radius: 4px;
94 | padding: 0 15px;
95 | cursor: pointer;
96 | height: 32px;
97 | font-size: 14px;
98 | transition: all 0.2s ease-in-out;
99 | }
100 | button:hover {
101 | border-radius: 50%;
102 | }
103 | `;
104 |
105 | export {
106 | squarecircle,
107 | squarecircleStyle,
108 | squarecircleHtmlVariable,
109 | squarecircleCssVariable
110 | };
111 |
--------------------------------------------------------------------------------
/src/effects/Swing.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { css } from "emotion";
3 |
4 | const swing = () => {
5 | return (
6 |
7 |
HTML
8 |
15 | {`<`}
16 | {`button`}
17 | {`>`}
18 | {`Square to Circle`}
19 | {`<`}
20 | {`/`}
21 | {`button `}
22 | {`>`}
23 |
24 |
25 |
26 |
CSS
27 |
34 |
{`button `}
35 |
{`{`}
36 |
37 | color:
38 | #1D9AF2;
39 |
40 | background-color:
41 | #292D3E;
42 |
43 | border:
44 | 1px solid #1D9AF2;
45 |
46 | border-radius:
47 | 4px;
48 |
49 | padding:
50 | 0 15px;
51 |
52 | cursor:
53 | pointer;
54 |
55 | height:
56 | 32px;
57 |
58 | font-size:
59 | 14px;
60 |
61 | transition:
62 | all 0.2s ease-in-out;
63 |
64 |
65 |
{`}`}
66 |
67 |
{`button:hover `}
68 |
{`{`}
69 |
70 | animation:
71 | swing 1s ease;
72 |
73 | animation-iteration-count:
74 | 1;
75 |
76 |
{`}`}
77 |
78 |
{`@keyframes swing `}
79 |
{`{`}
80 |
81 |
15%
82 |
{`{`}
83 |
84 | transform: translateX(5px);
85 |
86 |
{`}`}
87 |
30%
88 |
{`{`}
89 |
90 | transform: translateX(-5px);
91 |
92 |
{`}`}
93 |
50%
94 |
{`{`}
95 |
96 | transform: translateX(3px);
97 |
98 |
{`}`}
99 |
65%
100 |
{`{`}
101 |
102 | transform: translateX(-3px);
103 |
104 |
{`}`}
105 |
80%
106 |
{`{`}
107 |
108 | transform: translateX(2px);
109 |
110 |
{`}`}
111 |
100%
112 |
{`{`}
113 |
114 | transform: translateX(0);
115 |
116 |
{`}`}
117 |
118 |
119 |
120 | );
121 | };
122 |
123 | const swingStyle = css`
124 | @keyframes swing {
125 | 15% {
126 | -webkit-transform: translateX(5px);
127 | transform: translateX(5px);
128 | }
129 | 30% {
130 | -webkit-transform: translateX(-5px);
131 | transform: translateX(-5px);
132 | }
133 | 50% {
134 | -webkit-transform: translateX(3px);
135 | transform: translateX(3px);
136 | }
137 | 65% {
138 | -webkit-transform: translateX(-3px);
139 | transform: translateX(-3px);
140 | }
141 | 80% {
142 | -webkit-transform: translateX(2px);
143 | transform: translateX(2px);
144 | }
145 | 100% {
146 | -webkit-transform: translateX(0);
147 | transform: translateX(0);
148 | }
149 | }
150 | transition: all 0.2s ease-in-out !important;
151 |
152 | &:hover {
153 | animation: swing 1s ease;
154 | animation-iteration-count: 1;
155 | }
156 | `;
157 |
158 | const swingHtmlVariable = `
Swing `;
159 |
160 | const swingCssVariable = `
161 | button {
162 | color: #1D9AF2;
163 | background-color: #292D3E;
164 | border: 1px solid #1D9AF2;
165 | border-radius: 4px;
166 | padding: 0 15px;
167 | cursor: pointer;
168 | height: 32px;
169 | font-size: 14px;
170 | transition: all 0.2s ease-in-out;
171 | }
172 | button:hover {
173 | animation: swing 1s ease;
174 | animation-iteration-count: 1;
175 | }
176 |
177 | @keyframes swing {
178 | 15% {
179 | -webkit-transform: translateX(5px);
180 | transform: translateX(5px);
181 | }
182 | 30% {
183 | -webkit-transform: translateX(-5px);
184 | transform: translateX(-5px);
185 | }
186 | 50% {
187 | -webkit-transform: translateX(3px);
188 | transform: translateX(3px);
189 | }
190 | 65% {
191 | -webkit-transform: translateX(-3px);
192 | transform: translateX(-3px);
193 | }
194 | 80% {
195 | -webkit-transform: translateX(2px);
196 | transform: translateX(2px);
197 | }
198 | 100% {
199 | -webkit-transform: translateX(0);
200 | transform: translateX(0);
201 | }
202 | }
203 | `;
204 | export { swing, swingStyle, swingHtmlVariable, swingCssVariable };
205 |
--------------------------------------------------------------------------------
/src/index.css:
--------------------------------------------------------------------------------
1 | body {
2 | margin: 0;
3 | font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen",
4 | "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue",
5 | sans-serif;
6 | -webkit-font-smoothing: antialiased;
7 | -moz-osx-font-smoothing: grayscale;
8 | }
9 |
10 | code {
11 | font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New",
12 | monospace;
13 | }
14 |
15 | html {
16 | background-color: rgb(19, 23, 44);
17 | }
18 |
--------------------------------------------------------------------------------
/src/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import ReactDOM from 'react-dom';
3 | import './index.css';
4 | import App from './App';
5 | import * as serviceWorker from './serviceWorker';
6 |
7 | ReactDOM.render(
, document.getElementById('root'));
8 |
9 | // If you want your app to work offline and load faster, you can change
10 | // unregister() to register() below. Note this comes with some pitfalls.
11 | // Learn more about service workers: https://bit.ly/CRA-PWA
12 | serviceWorker.unregister();
13 |
--------------------------------------------------------------------------------
/src/logo.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/src/serviceWorker.js:
--------------------------------------------------------------------------------
1 | // This optional code is used to register a service worker.
2 | // register() is not called by default.
3 |
4 | // This lets the app load faster on subsequent visits in production, and gives
5 | // it offline capabilities. However, it also means that developers (and users)
6 | // will only see deployed updates on subsequent visits to a page, after all the
7 | // existing tabs open on the page have been closed, since previously cached
8 | // resources are updated in the background.
9 |
10 | // To learn more about the benefits of this model and instructions on how to
11 | // opt-in, read https://bit.ly/CRA-PWA
12 |
13 | const isLocalhost = Boolean(
14 | window.location.hostname === 'localhost' ||
15 | // [::1] is the IPv6 localhost address.
16 | window.location.hostname === '[::1]' ||
17 | // 127.0.0.1/8 is considered localhost for IPv4.
18 | window.location.hostname.match(
19 | /^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/
20 | )
21 | );
22 |
23 | export function register(config) {
24 | if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {
25 | // The URL constructor is available in all browsers that support SW.
26 | const publicUrl = new URL(process.env.PUBLIC_URL, window.location.href);
27 | if (publicUrl.origin !== window.location.origin) {
28 | // Our service worker won't work if PUBLIC_URL is on a different origin
29 | // from what our page is served on. This might happen if a CDN is used to
30 | // serve assets; see https://github.com/facebook/create-react-app/issues/2374
31 | return;
32 | }
33 |
34 | window.addEventListener('load', () => {
35 | const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;
36 |
37 | if (isLocalhost) {
38 | // This is running on localhost. Let's check if a service worker still exists or not.
39 | checkValidServiceWorker(swUrl, config);
40 |
41 | // Add some additional logging to localhost, pointing developers to the
42 | // service worker/PWA documentation.
43 | navigator.serviceWorker.ready.then(() => {
44 | console.log(
45 | 'This web app is being served cache-first by a service ' +
46 | 'worker. To learn more, visit https://bit.ly/CRA-PWA'
47 | );
48 | });
49 | } else {
50 | // Is not localhost. Just register service worker
51 | registerValidSW(swUrl, config);
52 | }
53 | });
54 | }
55 | }
56 |
57 | function registerValidSW(swUrl, config) {
58 | navigator.serviceWorker
59 | .register(swUrl)
60 | .then(registration => {
61 | registration.onupdatefound = () => {
62 | const installingWorker = registration.installing;
63 | if (installingWorker == null) {
64 | return;
65 | }
66 | installingWorker.onstatechange = () => {
67 | if (installingWorker.state === 'installed') {
68 | if (navigator.serviceWorker.controller) {
69 | // At this point, the updated precached content has been fetched,
70 | // but the previous service worker will still serve the older
71 | // content until all client tabs are closed.
72 | console.log(
73 | 'New content is available and will be used when all ' +
74 | 'tabs for this page are closed. See https://bit.ly/CRA-PWA.'
75 | );
76 |
77 | // Execute callback
78 | if (config && config.onUpdate) {
79 | config.onUpdate(registration);
80 | }
81 | } else {
82 | // At this point, everything has been precached.
83 | // It's the perfect time to display a
84 | // "Content is cached for offline use." message.
85 | console.log('Content is cached for offline use.');
86 |
87 | // Execute callback
88 | if (config && config.onSuccess) {
89 | config.onSuccess(registration);
90 | }
91 | }
92 | }
93 | };
94 | };
95 | })
96 | .catch(error => {
97 | console.error('Error during service worker registration:', error);
98 | });
99 | }
100 |
101 | function checkValidServiceWorker(swUrl, config) {
102 | // Check if the service worker can be found. If it can't reload the page.
103 | fetch(swUrl)
104 | .then(response => {
105 | // Ensure service worker exists, and that we really are getting a JS file.
106 | const contentType = response.headers.get('content-type');
107 | if (
108 | response.status === 404 ||
109 | (contentType != null && contentType.indexOf('javascript') === -1)
110 | ) {
111 | // No service worker found. Probably a different app. Reload the page.
112 | navigator.serviceWorker.ready.then(registration => {
113 | registration.unregister().then(() => {
114 | window.location.reload();
115 | });
116 | });
117 | } else {
118 | // Service worker found. Proceed as normal.
119 | registerValidSW(swUrl, config);
120 | }
121 | })
122 | .catch(() => {
123 | console.log(
124 | 'No internet connection found. App is running in offline mode.'
125 | );
126 | });
127 | }
128 |
129 | export function unregister() {
130 | if ('serviceWorker' in navigator) {
131 | navigator.serviceWorker.ready.then(registration => {
132 | registration.unregister();
133 | });
134 | }
135 | }
136 |
--------------------------------------------------------------------------------