Lab #15 was called "Clock + Drums". In this lab, I created a website that allowed the user to play sound effects in a drum-kit using the keys on their keyboard (A, S, D, F, G, H, J, K, and L). On this page, the user can also see a clock made using javascript that keeps track of the actual time (realtime updates).

In order to successfully create these two mechanics within one page, it required much CSS and lots of JavaScript. To explain the drums briefly, in the HTML, I stored different drum audio (the sound effects) in each key that was associated with it. Then in the JavaScript, I had created the function that would play the audio file that was associated with that key. Moving on to the clock, there was more CSS and JavaScript to it then HTML. In the HTML aspect of the page, I had created many divs to store properties like the clock itself, the clock's face, hour hand, second hand, and minute hand. In addition, I used CSS to shape the div into a circle by giving it a border-radius of 50% and made the three hands of the clock into rectangles. After that, using JavaScript, I syncronized the real-time with the clock using the setDate function while syncing the hands to calculate when seconds, minutes and hours passed in order to make the clock functional.
A web designer would need to know how to create these kind of functioning mechanics to enhance the user experience on their website. Usually, the time is shown on the bottom right of every computer, but to make it more satisfying for the user, having an on-screen clock can be very beneficial. Also for users to be able to interact with their keys to play certain sounds can open up opportunities for users to simulate real-world instruments and open creativity. For example, instead of a drum-kit, a web designer can make a piano set that can allow pianists to practice without having a physical piano in front of them.
Comments
Post a Comment