sweepai / landing-page

7 stars 6 forks source link

Sweep: Add fireworks particles on click to the pricing page #509

Open wwzeng1 opened 9 months ago

wwzeng1 commented 9 months ago
Checklist - [X] `src/components/PricingPage.tsx` ✅ Commit [`1e8a46c`](https://github.com/sweepai/landing-page/commit/1e8a46cd87a78adf1697ffa167f8632f698565e0)
sweep-nightly[bot] commented 9 months ago

Here's the PR! https://github.com/sweepai/landing-page/pull/518.

💎 Sweep Pro: I'm creating this ticket using GPT-4. You have unlimited GPT-4 tickets.

Actions (click)


Step 1: 🔎 Searching

I found the following snippets in your repository. I will now analyze these snippets and come up with a plan.

Some code snippets I looked at (click to expand). If some file is missing from here, you can mention the path in the ticket description. https://github.com/sweepai/landing-page/blob/3e8fdea9b5bcd47c57a4cee4cc464890bac4ed53/src/App.tsx#L34-L108

I also found some related docs:

Summary of related docs from https://particles.js.org/docs/modules/tsParticles_Engine.html:

To add fireworks particles on click to the pricing page, you can use the "Fireworks" preset provided by tsParticles. This preset is available as a separate package called "tsparticles-preset-fireworks". You can include this package in your project and configure the particles to appear on click.

Here are the steps to follow:

  1. Install the "tsparticles-preset-fireworks" package using npm or yarn:

    npm install tsparticles-preset-fireworks

    or

    yarn add tsparticles-preset-fireworks
  2. Import the necessary modules in your JavaScript file:

    import { tsParticles } from "tsparticles";
    import { loadFireworksPreset } from "tsparticles-preset-fireworks";
  3. Load the "Fireworks" preset:

    tsParticles.addPreset("fireworks", loadFireworksPreset);
  4. Initialize tsParticles on the desired element:

    tsParticles.load("element-id", {
     preset: "fireworks",
     // other configuration options
    });

    Replace "element-id" with the ID of the element where you want the particles to appear.

  5. Add an event listener to trigger the fireworks particles on click:

    const element = document.getElementById("element-id");
    element.addEventListener("click", () => {
     tsParticles.load("element-id", {
       preset: "fireworks",
       // other configuration options
     });
    });

    Replace "element-id" with the ID of the element where you want to trigger the fireworks particles.

By following these steps, you should be able to add fireworks particles on click to the pricing page.

Sources:


Step 2: ⌨️ Coding


Step 3: 🔁 Code Review

Here are my self-reviews of my changes at sweep/fireworks-particles.

Here is the 1st review

Hi there, great job on implementing the fireworks particles on click! There's just a small issue that needs to be addressed. In the file `src/components/PricingPage.tsx`, you've left the comment "// other configuration options" in two places (lines 10 and 18). This suggests that there may be some unimplemented sections. Please replace these comments with the actual configuration options for the fireworks particles. Here's an example of how you might do this: ```javascript tsParticles.load("pricing-page", { preset: "fireworks", particles: { number: { value: 100, }, color: { value: "#ff0000", }, // other options... }, }); ``` Please make these changes and push them to your branch. Keep up the good work!

I finished incorporating these changes.


🎉 Latest improvements to Sweep:


💡 To recreate the pull request edit the issue title or description. To tweak the pull request, leave a comment on the pull request. Join Our Discord