Giter VIP home page Giter VIP logo

fem-jr-price-comp's Introduction

Interactive Price Component (Junior)

Challenge Files

Criteria

Your users should be able to:

  • View the optimal layout for the app depending on their device's screen size
  • See hover states for all interactive elements on the page
  • Use the slider and toggle to see prices for different page view numbers (details provided below)

Page view and pricing totals

Here are the different page view ranges and the corresponding monthly price totals:

  • 10K pageviews / $8 per month
  • 50K pageviews / $12 per month
  • 100K pageviews / $16 per month
  • 500k pageviews / $24 per month
  • 1M pageviews / $36 per month

If the visitor switches the toggle to yearly billing, a 25% discount should be applied to all prices.

Visual Components

Class Description Tag Element(s)
ipc namespace div ipc-Intro ipc-Card
ipc-Intro header and details header h1 p
ipc-Card holds the slider, cta div ipc-Card_* #ipcCard
ipc-Card_prices price ranges ul #views #slider #price
ipc-Card_billing billing panel div p button p span
ipc-Card_cta call to action panel div [p > img] button
  • id's (#) are used for any element targeted by JS
  • body has a two background images
  • the ipc card has a shadow
  • the slider button has a coloured shadow
  • the slider price range elements are re-ordered on larger screen size so need to keep separate References
  • the discount value is a pill
  • give the ipc-Card_cta a top border, full width of card

Technical

  1. how to handle discount pricing?
    • JS to modify cost if yearly billing selected
    • JS to update the views and price when the slider is moved
  2. how to create the slider?
    • put together using ideas from tutorials and examples (see References)
      • gc-Slider class, JS used to update gradient colour of rail
      • works in 3 modern browsers: Firefox, Chrome, Edge
        • required some code duplication as needed two polyfill selectors: -moz-range-thumb and -webkit-slider-thumb
  3. how to create the toggle switch?
    • put together using ideas from tutorials (see References)
    • used a pseudo-element and a data-* attribute to hide and show the word discount in the billing section based on screen size
  4. CTA - had to load the icon-check.svg's in the HTML in order to position as per the design, originally tried using a ul but each item would have needed custom positioning anyway, making CSS code messier

References:

For the slider:

For the toggle switch:

For hiding/showing the word 'discount':

fem-jr-price-comp's People

Contributors

janegca avatar

Watchers

 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.