Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted 3 months ago

Responsive bookmark landing page

motion, react, react-hook-form, typescript, tailwind-css
P
Nishanth Venkatesan•1,030
@nishanth1596
A solution to the Bookmark landing page challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


What are you most proud of, and what would you do differently next time?

This was my first time using Framer Motion, and I implemented it to add a smooth sliding transition to the accordion component.

Recently, I learned about the compound components pattern, but I initially struggled to understand it. Since the best way to learn is by doing, I decided to apply it in this project. Although I faced challenges at first, I was able to complete it—and now, I feel like I have a solid understanding of the pattern, which I'm proud of.

What specific areas of your project would you like help with?

I need help with adding the background image and text decoration (underline).

Currently, the width of the underline remains constant instead of adjusting dynamically based on the content. I’d appreciate any help in resolving these two issues.

Code
Select a file

Please log in to post a comment

Log in with GitHub

Community feedback

  • P
    Habeeb Kareem•740
    @olaide-hok
    Posted 3 months ago

    Hi there,

    Great work here!

    Well done.

    Regarding the width of the underline remaining constant instead of adjusting dynamically based on the content. An approach would be to style using ::after pseudo css selector. The width will then be in percentage instead of a fixed value.

    For the background image, two approaches

    • add it using the ::before css pseudo selector.
    • add it by adding and styling a div as a sibling element of the image. With the parent div position relatively and target div absolutely. The width and height would have percentage values in other to be responsive.

    For example

    function HeroSection() {
      return (
        <section className="mx-8 mt-20 lg:mx-12 lg:mt-[6.75rem] lg:grid lg:grid-cols-2 xl:mx-0 xl:gap-16">
    <div class="relative">
          <img
            className="mx-auto lg:order-2"
            src={heroImg}
            alt="Illustration of a browser tab showing a list of bookmarks with colored indicators"
          />
    <div class="pos right-0 bottom-0 -z-1 bg-[#5267D} w-[75%] h-[75%] rounded-l-[999px]"></div>
    </div>
    
    // Article section goes here
        </section>
      );
    }
    

    Or styling the pseudo

    function HeroSection() {
      return (
        <section className="mx-8 mt-20 lg:mx-12 lg:mt-[6.75rem] lg:grid lg:grid-cols-2 xl:mx-0 xl:gap-16">
    <div class="hero-img-wrapper relative">
          <img
            className="mx-auto lg:order-2"
            src={heroImg}
            alt="Illustration of a browser tab showing a list of bookmarks with colored indicators"
          />
    </div>
    
    // Article section goes here
        </section>
      );
    }
    
    .hero-img-wrapper::before{
        content: "",
        background: #5267DF;
        position: absolute;
        width: 75%;
        height: 75%;
    }
    
    

    NB all tailwind utility classes and css rules provided have to be edited to suite specific needs.

    The Feature Section component could be update to

    
    function HeroSection() {
      return (
        <section className="mx-8 mt-20 lg:mx-12 lg:mt-[6.75rem] lg:grid lg:grid-cols-2 xl:mx-0 xl:gap-16">
        <article>
               <nav className="mt-8" aria-label="Download options">
              <ul className="flex items-center justify-left gap-3.5">
                // li tags goes here
              </ul>
            </nav>
          </article>
        </section>
      );
    }
    

    Well done and happy coding.

Join our Discord community

Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!

Join our Discord
Frontend Mentor logo

Stay up to datewith new challenges, featured solutions, selected articles, and our latest news

Frontend Mentor

  • Unlock Pro
  • Contact us
  • FAQs
  • Become a partner

Explore

  • Learning paths
  • Challenges
  • Solutions
  • Articles

Community

  • Discord
  • Guidelines

For companies

  • Hire developers
  • Train developers
© Frontend Mentor 2019 - 2025
  • Terms
  • Cookie Policy
  • Privacy Policy
  • License

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

How does the accessibility report work?

When a solution is submitted, we use axe-core to run an automated audit of your code.

This picks out common accessibility issues like not using semantic HTML and not having proper heading hierarchies, among others.

This automated audit is fairly surface level, so we encourage to you review the project and code in more detail with accessibility best practices in mind.

How does the CSS report work?

When a solution is submitted, we use stylelint to run an automated check on the CSS code.

We've added some of our own linting rules based on recommended best practices. These rules are prefixed with frontend-mentor/ which you'll see at the top of each issue in the report.

The report will audit all CSS, SCSS and Less files in your repository.

How does the HTML validation report work?

When a solution is submitted, we use html-validate to run an automated check on the HTML code.

The report picks out common HTML issues such as not using headings within section elements and incorrect nesting of elements, among others.

Note that the report can pick up “invalid” attributes, which some frameworks automatically add to the HTML. These attributes are crucial for how the frameworks function, although they’re technically not valid HTML. As such, some projects can show up with many HTML validation errors, which are benign and are a necessary part of the framework.

How does the JavaScript validation report work?

When a solution is submitted, we use eslint to run an automated check on the JavaScript code.

The report picks out common JavaScript issues such as not using semicolons and using var instead of let or const, among others.

The report will audit all JS and JSX files in your repository. We currently do not support Typescript or other frontend frameworks.

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub