🆗 调整界面样式,放大操作按钮,增加清空按钮

This commit is contained in:
jimlee 2023-03-03 11:07:59 +08:00
parent aab0134c8e
commit 5929098f0b
8 changed files with 50 additions and 18 deletions

View File

@ -1,3 +1,3 @@
# temp-clipboard # temp-clipboard
临时粘贴板,支持文本和部分图片,由于带宽太低,目前体验不佳 临时粘贴板,支持文本和部分图片,直接浏览器复制图片过不了referer校验带宽如果比较低复制图片体验不佳

View File

@ -18,10 +18,11 @@
/* 输入框 */ /* 输入框 */
.dzm-textarea { .dzm-textarea {
padding: 5px; padding: 5px;
border: 1px solid red; width: 95%;
width: 98%; border: 1px solid #019aff;
border-radius: 3px; border-radius: 3px;
position: fixed; position: fixed;
height: 97%;
} }
/* 输入框为空时显示 placeholder */ /* 输入框为空时显示 placeholder */
@ -33,14 +34,15 @@
/* 输入框获取焦点时移除 placeholder */ /* 输入框获取焦点时移除 placeholder */
.dzm-textarea:focus:before { .dzm-textarea:focus:before {
content: none; content: none;
border: thick #019AFF;
} }
.textcopy { .textcopy {
position: fixed; position: fixed;
height: 40px; height: 100px;
width: 40px; width: 90px;
top: 50%; right: 5%;
right: 1%; bottom: 270px;
transform: translateX(-50%) translateY(-50%); transform: translateX(-50%) translateY(-50%);
} }
@ -48,7 +50,10 @@
.textcopy a:hover { .textcopy a:hover {
background: #01BCFF; background: #01BCFF;
margin: 5px; margin: 5px;
right: 10px; width: 60px;
height: 40px;
line-height: 1.3em;
font-size: 30px;
} }
.btn { .btn {
@ -68,6 +73,7 @@
<a class="btn float-buttons waves-effect waves-button waves-float" onclick="copyText()">复制</a> <a class="btn float-buttons waves-effect waves-button waves-float" onclick="copyText()">复制</a>
<a class="btn float-buttons waves-effect waves-button waves-float" onclick="pasteText()">粘贴</a> <a class="btn float-buttons waves-effect waves-button waves-float" onclick="pasteText()">粘贴</a>
<a class="btn float-buttons waves-effect waves-button waves-float" onclick="openUrl()">打开</a> <a class="btn float-buttons waves-effect waves-button waves-float" onclick="openUrl()">打开</a>
<a class="btn float-buttons waves-effect waves-button waves-float" onclick="clearText()">清除</a>
</div> </div>
<script> <script>
@ -175,6 +181,10 @@
textarea.innerText = text textarea.innerText = text
}) })
} }
function clearText() {
textarea.innerText = ""
}
// //
// function appendText() { // function appendText() {
// navigator.clipboard.readText() // navigator.clipboard.readText()
@ -184,7 +194,13 @@
// } // }
function openUrl() { function openUrl() {
window.open(textarea.innerText) let url = textarea.innerText;
if (url.startsWith("http:")) {
window.open(url)
} else {
window.open("https://" + url)
}
} }
let lastUpdate = null let lastUpdate = null

View File

@ -18,10 +18,11 @@
/* 输入框 */ /* 输入框 */
.dzm-textarea { .dzm-textarea {
padding: 5px; padding: 5px;
border: 1px solid red; width: 95%;
width: 98%; border: 1px solid #019aff;
border-radius: 3px; border-radius: 3px;
position: fixed; position: fixed;
height: 97%;
} }
/* 输入框为空时显示 placeholder */ /* 输入框为空时显示 placeholder */
@ -33,14 +34,15 @@
/* 输入框获取焦点时移除 placeholder */ /* 输入框获取焦点时移除 placeholder */
.dzm-textarea:focus:before { .dzm-textarea:focus:before {
content: none; content: none;
border: thick #019AFF;
} }
.textcopy { .textcopy {
position: fixed; position: fixed;
height: 40px; height: 100px;
width: 40px; width: 90px;
top: 50%; right: 5%;
right: 1%; bottom: 270px;
transform: translateX(-50%) translateY(-50%); transform: translateX(-50%) translateY(-50%);
} }
@ -48,7 +50,10 @@
.textcopy a:hover { .textcopy a:hover {
background: #01BCFF; background: #01BCFF;
margin: 5px; margin: 5px;
right: 10px; width: 60px;
height: 40px;
line-height: 1.3em;
font-size: 30px;
} }
.btn { .btn {
@ -68,6 +73,7 @@
<a class="btn float-buttons waves-effect waves-button waves-float" onclick="copyText()">复制</a> <a class="btn float-buttons waves-effect waves-button waves-float" onclick="copyText()">复制</a>
<a class="btn float-buttons waves-effect waves-button waves-float" onclick="pasteText()">粘贴</a> <a class="btn float-buttons waves-effect waves-button waves-float" onclick="pasteText()">粘贴</a>
<a class="btn float-buttons waves-effect waves-button waves-float" onclick="openUrl()">打开</a> <a class="btn float-buttons waves-effect waves-button waves-float" onclick="openUrl()">打开</a>
<a class="btn float-buttons waves-effect waves-button waves-float" onclick="clearText()">清除</a>
</div> </div>
<script> <script>
@ -175,6 +181,10 @@
textarea.innerText = text textarea.innerText = text
}) })
} }
function clearText() {
textarea.innerText = ""
}
// //
// function appendText() { // function appendText() {
// navigator.clipboard.readText() // navigator.clipboard.readText()
@ -184,7 +194,13 @@
// } // }
function openUrl() { function openUrl() {
window.open(textarea.innerText) let url = textarea.innerText;
if (url.startsWith("http:")) {
window.open(url)
} else {
window.open("https://" + url)
}
} }
let lastUpdate = null let lastUpdate = null

View File

@ -1,2 +1,2 @@
mvn clean package -DskipTests=true mvn clean package -DskipTests=true
scp target/temp-clipboard-1.0-SNAPSHOT-executable.jar sweetless@47.102.204.44:~/clipboard/ scp target/temp-clipboard-1.0-SNAPSHOT-executable.jar root@iloli.vip:~/clipboard/