DEV Community

Discussion on: As a beginner in JavaScript, I did this within a day

Collapse
 
darkwiiplayer profile image
𒎏Wii 🏳️‍⚧️

Not bad, but one thing I noticed:

.tres:hover{
  background: linear-gradient( to right, #91a5f7, #020955);
  font-size: 1.5em;
  color: #e6e7ee;
}
.tbus:hover{
  background: linear-gradient( to right, #f291f7, #470255);
  font-size: 1.5em;
  color: #e6e7ee;
}
.tedu:hover{
  background: linear-gradient( to right, #d8f791, #225502);
  font-size: 1.5em;
  color: #e6e7ee;
}
Enter fullscreen mode Exit fullscreen mode

That's a lot of code duplication that you could put in a separate rule :D

The JS is also a lot of code for what it does.

  y++
  if(y == 4){
    y = 0;
  };
Enter fullscreen mode Exit fullscreen mode

You could also just write this as y = (y+1) % 4 😁

Collapse
 
joseph_ogunsuyi profile image
OGUNSUYI JOSEPH OLUWASEUN

Am seriously encourage by this action of yours , thanks so much, I have replaced it and it work well, thanks for you love