npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

wsi-challenge

v1.1.9

Published

Williams-Sonoma Coding Challenge

Downloads

1

Readme

Williams-Sonoma Coding Challenge

Given a JSON file of products, build a page that displays for each product:

  • product image
  • product name
  • product price

Display all products on a multi-column, responsive, accessible, and attractive page. Upon selection of a product image, display an overlay containing a carousel of product images.

3-column layout

Technologies Used

Name | Version | Usage -------------------------- | ------- | ----- Vue.js | 2.6.12 | production Bootstrap | 4.5.2 | production jQuery | 3.5.1 | production popper.js | 1.16.1 | production image-gallery-overlay* | 1.3.2 | production jest | 26.5.3 | dev test babel | 7.12.3 | dev test/build webpack | 4.44.2 | dev build postCSS | 8.1.1 | dev build

Installation

git clone https://github.com/terrymorse58/wsi-coding-challenge.git
cd wsi-coding-challenge
npm install

Launching the Page

This project build is installed on the Terry Morse Software, Inc. server and may be run here:

WSI Coding Challenge @ terrymorse.com

Or the development version can be run locally :

npm run dev

Tests

npm run test

Directory Structure

 Project
 |-- build
 |   |-- index.html
 |   |-- wsi-products.json
 |   |-- css
 |   |   |-- wsiprods.css
 |   |-- js
 |   |   |-- products.js

Responsive Design

iPhone responsive layout

The page layout and dimensions of the product cards are responsive to viewport width changes.

The product card default width is 354 pixels, which will display 3 columns of cards on a viewport at least 1200 pixels wide.

When the viewport is 776-999 pixels wide, two columns will be displayed.

On viewports narrower than 776 pixels, the layout changes to single-column, horizontally centered product cards.

On viewports narrower than 396 pixels, the product cards shrink in size to fit the viewport width.

The image gallery overlay is responsive to viewport width and height.

Accessibility Design

accessibility

To permit page navigtion without a pointing device, navigation is supported using tab, enter, and esc keys.

Pressing the tab key sets the focus on the next product card's image, and an outline indicates which card image has focus. Pressing esc removes focus from the product image.

When a product card's image has focus, the enter key opens an overlay which displays a carousel of product images.

When the overlay image gallery is displayed, esc closes it and returns focus to the product card image.

Styling

Styling is managed in wsiprods.css. To permit easy changes to the apperance, this file uses CSS custom properties (variables) for all the significant styles:

/* modify wsi styling here */
:root {
    --wsi-body-background-color: #f0f0f0;
    --wsi-container-background-color: #fff;
    --wsi-container-outline: 1px solid #bbb;
    --wsi-card-margin: 1rem 0.5rem;
    --wsi-card-width: 354px;
    --wsi-card-text-size: 0.85rem;
    --wsi-card-line-height: 1.2;
    --wsi-card-background-color: #fff;
    --wsi-card-border: 1px solid rgba(0,0,0,0.125);
    --wsi-card-hover-filter: drop-shadow(0 0 4px rgba(0,0,0,0.4));
    --wsi-card-hover-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2),
      0 6px 20px 0 rgba(0, 0, 0, 0.19);
    --wsi-card-hover-transform: scale(1.015);
    --wsi-card-img-focus-outline: 3px solid rgba(30,144,255,0.5);
    --wsi-card-flex-direction: row;
    --wsi-price-font-weight: 600;
    --wsi-sale-text-color: red;
}

For browser compantibility, the build version replaces CSS custom properties with static values.

Testimonial

This project was written entirely by me, Terry Morse, with no outside assistance.

Your comments or questions are welcome at [email protected].

Terry Morse President Terry Morse Software, Inc. Palo Alto, California, USA [email protected]