Skip to content

Instantly share code, notes, and snippets.

@tokyosheep
Last active July 7, 2019 22:47
Show Gist options
  • Select an option

  • Save tokyosheep/a46e6e22192c982aa8670c01facc99d1 to your computer and use it in GitHub Desktop.

Select an option

Save tokyosheep/a46e6e22192c982aa8670c01facc99d1 to your computer and use it in GitHub Desktop.
window.onload = ()=>{
`use strict`;
const csInterface = new CSInterface();
themeManager.init();
const btn_test = document.getElementById(`btn_test`);
const loading = document.getElementById(`loading`);
btn_test.addEventListener(`click`,saveJpegs);
async function saveJpegs(){
loading.style.display = `block`;
await adjustTime();//ロード画面を表示させるため少し間を空ける
csInterface.evalScript(`saveJpeg()`,(result)=>{
console.log(result);
loading.style.display = `none`;
});//メインjsxの関数を呼び出す
}
function adjustTime(){
return new Promise(resolve=>{
setTimeout(()=>{
resolve();
},100);
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment