LOADING...

Preview

Pen ID
Unlock Campus Themeforest adv

 

Code
CSS
@import "https://fonts.googleapis.com/css?family=Lato:100,300,400,700,900";
body {
  background: #221f1f;
  color: #ffffff;
  font-family: "Lato", sans-serif;
}

h2, .TitleList .Title {
  font-size: 24px;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 1em;
}

p {
  font-size: 15px;
  font-weight: 300;
  line-height: 1.6;
  margin-bottom: 1em;
}

.Header {
  /* FF3.6-15 */
  background: -webkit-linear-gradient(top, black 0%, transparent 100%);
  /* Chrome10-25,Safari5.1-6 */
  background: linear-gradient(to bottom, black 0%, transparent 100%);
  /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
  filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#a6000000', endColorstr='#00000000',GradientType=0 );
  /* IE6-9 */
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  padding: 40px;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  box-sizing: border-box;
  z-index: 5;
}

.Logo {
  width: 151px;
  height: 41px;
  margin-right: 10px;
  -webkit-transition: margin .125s ease;
  transition: margin .125s ease;
}
.Logo svg {
  -webkit-transform: scale(0.5);
          transform: scale(0.5);
  -webkit-transform-origin: 0 0;
          transform-origin: 0 0;
}
.Logo svg path {
  fill: #e50914;
  -webkit-transition: fill .125s ease;
  transition: fill .125s ease;
}
.Logo:hover {
  cursor: pointer;
  margin-top: 2px;
}
.Logo:hover svg path {
  fill: #ffffff !important;
}

.Navigation ul {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  height: 37px;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  padding: 0 10px;
}
.Navigation ul li {
  font-weight: 400;
  padding: 7px 10px;
  font-size: 14px;
  -webkit-transition: background .125s ease;
  transition: background .125s ease;
  border-radius: 3px;
}
.Navigation ul li:hover {
  background: #e50914;
  cursor: pointer;
}

.Search {
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  -webkit-box-pack: center;
      -ms-flex-pack: center;
          justify-content: center;
  width: 100%;
  position: absolute;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  justify-content: center;
  pointer-events: none;
}
.Search input {
  font-family: "Lato", sans-serif;
  font-weight: 300;
  font-size: 14px;
  height: 37px;
  width: 20%;
  background: transparent;
  color: #ffffff;
  -webkit-appearance: none;
     -moz-appearance: none;
          appearance: none;
  border: 0;
  border: 2px solid rgba(245, 245, 241, 0.1);
  outline: none;
  border-radius: 37px;
  padding: 0 10px;
  pointer-events: all;
  -webkit-transition: border .25s ease, width .125s ease .125s;
  transition: border .25s ease, width .125s ease .125s;
}
.Search input:focus {
  border: 2px solid #e50914;
  width: 30%;
}

.UserProfile {
  margin-left: auto;
}
.UserProfile .User {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
}
.UserProfile .User .image {
  border-radius: 44px;
  margin-left: 10px;
  overflow: hidden;
  width: 44px;
  height: 44px;
  box-sizing: border-box;
  border: 3px solid transparent;
  -webkit-transition: border .125s ease;
  transition: border .125s ease;
}
.UserProfile .User .image img {
  width: 100%;
  display: block;
}
.UserProfile .User .name {
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  font-size: 18px;
  font-weight: 300;
  height: 44px;
}
.UserProfile .User:hover {
  cursor: pointer;
}
.UserProfile .User:hover .image {
  border: 3px solid #e50914;
}
.UserProfile .UserProfile-menu {
  display: none;
}

.Hero {
  width: 100%;
  position: relative;
  background-size: cover;
  min-height: 800px;
}
.Hero .content {
  position: relative;
  z-index: 4;
  width: 500px;
  left: 10vw;
  top: 10vw;
}
.Hero .content .logo {
  max-width: 400px;
  display: block;
  position: relative;
  left: -5px;
}
.Hero .content p {
  width: 100%;
}
.Hero .content .button-wrapper {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  width: 400px;
  margin-top: 30px;
}
.Hero .content .button-wrapper .Button:first-child {
  margin-right: 10px;
}
.Hero .overlay {
  /* FF3.6-15 */
  background: -webkit-linear-gradient(top, #221f1f 0%, rgba(34, 31, 31, 0) 100%);
  /* Chrome10-25,Safari5.1-6 */
  background: linear-gradient(to bottom, #221f1f 0%, rgba(34, 31, 31, 0) 100%);
  /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
  filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#a6000000', endColorstr='#00000000',GradientType=0 );
  /* IE6-9 */
  height: 100%;
  position: absolute;
  z-index: 3;
  top: 0;
  left: 0;
  width: 100%;
  -webkit-transform: rotate(180deg);
          transform: rotate(180deg);
}

.Button {
  background: transparent;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  height: 44px;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  -webkit-box-pack: center;
      -ms-flex-pack: center;
          justify-content: center;
  text-decoration: none;
  color: #ffffff;
  padding: 20px;
  box-sizing: border-box;
  border: 2px solid rgba(245, 245, 241, 0.2);
  border-radius: 44px;
  font-size: 14px;
  font-weight: 600;
  -webkit-transition: border .125s ease, background .125s ease;
  transition: border .125s ease, background .125s ease;
}
.Button:hover {
  border: 2px solid #f5f5f1;
}
.Button[data-primary='true'] {
  border: 2px solid #e50914;
}
.Button[data-primary='true']:hover {
  background: #e50914;
}

.Hero ~ .TitleList:nth-child(3) {
  margin-top: -10vw;
  position: relative;
  z-index: 4;
}

.TitleList {
  padding: 20px 40px;
  box-sizing: border-box;
  -webkit-transition: opacity 3s ease;
  transition: opacity 3s ease;
  opacity: 0;
}
.TitleList .titles-wrapper {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -ms-flex-wrap: wrap;
      flex-wrap: wrap;
  margin: 20px 0;
  width: calc(100vw - 80px);
  box-sizing: border-box;
  -webkit-box-pack: justify;
      -ms-flex-pack: justify;
          justify-content: space-between;
}
.TitleList[data-loaded='true'] {
  opacity: 1;
}

.Item {
  width: calc(20% - 10px);
  min-width: calc(20% - 10px);
  background-color: #000000;
  -webkit-box-flex: 1;
      -ms-flex: 1 0 auto;
          flex: 1 0 auto;
  background-position: center;
  background-size: 100%;
  height: 200px;
  background-repeat: no-repeat;
  overflow: hidden;
  margin-right: 10px;
  -webkit-transition: background 1s ease;
  transition: background 1s ease;
}
.Item:nth-child(n+6) {
  margin-top: 20px;
}
.Item:last-child {
  margin-right: 0;
}
.Item .overlay {
  /* FF3.6-15 */
  background: -webkit-linear-gradient(top, rgba(0, 0, 0, 0.75) 0%, transparent 100%);
  /* Chrome10-25,Safari5.1-6 */
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.75) 0%, transparent 100%);
  /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
  filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#a6000000', endColorstr='#00000000',GradientType=0 );
  /* IE6-9 */
  padding: 20px;
  position: relative;
  height: 100%;
  pointer-events: none;
  opacity: 0;
  -webkit-transition: opacity .125s ease;
  transition: opacity .125s ease;
}
.Item .overlay .title {
  font-size: 22px;
  font-weight: 200;
  opacity: 0;
  -webkit-transition: opacity .25s ease;
  transition: opacity .25s ease;
}
.Item .overlay .rating {
  font-size: 14px;
  opacity: 0;
  -webkit-transition: opacity .25s ease .125s;
  transition: opacity .25s ease .125s;
}
.Item .overlay .plot {
  font-size: 14px;
  display: -webkit-box;
  margin-top: 100px;
  font-weight: 300;
  line-height: 1.6;
  opacity: 0;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  -webkit-transition: margin .25s ease .125s, opacity .25s ease .25s;
  transition: margin .25s ease .125s, opacity .25s ease .25s;
}
.Item:hover {
  background-size: 150%;
}
.Item:hover .overlay {
  opacity: 1;
  pointer-events: all;
}
.Item:hover .overlay .plot {
  margin-top: 10px;
  opacity: 1;
}
.Item:hover .overlay .title {
  opacity: 1;
}
.Item:hover .overlay .rating {
  opacity: 1;
}
.Item:hover .overlay .ListToggle {
  opacity: 1;
}

.ListToggle {
  border: 2px solid rgba(255, 255, 255, 0.2);
  width: 32px;
  height: 32px;
  font-size: 16px;
  border-radius: 32px;
  overflow: hidden;
  position: absolute;
  right: 20px;
  top: 20px;
  opacity: 0;
}
.ListToggle:hover {
  border: 2px solid #ffffff;
}
.ListToggle:hover div {
  top: -32px;
}
.ListToggle[data-toggled="true"] {
  background: #e50914;
  border: 2px solid #e50914;
}
.ListToggle[data-toggled="true"] div {
  top: -32px;
}
.ListToggle div {
  position: absolute;
  top: 0;
  left: 0;
  height: 64px;
  width: 32px;
  -webkit-transition: .125s ease;
  transition: .125s ease;
}
.ListToggle div i {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  -webkit-box-pack: center;
      -ms-flex-pack: center;
          justify-content: center;
  height: 32px;
  width: 32px;
}
JS
/////////////////
/// COMPONENTS //
/////////////////

// Container
var App = React.createClass({
	apiKey: '87dfa1c669eea853da609d4968d294be',
	getInitialState: function() {
		return {data: []};
	},
	performSearch: function(e) {
		// stop form from submitting
		e.preventDefault();
		
		// get the value
		var val = $('.Search input').val();
		
		// Do the thing
		var requestUrl = 'https://api.themoviedb.org/3/search/multi?query=' + val + '&api_key=' + this.apiKey;
		
		$.ajax({
      url: requestUrl,
      dataType: 'json',
      cache: false,
      success: function(data) {
        this.setState({data: data});
      }.bind(this),
      error: function(xhr, status, err) {
        console.error(this.props.url, status, err.toString());
      }.bind(this)
    });
		
	},
	componentDidUpdate: function() {
	
	},
	render: function() {
		
		if(this.state.data.results) {
			console.log(this.state.data);
		}
		
		return (
			
); } }); //////////// // Header // //////////// var Header = React.createClass({ render: function() { return (
); } }); // Logo var Logo = React.createClass({ render: function() { return ( ); } }); // Navigation var Navigation = React.createClass({ render: function() { return ( ); } }); // Search var Search = React.createClass({ render: function() { return ( ); } }); // User Profile var UserProfile = React.createClass({ render: function() { return (
Jack Oliver
  • Alexander
  • Mattias
  • Your Account
  • Help Center
  • Sign out of Netflix
); } }); ////////// // Hero // ////////// var Hero = React.createClass({ render: function() { return (

Season 2 now available

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Doloremque id quam sapiente unde voluptatum alias vero debitis, magnam quis quod.

); } }) // Hero Button var HeroButton = React.createClass({ render: function() { return ( {this.props.text} ); } }) //////////////// // Title List // //////////////// // Title List Container var TitleList = React.createClass({ apiKey: '87dfa1c669eea853da609d4968d294be', getInitialState: function() { return {data: [], mounted: false}; }, loadContent: function() { var requestUrl = 'https://api.themoviedb.org/3/' + this.props.url + '&api_key=' + this.apiKey; $.ajax({ url: requestUrl, dataType: 'json', cache: false, success: function(data) { this.setState({data: data}); // console.log(data); }.bind(this), error: function(xhr, status, err) { console.error(this.props.url, status, err.toString()); }.bind(this) }); }, componentDidMount: function() { this.loadContent(); this.setState({ mounted: true }); }, componentWillUnmount: function() { this.setState({ mounted: false }); }, render: function() { if(this.state.data.results) { var titles = this.state.data.results.map(function(title, i) { if(i < 5) { var backDrop = 'http://image.tmdb.org/t/p/original' + title.backdrop_path; if(!title.name) { var name = title.original_title; } else { var name = title.name; } return ( ); } }); } else { var titles = ''; } return (

{this.props.title}

{titles}
); } }); // Title List Item var Item = React.createClass({ render: function() { return (
{this.props.title}
{this.props.score} / 10
{this.props.overview}
); } }); // ListToggle var ListToggle = React.createClass({ getInitialState: function() { return({ toggled: false }) }, handleClick: function() { if(this.state.toggled === true) { this.setState({ toggled: false }); } else { this.setState({ toggled: true }); } }, render: function() { return (
); } }); ReactDOM.render( , document.getElementById('app') );

Description

Day 3 of the ReactJS DailyUI project. I'm going to be making 100 different React pens over the next 100 days, in order to get better.
Term
Mon, 11/27/2017 - 21:26

Related Codes

Pen ID
Pen ID
Pen ID
Square Adv