+ 3

Is there any API for shaking in js??

9th Mar 2018, 2:26 PM
Sina
Sina - avatar
11 Réponses
+ 6
Instead of deleting the original thread you created for this same question, you could have just edited the title/description. The resources that I took the time to seek out for you contained exactly what you're asking for, so it's kind of annoying that you deleted the thread and asked the same question when resources were already given to you for this. Anyways, best of luck to you! Google is an amazing tool.
9th Mar 2018, 2:42 PM
Fata1 Err0r
Fata1 Err0r - avatar
+ 6
Fair enough. Lets get the misunderstanding taken care of first then and I'll poke around further for you. When you say shaking, are you trying to detect when a user shakes their phone? Are you trying to make their screen have a "shake" effect? etc.. If you wouldn't mind further explaining exactly what you're trying to accomplish, I'll be more than happy to do what I can further on my end for you.
9th Mar 2018, 2:47 PM
Fata1 Err0r
Fata1 Err0r - avatar
+ 6
You want an event to be triggered when a person shakes his phone sideways? you'll have to know about . window.addEventListener("'devicemotion"); https://code.sololearn.com/Wh2kR2rMg69I/?ref=app
9th Mar 2018, 3:27 PM
᠌᠌Code X
᠌᠌Code X - avatar
+ 5
When you look at those API links, it may help to see what the sensor output looks like (just for the visualization, since the code isn't the shake API you're seeking). The red line is the raw data (the other two colors average the last 10 and 100 readings): https://code.sololearn.com/WanUHKGqxs5r/?ref=app
9th Mar 2018, 11:05 PM
Kirk Schafer
Kirk Schafer - avatar
+ 4
It is only for vibration. If the vibration means your shake shake thing.😂😁 https://www.sololearn.com/learn/888/?ref=app
9th Mar 2018, 2:59 PM
Akash Pal
Akash Pal - avatar
+ 2
I am so sorry for that but that links was not for shaking
9th Mar 2018, 2:44 PM
Sina
Sina - avatar
+ 2
I mean when a person shake's his/her phone
9th Mar 2018, 2:49 PM
Sina
Sina - avatar
+ 2
can use ondevicemotion , or ondeviceorientation to help detect that shake . https://code.sololearn.com/WA62p23avXtm/?ref=app https://code.sololearn.com/WDB8e5nNlZe9/?ref=app
9th Mar 2018, 11:57 PM
Morpheus
Morpheus - avatar
+ 1
Thanks all
10th Mar 2018, 11:58 AM
Sina
Sina - avatar
- 1
Can you make a simple example plz
9th Mar 2018, 5:20 PM
Sina
Sina - avatar