This repository has been archived on 2023-08-30. You can view files and clone it, but cannot push or open issues/pull-requests.
bytedo
/
wcui
Archived
1
0
Fork 0
old
yutent 2022-06-27 14:34:33 +08:00
parent 990d7a7dd2
commit 973fac0975
3 changed files with 23 additions and 19 deletions

View File

@ -56,9 +56,9 @@ code, pre, samp {font-family: Menlo, Monaco, Consolas, 'Courier New', monospace;
--color-blue-3: rgb(33, 150, 243);
/* danger */
--color-red-a: rgba(252, 118, 97, 0.35);
--color-red-1: rgb(252, 118, 97);
--color-red-2: rgb(255, 95, 69);
--color-red-3: rgb(243, 62, 34);
--color-red-1: #fc7661;
--color-red-2: #ff5f45;
--color-red-3: #f33e22;
/* warning */
--color-orange-a: rgba(254, 174, 117, 0.35);
--color-orange-1: #feae75;

View File

@ -303,14 +303,17 @@ const DEFAULT_TOOLS = [
]
function renderToolbar(list) {
return (list || DEFAULT_TOOLS)
return (
(list || DEFAULT_TOOLS)
.map(
it =>
`<span data-act="${it}"><svg class="icon" viewBox="0 0 1024 1024"><path d="${
ICONS[it]
}"/></svg>${it === 'image' ? '<input type="file">' : ''}</span>`
)
.join('')
.join('') +
`<span data-act="copy"><svg class="icon" viewBox="0 0 1024 1024"><path d="${ICONS.copy}"/></svg></span>`
)
}
export default class Editor {
@ -512,6 +515,10 @@ export default class Editor {
// 这里不作任何处理
break
case 'copy':
navigator.clipboard.writeText(this.value)
break
default:
this.__EDITOR__.focus()
this.restoreSelection()

View File

@ -5,18 +5,15 @@
*/
export default {
font:
'M123.68639053 456.52662723l332.84023669 0 0 110.94674556-110.94674556 0 0 332.84023669-110.94674557 0 0-332.84023669-110.94674556 0zM900.31360947 234.6331361l-218.20118344 0 0 665.68047338-118.31360947 0 0-665.68047338-218.20118342 0 0-110.94674556 554.7337278 0z',
font: 'M123.68639053 456.52662723l332.84023669 0 0 110.94674556-110.94674556 0 0 332.84023669-110.94674557 0 0-332.84023669-110.94674556 0zM900.31360947 234.6331361l-218.20118344 0 0 665.68047338-118.31360947 0 0-665.68047338-218.20118342 0 0-110.94674556 554.7337278 0z',
color:
'M470.975 137l-214.462 562.5h102l44.513-131.25h217.949l48.038 131.25h102.002l-214.501-562.5h-85.5zM512 256.55l78.525 233.175h-160.538l82.013-233.212zM212 774.5v112.5h599.999v-112.5h-599.999z',
bold:
'M584.81777778 724.57443555H414.91000889v-145.63555556H584.81777778c40.29212445 0 72.81777778 32.52565333 72.81777777 72.81777778 0 40.29326222-32.52565333 72.81777778-72.81777777 72.81777778m-169.90776889-436.90666667h145.63555556c40.29212445 0 72.81777778 32.52565333 72.81777777 72.81777778 0 40.29326222-32.52565333 72.81777778-72.81777777 72.81777778h-145.63555556m271.85265778 62.62328889C733.85187555 462.91626666 766.86222222 409.03111111 766.86222222 360.48554666c0-109.71136-84.95445333-194.17998222-194.18112-194.17998222H269.27445333V845.93777777H611.03217778c101.94488889 0 180.10225778-82.52643555 180.10225777-183.98663111 0-73.78830222-41.74848-136.89742222-104.37176888-166.02453333z',
copy: 'M646.4 960H243.2C182.9 960 128 903.8 128 842.1V291.9c0-29.4 11.8-59 32.5-81.3 21.4-23.1 49.2-35.8 78.4-35.8l23.9-0.6c0.3-29 12.6-56.6 34.7-77.7C319.2 75.9 348.4 64 377.6 64c3.2 0 319.3 0.9 322.6 0.9h3.4L896 289.6v442.5c0 61.7-54.9 117.9-115.1 117.9l-19.3-0.2c-0.2 29.2-12.5 56.8-34.9 78-21.8 20.4-51 32.2-80.3 32.2zM240.6 232.3c-23.3 0-56.6 35.1-56.6 59.6v550.2c0 10.9 8.1 26.2 20.6 39.1 12.8 13.2 27.6 21.4 38.6 21.4h403.3c19.1 0 44.5-25.7 46.3-52.9l-315.2 0.3c-60.3 0-115.2-56.2-115.2-117.9V231.7l-21.8 0.6z m124-110.9c-22.9 0-46.2 35.2-46.2 60.5v550.2c0 25.3 23.3 60.5 46.2 60.5h416.3c11 0 25.8-8.2 38.6-21.4 12.5-12.9 20.6-28.3 20.6-39.1V341.5h-86c-61.1 0-102.2-41.7-102.2-103.9 0-0.5-0.4-56.4 0-116.2H364.6z m335.6 536.3h-242c-19 0-34.5-15.9-34.5-35.3 0-19.5 15.5-35.3 34.5-35.3h242c19 0 34.5 15.9 34.5 35.3s-15.5 35.3-34.5 35.3z m0-137.4h-242c-19 0-34.5-15.9-34.5-35.3 0-19.5 15.5-35.3 34.5-35.3h242c19 0 34.5 15.9 34.5 35.3s-15.5 35.3-34.5 35.3z m7.6-310.2c0 26.1 23.7 74.6 46.2 74.6h64.3L707.8 149.2v60.9z',
bold: 'M584.81777778 724.57443555H414.91000889v-145.63555556H584.81777778c40.29212445 0 72.81777778 32.52565333 72.81777777 72.81777778 0 40.29326222-32.52565333 72.81777778-72.81777777 72.81777778m-169.90776889-436.90666667h145.63555556c40.29212445 0 72.81777778 32.52565333 72.81777777 72.81777778 0 40.29326222-32.52565333 72.81777778-72.81777777 72.81777778h-145.63555556m271.85265778 62.62328889C733.85187555 462.91626666 766.86222222 409.03111111 766.86222222 360.48554666c0-109.71136-84.95445333-194.17998222-194.18112-194.17998222H269.27445333V845.93777777H611.03217778c101.94488889 0 180.10225778-82.52643555 180.10225777-183.98663111 0-73.78830222-41.74848-136.89742222-104.37176888-166.02453333z',
image:
'M552.0003125 392h219.999375L552.0003125 171.9996875V392M272 111.9996875h319.9996875l240 240v480c0 44.000625-36 80.000625-79.9996875 80.000625H272c-44.4 0-79.9996875-36-79.9996875-80.000625V192.0003125A79.723125 79.723125 0 0 1 272 111.9996875m0 720h480V512L591.9996875 672.0003125 512 591.9996875l-240 240M351.9996875 392C308 392 272 428 272 471.9996875c0 44.000625 36 80.000625 79.9996875 80.000625 44.000625 0 80.000625-36 80.000625-80.000625 0-43.9996875-36-79.9996875-80.000625-79.9996875z',
left:
'M128 128h768v85.333H128V128m0 170.667h512V384H128v-85.333m0 170.666h768v85.334H128v-85.334M128 640h512v85.333H128V640m0 170.667h768V896H128v-85.333z',
link:
'M879.2 131.6c-103-95.5-264.1-88-361.4 11.2L474.7 184c-13.1 13.1-3.7 35.6 13.1 37.5 26.2 1.9 52.4 7.5 78.7 15 7.5 1.9 16.9 0 22.5-5.6l9.4-9.4c54.3-54.3 142.3-59.9 198.5-11.2 63.7 54.3 65.5 151.7 7.5 209.7L662 562.3c-18.7 18.7-41.2 30-63.7 37.5-30 7.5-61.8 5.6-89.9-5.6-16.9-7.5-33.7-16.9-48.7-31.8-7.5-7.5-13.1-15-18.7-24.3-7.5-13.1-24.3-15-33.7-3.7l-52.4 52.4c-7.5 7.5-7.5 18.7-1.9 28.1 7.5 11.2 16.9 20.6 26.2 30 13.1 13.1 30 26.2 44.9 35.6 26.2 16.9 56.2 28.1 86.1 33.7 58.1 11.2 121.7 1.9 174.2-26.2 20.6-11.2 41.2-26.2 58.1-43.1l142.3-142.3c104.9-103.2 101.2-271.8-5.6-371zM534.7 803.9l-39.3-5.6s-26.2-5.6-39.3-11.2c-7.5-1.9-16.9 0-22.5 5.6l-9.4 9.4c-54.3 54.3-142.3 59.9-198.5 11.2-63.7-54.3-65.5-151.7-7.5-209.7l142.3-142.3c18.7-18.7 41.2-30 63.7-37.5 30-7.5 61.8-5.6 89.9 5.6 16.9 7.5 33.7 16.9 48.7 31.8 7.5 7.5 13.1 15 18.7 24.3 7.5 13.1 24.3 15 33.7 3.7l52.4-52.4c7.5-7.5 7.5-18.7 1.9-28.1-7.5-11.2-16.9-20.6-26.2-30-13.1-13.1-28.1-26.2-44.9-35.6-26.2-16.9-56.2-28.1-88-33.7-58.1-11.2-121.7-1.9-174.2 26.2-20.6 11.2-41.2 26.2-58.1 43.1L141.4 515.5c-99.3 99.3-106.7 260.3-11.2 361.4C229.5 985.5 398 987.4 501 884.4l46.8-46.8c13.1-9.4 3.7-31.9-13.1-33.7z',
left: 'M128 128h768v85.333H128V128m0 170.667h512V384H128v-85.333m0 170.666h768v85.334H128v-85.334M128 640h512v85.333H128V640m0 170.667h768V896H128v-85.333z',
link: 'M879.2 131.6c-103-95.5-264.1-88-361.4 11.2L474.7 184c-13.1 13.1-3.7 35.6 13.1 37.5 26.2 1.9 52.4 7.5 78.7 15 7.5 1.9 16.9 0 22.5-5.6l9.4-9.4c54.3-54.3 142.3-59.9 198.5-11.2 63.7 54.3 65.5 151.7 7.5 209.7L662 562.3c-18.7 18.7-41.2 30-63.7 37.5-30 7.5-61.8 5.6-89.9-5.6-16.9-7.5-33.7-16.9-48.7-31.8-7.5-7.5-13.1-15-18.7-24.3-7.5-13.1-24.3-15-33.7-3.7l-52.4 52.4c-7.5 7.5-7.5 18.7-1.9 28.1 7.5 11.2 16.9 20.6 26.2 30 13.1 13.1 30 26.2 44.9 35.6 26.2 16.9 56.2 28.1 86.1 33.7 58.1 11.2 121.7 1.9 174.2-26.2 20.6-11.2 41.2-26.2 58.1-43.1l142.3-142.3c104.9-103.2 101.2-271.8-5.6-371zM534.7 803.9l-39.3-5.6s-26.2-5.6-39.3-11.2c-7.5-1.9-16.9 0-22.5 5.6l-9.4 9.4c-54.3 54.3-142.3 59.9-198.5 11.2-63.7-54.3-65.5-151.7-7.5-209.7l142.3-142.3c18.7-18.7 41.2-30 63.7-37.5 30-7.5 61.8-5.6 89.9 5.6 16.9 7.5 33.7 16.9 48.7 31.8 7.5 7.5 13.1 15 18.7 24.3 7.5 13.1 24.3 15 33.7 3.7l52.4-52.4c7.5-7.5 7.5-18.7 1.9-28.1-7.5-11.2-16.9-20.6-26.2-30-13.1-13.1-28.1-26.2-44.9-35.6-26.2-16.9-56.2-28.1-88-33.7-58.1-11.2-121.7-1.9-174.2 26.2-20.6 11.2-41.2 26.2-58.1 43.1L141.4 515.5c-99.3 99.3-106.7 260.3-11.2 361.4C229.5 985.5 398 987.4 501 884.4l46.8-46.8c13.1-9.4 3.7-31.9-13.1-33.7z',
ordered:
'M298.667 554.667H896v-85.334H298.667m0 341.334H896v-85.334H298.667m0-426.666H896v-85.334H298.667m-213.334 256h76.8l-76.8 89.6v38.4h128v-42.666h-76.8l76.8-89.6v-38.4h-128M128 341.333h42.667V170.667H85.333v42.666H128m-42.667 512h85.334v21.334H128v42.666h42.667v21.334H85.333v42.666h128V682.667h-128v42.666z',
italic: