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.
<h3>Hover over one of these jealous links!</h3>
<p>make sure you have your headphones on</p>
<div class="links-container">
<a class="btn btn1" href="http://www.nourabusoud.com" target="_blank">
<div class="arm">
<div class="stick"></div>
<div class="hand"></div>
<div class="bone"></div>
</div>
<div class="btn-text">About me</div>
</a>
<a class="btn btn2" href="https://twitter.com/Nour_ASoud" target="_blank">
<div class="arm">
<div class="stick"></div>
<div class="hand"></div>
<div class="bone"></div>
</div>
<div class="btn-text">Twitter</div>
</a>
<a class="btn btn3" href="https://nl.linkedin.com/in/nourabusoud" target="_blank">
<div class="arm">
<div class="stick"></div>
<div class="hand"></div>
<div class="bone"></div>
</div>
<div class="btn-text">Linkedin</div>
</a>
</div>
<audio controls preload="auto" id="sound-wohoo">
<source src="https://www.nourabusoud.com/audio/wooho.mp3" controls></source>
<source src="https://www.nourabusoud.com/audio/wooho.ogg" controls></source>
</audio>
<audio loop controls preload="auto" id="sound-me">
<source src="https://www.nourabusoud.com/audio/me-me-me.mp3" controls></source>
<source src="https://www.nourabusoud.com/audio/me-me-me.ogg" controls></source>
</audio>
$btn1-color: #ff3c41;
$btn2-color: #0ebeff;
$btn3-color:#47cf73;
$stick: #3F3F3F;
$flag: #686868;
body{
font-family: helvetica;
font-size: 16px;
color:#666;
text-align:center;
background: #fafafa;
}
h3{
margin-top:30px;
}
.links-container{
width: 400px;
margin:110px auto 0;
text-align: center;
}
.btn{
display: inline-block;
position: relative;
text-decoration: none;
margin: 0 15px;
&-text{
display: block;
line-height:20px;
padding:10px 20px;
background-color: navy;
color: white;
text-align: center;
z-index: 2;
border-radius: 5px;
//position: absolute;
}
&1{
.btn-text,.bone {
background-color: $btn1-color;
}
&.pick-me .arm{
animation-delay: 0.2s;
}
.bone{
&:before{
display: none;
}
}
}
&2{
.btn-text,.bone {
background-color: $btn2-color;
&.pick-me .arm{
animation-delay: 0.1s;
}
}
.bone{
&:before{
display: none;
}
}
}
&3{
.btn-text,.bone {
background-color: $btn3-color;
&.pick-me .arm{
animation-delay: 0.3s;
}
}
}
}
.pick-me{
.arm{
display: block;
animation: wave 0.5s alternate infinite;
}
}
.arm{
position: absolute;
top: -28px;
left: 40px;
visibility: hidden;
z-index: -1;
}
.bone{
width: 22px;
height: 45px;
border-radius: 3px 3px 0 0;
&:before{
content:".";
position: absolute;
text-align: left;
color: #a0a0a0;
width:22px;
font-weight: bold;
padding:4px 2px;
line-height: 5px;
top:0px;
left: 0;
background-color:rgba(250,250,245,0.98);
border:1px solid #cfcfcf;
box-sizing: border-box;
}
}
.hand{
position: absolute;
width:21px;
height: 25px;
top:-24px;
left:1px;
background-color: #ffe0bd;
border:1px solid #E2B783;
border-radius:10px 10px 5px 14px;
transform: rotate(35deg);
z-index:-2;
&:after, &:before{
content: "";
border:1px solid #E2B783;
position: absolute;
background-color:#ffe0bd;
border-bottom:0;
border-radius: 5px 5px 0 0;
height: 10px;
width: 4px;
top: -1px;
}
&:before{
left:2px;
}
&:after{
left:12px;
}
}
.stick{
width:10px;
height: 30px;
top: -30px;
left:5px;
background: $stick;
position: absolute;
z-index:-3;
transform: rotate(-50deg);
&:after{
content:"ME!";
color: white;
text-align: center;
padding:5px 8px;
position: absolute;
top:-30px;
left: 0;
height:20px;
color: #fff;
border-radius: 2px 2px px 0;
background: $flag;
}
}
.yeay{
&:before{
content:"Woohoo!";
position: absolute;
top: -14px;
left: 15px;
animation: wohoo 1s infinite ease-in-out;
visibility: hidden;
background: -webkit-linear-gradient(-180deg, red, blue);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
}
@keyframes wave{
0% {
visibility: hidden;
transform: rotate(-20deg);
top: -26px;
}
100%{
visibility: visible;
transform: rotate(20deg);
}
}
@keyframes wohoo{
0% {
visibility: hidden;
}
25%{
visibility: visible;
transform: scale(1.4);
top:-60px;
}
75%{
visibility: visible;
transform: scale(1.8);
top:-60px;
}
100%{
visibility: hidden;
top:-70px;
opacity: 0;
}
}
audio{
display:none;
}
var jealousButton = document.getElementsByClassName("btn");
var wohooSound = document.getElementById("sound-wohoo");
var meSound = document.getElementById("sound-me");
var getSiblings = function (elem) {
var siblings = [];
var sibling = elem.parentNode.firstChild;
for (; sibling; sibling = sibling.nextSibling) {
if (sibling.nodeType !== 1 || sibling === elem) continue;
siblings.push(sibling);
}
return siblings;
};
for (var i = 0; i < jealousButton.length; i++) {
jealousButton[i].addEventListener("mouseover", function(event) {
wohooSound.play();
meSound.play();
this.classList.add("yeay");
var siblings = getSiblings(this);
for (var i = 0; i < siblings.length; i++) {
siblings[i].classList.add("pick-me");
}
}, false);
jealousButton[i].addEventListener("mouseleave", function(event) {
wohooSound.pause();
wohooSound.currentTime = 0;
meSound.pause();
meSoundcurrentTime = 0;
event.target.classList.remove("yeay");
for (var i = 0; i < jealousButton.length; i++) {
jealousButton[i].classList.remove("pick-me");
jealousButton[i].classList.remove("yeay");
}
}, false);
}
// JQUERY CODE
// $(".btn" ).mouseover(function() {
// $("#sound-wohoo")[0].play();
// $("#sound-me")[0].play();
// $(this).addClass("yeay");
// $(this).siblings().addClass("pick-me");
// $(this).siblings().children( ".hand" ).css( "display", "block" );
// });
// $(".btn" ).mouseout(function() {
// $("#sound-woohoo")[0].pause();
// $("#sound-me")[0].pause();
// $(this).removeClass("yeay");
// $(".btn").removeClass("pick-me");
// });
Also see: Tab Triggers