58 lines
No EOL
1.3 KiB
HTML
58 lines
No EOL
1.3 KiB
HTML
<!DOCTYPE html>
|
|
<html class="notranslate" translate="no">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
|
|
|
|
<title style="display: none;">test</title>
|
|
</head>
|
|
|
|
<body>
|
|
<textarea id="text" rows="10" style="width: 100%;" onclick="">test</textarea>
|
|
<div id="shelf"></div>
|
|
</body>
|
|
|
|
</html>
|
|
|
|
<script>
|
|
setInterval(() => {
|
|
let kbHeight = window.innerHeight - window.visualViewport.height
|
|
kbHeight -= 1
|
|
|
|
document.getElementById('shelf').style.bottom = kbHeight + 'px'
|
|
// document.getElementById('text').style.height = (window.visualViewport.height - kbHeight) + 'px'
|
|
}, 10)
|
|
|
|
// function selectText() {
|
|
// // flash the textarea to stop ios from scrolling
|
|
// let textarea = document.querySelector('textarea')
|
|
// textarea.style.display = 'none'
|
|
// setTimeout(() => {
|
|
// textarea.style.display = 'block'
|
|
// // select the text
|
|
// textarea.select()
|
|
// }, 10)
|
|
// }
|
|
</script>
|
|
|
|
<style>
|
|
html, body {
|
|
overflow: hidden;
|
|
position: relative;
|
|
height: 100%;
|
|
box-sizing: border-box;
|
|
|
|
margin: 0;
|
|
padding: 0;
|
|
background-color: #79394f;
|
|
color: #fff;
|
|
font-family: sans-serif;
|
|
}
|
|
|
|
#shelf {
|
|
position: absolute;
|
|
width: 100%; height: 10px;
|
|
bottom: 0;
|
|
background-color: magenta;
|
|
}
|
|
</style> |