JSFiddle - React, Tailwind, and code Playground

by ninty9notout

HTML

<div class="cTsdiv">
    <a href="/{{ i.couponStoreURL }}/#{{ i.id }}">
        <span id="couponCode" style="">{{ i.couponCode }}</span>
    </a>
    <span class="cTs">Click to see the code</span>
</div>

CSS

.cTsdiv {
    width: 175px;
    position: relative;
    display: inline-block;
    border: 1px dashed;
    padding: 5px;
    margin: 5px;
    background: #EE4000;
    color: white;
    height: 20px;
    text-align: center;
}

.cTs {
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    height: auto;
    width: auto;
    line-height: 30px;
    background: black;
    position: absolute;
    -webkit-transition: opacity 0.1s ease-in-out;
}

.cTsdiv a {
    color: white;
    text-decoration: none;
}

JavaScript

$('.cTs').on("click", function() {
    $(this).css("opacity", 0).delay(100).queue(function() {
        $(this).css("display", "none");
    });
});