JavaScript preprocessors can help make authoring JavaScript easier and more convenient. For instance, CoffeeScript can help prevent easy-to-make mistakes and offer a cleaner syntax and Babel can bring ECMAScript 6 features to browsers that only support ECMAScript 5.
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.
You can apply a script from anywhere on the web to your Pen. Just put a URL to it here and we'll add it, in the order you have them, before the JavaScript in the Pen itself.
If the script you link to has the file extension of a preprocessor, we'll attempt to process it before applying.
You can also link to another Pen here, and we'll pull the JavaScript from that Pen and include it. If it's using a matching preprocessor, we'll combine the code before preprocessing, so you can use the linked Pen as a true dependency.
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 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
Also see: Tab Triggers