tungtap/index.html

218 lines
No EOL
5.6 KiB
HTML

<!DOCTYPE html>
<html class="notranslate" translate="no">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="interactive-widget=resizes-content, width=device-width, initial-scale=1.0, user-scalable=no">
<!-- <meta name="virtual-keyboard" content="resize-layout" /> future feature? -->
<meta name="google" content="notranslate" />
<link rel="apple-touch-icon" sizes="180x180" href="icons/tung.svg">
<link rel="icon" type="image/svg+xml" sizes="any" href="icons/tung.svg">
<link rel="manifest" href="manifest.webmanifest">
<meta name="description" content="Easily augment your system's keyboard">
<meta name="author" content="Ethan Merchant">
<title style="display: none;">tung-tap</title>
<link rel="stylesheet" href="style.css?v1">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="script.js"></script>
</head>
<body>
<dialog id="intro" style="
display: flex;
flex-direction: column;
align-items: center;
gap: 10px;
padding: 10px 32px;
padding-top: 20px;
background-color: rgb(var(--field));
border-width: 1px;
border-color: rgb(var(--txt));
border-radius: var(--key-radius);
font-size: 24px;
z-index: -1;
">
<!-- <div style="
display: flex;
flex-direction: row;
align-items: center;
gap: 10px;
">
<img src="icons/tung.png" style="
width: 32px; height: 32px;
transform: translateY(-5px) rotate(-5deg);
">
<img src="icons/tap.png" style="
width: 32px; height: 32px;
margin-right: -40px;
transform: translate(-32px, 7px) rotate(-45deg) scale(0.8);
">
</div> -->
<h1 style="font-weight: unset; font-size: 32px; line-height: 32px; margin: 0; color: rgb(var(--txt));">
tungtap<span style="font-size: 14px; letter-spacing: 1px;">.app</span>
</h1>
<p style="
font-size: 16px;
line-height: 24px;
margin: 0;
color: rgb(var(--txt));
text-align: center;
">
easily augment your<br>
system's keyboard
</p>
<img onclick="intro.close()" class="icon-btn" src="/icons/start.svg" style="
outline: 2px solid white;
outline-offset: 6px;
border-radius: 18px;
margin: 16px;
mix-blend-mode: difference;
">
<div style="
position: fixed;
top: 150px;
color: rgb(var(--txt));
">&nbsp; &nbsp; &nbsp; edit keys &nbsp; &nearrow;</div>
<div style="
position: fixed;
bottom: 150px;
color: rgb(var(--txt));
">&swarrow; &nbsp; tap keys &nbsp; &searrow;</div>
</dialog>
<div style="display: block; position: relative; background-color: white;">
<textarea hidden="true" id="tung" onclick="layout()" oninput="layout()" spellcheck="false" style="
user-select: text;
touch-action: none;
overflow: none;
white-space: pre;
width: 100%;
height: 100px;
padding: 10px;
font-family: 'DM Mono', monospace;
text-align: center;
font-size: 12px;
line-height: 20px;
background-color: #ff79a1;
color: #79394f;
/* display: none; */
"></textarea>
<div onclick="copyToClipboard('tung')" style="
cursor: pointer;
user-select: none;
position: absolute;
right: 10px;
bottom: 10px;
"><img class="icon-btn" src="icons/copy.svg" style="mix-blend-mode: difference;"></div>
</div>
<div style="
position: relative;
display: flex;
justify-content: space-between;
align-items: center;
width: 40px; height: 40px;
margin: 0 auto;
margin-right: 80px;
width: 100%;
/* background-color: #eb8bb3; */
background-color: #ff79a1c0;
color: white;
user-select: none;
line-height: 40px;
">
<img onclick="$('#nav').toggle()" class="icon-btn" src="icons/tungs.svg">
<div style="display: flex;">
<img onclick="intro.showModal()" class="icon-btn" src="icons/intro.svg">
<img onclick="TopToggle()" class="icon-btn" src="icons/tung.svg">
</div>
</div>
<div style="flex-grow: 1; overflow: hidden; position: relative; background-color: white;">
<!-- onclick="$('#text').focus()" -->
<textarea id="text" spellcheck="false" style="
user-select: text;
touch-action: pan-y;
overflow-y: scroll;
overscroll-behavior: contain;
white-space: pre-wrap;
display: block;
position: absolute;
top: 0; left: 0; right: 0; bottom: 0;
padding: 10px;
font-size: 14px;
line-height: 20px;
background-color: rgb(var(--field));
color: rgb(var(--txt));
/* padding-bottom: 600px; */
"></textarea>
<div onclick="copyToClipboard('text')" style="
cursor: pointer;
user-select: none;
position: absolute;
right: 10px;
bottom: 10px;
">
<img class="icon-btn" src="icons/copy.svg" style="mix-blend-mode: difference;">
</div>
</div>
<div id="nav" hidden="true"></div>
<div id="keyboard" onclick="text.focus()"></div>
<!-- safari disclaimer (centered vertically) -->
<div id="disclaimer" style="
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
height: 46px;
padding: 10px 20px;
background-color: #333;
color: white;
font-size: 12px;
line-height: 20px;
text-align: center;
opacity: 0.8;
z-index: 1000;
">
<p style="margin: 0;">
<span style="font-weight: bold;">Safari</span> is not supported yet.
<br>
Please use <span style="font-weight: bold;">Chrome</span> or <span style="font-weight: bold;">Firefox</span>.
</p>
</div>
</body>
</html>
<!--
TODO
migrate to textareas
contenteditable divs are a can of worms
esp. when it comes to conistent behaviour across devices
spellcheck toggle~
-->