WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit ba01bfd

Browse files
committed
Fixing function names
1 parent 59ebcc0 commit ba01bfd

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/js/main.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ let lastNameBox = document.getElementById("lastNameBox");
99
* Clicks and clacks
1010
*/
1111
spinner.addEventListener('click', () => {
12-
spin(firstNameBox, lastNameBox);
12+
spinForNames(firstNameBox, lastNameBox);
1313
});
1414

1515
spinner.addEventListener('touchstart', () => {
@@ -21,11 +21,11 @@ spinner.addEventListener('touchcancel', () => {
2121
});
2222

2323
/**
24-
* spin: executes logic to populate the input fields on click of the spinner button
24+
* spinForNames: executes logic to populate the input fields on click of the spinner button
2525
* @param {HTMLInputElement} firstBox - firstNameBox text input from document
2626
* @param {HTMLInputElement} lastBox - lastNameBox text input from document
2727
*/
28-
function spin(firstBox, lastBox) {
28+
function spinForNames(firstBox, lastBox) {
2929
// Grab names
3030
firstName = firstNames[Math.floor(Math.random() * Object.keys(firstNames).length)];
3131
lastName = lastNames[Math.floor(Math.random() * Object.keys(lastNames).length)];
@@ -36,9 +36,12 @@ function spin(firstBox, lastBox) {
3636
}
3737

3838
function spinUp() {
39-
spinner.style.transform = 'rotate(180deg)';
39+
spinner.style.transform = 'rotate(180deg)';ß
4040
}
4141

42+
/**
43+
* spinOut: executes a spin affect by transforming the element's CSS inline to rotate
44+
*/
4245
function spinOut() {
4346
spinner.style.transform = 'rotate(0)';
4447
spinner.style.transition = 'transform 0.3s';

0 commit comments

Comments
 (0)