You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey I am new to coding and don't really know what i'm doing I needed a wheel of names for my. project that i've been working on how exactly do I use this with raw html and css
The text was updated successfully, but these errors were encountered:
Welcome to the exciting world of coding, and I am glad I am responding to your first issue/question ever on github.
For writing code for a wheel of names, or wheel spinner, is not beginner level coding exercise. Also just using html and css you may not be able to do that, you will need Javascript at least.
The spinning a wheel has a lot of historical significance, however, for learning how to code, it is pretty much the same as having an array of names and random number generation.
A very simple example would be:
constnames=[];names.push('Alice');names.push('Bob');names.push('John');names.push('Jane');names.push('Tyler');constgetRandomName=(namesArray)=>{// Math.random() gives you a pseudo random floating point number between 0 and 1// because max value would be 1 from the random, we can multiple with our desired max value// to get a random number between 0 and our max value (max index of the array)constrandomNumber=Math.random()*(namesArray.length-1);returnnamesArray[Math.round(randomNumber)];};console.log(getRandomName(names));
Hey I am new to coding and don't really know what i'm doing I needed a wheel of names for my. project that i've been working on how exactly do I use this with raw html and css
The text was updated successfully, but these errors were encountered: