-
Notifications
You must be signed in to change notification settings - Fork 2
/
insert.html
13 lines (13 loc) · 1.28 KB
/
insert.html
1
2
3
4
5
6
7
8
9
10
11
12
13
<!DOCTYPE html>
<html>
<script>var url="https://vscode.dev";var appName="Open VSCode";</script>
<body>
<div id=mainContainer>
<span id=titleText></span>
<br />
<button id=openBtn class=grow>Launch</button>
</div>
<script>if(url){var win;var titleText=document.getElementById("titleText");titleText.textContent="Press Button to Launch "+appName;document.getElementById("mainContainer").style.display="block";document.getElementById("openBtn").onclick=function(){if(win){win.focus()}else{win=window.open();win.document.body.style.margin="0";win.document.body.style.height="100vh";var b=win.document.createElement("iframe");b.style.border="none";b.style.width="100%";b.style.height="100%";b.style.margin="0";b.src=url;win.document.body.appendChild(b);var a=setInterval(function(){if(win.closed){clearInterval(a);win=undefined;titleText.textContent=appName+" closed. Click button to reopen."}},500);titleText.textContent=appName+" is running. Click the button to switch to that tab."}}};</script>
<style>*{color:white;font-family:arial;text-align:center;margin:10px}#openBtn{width:220px;height:40px;border-radius:12px;background-color:#ab6afb;font-family:Arial,Helvetica,sans-serif;border:0;transition:all 250ms ease-in-out}#openBtn:hover{filter:brightness(125%);transform:scale(1.1)}</style>
</body>
</html>