Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $.ajaxSetup(
- {
- headers:
- {
- 'X-CSRF-TOKEN':$('meta[name="csrf-token"]').attr('content')
- }
- }
- );
- $(function()
- {
- var point=337001;
- var pointx=337001;
- $(".button-finger").bind("tap touchstart",function(e)
- {
- ga('send','event','Shake','ShakeButton');
- $('#timer').timer(
- {
- duration:'5s',callback:function()
- {
- eventPost(e)
- }
- }
- );
- $('.icon-hand').addClass('shake');
- tapHandler();
- eventTime()
- }
- );
- function tapHandler(event)
- {
- $.shake(
- {
- violence:3.0,hf:0.2,shakethreshold:5,debounce:100,callback:function()
- {
- point++;
- var pengali='1';
- $('#point').text(point*parseInt(pengali));
- if(point<2000)
- {
- $(".scroll").css("margin-bottom",(0-point)+"px");
- $(".bar-bottom").css("margin-top",(0+point)+"px")
- }
- $('#timer').timer('reset')
- }
- }
- )
- }
- $(".button-finger").bind('touchend',function(event,ui)
- {
- eventPost()
- }
- );
- function eventPost()
- {
- $('.icon-hand').removeClass('shake');
- var pengali='1';
- $.post("/detect-result-mid",
- {
- point:(point*parseInt(pengali)),points:pointx
- }
- ).success(function(data)
- {
- $(location).attr('href','/result')
- }
- )
- }
- function eventTime()
- {
- $.get("/detect-result-mids",
- {
- }
- ).success(function(data)
- {
- pointx=data
- }
- )
- }
- }
- );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement