LOADING...

Preview

Pen ID
Unlock Campus Themeforest adv

 

Code
Hi! I'm a bot. What's up?
CSS
@import url(https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,700);
* {
  box-sizing: border-box;
}

html {
  background: rgba(0, 0, 0, 0.03);
}

body, html {
  height: 100%;
}

body {
  font-family: 'Source Sans Pro', sans-serif;
  font-size: 115%;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
      -ms-flex-direction: column;
          flex-direction: column;
  max-width: 700px;
  margin: 0 auto;
}

.chat-output {
  -webkit-box-flex: 1;
      -ms-flex: 1;
          flex: 1;
  padding: 20px;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  background: white;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
      -ms-flex-direction: column;
          flex-direction: column;
}
.chat-output > div {
  margin: 0 0 20px 0;
}
.chat-output .user-message .message {
  background: #0FB0DF;
  color: white;
}
.chat-output .bot-message {
  text-align: right;
}
.chat-output .bot-message .message {
  background: #eee;
}
.chat-output .message {
  display: inline-block;
  padding: 12px 20px;
  border-radius: 10px;
}

.chat-input {
  padding: 20px;
  background: #eee;
  border: 1px solid #ccc;
  border-bottom: 0;
}
.chat-input .user-input {
  width: 100%;
  font-size: 2rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 8px;
}
JS
var outputArea = $("#chat-output");

$("#user-input-form").on("submit", function(e) {
  
  e.preventDefault();
  
  var message = $("#user-input").val();
  
  outputArea.append(`
    
${message}
`); setTimeout(function() { outputArea.append(`
I'm like 20 lines of JavaScript I can't actually talk to you.
`); }, 250); $("#user-input").val(""); });
Term
Mon, 11/27/2017 - 21:29

Related Codes

Pen ID
Pen ID
Pen ID
Square Adv