cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

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.

            
              <div id="container">

<div class="content">
<h1>Your reaction?</h1>
<div class="reaction">
	<div class="emoji">😺</div>
	<div class="count">52</div>
	<div class="text">happy</div>
</div>

<div class="reaction">
	<div class="emoji">😹</div>
	<div class="text">amused</div>
	<div class="count">1361</div>
</div>

<div class="reaction">
	<div class="emoji">😻</div>
	<div class="text">in love</div>
	<div class="count">94</div>
</div>  
  
<div class="reaction">
	<div class="emoji">🙀</div>
	<div class="text">shocked</div>
	<div class="count">5</div>
</div>

<div class="reaction">
	<div class="emoji">😼</div>
	<div class="text">angry</div>
	<div class="count">17</div>
</div>

<div class="reaction">
	<div class="emoji">😿</div>
	<div class="text">sad</div>
	<div class="count">0</div>
</div>

<div class="settings">
	<strong>Share buttons:</strong>
	<input type="radio" name="settings" value="popup" id="popup" checked><label for="popup">Popup</label>
	<input type="radio" name="settings" value="tooltip" id="tooltip"><label for="tooltip">Tooltip</label>
	<input type="radio" name="settings" value="none" id="none"><label for="none">None</label>
</div>
</div>
</div>

<div class="hidden" id="modal">
	<a class="fa fa-close" onclick="closeModal()"></a>
	<h2>Share your feelings!</h2>
	<h3 id="modalcontent">Let your friends know what you think.</h3>
	
	<div class="social">
		<a class="fa fa-facebook" href="https://www.facebook.com/sharer.php?u=https://codepen.io/inesmontani/full/XmzeYr&t=Reaction emojis with social sharing & animation" target="_blank"></a>
		<a class="fa fa-twitter" href="https://twitter.com/share?text=Reaction emojis with social sharing & animation &url=https://codepen.io/inesmontani/full/XmzeYr&via=klammerauf" target="_blank"></a>
		<a class="fa fa-tumblr" href="https://www.tumblr.com/share/link?url=https://codepen.io/inesmontani/full/XmzeYr" target="_blank"></a>
	</div>
</div>
            
          
!
            
              @import url(https://fonts.googleapis.com/css?family=Muli:400,300|Merriweather:400,300,700)

$background: #564787
$accent: #ffa630
$light: #ccc
$dark: #222

body
	width: 100vw
	height: 100vh
	display: table
	background: $background
	margin: 0

#container
	display: table-cell
	vertical-align: middle
	text-align: center

.content
	background: white
	padding: 1em 0 1em 0

.reaction
	display: inline-block
	position: relative
	text-align: center
	margin: 1em 0 0 0

	&:hover
		.emoji
			transform: scale(1.1, 1.1)
			transition: all .1s

		.text
			color: #222
			transition: all .1s
	

.emoji
	font-size: 4em
	cursor: pointer

.count
	position: absolute
	top: -1em
	right: 0
	border-radius: 1.75em
	min-width: 1.25em
	height: 1.75em
	font: 600 .9em "Muli", arial, sans-serif
	background: $accent
	color: white
	border: .25em solid white
	padding: 0 .25em
	cursor: pointer

.text
	font: 400 1em/2.5em "Muli", arial, sans-serif
	color: $light
	cursor: pointer

h1,
h2
	font: 700 2em/3em "Merriweather", georgia, serif
	text-align: center
	color: $dark

h2
	line-height: 1.25em
	margin: 1.5em 0 0 0

h3
	font: 300 1em/2.5em "Muli", arial, sans-serif
	text-align: center
	color: darken($light, 15%)
	margin: 0 0 2.5em 0

#modal
	position: absolute
	background: white
	border: 1px solid lighten($light, 5%)
	box-shadow: 0 0 .25em $light

.popup
	bottom: 0
	right: 0
	margin: auto
	width: 500px
	height: 275px

.tooltip
	position: absolute
	top: 26em
	left: 7.5em
	width: 275px
	font-size: .8em
	padding: 0 1em 1em 1em
	margin: 0 0 3em 0
	border-radius: 1.5em

	&:after
		display: block
		content: ""
		position: absolute
		top: .15em
		left: 0
		right: 0
		width: 0
		height: 0
		margin: auto
		border-width: .75em
		border-style: solid
		border-color: transparent transparent white white
		box-shadow: .1em -.1em .25em $light
		background: white
		transform-origin: 0 0
		transform: rotate(-45deg)
		z-index: 100 !important

	h2
		margin: .75em 0 0 0
	
	h3
		margin: .75em 0 1.5em 0
		line-height: 1.25em

	.social
		font-size: 1.75em

	.fa-close
		bottom: -.75em
		font-size: 1.25em

.fa-close
	display: inline-block
	position: absolute
	top: -.75em
	right: -.75em
	text-align: center
	text-decoration: none
	color: $dark
	background: white
	border: 1px solid lighten($light, 5%)
	border-radius: 50%
	width: 1.25em
	height: 1.25em
	padding: .25em
	cursor: pointer

.social
	font-size: 2.5em
	text-align: center

	.fa
		width: 1em
		text-decoration: none
		background: $dark
		color: white
		margin: 0 .15em
		padding: .25em
	
		&:hover
			opacity: .9
	
	.fa-facebook
		background: #3765a3
	
	.fa-twitter
		background: #6cadde

	.fa-tumblr
		background: #1c2f44

.animate
	animation: bounce .5s

.hidden
	visibility: hidden
	pointer-events: none

.settings
	font: 300 .85em "Muli", arial, sans-serif
	color: $dark
	margin: 3em 0 0 0
	padding: 1em 0 0 0

	input[type="radio"]
		display: none

	input[type="radio"] + label:before
		content: ""
		display: inline-block
		border: 2px solid $background
		width: .75em
		height: .75em
		margin: 0 .5em 0 0
		vertical-align: middle
		cursor: pointer
		border-radius: 50%

	input[type="radio"] + label:before
		background: white

	input[type="radio"]:checked + label:before
		background: $background

	label
		margin: 0 1em 0 .5em
		cursor: pointer

// Thanks to animate.css!
@keyframes bounce
	from, 20%, 40%, 60%, 80%, to
		animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000)

	20%
		transform: scale3d(1.1, 1.1, 1.1)

	40%
		transform: scale3d(.9, .9, .9)

	60%
		transform: scale3d(1.03, 1.03, 1.03)

	80%
		transform: scale3d(.97, .97, .97)

	to
		transform: scale3d(1, 1, 1)
            
          
!
            
              // using the same JS as here: https://codepen.io/inesmontani/pen/OyOEWg
            
          
!
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