Giter VIP home page Giter VIP logo

classnames-bem-sass's Introduction

classnames, BEM and Sass

We will create a small UI library here which will use classnames, BEM and Sass for styling

Tasks

Voting buttons

  • Create a VotingButtons component with five voting buttons Camel, Duck, Donut, Potato and Mash Potato.
  • When a button is clicked, display it in different style to mark it as selected.
  • Ensure that no more than one voting button can be selected at a time.

Country selector

  • Create a CountrySelector component. It should have 2 parts
    • A text input which displays the country selected
    • A popup div underneath which displays a list of countries
  • You may want to use {overflow-y: scroll} and {position: absolute} on the popup to display it correctly with a fixed height and a scroll bar.
  • When the CountrySelector component receives a focus event it should display the popup with list of countries underneath.
  • When the CountrySelector component receives a blur event it should hide the popup.
  • When a country in the popup is clicked, set the name of the country as the value in the input.

Stretch goals

  • When the CountrySelector is in focus and the country list is displayed, allow the user to navigate the list of countries using the up and down arrows. You may want to listen for a keyDown event to detect arrow presses.
  • Allow the user to pick a country selected using above by pressing the 'Enter' key.
  • Allow the user to filter the list of countries displayed using by the text entered into the input and implement it using a filter method

You can see an example of country input at https://semantic-ui.com/modules/dropdown.html with all above features implemented in the Search Selection section.

Datepicker

  • Create a Datepicker component. It should have 2 parts
    • A text input which displays the date selected
    • A popup div underneath which displays a list of dates for current month
  • When the component receives a blur event display the popup div underneath it. Hide the popup when component receives a blur event.
  • Display current month name and a list of dates for current month in the popup. You may want to use the moment library to help you.
  • When a date in popup is clicked display the date selected date in the text input part of the component in 'DD-MM-YYYY' format.
  • When the input already has a date value, display the date in popup with a dark background
  • Ensure that days in the past cannot be selected. Display days in the past as greyed out.
  • Add arrow buttons on either side of the popup. Clicking the right button should change current month to next month and left button to previous month. Update the dates displayed on month changes.

Stretch goals

  • When the month selected is not the current month, make sure that when the popup opens the month is set to month selected rather than current month.
  • Display days of the week as two letters at the top of the popup. Make sure that the dates displayed underneath correspond to days of the week above. Ensure this behaviour is consistent as months change.
  • Create a date range selector which uses two date pickers to allow users to select a start date and an end date. An end date should not be selectable after an end date and an end date should not be selectable before a start date.

classnames-bem-sass's People

Contributors

dmitrigrabov 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.