Git Product home page Git Product logo

unsprinkle's Introduction

Unsprinkle — Module 6 workshop

In this workshop, we're going to optimize and improve an existing application.

Using the tricks we learned about typography and images in this module, we'll improve the performance, accessibility, and user experience for Unsprinkle, a photo-sharing application.

Troubleshooting

If you run into problems running a local development server, check out our Troubleshooting Guide on the course platform.

This guide addresses the common Digital Envelope Routine error you may have seen.


Exercise 1: Optimize fonts

This project is using a variable font, but it's quite hefty! Using Google Fonts, swap it out for an optimized version.

Bonus points for self-hosting the optimized font!

Exercise 2: Improve images

For a photo-heavy site like this one, we can significantly improve the user experience by optimizing the images that appear.

The images in the photo grid and the hero should implement the following optimizations:

  1. Serve larger images to users who use high-DPI displays.
  2. Serve modern .avif images instead of .jpg images to users on supported browsers.

All of the images have already been created for you. They follow a consistent naming pattern:

For the hero, you can hardcode these values. For the photo grid, you'll need to use some JavaScript to update the photo names. You can use the replace method:

src.replace('.jpg', '@2x.avif');

One last thing: the images are a little distorted right now. This happens because our images are all the same size, but they don't share the same aspect ratio.

Here's what the giraffe picture looks like by default:

Squashed photo of a giraffe

…And here's what it should look like after your modifications:

Regular photo of a giraffe

Exercise 3: Accessibility issues

There are several images in this application, and none of them have been given the required "alt" attribute.

Update all images so that they have appropriate alternative text.

There are 11 images in total, including 2 in the Hero.js component. Be sure to consider the context (if you weren't able to see the page, what would you want to know about them?).

Exercise 4: Tag overflow

Each photo has associated tags, shown in small grey boxes below the image:

Screenshot from the app, showing a dog with 3 tags below

Some of these items have very long tags:

Screenshot from the app, showing a lizard with a particlarly long tag

Update the CSS so that the tags always fit on 1 line. If there is too much text, the final tag should have an ellipsis (…).

The lizard example, but with an ellipsis at the right edge, in the second label

This is a challenging exercise. You'll need to tweak some of the existing CSS (Hint: Flexbox might not be the right layout mode for this)

unsprinkle's People

Contributors

joshwcomeau avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.