Help Wanted2

by enbette

HTML

<div class="main">
    
  <div class="wrapper">

    <div class="textDiv">
        <ul class="rolldown-list" id="myList">
        <li><img
        src="https://i.ibb.co/DHbRd4T6/Help-Wanted-Text2.png"
        alt="Help-Wanted-Text"
        style="display: block; margin:auto"
      /></li><li><p class="centered">
        Do you miss the
        <span style="color: #ff783a">Monthly Magazine</span> and
        <span style="color: #24a3ed">NewsTeam</span>?<br />
        Want to be a part of making iconic VP magazine articles?<br />
        Come join the group of volunteer VP users bringing back those nostalgic
        vibes.
        
      </p></li>
    <li><p class="centeredButIdk">We are looking for:</p></li>
  <li> <span class="roleCardText writers deselectedTab">Writers</span>
    <p class="infoP">
          As a writer you are expected to help out with writing articles for the
          magazine, but also to proofread the texts you write and/or help the
          other writers with proofreading.
        </p>
        <p class="infoP">
          You are also expected to communicate with the layouter and coder for
          your articles.
        </p>

        <p class="infoP">
          There are no expectations to what you write about, we might have a few
          pages that are expected to be in each magazine – such as this
          application article. Other than that, you can write about whatever
          your heart desires!
        </p>
</li>
  <li><span class="roleCardText layouters deselectedTab">Page Layouters</span>
        <p class="infoP">
          As a layouter you are expected to make layouts for the magazine, and
          help out with deciding on color palettes and themes for each magazine.
        </p>

        <p class="infoP">
          You are also expected to keep up communication with the writer and the
          coder for the articles you layout for.
        </p></li>
  <li><span...

CSS

body {
  font:
    1.2em/1.4 "Oswald",
    sans-serif;
  color: #fff;
  text-align: right;
}

.rolldown-list {
  text-align: left;
  padding: 0;
  margin: 0;
}

.rolldown-list li {
  padding: 1em;
  margin-bottom: 0.125em;
  display: block;
  list-style: none;
}

.rolldown-list li {
  visibility: hidden;
  animation: rolldown 0.7s 1;
  transform-origin: 50% 0;
  animation-fill-mode: forwards;
}

.rolldown-list li:nth-child(2n) {
  background-color: #186679;
}

.rolldown-list li:nth-child(2n + 1) {
  background-color: #113c4d;
}

.rolldown-list li:nth-child(1) {
  position: sticky;
  top: 0px;
  z-index: 100;
}

#myList {
  display: block;
  width: 100%;
  left: 1%;
}

#btnReload {
  float: right;
  color: #333;
  background: #ccc;
  text-transform: uppercase;
  border: none;
  padding: 0.5em 1em;
}

#btnReload:hover {
  background: #ddd;
}

@keyframes rolldown {
  0% {
    visibility: visible;
    transform: rotateX(180deg) perspective(500px);
  }
  70% {
    visibility: visible;
    transform: rotateX(-20deg);
  }
  100% {
    visibility: visible;
    transform: rotateX(0deg);
  }
}

canvas {
  background-color: #e83d3d;
}
.main {
  width: 688px;
  height: 500px;
}
body {
  width: 688px;
  height: 500px;
}
.wrapper {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 680px;

  background-color: #f8fdfd37;
  border-radius: 0px;
  border-style: solid;
  border-color: #fed490;
  border-width: 5px;
  overflow: hidden;
}

.textDiv::-webkit-scrollbar {
  width: 8px;
}
.textDiv::-webkit-scrollbar-thumb:hover {
  background-color: #fed490;
}
/* The area behind scrollbar */
.textDiv::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 10px;
}

/* Customize the bar moving inside the tracker */
.textDiv::-webkit-scrollbar-thumb {
  background-color: #fed490;
  border-radius: 0px;
}
.textDiv {
  overflow-y: scroll;
  min-height:...

JavaScript

let btns = document.getElementsByClassName("roleCardText")
let panels = document.getElementsByClassName("panel")
let totalBtns = btns.length

Array.from(btns).forEach((tab) => tab.addEventListener("click", setActive))

function setActive(e) {
  if (e.srcElement.classList.contains("deselectedTab")) {
    e.srcElement.classList.replace("deselectedTab", "selectedTab")
    document
      .getElementById(e.srcElement.classList[1])
      .classList.replace("closed", "opened")
  } else {
    e.srcElement.classList.replace("selectedTab", "deselectedTab")
    document
      .getElementById(e.srcElement.classList[1])
      .classList.replace("opened", "closed")
  }
}