DEV Community

Cover image for As a beginner in JavaScript, I did this within a day
OGUNSUYI JOSEPH OLUWASEUN
OGUNSUYI JOSEPH OLUWASEUN

Posted on

As a beginner in JavaScript, I did this within a day

GitHub link : https://github.com/Emmijozzy/JavaScript-tab-carousel

Site link : https://emmijozzy-js-tab-carousel.herokuapp.com

This is done with a mindset of a beginner looking forward to be a great developer , building on at least a project within a week

Top comments (3)

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

Collapse
 
thoughtsunificator profile image
Romain Lebesle • Edited

Nice one!

If I may..

I don't think you need PHP for this demo so you can safely remove index.php file and rename home.html into index.html.

I would also recommend you publish your demo on Github Page instead of Heroku.