+ 1

Custom Cursor

Okay so i did this yesterday and it worked but not i forgot how to do it, sad. That rotating box is supposed to be the cursor. Its also giving me an error but i dont get it https://code.sololearn.com/WlQ3Ol8OeE2z

16th Jun 2022, 12:50 AM
Junior
Junior - avatar
36 Answers
+ 3
This leaves some good lessons, which I recommend you keep: 1. Always document your code. Everyone forgets the reasoning behind code written a while ago. Documenting protects you from that, and also allows others to understand and help. 2. Think first logic, then code. This makes the difference between improving the code and getting lost in it. With the logic clear in your mind, you can mantain it and also explain it to whoever can contribute. 3. Make communication clear and straight. We can't read each other minds, so we have to tell each other what we think. That said, I can't understand your last questions.
16th Jun 2022, 4:04 AM
Emerson Prado
Emerson Prado - avatar
+ 1
Your move function takes one argument, but is called with zero arguments. What was this object "mouse" supposed to be?
16th Jun 2022, 1:08 AM
Emerson Prado
Emerson Prado - avatar
+ 1
Your Mom I refer to the code. The function asks for an argument. What should it contain?
16th Jun 2022, 1:54 AM
Emerson Prado
Emerson Prado - avatar
+ 1
But it's your code... What did you intend with the argument?
16th Jun 2022, 2:29 AM
Emerson Prado
Emerson Prado - avatar
0
it was supposed to move the mouse
16th Jun 2022, 1:41 AM
Junior
Junior - avatar
0
idk what it should contain? do u know? It should contain something in those 2 documents somethin to make that mouse move but idk what that somethin is
16th Jun 2022, 1:57 AM
Junior
Junior - avatar
0
i dont think the mouse object is going to work
16th Jun 2022, 1:58 AM
Junior
Junior - avatar
0
i was trying to remeber what i did yesterday cus it worked but now i forgot. i wanted that argument to help me move the cursor
16th Jun 2022, 2:31 AM
Junior
Junior - avatar
0
Okay so i got it working now, but 3 things. My :active is not working and when it does work my transform: scale(.9); is somehow growing?? and resetting. also my @keyframes spin2 is not working
16th Jun 2022, 3:33 AM
Junior
Junior - avatar
0
thanks. (first problem) so basically my css cursor:active i did transform: scale(.9); when i run the code and press down on my mouse or keypad u can see a change and that change is my @keyframes stopping even though i have animation @keyframes in my css :active (second problem). And when u hold down ur mouse for maybe like 10 seonds or so u can see that my cursor is kind of like growing. (third problem) In javascript where u see .style.left = mouse.clientX - 0and .style.top = mouse.clientY - 0. this piece of code makes it so i cant use my css :active and it wont work u have to spam. u can try the code yourself and see the bugs. also that same piece of javascript code when u does mouse.clientX = 20px and mouse.clientY = 20px. the css :active does work which makes no sense to me
16th Jun 2022, 4:13 AM
Junior
Junior - avatar
16th Jun 2022, 1:27 PM
Junior
Junior - avatar
19th Jun 2022, 8:14 PM
Junior
Junior - avatar
0
Sorry, I'm struggling a lot to understand your question. What I got is the parts about the cursor stopping and growing. I ran the code a couple times but neither happened. I'll try on a computer to see if I can reproduce. Let's break the problem in parts, starting by the first. 1. What is the relationship between the scale property, keyframes and the animation? 2. In which system did you see the stopping problem? Was it in Code Playground?
19th Jun 2022, 11:06 PM
Emerson Prado
Emerson Prado - avatar
0
Yes, i am using code playground. The scale :active property will on work on a computer btw. I dont really understand you question “1” where is says whats the relationship between the scale property.
19th Jun 2022, 11:07 PM
Junior
Junior - avatar
0
Your Mom I probably got everything wrong about the problem. I tested in a computer too, in Firefox, and didn't see the problem. Even pasted the code in HTML, CSS and JS, and everything passed. Let's try to set it straight: 1. Pls describe problem 1, in a concise way, without elements not related. 2. Pls describe the system where you saw the problem occur.
20th Jun 2022, 1:00 AM
Emerson Prado
Emerson Prado - avatar
0
theres no error. Its working just not how i intended it to. What do u mean by system?? I cant really make it any simpler by just saying hold down ur mouse and wait. u will see a change in the cursor
20th Jun 2022, 5:32 PM
Junior
Junior - avatar
0
System would be wherever you run the app in. For example, I ran in an Android phone and in Firefox, in a Linux notebook. Maybe versions and so on until we spot a relevant difference. Anyway, I really won't be able to help you. I can't reproduce the problem neither understand what triggers it.
21st Jun 2022, 1:55 AM
Emerson Prado
Emerson Prado - avatar
0
Well i ran it on laptop in google. And in app on my phone. i can try to run it on firefox
21st Jun 2022, 2:11 AM
Junior
Junior - avatar
0
Okay, so finally i tried it on firefox. I see what u mean now. can u try my code on google?
24th Jun 2022, 9:38 PM
Junior
Junior - avatar
0
Google Chrome? What's the version you're running? What's your operating system?
24th Jun 2022, 10:17 PM
Emerson Prado
Emerson Prado - avatar