diff --git a/src/App.vue b/src/App.vue index ffc0bc9..5c0b486 100644 --- a/src/App.vue +++ b/src/App.vue @@ -6,36 +6,38 @@ diff --git a/src/assets/less/app.less b/src/assets/less/app.less index 6e8ae4b..cf42a19 100644 --- a/src/assets/less/app.less +++ b/src/assets/less/app.less @@ -1,14 +1,14 @@ -@import './code-theme.less'; +@import "./code-theme.less"; * { - box-sizing: border-box; - margin: 0; - padding: 0; + box-sizing: border-box; + margin: 0; + padding: 0; } input, button, textarea { - font-family: inherit; + font-family: inherit; } h1, @@ -17,109 +17,110 @@ h3, h4, h5, h6 { - font-weight: normal; + font-weight: normal; } em { - font-style: normal !important; + font-style: normal !important; } html, body { - height: 100%; - font-family: 'PingFang SC', BlinkMacSystemFont, Roboto, 'Helvetica Neue', sans-serif; + height: 100%; + font-family: "PingFang SC", BlinkMacSystemFont, Roboto, "Helvetica Neue", + sans-serif; } .el-message__icon { - display: none + display: none; } .container { - height: 100%; - display: flex; - flex-direction: column; + height: 100%; + display: flex; + flex-direction: column; } .top { - height: 60px; - padding: 10px 20px; - display: flex; - align-items: center; - margin-right: 20px; + height: 60px; + padding: 10px 20px; + display: flex; + align-items: center; + margin-right: 20px; } .web-title { - margin: 0 15px 0 5px; + margin: 0 15px 0 5px; } .web-icon { - width: auto; - height: 1.5rem; - vertical-align: middle; + width: auto; + height: 1.5rem; + vertical-align: middle; } #editor { - height: 100%; - display: block; - border: none; - width: 100%; - padding: 10px; + height: 100%; + display: block; + border: none; + width: 100%; + padding: 10px; } section { - height: 100%; + height: 100%; } .main-body { - display: flex; - flex-direction: column; - padding-top: 0; - padding-bottom: 10px; + display: flex; + flex-direction: column; + padding-top: 0; + padding-bottom: 10px; } .ctrl { - flex-basis: 60px; - flex-grow: 1; - flex-shrink: 1; - display: flex; - align-items: center; + flex-basis: 60px; + flex-grow: 1; + flex-shrink: 1; + display: flex; + align-items: center; } .preview-wrapper { - box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1); - padding: 0; - align-items: center; - justify-content: center; - display: flex; - overflow: scroll; - word-break: break-all; + box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1); + padding: 0; + align-items: center; + justify-content: center; + display: flex; + overflow: scroll; + word-break: break-all; } .main-section { - display: flex; - height: 100%; + display: flex; + height: 100%; } .hint { - opacity: 0.6; - margin: 20px 0; + opacity: 0.6; + margin: 20px 0; } .preview { - margin: 0 -20px; - width: 375px; - padding: 20px; - font-size: 14px; - box-sizing: border-box; - outline: none; - box-shadow: 0 0 60px rgba(0, 0, 0, 0.1); + margin: 0 -20px; + width: 375px; + padding: 20px; + font-size: 14px; + box-sizing: border-box; + outline: none; + box-shadow: 0 0 60px rgba(0, 0, 0, 0.1); } .preview table { - margin-bottom: 10px; - border-collapse: collapse; - display: table; - width: 100% !important; + margin-bottom: 10px; + border-collapse: collapse; + display: table; + width: 100% !important; } /* @@ -128,60 +129,61 @@ section { } */ .select-item-left { - float: left; + float: left; } .select-item-right { - float: right; - color: #8492a6; - font-size: 13px; + float: right; + color: #8492a6; + font-size: 13px; } .CodeMirror { - height: 100% !important; - box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1); - font-size: 14px; - padding: 20px; - width: 100% !important; - font-family: 'PingFang SC', BlinkMacSystemFont, Roboto, 'Helvetica Neue', sans-serif !important; + height: 100% !important; + box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1); + font-size: 14px; + padding: 20px; + width: 100% !important; + font-family: "PingFang SC", BlinkMacSystemFont, Roboto, "Helvetica Neue", + sans-serif !important; } /* ele ui */ .el-form-item { - margin-bottom: 0 !important; + margin-bottom: 0 !important; } .el-tooltip { - cursor: pointer; + cursor: pointer; } ::-webkit-scrollbar { - width: 6px; - height: 6px; - background-color: #FFF; + width: 6px; + height: 6px; + background-color: #fff; } ::-webkit-scrollbar-track { - border-radius: 6px; - background-color: rgba(200, 200, 200, 0.3); + border-radius: 6px; + background-color: rgba(200, 200, 200, 0.3); } ::-webkit-scrollbar-thumb { - border-radius: 6px; - background-color: rgba(144, 146, 152, 0.5); - transition: background-color .3s; + border-radius: 6px; + background-color: rgba(144, 146, 152, 0.5); + transition: background-color 0.3s; } ::-webkit-scrollbar-thumb:hover { - background-color: rgba(144, 146, 152, 0.5); + background-color: rgba(144, 146, 152, 0.5); } .CodeMirror-vscrollbar:focus { - outline: none; + outline: none; } .CodeMirror-scroll, .preview-wrapper { - overflow: unset; - overflow-y: scroll; -} \ No newline at end of file + overflow: unset; + overflow-y: scroll; +} diff --git a/src/assets/less/code-theme.less b/src/assets/less/code-theme.less index 30af9b7..94a0aa1 100644 --- a/src/assets/less/code-theme.less +++ b/src/assets/less/code-theme.less @@ -1,2 +1,2 @@ -@import './codeTheme/wechat-code-block.less'; -@import './codeTheme/github-code-block.less'; \ No newline at end of file +@import "./codeTheme/wechat-code-block.less"; +@import "./codeTheme/github-code-block.less"; diff --git a/src/assets/less/codeTheme/github-code-block.less b/src/assets/less/codeTheme/github-code-block.less index a54cede..ebb9f34 100644 --- a/src/assets/less/codeTheme/github-code-block.less +++ b/src/assets/less/codeTheme/github-code-block.less @@ -1,47 +1,47 @@ /*github code block*/ .code-snippet__github { - display: flex; + display: flex; + font-size: 12px; + margin: 10px 8px; + position: relative; + height: auto; + background-color: rgba(27, 31, 35, 0.05); + + .code-snippet__line-index { + display: none; + } + + .code__pre { + display: grid; + position: relative; + counter-reset: line; + overflow-x: auto; + padding: 1em; + white-space: normal; + flex: 1; + line-height: 20px; + font-family: Operator Mono, Consolas, Monaco, Menlo, monospace; + -webkit-overflow-scrolling: touch; + } + + pre { + display: inline-block; font-size: 12px; - margin: 10px 8px; - position: relative; - height: auto; - background-color: rgba(27,31,35,.05); + } - .code-snippet__line-index { - display: none; + code { + display: flex; + position: relative; + padding-right: 8px; + text-align: left; + white-space: pre; + font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; + &::before { + display: none; } + } - .code__pre { - display: grid; - position: relative; - counter-reset: line; - overflow-x: auto; - padding: 1em; - white-space: normal; - flex: 1; - line-height: 20px; - font-family: Operator Mono, Consolas, Monaco, Menlo, monospace; - -webkit-overflow-scrolling: touch; - } - - pre { - display: inline-block; - font-size: 12px; - } - - code { - display: flex; - position: relative; - padding-right: 8px; - text-align: left; - white-space: pre; - font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; - &::before { - display: none; - } - } - - ul li { - list-style: none; - } -} \ No newline at end of file + ul li { + list-style: none; + } +} diff --git a/src/assets/less/codeTheme/wechat-code-block.less b/src/assets/less/codeTheme/wechat-code-block.less index 89872e2..526559d 100644 --- a/src/assets/less/codeTheme/wechat-code-block.less +++ b/src/assets/less/codeTheme/wechat-code-block.less @@ -1,62 +1,62 @@ /*wechat code block*/ .rich_media_content .code-snippet *, .rich_media_content .code-snippet__wechat * { - max-width: 1000% !important; + max-width: 1000% !important; } .code-snippet__wechat { - word-wrap: break-word !important; - font-size: 14px; - margin: 10px 8px; - color: #333; - position: relative; - background-color: rgba(27, 31, 35, .05); - border: 1px solid #f0f0f0; - border-radius: 2px; - display: flex; - line-height: 24px; + word-wrap: break-word !important; + font-size: 14px; + margin: 10px 8px; + color: #333; + position: relative; + background-color: rgba(27, 31, 35, 0.05); + border: 1px solid #f0f0f0; + border-radius: 2px; + display: flex; + line-height: 24px; } .code-snippet__wechat .code-snippet__line-index { - counter-reset: line; - flex-shrink: 0; - height: 100%; - padding: 1em; - list-style-type: none; + counter-reset: line; + flex-shrink: 0; + height: 100%; + padding: 1em; + list-style-type: none; } .code-snippet__wechat .code-snippet__line-index li { - list-style-type: none; - text-align: right; + list-style-type: none; + text-align: right; } .code-snippet__wechat .code-snippet__line-index li::before { - min-width: 1.5em; - text-align: right; - left: -2.5em; - counter-increment: line; - content: counter(line); - display: inline; - color: rgba(0, 0, 0, 0.15); + min-width: 1.5em; + text-align: right; + left: -2.5em; + counter-increment: line; + content: counter(line); + display: inline; + color: rgba(0, 0, 0, 0.15); } .code-snippet__wechat pre { - overflow-x: auto; - padding: 1em 1em 1em 1em; - white-space: normal; - flex: 1; - -webkit-overflow-scrolling: touch; + overflow-x: auto; + padding: 1em 1em 1em 1em; + white-space: normal; + flex: 1; + -webkit-overflow-scrolling: touch; } .code-snippet__wechat code { - text-align: left; - font-size: 14px; - white-space: pre; - display: flex; - position: relative; - font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; + text-align: left; + font-size: 14px; + white-space: pre; + display: flex; + position: relative; + font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; } .code-snippet__wechat ul li { - list-style: none; -} \ No newline at end of file + list-style: none; +} diff --git a/src/assets/less/github-v2.min.css b/src/assets/less/github-v2.min.css index 74361f4..3ff324c 100644 --- a/src/assets/less/github-v2.min.css +++ b/src/assets/less/github-v2.min.css @@ -1,2 +1,72 @@ /*! Color themes for Google Code Prettify | MIT License | github.com/jmblog/color-themes-for-google-code-prettify */ -.prettyprint{font-family:Menlo,Bitstream Vera Sans Mono,DejaVu Sans Mono,Monaco,Consolas,monospace;border:0!important}.pln{color:#333}ol.linenums{margin-top:0;margin-bottom:0;color:#ccc}li.L0,li.L1,li.L2,li.L3,li.L4,li.L5,li.L6,li.L7,li.L8,li.L9{padding-left:1em;background-color:#fff;list-style-type:decimal}@media screen{.str{color:#183691}.kwd{color:#a71d5d}.com{color:#969896}.typ{color:#0086b3}.lit{color:#0086b3}.pun{color:#333}.opn{color:#333}.clo{color:#333}.tag{color:navy}.atn{color:#795da3}.atv{color:#183691}.dec{color:#333}.var{color:teal}.fun{color:#900}} \ No newline at end of file +.prettyprint { + font-family: Menlo, Bitstream Vera Sans Mono, DejaVu Sans Mono, Monaco, + Consolas, monospace; + border: 0 !important; +} +.pln { + color: #333; +} +ol.linenums { + margin-top: 0; + margin-bottom: 0; + color: #ccc; +} +li.L0, +li.L1, +li.L2, +li.L3, +li.L4, +li.L5, +li.L6, +li.L7, +li.L8, +li.L9 { + padding-left: 1em; + background-color: #fff; + list-style-type: decimal; +} +@media screen { + .str { + color: #183691; + } + .kwd { + color: #a71d5d; + } + .com { + color: #969896; + } + .typ { + color: #0086b3; + } + .lit { + color: #0086b3; + } + .pun { + color: #333; + } + .opn { + color: #333; + } + .clo { + color: #333; + } + .tag { + color: navy; + } + .atn { + color: #795da3; + } + .atv { + color: #183691; + } + .dec { + color: #333; + } + .var { + color: teal; + } + .fun { + color: #900; + } +} diff --git a/src/assets/less/style-mirror.css b/src/assets/less/style-mirror.css index 8c74dff..6e17d0f 100644 --- a/src/assets/less/style-mirror.css +++ b/src/assets/less/style-mirror.css @@ -9,116 +9,116 @@ */ .cm-s-style-mirror.CodeMirror { - background: #f5f5f5; - color: #444; - font-size: 16px; - padding: 20px; - line-height: 25px; + background: #f5f5f5; + color: #444; + font-size: 16px; + padding: 20px; + line-height: 25px; } .cm-s-style-mirror div.CodeMirror-selected { - background: #e0e0e0; + background: #e0e0e0; } .cm-s-style-mirror .CodeMirror-line::selection, -.cm-s-style-mirror .CodeMirror-line>span::selection, -.cm-s-style-mirror .CodeMirror-line>span>span::selection { - background: #e0e0e0; +.cm-s-style-mirror .CodeMirror-line > span::selection, +.cm-s-style-mirror .CodeMirror-line > span > span::selection { + background: #e0e0e0; } .cm-s-style-mirror .CodeMirror-line::-moz-selection, -.cm-s-style-mirror .CodeMirror-line>span::-moz-selection, -.cm-s-style-mirror .CodeMirror-line>span>span::-moz-selection { - background: #e0e0e0; +.cm-s-style-mirror .CodeMirror-line > span::-moz-selection, +.cm-s-style-mirror .CodeMirror-line > span > span::-moz-selection { + background: #e0e0e0; } .cm-s-style-mirror .CodeMirror-gutters { - background: #f5f5f5; - border-right: 0px; + background: #f5f5f5; + border-right: 0px; } .cm-s-style-mirror .CodeMirror-guttermarker { - color: #ac4142; + color: #ac4142; } .cm-s-style-mirror .CodeMirror-guttermarker-subtle { - color: #b0b0b0; + color: #b0b0b0; } .cm-s-style-mirror .CodeMirror-linenumber { - color: #b0b0b0; + color: #b0b0b0; } .cm-s-style-mirror .CodeMirror-cursor { - border-left: 1px solid #505050; + border-left: 1px solid #505050; } .cm-s-style-mirror span.cm-comment { - color: green; + color: green; } .cm-s-style-mirror span.cm-atom { - color: #aa759f; + color: #aa759f; } .cm-s-style-mirror span.cm-number { - color: #aa759f; + color: #aa759f; } .cm-s-style-mirror span.cm-property, .cm-s-style-mirror span.cm-attribute { - color: #90a959; + color: #90a959; } .cm-s-style-mirror span.cm-keyword { - color: #023a52; + color: #023a52; } .cm-s-style-mirror span.cm-string { - color: #e46918; + color: #e46918; } .cm-s-style-mirror span.cm-variable { - color: #90a959; + color: #90a959; } .cm-s-style-mirror span.cm-variable-2 { - color: #00695f; + color: #00695f; } .cm-s-style-mirror span.cm-variable-3 { - color: #2e6e8a; + color: #2e6e8a; } .cm-s-style-mirror span.cm-def { - color: #d28445; + color: #d28445; } .cm-s-style-mirror span.cm-bracket { - color: #202020; + color: #202020; } .cm-s-style-mirror span.cm-tag { - color: #000; + color: #000; } .cm-s-style-mirror span.cm-link { - color: #b26a00; + color: #b26a00; } .cm-s-style-mirror span.cm-error { - /* background: #ac4142; + /* background: #ac4142; color: #f5f5f5; */ - text-decoration: underline; - text-decoration-style: wavy; - text-decoration-color: #df8d8e; + text-decoration: underline; + text-decoration-style: wavy; + text-decoration-color: #df8d8e; } .cm-s-style-mirror .CodeMirror-activeline-background { - background: #dddcdc; + background: #dddcdc; } .cm-s-style-mirror .CodeMirror-matchingbracket { - color: rgb(32, 32, 32) !important; - background-color: rgba(0, 0, 0, 0.1) !important; -} \ No newline at end of file + color: rgb(32, 32, 32) !important; + background-color: rgba(0, 0, 0, 0.1) !important; +} diff --git a/src/assets/less/theme.less b/src/assets/less/theme.less index ae2f2b0..640363a 100644 --- a/src/assets/less/theme.less +++ b/src/assets/less/theme.less @@ -10,85 +10,94 @@ @nightButtonBg: #1e1e1e; @nightButtonHoverColor: #84868b; .container_night { + background-color: @nightBgColor; + .el-main { background-color: @nightBgColor; - .el-main { - background-color: @nightBgColor; + } + .CodeMirror { + caret-color: @nightFontColor; + color: @nightFontColor; + background-color: @nightCodeMirrorColor; + box-shadow: inset 0 0 0 1px rgba(100, 37, 37, 0.102); + } + .output_night { + .preview { + background-color: @nightPreviewColor; + box-shadow: 0 0 70px rgba(0, 0, 0, 0.3); } - .CodeMirror { - caret-color: @nightFontColor; - color: @nightFontColor; - background-color: @nightCodeMirrorColor; - box-shadow: inset 0 0 0 1px rgba(100, 37, 37, 0.102); + .preview-wrapper { + background-color: @nightCodeMirrorColor; + box-shadow: inset 0 0 0 1px rgba(233, 231, 231, 0.102); } - .output_night { - .preview { - background-color: @nightPreviewColor; - box-shadow: 0 0 70px rgba(0, 0, 0, 0.3); - } - .preview-wrapper { - background-color: @nightCodeMirrorColor; - box-shadow: inset 0 0 0 1px rgba(233, 231, 231, 0.102); - } - .code-snippet__fix { - background-color: rgb(238,238,238); - } + .code-snippet__fix { + background-color: rgb(238, 238, 238); } - .cm-s-style-mirror .CodeMirror-matchingbracket { - color: @nightWhiteColor!important; - background: rgb(30, 30, 30)!important; + } + .cm-s-style-mirror .CodeMirror-matchingbracket { + color: @nightWhiteColor!important; + background: rgb(30, 30, 30) !important; + } + .cm-s-xq-light span.cm-variable-2, + .cm-s-style-mirror span.cm-tag { + color: @nightFontColor; + } + .cm-s-xq-light .CodeMirror-activeline-background { + background-color: transparent; + } + .cm-s-xq-light span.cm-string { + color: @nightLinkColor; + } + .cm-s-xq-light span.cm-link { + color: @nightLinkTextColor; + } + .editor__header { + background-color: @nightHeaderColor; + } + .el-button { + color: @nightWhiteColor; + background-color: @nightCodeMirrorColor; + border: 1px solid transparent; + } + .el-button.is-plain:focus, + .el-button.is-plain:hover { + background: @nightButtonBg; + color: @nightWhiteColor; + border: 1px solid @nightWhiteColor; + i { + color: @nightWhiteColor; } - .cm-s-xq-light span.cm-variable-2, .cm-s-style-mirror span.cm-tag { - color: @nightFontColor; + } + .insert__dialog, + .about__dialog, + .reset__dialog, + .upload__dialog { + .el-dialog { + background-color: @nightBgColor; } - .cm-s-xq-light .CodeMirror-activeline-background { - background-color: transparent; + .el-dialog__body { + color: @nightWhiteColor; } - .cm-s-xq-light span.cm-string { - color: @nightLinkColor; + .el-dialog__title, + .el-form-item__label { + color: @nightWhiteColor; } - .cm-s-xq-light span.cm-link { - color: @nightLinkTextColor; + .el-tabs__item { + color: @nightActiveCodeMirrorColor; } - .editor__header { - background-color: @nightHeaderColor; + .is-active { + color: @nightWhiteColor; } - .el-button { - color: @nightWhiteColor; - background-color: @nightCodeMirrorColor; - border: 1px solid transparent; + .el-upload-dragger { + background-color: @nightButtonBg; } - .el-button.is-plain:focus, .el-button.is-plain:hover { - background: @nightButtonBg; - color: @nightWhiteColor; - border: 1px solid @nightWhiteColor; - i { - color: @nightWhiteColor; - } - } - .insert__dialog, .about__dialog, .reset__dialog, .upload__dialog { - .el-dialog { - background-color: @nightBgColor; - } - .el-dialog__body { - color: @nightWhiteColor; - } - .el-dialog__title, .el-form-item__label { - color: @nightWhiteColor; - } - .el-tabs__item { - color: @nightActiveCodeMirrorColor; - } - .is-active { - color: @nightWhiteColor; - } - .el-upload-dragger { - background-color: @nightButtonBg; - } - } - ::v-deep .el-icon-upload, .el-icon-download, .el-icon-refresh, .el-icon-s-grid { - color: @nightWhiteColor; - } - ::-webkit-scrollbar { - background-color: @nightCodeMirrorColor; - } -} \ No newline at end of file + } + ::v-deep .el-icon-upload, + .el-icon-download, + .el-icon-refresh, + .el-icon-s-grid { + color: @nightWhiteColor; + } + ::-webkit-scrollbar { + background-color: @nightCodeMirrorColor; + } +} diff --git a/src/components/CodemirrorEditor/aboutDialog.vue b/src/components/CodemirrorEditor/aboutDialog.vue index d1775fc..de16e94 100644 --- a/src/components/CodemirrorEditor/aboutDialog.vue +++ b/src/components/CodemirrorEditor/aboutDialog.vue @@ -1,15 +1,35 @@ @@ -19,16 +39,15 @@ export default { props: { value: { type: Boolean, - default: false - } + default: false, + }, }, methods: { onRedirect(url) { window.open(url); - } - } -} + }, + }, +}; - \ No newline at end of file + diff --git a/src/components/CodemirrorEditor/header.vue b/src/components/CodemirrorEditor/header.vue index 235c4a2..92f2a8b 100644 --- a/src/components/CodemirrorEditor/header.vue +++ b/src/components/CodemirrorEditor/header.vue @@ -1,162 +1,278 @@ \ No newline at end of file + diff --git a/src/components/CodemirrorEditor/insertForm.vue b/src/components/CodemirrorEditor/insertForm.vue index aa34a45..7cd74fc 100644 --- a/src/components/CodemirrorEditor/insertForm.vue +++ b/src/components/CodemirrorEditor/insertForm.vue @@ -6,66 +6,71 @@ @close="$emit('input', false)" border > - - - 行数: - + + 行数: + - - - 列数: - + + 列数: + - - - - - - -
- -
- - + + + + + + +
+ +
+ + diff --git a/src/components/CodemirrorEditor/resetDialog.vue b/src/components/CodemirrorEditor/resetDialog.vue index c382eab..0331aba 100644 --- a/src/components/CodemirrorEditor/resetDialog.vue +++ b/src/components/CodemirrorEditor/resetDialog.vue @@ -1,49 +1,54 @@ diff --git a/src/components/CodemirrorEditor/rightClickMenu.vue b/src/components/CodemirrorEditor/rightClickMenu.vue index 950359e..efba36b 100644 --- a/src/components/CodemirrorEditor/rightClickMenu.vue +++ b/src/components/CodemirrorEditor/rightClickMenu.vue @@ -1,62 +1,70 @@ diff --git a/src/components/CodemirrorEditor/uploadImgDialog.vue b/src/components/CodemirrorEditor/uploadImgDialog.vue index 2cfb7c7..d57ee6c 100644 --- a/src/components/CodemirrorEditor/uploadImgDialog.vue +++ b/src/components/CodemirrorEditor/uploadImgDialog.vue @@ -1,323 +1,452 @@ - - - - - + + + + + diff --git a/src/components/Loading.vue b/src/components/Loading.vue index fe344b3..439fdfd 100644 --- a/src/components/Loading.vue +++ b/src/components/Loading.vue @@ -7,8 +7,7 @@ - + diff --git a/src/view/CodemirrorEditor.vue b/src/view/CodemirrorEditor.vue index 2adfd75..8c13dcd 100644 --- a/src/view/CodemirrorEditor.vue +++ b/src/view/CodemirrorEditor.vue @@ -1,5 +1,5 @@ -