Skip to content

Commit

Permalink
refactor: Removed click interaction from tsparticles
Browse files Browse the repository at this point in the history
  • Loading branch information
sumitsahoo committed Jul 20, 2024
1 parent fe9cec6 commit ce88cdd
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 11 deletions.
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"generate-pwa-assets": "pwa-assets-generator --preset minimal public/images/ic-logo.svg"
},
"dependencies": {
"@heroicons/react": "^2.1.4",
"@heroicons/react": "^2.1.5",
"@material-tailwind/react": "^2.1.9",
"@tsparticles/react": "^3.0.0",
"@tsparticles/slim": "^3.5.0",
Expand Down
15 changes: 10 additions & 5 deletions src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ import BarcodeScanner from "./components/BarcodeScanner";

const App = () => {
const [_init, setInit] = useState(false);

const backgroundColor = "#ECEFF1";
const particlesColor = "#78909C";

// this should be run only once per application lifetime
useEffect(() => {
initParticlesEngine(async (engine) => {
Expand All @@ -13,8 +17,9 @@ const App = () => {
// starting from v2 you can add only the features you need reducing the bundle size
//await loadAll(engine);
//await loadFull(engine);
await loadSlim(engine);
//await loadBasic(engine);

await loadSlim(engine);
}).then(() => {
setInit(true);
});
Expand All @@ -26,7 +31,7 @@ const App = () => {

const options = {
background: {
color: "#eceff1",
color: backgroundColor,
},
particles: {
number: {
Expand All @@ -37,7 +42,7 @@ const App = () => {
},
},
color: {
value: ["#78909C"],
value: [particlesColor],
},
shape: {
type: "circle",
Expand All @@ -51,7 +56,7 @@ const App = () => {
links: {
enable: true,
distance: 150,
color: "#78909C",
color: particlesColor,
opacity: 0.4,
width: 1,
},
Expand All @@ -71,7 +76,7 @@ const App = () => {
mode: "grab",
},
onClick: {
enable: true,
enable: false,
mode: "push",
},
},
Expand Down
10 changes: 9 additions & 1 deletion tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,15 @@ const withMT = require("@material-tailwind/react/utils/withMT");
module.exports = withMT({
content: ["./index.html", "./src/**/*.{vue,js,ts,jsx,tsx}"],
theme: {
extend: {},
extend: {
colors: {
primary: {
light: "#78909C",
DEFAULT: "#78909C", // Default primary color
dark: "#78909C",
},
},
},
},
plugins: [],
});

0 comments on commit ce88cdd

Please sign in to comment.