[javascript] ITRACE 6 per 7 moveme.js
Viewer
*** This page was generated with the meta tag "noindex, nofollow". This happened because you selected this option before saving or the system detected it as spam. This means that this page will never get into the search engines and the search bot will not crawl it. There is nothing to worry about, you can still share it with anyone.
- idx = 0;
- r = r();
- let f = newElement('input',{id:"f",type:'button',value:'Move Me!',style:`position:absolute;left:${r[0].split(",")[0]}px;top:${r[0].split(",")[1]}px`});
- let l = newElement('label',{id:"l",innerText:'Coba hitung sejak dari awal, berapa kali tombol berpindah?',style:'position:absolute;display:inline-block;width:100%;text-align:center;left:0;right:0;top:150px;margin:auto'});
- let a = newElement('input',{id:"a",type:'text',value:'0',style:'position:absolute;padding:5px;left:0;right:0;top:180px;margin:auto'});
- let g = newElement('input',{id:"g",type:"button",value:"Kirim Jawaban",style:'position:absolute;padding:5px;left:0;right:0;top:220px;margin:auto'});
- f.onmouseover = ()=>{
- let rndm = Math.floor(Math.random() * 100);
- eits(idx,rndm+idx);
- idx += rndm;
- }
- g.onclick = async ()=>{
- if(idx == '0') return xpopup({msg:"Gak gerak gak dihitung",btn:[{onclick:()=>{location.reload()}}]});
- if(idx >= r.length-1) return xpopup({msg:"Dijawab dong. Ulang ya!",btn:[{onclick:()=>{location.reload()}}]});
- kirim_jawaban();
- }
- oo("%body")[0].appendChild(f);
- oo("%body")[0].appendChild(l);
- oo("%body")[0].appendChild(a);
- oo("%body")[0].appendChild(g);
- function eits(m,n){
- if(m >= r.length-1) return xpopup({msg:"Telat. Ulang ya!",btn:[{onclick:()=>{location.reload()}}]});
- setTimeout(()=>{
- let x=r[m].split(",");
- oo("f").style = `position:absolute;left:${x[0]}px;top:${x[1]}px`;
- m++;
- if(m >= n) return false;
- return eits(m,n);
- },50);
- }
- async function kirim_jawaban(){
- let url = location.href;
- let data = {
- f:document.getElementById("f").style.left,
- l:document.getElementById("f").style.top,
- a:document.getElementById("a").value,
- g:0
- };
- let res = await post_nothing(url,data);
- let o = res.o;
- const p = {msg:o.errmsg}
- if(o.errno !== 0) p.btn = [{onclick:()=>{location.reload();}}]
- xpopup(p);
- }
Editor
You can edit this paste and save as new: