Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted almost 4 years ago

HTML, CSS, JavaScript, BootStrap

Carlos•1,110
@Carlos-A-P
A solution to the URL shortening API landing page challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


This was a fun project. I practiced using BootStrap a little more and it certainly helps.

  • I used Bootstrap for the navbar and noticed that the transition isn't as smooth and a little flickery, I was hoping someone knew what I can change to make it smooth?
  • I wanted to simulate a loading element and I added the gif into my HTML and simply added a hidden class that toggles with JavaScript. I was wondering if there is a more efficient way of implementing a loading gif or something similar.
  • I also added a delete button in case the screen gets too full with Link cards and there was no way to remove them since they save even after the page is refreshed.
  • Is it common for sites to have headings only increase by one? I've seen how sometimes larger headings comes after smaller headings in some sites and I was wondering what is the common practice for that? Would a developer use an h2 with smaller font size and then use an h3 with a larger font?

Let me know if you have any tips/suggestions/spotted bugs. Thanks!

Code
Select a file

Please log in to post a comment

Log in with GitHub

Community feedback

  • P
    Dave•5,295
    @dwhenson
    Posted almost 4 years ago

    Hey @Carlos-A-P great job here - this one is a tricky one!! 🙌

    Here's a few things to think about, in response to your points:

    • I think the transition is flickering as you/Bootstrap is changing the height of the open panel. Animating this property demands a lot of the browser, if you change to opacity or just a transition in from somewhere you should be OK. I don't know Bootstrap, but it seems it is somehow adding the value inline, then removing once the transition is complete

    • For the loading element, at the moment it stays after the fetch request is complete. It should be removed. You can actually create these kind of effects with pure CSS which might be easier and lead to less disruption on the page. I changed the content of the fetch button content on my attempt to try and address this.

    • It might be worth having another play around with the API here. As there are two levels of failure, 1) if there is an error in response (which you have covered), and 2) if the url requested cannot be shortened. At the minute if I try the second on your page it just hangs.

    Try shortening www.shrtco.de to see how this error manifests itself. It took me a while to deal with this issue, but the API has some good built in error messages that you can catch and provide in the user error message.

    • For headings, I think the answer is yes, what this means is that you should use the <h1> headings as main heading of your web page, followed by the <h2> headings, then the less important <h3> headings, and so on, without skipping a level.

    This is really important as many people using assistive tech to access your pages will navigate the site based on the heading structure.

    I approach this by first laying out the page using only HTML and only thinking about the document structure, not design at all, and then once done returning to the page and using CSS to make things look how they should.

    We shouldn’t use headings to make text look BIG or bold. Use them only for setting out the heading of your document and to show the document structure, and then change things up with CSS after that.

    Hope this helps - great stuff on a very challenging one!! 👍

    Cheers 👋

    Dave

    Marked as helpful

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

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