Skip to content

Commit

Permalink
apppush
Browse files Browse the repository at this point in the history
  • Loading branch information
kimkee committed Feb 12, 2025
1 parent f889342 commit c5e3625
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion static/extention/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const extention = {
this.bgs.init();

if(typeof window !== 'undefined') setTimeout(() => { this.iosx.init(); },50);

this.apppush.init();
document.querySelector("head")?.insertAdjacentHTML("beforeend",`<style>a,button,input { user-select: auto; touch-action: auto; -webkit-tap-highlight-color: initial; } button{cursor: pointer;} </style>`);
},
iosx:{
Expand Down Expand Up @@ -59,6 +59,29 @@ const extention = {
isImg.style.backgroundColor = "transparent";
}
},
apppush:{
init: function(){
location.pathname.includes('/webapp/mobile/images/push/') ? this.evt() : null;
},
evt: function(){
document.addEventListener("keydown", e => this.set(e) );
},
set: function(e){
const path = location.pathname;
const extn = path.split('.').pop();
const ppp = path.split(`.${extn}`)[0].slice(0,-2);
let num = parseInt( path.split(`.${extn}`)[0].slice(-2) );
const dgit = t => t < 10 ? "0"+t : t;
const gourl = url => location.href = location.href.replace(location.host, `${url}`);
const goimg = eee => location.href = `https://${location.host + ppp + dgit(num)}.${extn}`
switch (e.code) {
case 'ArrowUp' : gourl('image.lottecard.co.kr'); break;
case 'ArrowDown' : gourl('dimage.lottecard.co.kr'); break;
case 'ArrowRight' : goimg(num++); break;
case 'ArrowLeft' : goimg(num--); break;
}
}
},
param:(function(a) { // URL에서 파라미터 읽어오기 ui.param.***
if (a == "") return {};
var b = {};
Expand Down

0 comments on commit c5e3625

Please sign in to comment.