Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <div id="app"></div>
              
            
!

CSS

              
                @import url('https://fonts.googleapis.com/css?family=Poppins');

/***************
VARIABLES
****************/
$white: rgb(255, 255, 255);
$yellow: rgb(220, 190, 0);
$gray: rgb(115, 115, 115);
$light-background: rgb(245, 245, 245);

html {
  scroll-behavior: smooth;
}

body {
  overflow-x: hidden;
}
/****************
GLOBAL
*****************/
*, *::before, *::after {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
}
/*******************************
REMOVE BORDER FORM REACT-SLICK
********************************/
.slick-slide, .slick-active {
  border: none !important;
}
/**********************************
  CUSTOM ARROWS & DOTS FOR CAROUSEL
************************************/
// .slick-arrow {
//   border: solid 2px lightgray !important;
//   height: 40px;
//   width: 40px;
//   border-radius: 50%;
//   display: flex !important;
//   justify-content: center !important;
//   align-items: center !important;
//   z-index: 100 !important;
// }
// .slick-next {
//   position: absolute !important;
//   right: 2% !important;
// }
// .slick-next:before {
//   font-family: 'FontAwesome';
//   content: '\f078';
//   font-size: 20px;
//   color: lightgray;
// }
// .slick-prev {
//   position: absolute !important;
//   left: 94% !important;
//   top: 42% !important;
// }
// .slick-prev::before {
//   font-family: 'FontAwesome';
//   content: '\f077 ';
//   font-size: 20px;
//   color: lightgray;
//   margin-top: -5px;
// }
.slick-dots {
  position: absolute !important;
  top: 50% !important;
  left: 0 !important;
  height: 30px;
  width: 130px;
  transform: rotate(90deg);
  margin-top: -40px;
  li button::before {
    color: lightgray !important;
  }
}

a {
  text-decoration: none;
}
ul {
  list-style: none;
}
img {
  width: 100%;
  height: 100%;
}

/****************
WRAPPER
*****************/
#wrapper {
  min-width: 1000px;
  // margin:0 auto;
  background-color: $light-background;
  font-family: 'Poppins', sans-serif;
  box-shadow: 0 0 15px gray;
}

/**********************
    NAVIGATION
**********************/
nav {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1;
  min-width: 1000px;
  padding: .40em 1em;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-pack: justify;
  -ms-flex-pack: justify;
  justify-content: space-between;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  

  .user {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-pack: justify;
    -ms-flex-pack: justify;
    justify-content: space-between;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    width: 80px;
    .user-settings {
      color: lighten($gray, 35%);
      cursor: pointer;
      &:hover {
        color: $gray;
      }
    }
    .user-icon {
      width: 50px;
      border-radius: 50px;
      cursor: pointer;
    }
  }
}
.nav {
  text-transform: uppercase;
  color: $white;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-pack: center;
  -ms-flex-pack: center;
  justify-content: center;
  margin: auto;
  li {
    font-size: .90em;
    padding: 0 1em;
    cursor: pointer;
    transition: color .25s ease;
    &:hover {
      color: $yellow;
    }
  }
  .active {
    color: $yellow;
  }
}

/*************
HEADER
**************/
header {
  height: 600px;
  // background: linear-gradient(0deg, rgba(0, 0, 0, .3), rgba(0, 0, 0, .3))
    // ,
    //  url("https://68.media.tumblr.com/37aa774749579b5a20e35fd40fc269e7/tumblr_ob7vuzk7qP1uwbmnzo4_1280.jpg")no-repeat
    //    center
    //    center
    ;
  // background-size: cover;
  // display: -webkit-box;
  // display: -ms-flexbox;
  // display: flex;
  // -webkit-box-orient: vertical;
  // -webkit-box-direction: normal;
  // -ms-flex-direction: column;
  // flex-direction: column;
  .movie-info {
    margin-top: auto;
    margin-bottom: auto;
    text-transform: uppercase;
    color: $white;
    width: 500px;
    margin-left: 10em;
    h1 {
      font-size: 3.8em;
      line-height: 1.2;
    }
    .genre {
      list-style: none;
      display: -webkit-box;
      display: -ms-flexbox;
      display: flex;
      -webkit-box-pack: start;
      -ms-flex-pack: start;
      justify-content: flex-start;
      margin-bottom: 1.5em;
      li {
        padding-right: .90em;
        padding-left: .80em;
        font-size: .75em;
      }
    }
    button {
      cursor: pointer;
      border: 0;
      padding: 1em 1.5em;
      border-radius: 20px;
      background: $yellow;
      text-transform: uppercase;
      font-weight: 600;
      font-size: .75em;
      margin-bottom: 8.5em;
      display: -webkit-box;
      display: -ms-flexbox;
      display: flex;
      -webkit-box-pack: justify;
      -ms-flex-pack: justify;
      justify-content: space-between;
      -webkit-box-align: center;
      -ms-flex-align: center;
      align-items: center;
      .fa-play-circle-o {
        font-size: 1.7em;
        margin-left: .50em;
      }
    }
    h3, h4 {
      font-weight: 200;
    }
    h3 {
      text-transform: initial;
    }
    h4 {
      color: $yellow;
    }
  }
}

/**********************
    MAIN (MOVIES)
***********************/
main {
  width: 800px;
  background: $light-background;
  margin: auto;
  transform: translateY(-5%);
  border-top-left-radius: 5px;
  border-top-right-radius: 5px;
  padding: 1.5em 2em;
  .options {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    text-align: center;
    text-transform: uppercase;
    // margin-bottom:2em;
    .active {
      color: $yellow;
      border-bottom: solid 2px $yellow;
    }
    li {
      -webkit-box-flex: 1;
      -ms-flex: 1;
      flex: 1;
      padding-bottom: 1em;
      border-bottom: solid 1px lightgray;
      font-weight: 600;
      font-size: .80em;
      color: $gray;
      cursor: pointer;
      &:hover {
        color: $yellow;
        border-bottom-color: $yellow;
        border-bottom-width: 2px;
      }
    }
  }

  #movies {
    min-height: 100vh;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
    -webkit-box-align: flex-start;
    -ms-flex-align: flex-start;
    align-items: flex-start;
    figure {
      background-color: $white;
      width: 14em;
      margin: .50em;
      box-shadow: 0 5px 15px gray;
      overflow: hidden;
      position: relative;
      cursor: pointer;
      // transition: all .45s ease-out-quad;
      transition: all 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94);
      &:hover {
        transform: scale(1.04);
        box-shadow: 0 -3px 20px gray;
      }
      img {
        // height:350px;
        height: 21em;
      }
      figcaption {
        line-height: 2;
        padding: 0 .80em;
        height: 90px;
        h5 {
          text-transform: uppercase;
          font-weight: 600;
          color: $gray;
        }
        p {
          text-transform: capitalize;
          font-size: .70em;
          font-weight: 600;
          color: $yellow;
        }
        .rating {
          display: -webkit-box;
          display: -ms-flexbox;
          display: flex;
          -webkit-box-align: center;
          -ms-flex-align: center;
          align-items: center;
          .fa-heart {
            color: rgb(250, 80, 80);
            margin: .50em .50em .50em 0;
          }
          h4 {
            color: black;
          }
        }
        button {
          border: 0;
          font-size: 17px;
          cursor: pointer;
          color: $yellow;
          background-color: white;
          position: absolute;
          bottom: 0;
          right: 0;
          padding: 8px;
        }
      }
    }
  }
}
/************
LOADING ICON
************/
.loading {
  background-color: $yellow;
  color: $white;
  font-size: 1.3em;
  width: 50px;
  height: 50px;
  border-radius: 50px;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-pack: center;
  -ms-flex-pack: center;
  justify-content: center;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  margin: 1.2em auto;
}
/************
FOOTER
************/
footer {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -ms-flex-direction: column;
  flex-direction: column;
  background-color: $white;
  div {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    padding: 1em;
    color: lighten($gray, 30%);
    h3 {
      -webkit-box-flex: 1;
      -ms-flex: 1;
      flex: 1;
    }
    .social-links {
      .social-link {
        padding: 0 .80em;
        font-size: 1.3em;
        cursor: pointer;
        &:hover {
          color: darken($gray, 10%);
        }
      }
    }
    p {
      text-transform: uppercase;
      font-size: .90em;
      text-align: right;

      -webkit-box-flex: 1;
      -ms-flex: 1;
      flex: 1;
    }
  }
  a {
    text-decoration: none;
    color: $yellow;
    text-transform: uppercase;
    font-size: .70em;
    border-top: solid 1px lighten($gray, 50%);
    text-align: center;
    padding: .50em;
  }
}

/********************
RANGE & SEARCH INPUT
*********************/
#forms {
  padding: 20px 10px;
  display: flex;
  align-items: center;
  // border: solid 1px red;
}

#range-form {
  flex: 1;
  margin-right: 5px;
  p {
    letter-spacing: 1px;
    font-size: 12px;
    font-weight: bold;
    color: lighten(black, 30%);
  }
  .group {
    display: flex;
    align-items: center;
    #range {
      -webkit-appearance: none;
      cursor: pointer;
      width: 100%;
      display: -webkit-box;
      display: -ms-flexbox;
      display: flex;
      -webkit-box-align: center;
      -ms-flex-align: center;
              align-items: center;
      margin-right: 10px;
      &::before {
        content: '';
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: $yellow;
        position: absolute;
        z-index: -1;
      }
    }
    #results {
      width: 28px;
      text-align: center;
      font-size: 13px;
      padding: 2px 4px;
      border-radius: 4px;
      background: white;
      box-shadow: 0 2px 5px 1px lightgray;
    }
  }
}


::placeholder {
  color: lightgray;
  font-style: italic;
  letter-spacing: 1px;
}

#search-input {
  flex: 1;
  // border: solid 1px red;
  display: flex;
  align-items: center;
  position: relative;
  #search {
    letter-spacing: 1px;
    width: 100%;
    background: none;
    border: none;
    border-bottom: solid 2px lightgray;
    padding: 5px 20px 5px 10px;
    color: gray;
    transition: border-bottom-color .3s;
    &:focus {
      outline: none;
      border-bottom-color: $yellow;
    }
  }
  .fa-search {
    color: lightgray;
    position: absolute;
    right: 0;
    padding-right: 8px;
    transform: rotate(95deg);
    -webkit-transform: rotate(95deg);
    -ms-transform: rotate(95deg);
    padding: 0;
  }
}

/*
CUSTOM SLIDER
*/
#forms #range-form .group #range {
  -webkit-appearance: none;
  outline: none;
  background: $yellow;
  height: 3px;
  border-radius: 5px;
  &::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: $yellow;
  }
}

/* FIREFOX */
#range::-moz-range-thumb {
  border: none;
  height: 14px;
  width: 14px;
  border-radius: 50%;
  background: $yellow;
  cursor: pointer;
}

#range::-moz-range-track {
  width: 100%;
  height: 3px;
  cursor: pointer;
  background: $yellow;
  border-radius: 5px;
}

/**************
MODAL
***************/
.modal {
  display: flex;
  position: relative;
  .close-modal {
    position: absolute;
    top: 10px;
    right: 10px;
    font-weight: bold;
    color: lighten($gray, 15%);
    cursor: pointer;
  }
  img {
    width: 320px;
    height: 512px;
    display: block;
    
  }
  > div {
    // border: solid 1px red;
    flex: 1;
    // padding: 0 80px 0 40px;
    display: flex;
    flex-direction: column;
    h1 {
      font-weight: 100;
      font-family: 'Poppins', sans-serif;
      color: $gray;
    }
    a {
      text-transform: uppercase;
      color: lightblue;
      font-weight: bold;
      font-size: 15px;
      margin-bottom: 20px;
      padding: 0 30px;
    }
  }
}

.modal-movie-title {
  background: $white;
  box-shadow: 15px 3px 50px 2px lightgray;
  padding: 40px 40px 20px 40px;
  margin: 40px 50px 30px -60px;
  h1 {
    text-transform: uppercase;
  }
}

.modal .modal-genre {
  // border: solid 1px red;
  display: flex;
  align-items: center;
  // color: lightblue;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: solid 1px lighten(lightgray, 10%);
  font-weight: bold;
  font-family: 'Poppins', sans-serif;
  .genre {
    color: lightblue;
    margin-right: auto;
  }
  .rated, .duration {
    font-size: 13px;
    font-weight: bold;
    text-align: center;
    background: lighten(lightgray, 13%);
    padding: 5px 0;
    width: 70px;
    margin: 0 5px;
    border-radius: 10px;
    color: $gray;
  }
  .rated {
    text-transform: uppercase;
  }
}


.fa-heart {
  color: rgb(250, 80, 80);
}
.fa-thumbs-down {
  color: rgb(0, 80, 240);
}
.fa-thumbs-up {
  color: rgb(0 ,240, 0);
}
.fa-trophy {
  color: rgb(255, 221, 26);
}

.movie-numbers {
  display: flex;
  // padding: 20px;
  // border-bottom: solid 1px lightgray;
  > div {
    flex: 1;
    text-align: center;
  }
}

.movie-numbers {
  i {
    font-size: 22px;
    margin-right: 8px;
  }
  h4 {
    font-size: 26px;
    font-weight: 100;
    margin: 0;
    color: $gray;
  }
  p {
    font-family: 'Poppins';
    font-size: 13px;
    // font-weight: bold;
    color: gray;
    text-align: center;
    margin: 0;
    // border: solid 1px red;
  }
}

.modal-rating {
  display: flex;
  flex-direction: column;
  align-items: center;
  div {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
    padding: 0;
  }
}

.score {
  display: flex;
  flex-direction: column;
  div {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 5px;
  }
}

.awards {
  display: flex;
  flex-direction: column;
  div {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 5px;
  }
}



// .modal-rating {
//   width: 50px;
//   display: flex;
//   flex-direction: column;
//   div {
//     // border: solid 1px red;
//     display: flex;
//     align-items: center;
//     margin-bottom: 5px;
//     .fa-heart {
//       color: rgb(250, 80, 80);
//       margin-right: 5px;
//       font-size: 20px;
//     }
//     h4 {
//       color: $gray;
//       font-size: 24px;
//       font-weight: 100;
//     }
//   }
//   p {
//     font-size: 12px;
//     font-weight: bold;
//     color: lighten($gray, 8%);
//     text-align: center;
//   }
// }




.modal .movie-description {
  font-family: 'Poppins', sans-serif;
  color: $gray;
  margin-bottom: 15px;
  padding: 0 30px;
}

.modal .modal-buttons {
  // border: solid 1px red;
  margin-top: auto;
  display: flex;
  button {
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    border: none;
    text-transform: uppercase;
    flex: 1;
    padding: 25px 20px;
    .fa {
      margin-left: 20px;
    }
    &:first-child {
      background: $yellow;
      color: white;
      &:hover {
        background: darken($yellow, 5%);
      }
    }
    &:last-child {
      background: darken($gray, 20%);
      color: $yellow;
      &:hover {
        background: darken($gray, 25%);
      }
    }
  }
}
              
            
!

JS

              
                ReactModal.setAppElement('#app');

const customStyles = {
  overlay : {
    position          : 'fixed',
    top               : 0,
    left              : 0,
    right             : 0,
    bottom            : 0,
    backgroundColor   : 'rgba(0, 0, 0, .8)'
  },
  content : {
    position                   : 'absolute',
    top                        : '40px',
    left                       : '100px',
    right                      : '100px',
    bottom                     : 'auto',
    background                 : '#fff',
    overflow                   : 'auto',
    WebkitOverflowScrolling    : 'touch',
    borderRadius               : '0px',
    outline                    : 'none',
  }

};

let movies = [
  {
    title: 'Mad Max: Fury Road',
    genre : ['Action', 'Adventure', 'Sci-Fi'],
    rating: 8.3,
    poster: 'https://s-media-cache-ak0.pinimg.com/originals/ce/0c/93/ce0c93d50ae68922d1f4f6667c95e1a8.jpg',
    description: 'A woman rebels against a tyrannical ruler in postapocalyptic Australia in search for her home-land with the help of a group of female prisoners, a psychotic worshipper, and a drifter named Max.',
    duration: '2h',
    rated: 'r',
    score: 90,
    awards: 88
  },
  {
    title: 'The Hunger Games: Mockingjay Part 1',
    genre: ['Adventure', 'Sci-Fi', 'Thriller'],
    rating: 6.8,
    poster: 'https://1.bp.blogspot.com/-Ds0sudZmSq4/Vgxrr75E77I/AAAAAAAAREo/sZkZW5YMDTw/s1600/Mockingjay%2BPart%2B1.jpg',
    description: 'Katniss Everdeen is in District 13 after she shatters the games forever. Under the leadership of President Coin and the advice of her trusted friends, Katniss spreads her wings as she fights to save Peeta and a nation moved by her courage.',
    duration: '2h 3m',
    rated: 'pg-13',
    score: 64,
    awards: 8
  },
  {
    title: 'Jurassic World',
    genre: ['Action', 'Adventure', 'Sci-Fi'],
    rating: 7.2,
    poster: 'https://s-media-cache-ak0.pinimg.com/736x/0b/ab/9a/0bab9a9c671dbb7aa8626eec44a0195f.jpg',
    description: 'A new theme park, built on the original site of Jurassic Park, creates a genetically modified hybrid dinosaur, which escapes containment and goes on a killing spree.',
    duration: '2h 4m',
    rated: 'pg-13',
    score: 59,
    awards: 8
  },
  {
    title: 'Everest',
    genre: ['Adventure', 'Drame', 'Thriller'],
    rating: 7.4,
    poster: 'http://www.impawards.com/2015/posters/everest_ver4.jpg',
    description: 'The story of New Zealand\'s Robert "Rob" Edwin Hall, who on May 10, 1996, together with Scott Fischer, teamed up on a joint expedition to ascend Mount Everest.',
    duration: '2h 1m',
    rated: 'pg-13',
    score: 64,
    awards: 0
  },
  {
    title: 'Insurgent',
    genre: ['Adventure', 'Sci-Fi', 'Thriller'],
    rating: 6.4,
    poster: 'http://cdn2-www.comingsoon.net/assets/uploads/2015/01/FIN16_Insurgent_Guns_1Sht_Trim-1422379653-mtv-14224534611.jpg',
    description: 'Beatrice Prior must confront her inner demons and continue her fight against a powerful alliance which threatens to tear her society apart with the help from others on her side.',
    duration: '1h 59m',
    rated: 'pg-13',
    score: 42,
    awards: 3
  },
  {
    title: 'Sicario',
    genre: ['Action', 'Crime', 'Drama'],
    rating: 8,
    poster: 'https://s-media-cache-ak0.pinimg.com/564x/7f/a1/5c/7fa15c26aa2cb48562ea37bbc177be74.jpg',
    description: 'An idealistic FBI agent is enlisted by a government task force to aid in the escalating war against drugs at the border area between the U.S. and Mexico.',
    duration: '2h 1m',
    rated: 'r',
    score: 82,
    awards: 15
  }
];

const text_truncate = function(str, length, ending) {
  if (length == null) {
    length = 100;
  }
  if (ending == null) {
    ending = '...';
  }
  if (str.length > length) {
    return str.substring(0, length - ending.length) + ending;
  } else {
    return str;
  }
};

const Nav = () => (
  <nav>
       
      <ul className="nav">
        <li className="active">movies</li>
        <li>celebs & photos</li>
        <li>community</li>
        <li>news</li>
      </ul>
      <div className="user">
        <i className="fa fa-gear user-settings"></i>
        <img className="user-icon" src="https://s3.amazonaws.com/uifaces/faces/twitter/calebogden/128.jpg"/>
      </div>
      
    </nav>
);

class Header extends React.Component {
  constructor() {
    super()
    this.state = {
      popularMovies: [
        {
          name: "the martian",
          genre: ["adventure", "sci-fi", "thriller"],
          releaseDate: "15 Oct, 2015 (USA)",
          img: "https://68.media.tumblr.com/37aa774749579b5a20e35fd40fc269e7/tumblr_ob7vuzk7qP1uwbmnzo4_1280.jpg"
        },
        {
          name: 'dredd',
          genre: ["action", "crime", "sci-fi"],
          releaseDate: "21 September, 2012 (USA)",
          img: "https://images.alphacoders.com/503/thumb-1920-503738.jpg"
        },
        {
          name: "alien: covenent",
          genre: ["horror", "sci-fi", "thriller"],
          releaseDate: "19 May, 2017 (USA)",
          img: "https://www.slashfilm.com/wp/wp-content/images/Alien-Covenant-Trailer-Breakdown-59.jpg"
        },
        {
          name: "godzilla",
          genre: ["action", "adventure", "sci-fi"],
          releaseDate: "16 May, 2014 (USA)",
          img: "https://i.ytimg.com/vi/-ieuv_84nmc/maxresdefault.jpg"
        }
      ]
    }
  }
  render() {
    const { popularMovies } = this.state;
    const settings = {
      dots: true,
      arrows: false,
      infinite: true,
      vertical: true,
      autoplay: true,
      autoplaySpeed: 6500,
      speed: 1300,
      slidesToShow: 1,
      slidesToScroll: 1,
      pauseOnHover: false
    };
    return (
      <header>
        <Slider {...settings}>
          {
            popularMovies.map(m => (
              <div
                key={m.name}
                style={{
                  position: 'relative',
                  display: 'flex',
                  flexDirection: 'column',
                  height: '600px'
                }}
                >
                <img src={m.img} 
                  style={{
                    display: 'block',
                    position: 'absolute',
                    top: 0,
                    left: 0,
                    width: '100%',
                    height: '100%',
                    objectFit: 'cover',
                    verticalAlign: 'top'
                  }}/>
                <div className="movie-info" style={{zIndex: 2}}>
                  <h1>{m.name}</h1>
                  <ul className="genre">
                    {
                      m.genre.map(g => (
                      <li>{g}</li>))
                    }
                  </ul>
                  <button>watch trailer <i className="fa fa-play-circle-o"></i></button>
        <h3>In theaters</h3>
        <h4>{m.releaseDate}</h4>
                </div>
              </div>
            ))
          }
        </Slider>
      </header>
    )
  }
}

const Tabs = () => (
  <ul className="options">
      <li className="active">in theaters</li>
      <li>coming soon</li>
      <li>charts</li>
      <li>tv series</li>
      <li>trailers</li>
      <li>more</li>
  </ul>
);

class Forms extends React.Component {
  constructor(props) {
    super(props);
    this.updateSearch = this.updateSearch.bind(this);
  }
  
  updateSearch(newSearch) {
    this.props.updateSearch(newSearch)
  }
  
  render() {
    // console.log(this.props);
    const { search } = this.props;
    return(
      <div id="forms">
        
        <form id="range-form">
          <p>IMDb Rating</p>
          <div className="group">    
            <input id="range"
              type="range"
              min="6.0"
              max="8.3"
              step="0.1"
              value="6"
              />
            <p id="results">6</p>
        </div>
      </form>

      <div id="search-input">
        <input id="search"
          type="search"
          results="5"
          // placeholder="Search Movies..."
          value={search}
          onChange={this.updateSearch}
          />
        <i className="fa fa-search"></i>
      </div>
    </div>
    )
  }
}

class Movie extends React.Component {
  constructor(props) {
    super(props);
    this.state = {
      showModal: false
    }
  }
  
  openModal = () => {
    this.setState({showModal: true})
  }
    
  closeModal = () => {
    this.setState({showModal: false})
  }
  
  render() {
    const { showModal } = this.state;
    const { movie } = this.props;
    
    return (
      <div>
      <figure onClick={this.openModal}>
        <img src={movie.poster}/>
        <figcaption>
          <h5>{text_truncate(movie.title, 26)}</h5>
          <p>{movie.genre.join(', ')}</p>
          <div className="rating">
            <i className="fa fa-heart"></i>
            <h4>{movie.rating}</h4>
          </div>
        </figcaption>
      </figure>
       
      <Modal showModal={showModal} closeModal={this.closeModal} movie={movie} />
      
      </div>
    )
  }
}
            
const Modal = ({ showModal, closeModal, movie  }) => (
  <ReactModal
    className="modal"
    isOpen={showModal}
    onRequestClose={closeModal}
    shouldCloseOnOverlayClick={true}
    style={customStyles}
    >
    <p onClick={closeModal} className="close-modal">X</p>
    <img src={movie.poster} alt={movie.title} />
        <div>
          <div className="modal-movie-title">
            <h1>{movie.title}</h1>
            <div className="modal-genre">
              <p className="genre">{movie.genre.join(', ')}</p>
              <span className="rated">{movie.rated}</span>
              <span className="duration">{movie.duration}</span>
            </div>
            <div className="movie-numbers">
              <div className="modal-rating">
                <div>
                  <i className="fa fa-heart"></i>
                  <h4>{movie.rating}</h4>
                </div>
                <p>Rating</p>
              </div>

              <div className="score">
                <div>
                  <i className={movie.score < 70 ? 'fa fa-thumbs-down' : 'fa fa-thumbs-up'}></i>
                  <h4>{movie.score}</h4>
                </div>
                <p>Score</p>
              </div>

              <div className="awards">
                <div>
                  <i className="fa fa-trophy"></i>
                  <h4>{movie.awards}</h4>
                </div>
                <p>Awards</p>
              </div>

            </div>
          </div>
          <p className="movie-description">
          {movie.description}
          </p>
          <a href="#">full movie profile</a>
          <div className="modal-buttons">
            <button>watch trailer <i className="fa fa-caret-right"></i></button>
            <button>to watchlist <i className="fa fa-star"></i></button>
          </div>
        </div>
  </ReactModal>
)

class Movies extends React.Component {
  render() {
    // console.log(this.props);
    const { movies, search } = this.props;
    let filterMovies = movies.
    filter(movie => movie.title.toLowerCase().
                    includes(search.toLowerCase()));
    return(
      <section id="movies">
        {
          filterMovies.map(movie => <Movie movie={movie}/>)
        }
      </section>
    )
  }
}

class Main extends React.Component {
  constructor(props) {
    super(props);
    this.updateSearch = this.updateSearch.bind(this);
    this.state = {
      movies: movies,
      search: ''
    }
  }
  updateSearch(e) {
    e.preventDefault();
    this.setState({
      search: e.target.value.substr(0, 26)
    })
  }
  render() {
    const { movies, search } = this.state;
    return(
      <main>
        <Tabs />
        <Forms search={search} updateSearch={this.updateSearch}/>
        <Movies movies={movies} search={search} />
      </main>
    )
  }
}

const LoadingIcon = () => (
  <div className="loading">
    <i className="fa fa-spinner fa-spin"></i>
  </div>
);

const Footer = () => (
  <footer>
    <div>
      <h3>IMDb</h3>
      
      <div className="social-links">
        <i className="fa fa-twitter social-link"></i>
        <i className="fa fa-facebook social-link"></i>
        <i className="fa fa-instagram social-link"></i>
      
      </div>
      <p>1990-2017 imdb.com, inc</p>
    </div>
    <a href="#">show menu</a>
  </footer>
);

class App extends React.Component {  
  render(){
    return(
      <div id="wrapper">
        <Nav />
        <Header />
        <Main />
        <LoadingIcon />
        <Footer />
      </div>
    )
  }
}

const app = document.getElementById('app');
ReactDOM.render(<App />, app);
              
            
!
999px

Console