Adding in a mouse over element from codepen

I have been trying to add in something which I designed in codepen. As it contains HTML, CSS and JS is there a simple way to add this into a Weebly site? as the embed tool from codepen shows the code and not the element I needed to design?

Code is below! 

Thank you in advance to all.

code

html:


<figure class="snip1584"><img src="https://enrol.lecb.ac.uk/externalMedia/1011/skills-for-life-and-families_450.jpeg?width=450&height=3..." alt="Esol Learner"/>
<figcaption>
<h3>Skills for Life <br/>
and Families</br></h3>
<h5>Learn More</h5>
</figcaption><a href="#"></a>
</figure>
<figure class="snip1584 hover"><img src="https://enrol.lecb.ac.uk/externalMedia/1012/supported-learning_450.jpeg?width=450&height=377" alt="sample119"/>
<figcaption>
<h3>Supported Learning</h3>
<h5>Learn More</h5>
</figcaption><a href="#"></a>
</figure>
<figure class="snip1584"><img src="https://enrol.lecb.ac.uk/externalMedia/1010/learning-for-work_450.jpeg?width=450&height=377" alt="sample120"/>
<figcaption>
<h3>Learning For Work</h3>
<h5>Learn More</h5>
</figcaption><a href="#"></a>
</figure>

<figure class="snip1584"><img src="https://enrol.lecb.ac.uk/externalMedia/1008/health-and-wellbeing_450.jpeg?width=450&height=377" alt="Esol Learner"/>
<figcaption>
<h3>Health and Wellbeing</h3>
<h5>Learn More</h5>
</figcaption><a href="#"></a>
</figure>
<figure class="snip1584 hover"><img src="https://enrol.lecb.ac.uk/externalMedia/1007/the-arts-and-crafts_450.jpeg?width=450&height=377" alt="sample119"/>
<figcaption>
<h3>The Arts and Crafts</h3>
<h5>Learn More</h5>
</figcaption><a href="#"></a>
</figure>
<figure class="snip1584"><img src="https://enrol.lecb.ac.uk/externalMedia/1009/languages-and-bsl_450.jpeg?width=450&height=377" alt="sample120"/>
<figcaption>
<h3>Languages and BSL</h3>
<h5>Learn More </h5>
</figcaption><a href="#"></a>
</figure>

CSS

@import url(https://fonts.googleapis.com/css?family=lato);
.snip1584 {
font-family: 'lato', sans-serif;
position: relative;
display: inline-block;
overflow: hidden;
margin: 10px;
min-width: 230px;
max-width: 315px;
width: 100%;
color: #ffffff;
font-size: 16px;
text-align: left;
}
.snip1584 * {
-webkit-box-sizing: border-box;
box-sizing: border-box;
-webkit-transition: all 0.25s ease;
transition: all 0.25s ease;
}
.snip1584:before {
position: absolute;
top: 10px;
bottom: 10px;
left: 10px;
right: 10px;
top: 100%;
content: '';
background-color: rgba(228, 108, 49, 0.8);
-webkit-transition: all 0.25s ease;
transition: all 0.25s ease;
-webkit-transition-delay: 0.25s;
transition-delay: 0.25s;
}
.snip1584 img {
vertical-align: top;
max-width: 100%;
backface-visibility: hidden;
}
.snip1584 figcaption {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
z-index: 1;
align-items: center;
display: flex;
flex-direction: column;
justify-content: center;
}
.snip1584 h3,
.snip1584 h5 {
margin: 0;
opacity: 0;
letter-spacing: 1px;
}
.snip1584 h3 {
-webkit-transform: translateY(-100%);
transform: translateY(-100%);
text-transform: uppercase;
font-weight: 400;
-webkit-transition-delay: 0.05s;
transition-delay: 0.05s;
margin-bottom: 5px;
}
.snip1584 h5 {
font-weight: normal;
background-color: #ae895d;
padding: 3px 10px;
-webkit-transform: translateY(-100%);
transform: translateY(-100%);
-webkit-transition-delay: 0s;
transition-delay: 0s;
}
.snip1584 a {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
z-index: 1;
}
.snip1584:hover:before,
.snip1584.hover:before {
top: 10px;
-webkit-transition-delay: 0s;
transition-delay: 0s;
}
.snip1584:hover h3,
.snip1584.hover h3,
.snip1584:hover h5,
.snip1584.hover h5 {
-webkit-transform: translateY(0);
transform: translateY(0);
opacity: 1;
}
.snip1584:hover h3,
.snip1584.hover h3 {
-webkit-transition-delay: 0.3s;
transition-delay: 0.3s;
}
.snip1584:hover h5,
.snip1584.hover h5 {
-webkit-transition-delay: 0.2s;
transition-delay: 0.2s;
}

JS

var snippet = [].slice.call(document.querySelectorAll('.hover'));
if (snippet.length) {
snippet.forEach(function (snippet) {
snippet.addEventListener('mouseout', function (event) {
if (event.target.parentNode.tagName === 'figure') {
event.target.parentNode.classList.remove('hover')
} else {
event.target.parentNode.classList.remove('hover')
}
});
});
}

978 Views
Message 1 of 1
Report
0 REPLIES 0