Add Task

by 201flaviosilva

HTML

<marquee behavior="75" direction="right">Mindera</marquee>
<p class="titulo">Lista de afazeres</p>
<div>
  <form action="https://duckduckgo.com/" id="formTask">
    <input id="textBox" name="task">
    <button id="addButton" class="addButtonEffetc"> Add Task</button>
  </form>
  <ul id="ulList">

  </ul>
</div>

CSS

body {
  background: fixed linear-gradient(to bottom right, #25cc81 0%, #1a08c2 100%);
  color: white;
  color: greenyellow;
  font-family: consolas, monaco, monospace;
}

marquee {
  background: linear-gradient(to left, white, black) 5px, 5px;
  color: blueviolet;
  border: coral 5px dashed;
}

.titulo {
  letter-spacing: 3px;
  text-align: center;
  color: #ff00ff;
  text-shadow: yellow 10px 10px;
  font-size: 50px;
}

input {
  border-radius: 60px;
  border: 10px blue solid;
  margin-left: 25px;
  width: 425px;
  color: chartreuse;
  font-size: 25px;
  text-align: center;
  text-shadow: linear-gradient(to left, white, black) 5px, 5px;
}

button {
  background: linear-gradient(to bottom, #ff00ff 0%, #ff6600 100%);
  color: white;
  padding: 0.4rem 1rem;
  border-radius: 6px;
  border: 5px solid green;
  cursor: pointer;
}

ul {
  background: linear-gradient(to right, #33ccff 0%, #cc6600 100%);
  width: 300px;
  border: 15px green;
  border-style: dotted dashed solid double;
  padding: 50px;
  margin: 20px;
}

ul:hover {
  transition: 3s;
  font-size: 50px;
}

div {
  /* background: linear-gradient(to right, yellow, green, red, blue);*/
  background: linear-gradient(to left, red, orange, yellow, green, blue, indigo, violet);
}

.addButtonEffetc {
  width: 220px;
  height: 50px;
  border: none;
  outline: none;
  color: #fff;
  background: #111;
  cursor: pointer;
  position: relative;
  z-index: 0;
  border-radius: 10px;
}

.addButtonEffetc:before {
  content: '';
  background: linear-gradient(45deg, #ff0000, #ff7300, #fffb00, #48ff00, #00ffd5, #002bff, #7a00ff, #ff00c8, #ff0000);
  position: absolute;
  top: -2px;
  left: -2px;
  background-size: 400%;
  z-index: -1;
  filter: blur(5px);
  width: calc(100% + 4px);
  height: calc(100% + 4px);
  animation: glowing 20s linear infinite;
  opacity: 0;
  transition: opacity .3s ease-in-out;
  border-radius: 10px;
}

.addButtonEffetc:active {
  color: #000
}

.addButtonEffetc:active:after {
  background:...

JavaScript

const input = document.getElementById("textBox");
const ul = document.getElementById("ulList");
const buttonAdd = document.getElementById("addButton");
const formTask = document.getElementById("formTask");

buttonAdd.addEventListener(
  "click",
  () => {
    const li = document.createElement("li");
    li.textContent = input.value;

    const buttonRemove = document.createElement("button");
    buttonRemove.textContent = "Remove";
    buttonRemove.addEventListener(
      "click",
      () => {
        ul.removeChild(li);
      },
      false,
    );

    li.appendChild(buttonRemove);

    ul.prepend(li);
  },
  false,
);

formTask.addEventListener(
  "submit",
  event => {
    event.preventDefault();
  },
  false,
);