jQuery addClass example

Change class name on click in jQuery

by Emanuele del Grande

HTML

<div class="logo">
    <span>CSS</span> <span>AnimatedButton</span>
    <div>CSS animation on CTA button</div>
</div>

<p>
Test of infinite animation on a button shadow.
</p>
<div id="banner-message">
  <p>Hello World</p>
  <button>You wanna click me</button>
</div>
<div class="abc">
  <p>Test text.</p>
</div>

CSS

@import url(https://fonts.googleapis.com/css2?family=Inter:wght@100;200;300;400;500;600;700;800;900&display=swap);

:root {
  --font-color: #444;
  --font-family: Inter, Roboto, Arial, Helvetica;
  --font-size: 14px;
  --font-weight: 300;
  --letter-spacing: -0.5px;
  --main-color: #607f8b; /* #4ae */
  --inner-border-width: 1px;
  --border-color: #ddd;
  --v-padding: 10px;
}


/* GENERIC STYLE */
*, *:before, *:after { margin; 0; padding: 0; box-sizing: border-box; outline: none; }
html, body {
    font: 14px var(--font-family); color: var(--font-color); line-height: 1.4em;
    font-weight: var(--font-weight); letter-spacing: var(--letter-spacing);
}
.logo { font: 42px var(--font-family); margin: 0; padding: 10px 0 0 20px; font-weight: 800; letter-spacing: -3px; white-space: nowrap; }
.logo span:first-child {
    position: relative; top: 0; left: 0; padding: 0 13px 0 10px; color: var(--main-color); background: var(--main-color); color: #fff;
    clip-path: ellipse(100% 125% at 100% 50%); z-index: 1;
}
.logo span:nth-child(2) { position: relative;top: 0; left: 0; margin: 0 0 0 -13px; background: transparent; z-index: 2; }

.logo div { font: 12px var(--font-family); padding: 0 0 0 70px; letter-spacing: -0.5px; }


/* POPUP AND BUTTON STYLES */
body { background: #eee; }
#banner-message {
  width: 300px; padding: 2px 20px 20px 20px; margin: 0 auto; border-radius: 3px;
  font-size: 25px; background: #fff; text-align: center; transition: all 0.2s;
}

button {
  border: none; padding: 8px 14px; border-radius: 3px;
  font-size: 15px; color: #fff; background: #0084ff; outline: none;
  cursor: pointer;
  box-shadow: 0 0 0 0 rgba(0, 135, 255, 1);
  animation: pulse 1.7s infinite;
  animation-duration: 1.7s;
  animation-timing-function: ease;
  animation-delay: 0s;
  animation-iteration-count: infinite;
  animation-direction: normal;
  animation-fill-mode: none;
  animation-play-state: running;
  animation-name:...