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 is required to process package imports. If you need a different preprocessor remove all packages first.

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

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 Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

HTML

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

CSS

              
                $dark: #0F161A;
$turq: #0BE5E5;

body {
  background: $dark;
  color: white;
  font-family: 'Khula', sans-serif;
}

.pagearea {
  margin: 100px auto;
  max-width: 700px;
  position: relative;
  h2 {
    font-weight: 300;
    color: white;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 10px;
  }
}

#icon-github {
  display: inline-block;
  margin-right: 10px;
  vertical-align: top;
}

form {
  display: flex;
}

.inputstyle {
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  font-size: 14px;
}

.inputContain {
  width: 70%;
  position: relative;
  border: 1px solid $turq;
  padding: 11px;
  @extend .inputstyle;
}

input {
  background: $dark;
  @extend .inputstyle;
  width: 95%;
}

button.next {
  padding: 10px;
  border: 1px solid $turq;
  background: $turq;
  font-family: helvetica;
  text-transform: uppercase;
  font-size: 13px;
  letter-spacing: 0.08em;
  position: absolute;
  right: 0;
  top: -10px;
}

.check {
  background: #393D3F;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  position: absolute;
  right: 12px;
  top: 12px;
  padding: 5px;
  box-shadow: inset 0px 3px 5px 0px rgba(0,0,0,0.75);
}

#oval {
  fill: rgba(0, 0, 0, 0.15);
}

.next-arrow {
  display: inline-block;
  vertical-align: bottom;
  margin-left: 7px;
}

.confirmtext {
  position: relative;
  background: black;
  padding: 20px;
  color: grey;
  font-size: 14px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  margin-top: 30px;
  border: 1px solid rgba(21, 58, 58, 0.69);
  h3 {
    margin-top: 3px;
    color: white;
    text-transform: none;
    font-weight: 300;
    font-size: 22px;
    letter-spacing: 0;
  }
}

.shape {
  padding: 5px;
  border-radius: 50%;
  width: 5px;
  height: 5px;
  position: relative;
  display: inline-block;
  left: 5px;
  top: -3px;
}

.shape div {
	border: 1px $turq solid;
	border-radius: 50%;
	width: 100%;
	height: 100%;
	position: absolute;
	left: 0px;
}
              
            
!

JS

              
                const { TransitionGroup } = React.addons;

class Shape extends React.Component {
  constructor() {
    super();
  }

  componentDidMount(callback) {
    const el = this.shape;
    const elChild1 = this.shape.childNodes[0];
    const elChild2 = this.shape.childNodes[1];
    const tl = new TimelineMax();
    
    TweenMax.fromTo(el, 0.3, {
      opacity: 0,
      scale: 0
    }, {
      opacity: 1,
      scale: 1,
      tranformOrigin: '50% 50%',
      ease: Circ.easeOut,
      onComplete: callback
    });
    
    TweenMax.fromTo(elChild1, 0.5, {
      opacity: 1,
      scale: 1
    }, {
      opacity: 0,
      scale: 1.5,
      repeat: -1,
      transformOrigin: '50% 50%',
      ease: Linear.easeNone,
      onComplete: callback
    });
    
    tl.fromTo(elChild2, 0.5, {
      opacity: 0,
      scale: 0.5
    }, {
      opacity: 1,
      scale: 1,
      repeat: -1,
      transformOrigin: '50% 50%',
      ease: Linear.easeNone
    });
  }

  componentWillLeave(callback) {
    const el = this.shape;
    TweenMax.fromTo(el, 0.2, {
      opacity: 1,
      scale: 1
    }, {
      scale: 0,
      opacity: 0,
      transformOrigin: '50% 50%',
      ease: Circ.easeIn,
      onComplete: callback
    });
  }

  render() {
    return (
      <div className="shape" ref={c => this.shape = c}>
        <div></div>
        <div></div>
      </div>
    );
  }
};

class ConfirmText extends React.Component {
  constructor() {
    super();
    this.state = {
      isLoading: false
    }
  }
  
  // this is all suggesiton for how to load (not wired up, ellipses are placeholder data)
//   constructor(props) {
//     super(props);
//     this.state = {
//       loading: true,
//       data: ''
//     }
//     this.loaded = this.loaded.bind(this);
//     this.getData = this.getData.bind(this);
//   }

//   componentDidMount() {
//     this.getData();
//   }
  
//   getData(...) {
//     this.setState({
//       loading: true
//     });
//     let data = new Data;
//     data.onload = (e) => {
//       this.setState({
//         data: ...,
//         loading: false
//       })
//     } 
//   }

//   loaded() {
//     this.setState({
//       loading: false
//     });
//   }
  
  componentDidMount() {
    setTimeout(function() {
      TweenMax.to(this.connect, 0.3, {
        color: '#0BD466',
        ease: Sine.easeOut
      });
      this.setState(
        {isLoading: true}
      )
    }.bind(this), 3000);
  }

  componentWillEnter(callback) {
    const el = this.confirmtext;
    
    TweenMax.fromTo(el, 0.3, {
      opacity: 0,
      scale: 0.9,
    }, {
      opacity: 1,
      scale: 1,
      tranformOrigin: '50% 50%',
      ease: Power4.easeOut
    });
    TweenMax.fromTo(this.check, 0.3, {
      opacity: 0,
      rotation: 360,
      scale: 0.5
    }, {
      opacity: 1,
      scale: 1,
      rotation: 0,
      delay: 0.1,
      tranformOrigin: '50% 50%',
      ease: Back.easeOut,
      onComplete: callback
    });
  }

  componentWillLeave(callback) {
    const el = this.confirmtext;
    TweenMax.fromTo(el, 0.1, {
      opacity: 1,
    }, {
      opacity: 0,
      ease: Power4.easeIn,
      onComplete: callback
    });
  }

  render() {
    return (
      <div className="confirmtext" ref={c => this.confirmtext = c}>
        org/<br />
        <h3>Repo Name</h3>
        <p>This repo has qualifying React Components</p>
        <p>
          <span ref={c => this.connect = c}> Connect{this.state.isLoading ? 'ed' : 'ing to remote'} </span>
          <div className="shape"></div>
          <TransitionGroup>
            { !this.state.isLoading && <Shape /> }
          </TransitionGroup>
        </p> 
        <div className="check" ref={c => this.check = c}>
          <svg id="icon-check" viewBox="0 0 20 20" width="20" height="20" aria-labelledby="title">
            <title id="title">Checkmark</title>
            <path fill="#0BE5E5" d="M8.294 16.998c-0.435 0-0.847-0.203-1.111-0.553l-3.573-4.721c-0.465-0.613-0.344-1.486 0.27-1.951 0.615-0.467 1.488-0.344 1.953 0.27l2.351 3.104 5.911-9.492c0.407-0.652 1.267-0.852 1.921-0.445s0.854 1.266 0.446 1.92l-6.984 11.21c-0.242 0.391-0.661 0.635-1.12 0.656-0.022 0.002-0.042 0.002-0.064 0.002z"></path>
          </svg>
        </div>
      </div>
    );
  }
};

class NextButton extends React.Component {
  constructor() {
    super();
  }

  componentWillEnter(callback) {
    const el = this.next;
    
    TweenMax.fromTo(el, 0.4, {
      opacity: 0,
      scale: 0.8,
    }, {
      opacity: 1,
      scale: 1,
      tranformOrigin: '50% 50%',
      ease: Circ.easeOut
    });
  }

  componentWillLeave(callback) {
    const el = this.next;
    TweenMax.fromTo(el, 0.3, {
      opacity: 1,
      scale: 1
    }, {
      scale: 0.95,
      opacity: 0,
      transformOrigin: '50% 50%',
      ease: Circ.easeIn,
      onComplete: callback
    });
  }

  render() {
    return (
      <button className="next" ref={c => this.next = c}> Next 
        <svg className="next-arrow" xmlns="http://www.w3.org/2000/svg" width="15" height="15" viewBox="0 0 15 15">
          <title>next-arrow</title>
          <g>
            <circle id="oval" cx="7.5" cy="7.5" r="7.5"/>
            <polyline points="7 11 11 7.5 7 4" fill="none" stroke="#000"/>
            <path id="Line" d="M10.5,7.5h-7" fill="none" stroke="#000" stroke-linecap="square"/>
          </g>
        </svg>
      </button>
    );
  }
};

class Page extends React.Component {
   constructor() {
    super();
    this.state = {
      entered: false
    };
    this._handleChange = this._handleChange.bind(this);
  }
  
  _handleChange(e) {
    e.preventDefault();
    
    //for the purposes of demo
    this.input.value = null;
    
    this.setState({
      entered: true
    });
  } 
  
  render() {
    return (
      <div className="pagearea">
        <h2>
          <svg id="icon-github" viewBox="0 0 32 32" width="20" height="20" aria-labelledby="title">
            <title id="title">github logo</title>
            <path fill="white" d="M16 0.395c-8.836 0-16 7.163-16 16 0 7.069 4.585 13.067 10.942 15.182 0.8 0.148 1.094-0.347 1.094-0.77 0-0.381-0.015-1.642-0.022-2.979-4.452 0.968-5.391-1.888-5.391-1.888-0.728-1.849-1.776-2.341-1.776-2.341-1.452-0.993 0.11-0.973 0.11-0.973 1.606 0.113 2.452 1.649 2.452 1.649 1.427 2.446 3.743 1.739 4.656 1.33 0.143-1.034 0.558-1.74 1.016-2.14-3.554-0.404-7.29-1.777-7.29-7.907 0-1.747 0.625-3.174 1.649-4.295-0.166-0.403-0.714-2.030 0.155-4.234 0 0 1.344-0.43 4.401 1.64 1.276-0.355 2.645-0.532 4.005-0.539 1.359 0.006 2.729 0.184 4.008 0.539 3.054-2.070 4.395-1.64 4.395-1.64 0.871 2.204 0.323 3.831 0.157 4.234 1.026 1.12 1.647 2.548 1.647 4.295 0 6.145-3.743 7.498-7.306 7.895 0.574 0.497 1.085 1.47 1.085 2.963 0 2.141-0.019 3.864-0.019 4.391 0 0.426 0.288 0.925 1.099 0.768 6.354-2.118 10.933-8.113 10.933-15.18 0-8.837-7.164-16-16-16z"></path>
          </svg>  Select a local directory for a component repo</h2> 
        <TransitionGroup>
          { this.state.entered && <NextButton /> }
        </TransitionGroup>
        
        <form>
          <div className="inputContain">
            <input type="file" ref={c => this.input = c} onChange={this._handleChange} />
          </div>
        </form>
        <TransitionGroup>
          { this.state.entered && <ConfirmText /> }
        </TransitionGroup>
      </div>
    );
  };
}

ReactDOM.render(<Page />, document.querySelector("#container"));
              
            
!
999px

Console