Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add clickable buttons to the cup #37

Closed
kevinmonisit opened this issue Jan 31, 2024 · 2 comments · Fixed by #59
Closed

Add clickable buttons to the cup #37

kevinmonisit opened this issue Jan 31, 2024 · 2 comments · Fixed by #59
Assignees

Comments

@kevinmonisit
Copy link
Member

this task..... lokey might be hard. i wonder how this would even work?

i think we would have to have a set of fixed dimensions for the cup for each breakpoint so that button placement is predictacble

image
@kevinmonisit
Copy link
Member Author

kevinmonisit commented Feb 1, 2024

Current implementation of the this fire component:

        <Image
          src="/landing/fire.png"
          width="0"
          height="0"
          sizes="100vw"
          alt="Fire"
          // https://stackoverflow.com/questions/69230343/nextjs-image-component-with-fixed-witdth-and-auto-height
          className="h-auto w-[790px] pl-8 md:w-[550px] lg:w-[650px]"
          priority
        />

Regarding TailwindCSS breakpoints and responsive design: https://tailwindcss.com/docs/responsive-design#working-mobile-first. (The "mobile-first" principle is just something I want to get across)

One implementation that comes to mind:

<div className="h-auto w-[790px] pl-8 md:w-[550px] lg:w-[650px] relative">
        <Button className="absolute top-[something] left-[something] md:top-[something] md:left-[something]"/>
        <Button className="absolute top-[something] left-[something] md:top-[something] md:left-[something]"/>

        <Image
          src="/landing/fire.png"
          width="0"
          height="0"
          sizes="100%"
          alt="Fire"
          // https://stackoverflow.com/questions/69230343/nextjs-image-component-with-fixed-witdth-and-auto-height
          priority
        />
</div>

When we give the image container (and therefore the image itself) fixed sizes, we can predictably place the buttons at each defined breakpoint.

Wrapping it in a container and setting the container to have relative positioning allows us to place the buttons with absolute positioning relative to the image container itself.

However, wouldn't it be better to have one single button called "Get Started"> and have it take the width of two buttons? I feel like that would make life easier. That way:

  • On Mobile, the buttons are never too small
  • On implementation, we don't need to figure out the positioning of two buttons

When the user tries to log in but they are not registered, there is a button to switch the login page to a user registration page. Something like this:
image

But I'm just yapping. Two buttons is fine as well.

@kevinmonisit
Copy link
Member Author

also. i forgot to mention. i think, instead of the image "growing" (shrinking or decreasing dynamically by change of browser width), i think there should be some FIXED width and height for every breakpoint. that way, the buttons don't need to /grow/ or /shrink/ alongside with the cup.

might save some headaches?

@bhivam bhivam linked a pull request Feb 6, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants