<tr><th>Date</th><td><timedatetime="2020-08-08">8 August 2020</time></td></tr>
</tbody>
</table>
</aside>
<p>I was browsing on the Web when suddenly an advertisement showed up and vibrate my phone. I was confused for a second because it said that there is a virus inside my phone. Knowing that it is an advertisement, I ignored that. But, I did not know that you can vibrate your device from Web!</p>
<p>This was created to demonstrate <ahref="https://developer.mozilla.org/docs/Web/API/Vibration_API"target="_blank"rel="noopener">Web Vibration API</a>. It consists of a function, <code>navigator.vibrate()</code>, to do vibration for some amount of time.</p>
<p>Since the API only allows to vibrate for a finite amount of time, a timer is scheduled to re-vibrate the device (using <code>setTimeout()</code> function). To prevent gap between vibration, the length of each vibration is doubled. It is fine because the <code>vibrate()</code> function will reset the duration.</p>
<p><spanclass="italic">Try different vibration cycle</span></p>
<p><ahref="bare/vibration_test.html"target="_blank">open in new window</a></p>