css Audio - Active file-generic CSS - Active Generic - Active HTML - Active JS - Active SVG - Active Text - Active file-generic Video - Active header Love html icon-new-collection icon-person icon-team numbered-list123 pop-out spinner split-screen star tv

Pen Settings

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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation

     

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.

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.

            
              <div class="app-main">
	<div id="right_col" class="open column fixed">
    <div class="chat-container float-right">
      <div class="chat-header">
        <a class="button glyph-only left">
          <svg class="svg-roomlist" height="16px" version="1.1" viewBox="0 0 16 16" width="16px" x="0px" y="0px">
            <path clip-rule="evenodd" d="M1,13v-2h14v2H1z M1,5h13v2H1V5z M1,2h10v2H1V2z M12,10H1V8h11V10z" fill-rule="evenodd"></path>
          </svg>
        </a>
        <p class="room-title">avalonstar</p>
      </div>
      <div class="chat-room">
      </div>
      <div class="chat-interface">
        <div class="textarea-contain">
					<div class="whatisthis anchor-bottom">
						<div class="text">
							<p>You have 1,000 Bits to spend!</p>
						</div>
						<div class="sub-text">
							Spend more than 500 Bits to send this message
						</div>
					</div>
					<div class="bits-image">
						<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/t-140/bit.png">
						<div class="bounding-box"></div>
					</div>
          <textarea id="chat-message" placeholder="Send a message"></textarea>
          <a class="emoticon-selector-toggle">
            <svg class="svg-emoticons" height="18px" version="1.1" viewBox="0 0 18 18" width="18px" x="0px" y="0px">
      <path clip-rule="evenodd" d="M9,18c-4.971,0-9-4.029-9-9s4.029-9,9-9s9,4.029,9,9S13.971,18,9,18z M14,4.111V4h-0.111C12.627,2.766,10.904,2,9,2C7.095,2,5.373,2.766,4.111,4H4v0.111C2.766,5.373,2,7.096,2,9s0.766,3.627,2,4.889V14l0.05-0.051C5.317,15.217,7.067,16,9,16c1.934,0,3.684-0.783,4.949-2.051L14,14v-0.111c1.234-1.262,2-2.984,2-4.889S15.234,5.373,14,4.111zM11,6h2v4h-2V6z M12.535,12.535C11.631,13.44,10.381,14,9,14s-2.631-0.56-3.536-1.465l0.707-0.707C6.896,12.553,7.896,13,9,13s2.104-0.447,2.828-1.172L12.535,12.535z M5,6h2v4H5V6z" fill-rule="evenodd"></path>
    </svg>
          </a>
        </div>
        <div class="chat-buttons-container clearfix">
          <a class="button glyph-only float-left">
            <svg class="svg-gear" height="16px" version="1.1" viewBox="0 0 16 16" width="16px" x="0px" y="0px">
      <path clip-rule="evenodd" d="M15,7v2h-2.115c-0.125,0.615-0.354,1.215-0.713,1.758l1.484,1.484l-1.414,1.414l-1.484-1.484C10.215,12.531,9.615,12.76,9,12.885V15H7v-2.12c-0.614-0.126-1.21-0.356-1.751-0.714l-1.491,1.49l-1.414-1.414l1.491-1.49C3.477,10.211,3.247,9.613,3.12,9H1V7h2.116C3.24,6.384,3.469,5.785,3.829,5.242L2.343,3.757l1.414-1.414l1.485,1.485C5.785,3.469,6.384,3.24,7,3.115V1h2v2.12c0.613,0.126,1.211,0.356,1.752,0.714l1.49-1.491l1.414,1.414l-1.49,1.492C12.523,5.79,12.754,6.387,12.88,7H15z M8,6C6.896,6,6,6.896,6,8s0.896,2,2,2s2-0.896,2-2S9.104,6,8,6z" fill-rule="evenodd"></path>
    </svg>
          </a>
          <a class="button glyph-only float-left">
            <svg class="svg-viewerlist" height="16px" version="1.1" viewBox="0 0 16 16" width="16px" x="0px" y="0px">
              <path clip-rule="evenodd" d="M6,12.999v-2h8v2H6z M6,6.999h8v2H6V6.999z M6,2.999h8v2H6V2.999z M2,10.999h2v2H2V10.999z M2,6.999h2v2H2V6.999z M2,2.999h2v2H2V2.999z" fill-rule="evenodd"></path>
            </svg>
          </a>
          <button class="button primary float-right send-chat-button">Chat</button>
        </div>
      </div>
    </div>
</div>
</div>
            
          
!
            
              textarea
	line-height: 28px
	font: inherit
	letter-spacing: inherit
	color: #666
	vertical-align: top
	border: 1px solid rgba(0, 0, 0, 0.25)
	background-clip: padding-box
	background: #fff
	padding: 7px

	&:focus
		outline: 0
		box-shadow: 0 0 3px 1px rgba(185,155,235,0.75)
		border: 1px solid rgba(100,65,165,0.75)

.button
	position: absolute
	display: inline-block
	position: relative
	cursor: pointer
	line-height: 30px
	height: 30px
	font-size: 14px
	font-family: inherit
	padding: 0
	color: #6441a5
	border: 0
	background: none

	&.primary
		background: #6441a5
		color: #fff
		padding: 0 10px
		font-size: 12px

	&.left
		left: 20px
	
	&.glyph-only
		padding: 0 10px
	
	svg
		path
			fill: #6441a5

.chat-container
	position: absolute
	top: 0
	bottom: 0
	right: 0
	width: 340px
	background-color: #f2f2f2

.chat-header
	height: 30px
	padding: 10px 0
	line-height: 30px
	text-align: center
	font-size: 14px
	width: 100%
	box-shadow: inset 0 -1px 0 0 #dedede

	.button
		position: absolute
		top: 10px
		
		&.left
			left: 20px
			padding-left: 0
	
		&.right
			right: 20px
			padding-right: 0

	.svg-roomlist
		width: 16px
		height: 16px
		margin-top: 7px
		margin-bottom: 7px
		float: left

.chat-room
	top: 50px
	left: 0
	right: 0
	bottom: 0
	position: absolute
	display: block
	background-clip: content-box

.chat-interface
	color: #8c8c8c
	border-color: #3b3b3b
	height: 111px
	bottom: 0
	width: 100%
	position: absolute
	padding: 0 20px 20px
	box-sizing: border-box
	
.textarea-contain
	width: 100%
	height: 50px
	margin-bottom: 10px
	position: relative

	textarea
		width: 300px
		height: 50px
		padding-right: 25px
		margin: 0
		resize: none
		box-sizing: border-box

.emoticon-selector-toggle
	display: block
	width: 18px
	height: 18px
	top: 5px
	right: 5px
	position: absolute
	cursor: pointer

	svg path
		fill: rgba(0,0,0,0.2)

		&:hover
			svg path
				fill: rgba(0,0,0,0.5)

.chat-buttons-container
	width: 100%
	display: block

	.glyph-only
		min-width: 14px
		&:first-child
			padding-left: 0
	
.bits-image
	position: absolute
	top: 6px
	left: 100px
	display: none

.bounding-box
	width: 40px
	height: 24px
	border: 1px solid rgba(#6441a5, 0.5)
	position: absolute
	top: -2px
	left: 18px

.whatisthis
	padding: 15px
	width: 270px
	margin-left: -150px
	display: none

	.sub-text
		font-size: 11px
	.text p
		margin-bottom: 0px
		font-weight: bold
	
            
          
!
            
              var isBitsActive = false;
$('#chat-message').keyup(function (e) {
	var self = $(this);
	console.log(self.val().match(/giveBits/g));
	var res = self.val().match(/giveBits/g);
	
	if(res) {
		if (res[0] === 'giveBits') {
			isBitsActive = true;
			self.val('MLG! Nice shot!\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0');

			$('.whatisthis, .bits-image').show();	
		}	
	}
	
	console.log(isBitsActive);
	if (isBitsActive) {
		if (e.keyCode === 32) {
			$('.bounding-box').hide();
			$('.whatisthis').hide();
			self.val('MLG! Nice shot!\xa0\xa0\xa0\xa0\xa0\xa0\xa0500')
			isBitsActive = false;
		}		
	}

})

$('.whatisthis').click(function () {
	$('.whatisthis, .bits-image').hide();
	$('#chat-message').val('');
});
            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.
Loading ..................

Console