Skip to content

Commit d0ee328

Browse files
committed
feat: working example
1 parent 21af34c commit d0ee328

File tree

8 files changed

+91
-14
lines changed

8 files changed

+91
-14
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ yarn-debug.log*
66
yarn-error.log*
77
lerna-debug.log*
88
.pnpm-debug.log*
9-
9+
example/
1010
# Diagnostic reports (https://nodejs.org/api/report.html)
1111
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
1212

example/package-lock.json

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

example/src/App.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
import "./App.css";
22
import ReactBubblyEffectButton from "react-bubbly-effect-button";
3-
// import "example-component/dist/index.css";
43

54
const onClick = () => {
65
console.log('Clicked')
76
}
87

98
function App() {
10-
return <ReactBubblyEffectButton text="Hello World!" color='#fff' bgColor='#ff0081' onClick={onClick} />;
9+
return <div className='container'>
10+
<ReactBubblyEffectButton text="Click here" color='#fff' bgColor='#26292c' onClick={onClick} />
11+
</div>;
1112
}
1213

1314
export default App;

example/src/index.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.container {
2+
display: flex;
3+
justify-content: center;
4+
align-items: center;
5+
height: 100vh
6+
}

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
"main": "dist/index.js",
66
"scripts": {
77
"dev": "webpack serve --mode development --env development",
8-
"build": "webpack --mode production --env production && npm pack"
8+
"build": "webpack --mode production --env production && npm pack",
9+
"predeploy": "cd example && npm run build",
10+
"deploy": "gh-pages -d example/build"
911
},
1012
"keywords": [
1113
"react-bubbly-effect-button"
@@ -19,6 +21,7 @@
1921
"clean-webpack-plugin": "^4.0.0-alpha.0",
2022
"css-loader": "^6.2.0",
2123
"file-loader": "^6.2.0",
24+
"gh-pages": "^3.2.3",
2225
"html-webpack-plugin": "^5.3.2",
2326
"mini-css-extract-plugin": "^2.3.0",
2427
"react": "^17.0.2",

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ const onClick = () => {
77
}
88

99
ReactDom.render(
10-
<ReactBubblyEffectButton text="Hello World!" color='#fff' bgColor='#ff0081' onClick={onClick} />,
10+
<ReactBubblyEffectButton text="Hello World!" color='#fff' bgColor='#26292c' onClick={onClick} />,
1111
document.getElementById("app")
1212
);

src/react-bubbly-effect-button.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,14 +84,14 @@ const ReactBubblyEffectButton = ({ text, onClick, bgColor, color }) => {
8484
background-repeat: no-repeat;
8585
}
8686
87-
.bubbly-button:before {
87+
.bubbly-button::before {
8888
display: none;
8989
top: -75%;
9090
background-image: radial-gradient(circle, ${bgColor} 20%, transparent 20%), radial-gradient(circle, transparent 20%, ${bgColor} 20%, transparent 30%), radial-gradient(circle, ${bgColor} 20%, transparent 20%), radial-gradient(circle, ${bgColor} 20%, transparent 20%), radial-gradient(circle, transparent 10%, ${bgColor} 15%, transparent 20%), radial-gradient(circle, ${bgColor} 20%, transparent 20%), radial-gradient(circle, ${bgColor} 20%, transparent 20%), radial-gradient(circle, ${bgColor} 20%, transparent 20%), radial-gradient(circle, ${bgColor} 20%, transparent 20%);
9191
background-size: 10% 10%, 20% 20%, 15% 15%, 20% 20%, 18% 18%, 10% 10%, 15% 15%, 10% 10%, 18% 18%;
9292
}
9393
94-
.bubbly-button:after {
94+
.bubbly-button::after {
9595
display: none;
9696
bottom: -75%;
9797
background-image: radial-gradient(circle, ${bgColor} 20%, transparent 20%), radial-gradient(circle, ${bgColor} 20%, transparent 20%), radial-gradient(circle, transparent 10%, ${bgColor} 15%, transparent 20%), radial-gradient(circle, ${bgColor} 20%, transparent 20%), radial-gradient(circle, ${bgColor} 20%, transparent 20%), radial-gradient(circle, ${bgColor} 20%, transparent 20%), radial-gradient(circle, ${bgColor} 20%, transparent 20%);
@@ -100,7 +100,7 @@ const ReactBubblyEffectButton = ({ text, onClick, bgColor, color }) => {
100100
101101
.bubbly-button:active {
102102
transform: scale(0.9);
103-
background-color: #e60074;
103+
background-color: ${bgColor};
104104
box-shadow: 0 2px 25px ${hexToRGB(bgColor, 0.2)};
105105
}
106106

yarn.lock

Lines changed: 71 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1252,7 +1252,7 @@ async-limiter@~1.0.0:
12521252
resolved "https://registry.yarnpkg.com/async-limiter/-/async-limiter-1.0.1.tgz#dd379e94f0db8310b08291f9d64c3209766617fd"
12531253
integrity sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ==
12541254

1255-
async@^2.6.2:
1255+
async@^2.6.1, async@^2.6.2:
12561256
version "2.6.3"
12571257
resolved "https://registry.yarnpkg.com/async/-/async-2.6.3.tgz#d72625e2344a3656e3a3ad4fa749fa83299d82ff"
12581258
integrity sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==
@@ -1576,7 +1576,7 @@ colorette@^1.2.1:
15761576
resolved "https://registry.yarnpkg.com/colorette/-/colorette-1.4.0.tgz#5190fbb87276259a86ad700bff2c6d6faa3fca40"
15771577
integrity sha512-Y2oEozpomLn7Q3HFP7dpww7AtMJplbM9lGZP6RDfHqmbeRjiwRg4n6VM6j4KLmRke85uWEI7JqF17f3pqdRA0g==
15781578

1579-
commander@^2.20.0:
1579+
commander@^2.18.0, commander@^2.20.0:
15801580
version "2.20.3"
15811581
resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33"
15821582
integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==
@@ -1916,6 +1916,11 @@ electron-to-chromium@^1.3.846:
19161916
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.848.tgz#94cc196e496f33c0d71cd98561448f10018584cc"
19171917
integrity sha512-wchRyBcdcmibioggdO7CbMT5QQ4lXlN/g7Mkpf1K2zINidnqij6EVu94UIZ+h5nB2S9XD4bykqFv9LonAWLFyw==
19181918

1919+
email-addresses@^3.0.1:
1920+
version "3.1.0"
1921+
resolved "https://registry.yarnpkg.com/email-addresses/-/email-addresses-3.1.0.tgz#cabf7e085cbdb63008a70319a74e6136188812fb"
1922+
integrity sha512-k0/r7GrWVL32kZlGwfPNgB2Y/mMXVTq/decgLczm/j34whdaspNrZO8CnXPf1laaHxI6ptUlsnAxN+UAPw+fzg==
1923+
19191924
emoji-regex@^7.0.1:
19201925
version "7.0.3"
19211926
resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-7.0.3.tgz#933a04052860c85e83c122479c4748a8e4c72156"
@@ -1978,7 +1983,7 @@ escape-html@~1.0.3:
19781983
resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988"
19791984
integrity sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=
19801985

1981-
escape-string-regexp@^1.0.5:
1986+
escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5:
19821987
version "1.0.5"
19831988
resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4"
19841989
integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=
@@ -2176,6 +2181,20 @@ file-uri-to-path@1.0.0:
21762181
resolved "https://registry.yarnpkg.com/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz#553a7b8446ff6f684359c445f1e37a05dacc33dd"
21772182
integrity sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==
21782183

2184+
filename-reserved-regex@^2.0.0:
2185+
version "2.0.0"
2186+
resolved "https://registry.yarnpkg.com/filename-reserved-regex/-/filename-reserved-regex-2.0.0.tgz#abf73dfab735d045440abfea2d91f389ebbfa229"
2187+
integrity sha1-q/c9+rc10EVECr/qLZHzieu/oik=
2188+
2189+
filenamify@^4.3.0:
2190+
version "4.3.0"
2191+
resolved "https://registry.yarnpkg.com/filenamify/-/filenamify-4.3.0.tgz#62391cb58f02b09971c9d4f9d63b3cf9aba03106"
2192+
integrity sha512-hcFKyUG57yWGAzu1CMt/dPzYZuv+jAJUT85bL8mrXvNe6hWj6yEHEc4EdcgiA6Z3oi1/9wXJdZPXF2dZNgwgOg==
2193+
dependencies:
2194+
filename-reserved-regex "^2.0.0"
2195+
strip-outer "^1.0.1"
2196+
trim-repeated "^1.0.0"
2197+
21792198
fill-range@^4.0.0:
21802199
version "4.0.0"
21812200
resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-4.0.0.tgz#d544811d428f98eb06a63dc402d2403c328c38f7"
@@ -2250,6 +2269,15 @@ fresh@0.5.2:
22502269
resolved "https://registry.yarnpkg.com/fresh/-/fresh-0.5.2.tgz#3d8cadd90d976569fa835ab1f8e4b23a105605a7"
22512270
integrity sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=
22522271

2272+
fs-extra@^8.1.0:
2273+
version "8.1.0"
2274+
resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-8.1.0.tgz#49d43c45a88cd9677668cb7be1b46efdb8d2e1c0"
2275+
integrity sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==
2276+
dependencies:
2277+
graceful-fs "^4.2.0"
2278+
jsonfile "^4.0.0"
2279+
universalify "^0.1.0"
2280+
22532281
fs.realpath@^1.0.0:
22542282
version "1.0.0"
22552283
resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f"
@@ -2304,6 +2332,19 @@ get-value@^2.0.3, get-value@^2.0.6:
23042332
resolved "https://registry.yarnpkg.com/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28"
23052333
integrity sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=
23062334

2335+
gh-pages@^3.2.3:
2336+
version "3.2.3"
2337+
resolved "https://registry.yarnpkg.com/gh-pages/-/gh-pages-3.2.3.tgz#897e5f15e111f42af57d21d430b83e5cdf29472c"
2338+
integrity sha512-jA1PbapQ1jqzacECfjUaO9gV8uBgU6XNMV0oXLtfCX3haGLe5Atq8BxlrADhbD6/UdG9j6tZLWAkAybndOXTJg==
2339+
dependencies:
2340+
async "^2.6.1"
2341+
commander "^2.18.0"
2342+
email-addresses "^3.0.1"
2343+
filenamify "^4.3.0"
2344+
find-cache-dir "^3.3.1"
2345+
fs-extra "^8.1.0"
2346+
globby "^6.1.0"
2347+
23072348
glob-parent@^3.1.0:
23082349
version "3.1.0"
23092350
resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-3.1.0.tgz#9e6af6299d8d3bd2bd40430832bd113df906c5ae"
@@ -2345,7 +2386,7 @@ globby@^6.1.0:
23452386
pify "^2.0.0"
23462387
pinkie-promise "^2.0.0"
23472388

2348-
graceful-fs@^4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.2.4:
2389+
graceful-fs@^4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.4:
23492390
version "4.2.8"
23502391
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.8.tgz#e412b8d33f5e006593cbd3cee6df9f2cebbe802a"
23512392
integrity sha512-qkIilPUYcNhJpd33n0GBXTB1MMPp14TxEsEs0pTrsSVucApsYzW5V+Q8Qxhik6KU3evy+qkAAowTByymK0avdg==
@@ -2866,6 +2907,13 @@ json5@^2.1.2:
28662907
dependencies:
28672908
minimist "^1.2.5"
28682909

2910+
jsonfile@^4.0.0:
2911+
version "4.0.0"
2912+
resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-4.0.0.tgz#8771aae0799b64076b76640fca058f9c10e33ecb"
2913+
integrity sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=
2914+
optionalDependencies:
2915+
graceful-fs "^4.1.6"
2916+
28692917
killable@^1.0.1:
28702918
version "1.0.1"
28712919
resolved "https://registry.yarnpkg.com/killable/-/killable-1.0.1.tgz#4c8ce441187a061c7474fb87ca08e2a638194892"
@@ -4240,6 +4288,13 @@ strip-final-newline@^2.0.0:
42404288
resolved "https://registry.yarnpkg.com/strip-final-newline/-/strip-final-newline-2.0.0.tgz#89b852fb2fcbe936f6f4b3187afb0a12c1ab58ad"
42414289
integrity sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==
42424290

4291+
strip-outer@^1.0.1:
4292+
version "1.0.1"
4293+
resolved "https://registry.yarnpkg.com/strip-outer/-/strip-outer-1.0.1.tgz#b2fd2abf6604b9d1e6013057195df836b8a9d631"
4294+
integrity sha512-k55yxKHwaXnpYGsOzg4Vl8+tDrWylxDEpknGjhTiZB8dFRU5rTo9CAzeycivxV3s+zlTKwrs6WxMxR95n26kwg==
4295+
dependencies:
4296+
escape-string-regexp "^1.0.2"
4297+
42434298
style-loader@^3.2.1:
42444299
version "3.3.0"
42454300
resolved "https://registry.yarnpkg.com/style-loader/-/style-loader-3.3.0.tgz#d66ea95fc50b22f8b79b69a9e414760fcf58d8d8"
@@ -4341,6 +4396,13 @@ toidentifier@1.0.0:
43414396
resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.0.tgz#7e1be3470f1e77948bc43d94a3c8f4d7752ba553"
43424397
integrity sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw==
43434398

4399+
trim-repeated@^1.0.0:
4400+
version "1.0.0"
4401+
resolved "https://registry.yarnpkg.com/trim-repeated/-/trim-repeated-1.0.0.tgz#e3646a2ea4e891312bf7eace6cfb05380bc01c21"
4402+
integrity sha1-42RqLqTokTEr9+rObPsFOAvAHCE=
4403+
dependencies:
4404+
escape-string-regexp "^1.0.2"
4405+
43444406
tslib@^2.0.3:
43454407
version "2.3.1"
43464408
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.3.1.tgz#e8a335add5ceae51aa261d32a490158ef042ef01"
@@ -4392,6 +4454,11 @@ union-value@^1.0.0:
43924454
is-extendable "^0.1.1"
43934455
set-value "^2.0.1"
43944456

4457+
universalify@^0.1.0:
4458+
version "0.1.2"
4459+
resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66"
4460+
integrity sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==
4461+
43954462
unpipe@1.0.0, unpipe@~1.0.0:
43964463
version "1.0.0"
43974464
resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec"

0 commit comments

Comments
 (0)