Want to Add a Slot Machine Effect to Your Website?

The next time you browse the Apple website to check out the company's latest offerings, select the iMac 24" desktop, which comes in seven colors. Whether you are visiting by means of a desktop or mobile browser, you will notice that the hero section features a carousel of the various iMac colors, and when they rotate to the front, the name of the corresponding color will change and slide vertically in a manner reminiscent of one-armed bandits in Las Vegas.

A web designer recently brought to this attention of his peers on a popular online discussion forum, and she believed that it was a modification of the marquee HTML element, which Mozilla no longer recommends because it is being deprecated across many browsers; besides, the marquee element is mostly for horizontal scrolling, which may require excessive coding. There was also the possibility of importing the Slick carousel library from GitHub, but that would have been JavaScript overkill.

As usual, the best way to achieve this vertical sliding effects is to resort to CSS coding. If you search GitHub for slot machine text, you will get exactly what you need; plus, there are title slide and transition effects that can achieve this. If you really want to get fancy and technical, search for CSS-powered slot machines, but you will need to adjust your code in order to cover all iMac colors and all variations of browser viewport sizes. The slot machine effect is not responsive on its own; you have to look for certain libraries in order to complete your project.

In essence, you will be coding the following:

  • A carousel with text
  • A text slider
  • Customizing text slides
  • Using a carousel to control the text slides

Although you may think that it is easy to change the layout of a website when a smartphone is smaller than a laptop or a tablet, the truth is that it is quite difficult and it will only be possible through the right responsive web design library, where you will be able to design the website for one device, one size, and then make changes for other screen resolutions; this could very well be the most challenging aspect of your project. For more information click here https://v.redd.it/iaaotujprfe71.