替换发送为图标

This commit is contained in:
2024-03-08 14:04:12 +08:00
parent 03e19fbf58
commit c3c0a37a41
2 changed files with 20 additions and 6 deletions

13
public/send.svg Normal file
View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg fill="#000000" height="800px" width="800px" version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
viewBox="0 0 495.003 495.003" xml:space="preserve">
<g id="XMLID_51_">
<path id="XMLID_53_" d="M164.711,456.687c0,2.966,1.647,5.686,4.266,7.072c2.617,1.385,5.799,1.207,8.245-0.468l55.09-37.616
l-67.6-32.22V456.687z"/>
<path id="XMLID_52_" d="M492.431,32.443c-1.513-1.395-3.466-2.125-5.44-2.125c-1.19,0-2.377,0.264-3.5,0.816L7.905,264.422
c-4.861,2.389-7.937,7.353-7.904,12.783c0.033,5.423,3.161,10.353,8.057,12.689l125.342,59.724l250.62-205.99L164.455,364.414
l156.145,74.4c1.918,0.919,4.012,1.376,6.084,1.376c1.768,0,3.519-0.322,5.186-0.977c3.637-1.438,6.527-4.318,7.97-7.956
L494.436,41.257C495.66,38.188,494.862,34.679,492.431,32.443z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 973 B

View File

@ -41,6 +41,7 @@ export default class Chat {
boxShadow: '0 0 1rem #eee', boxShadow: '0 0 1rem #eee',
border: 'none', border: 'none',
outline: 'none', outline: 'none',
borderRadius: '2rem'
}, },
onkeydown: event => { onkeydown: event => {
event.stopPropagation() event.stopPropagation()
@ -79,7 +80,6 @@ export default class Chat {
} }
}), }),
Button({ Button({
textContent: '发送(Enter)',
onclick: event => { onclick: event => {
const text = event.target.previousSibling.value.trim() const text = event.target.previousSibling.value.trim()
if (text) { if (text) {
@ -88,10 +88,11 @@ export default class Chat {
} }
}, },
style: { style: {
padding: '.5rem 1rem', width: '1.2rem',
boxSizing: 'border-box', height: '1.2rem',
boxShadow: '0 0 1rem #eee', border: 'none',
borderRadius: '1rem', background: 'url("/send.svg") no-repeat center / cover',
margin: 'auto 0 auto -2.6rem'
} }
}), }),
] ]
@ -311,7 +312,7 @@ export default class Chat {
maxWidth: '24rem', maxWidth: '24rem',
borderRadius: '1rem', borderRadius: '1rem',
listStyle: 'none', listStyle: 'none',
backgroundColor : 'rgba(255,255,255,.9)', backgroundColor: 'rgba(255,255,255,.9)',
}, },
children: [ children: [
createElement({ createElement({