diff --git a/assets/css/app.css b/assets/css/app.css index 2cfeade..e51d6cc 100644 --- a/assets/css/app.css +++ b/assets/css/app.css @@ -1,234 +1,245 @@ * { - box-sizing: border-box; - margin: 0; - padding: 0; + box-sizing: border-box; + margin: 0; + padding: 0; } -input, button, textarea { - font-family: inherit; +input, +button, +textarea { + font-family: inherit; } -h1, h2, h3, h4, h5, h6 { - font-weight: normal; +h1, +h2, +h3, +h4, +h5, +h6 { + 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; +html, +body { + 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; } + /* .preview table tr:nth-child(even){ background: rgb(250, 250, 250); } */ .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; } /*wechat code block*/ -.rich_media_content .code-snippet *, .rich_media_content .code-snippet__fix * { - max-width: 1000% !important; +.rich_media_content .code-snippet *, +.rich_media_content .code-snippet__fix * { + max-width: 1000% !important; } .code-snippet__fix { - word-wrap: break-word !important; - font-size: 14px; - margin: 10px 8px; - color: #333; - position: relative; - background-color: rgb(238,238,238); - 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: rgb(238, 238, 238); + border: 1px solid #f0f0f0; + border-radius: 2px; + display: flex; + line-height: 24px; } .code-snippet__fix .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__fix .code-snippet__line-index li { - list-style-type: none; - text-align: right; + list-style-type: none; + text-align: right; } .code-snippet__fix .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__fix 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__fix 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; } ::-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 .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; } -.CodeMirror-scroll, .preview-wrapper { +.CodeMirror-scroll, +.preview-wrapper { overflow: unset; overflow-y: scroll; } \ No newline at end of file diff --git a/assets/css/loading.css b/assets/css/loading.css index aea6b19..d0ede5b 100644 --- a/assets/css/loading.css +++ b/assets/css/loading.css @@ -1,47 +1,47 @@ .loading { - text-align: center; - position: fixed; - width: 100%; - height: 100%; - overflow: hidden; - z-index: 99999; - background-color: #f2f2f2; + text-align: center; + position: fixed; + width: 100%; + height: 100%; + overflow: hidden; + z-index: 99999; + background-color: #f2f2f2; } .loading_night { - background-color: #303133; + background-color: #303133; } .loading-wrapper { - position: fixed; - top: 50%; - left: 50%; - -webkit-transform: translateX(-50%) translateY(-50%); - -moz-transform: translateX(-50%) translateY(-50%); - -ms-transform: translateX(-50%) translateY(-50%); - transform: translateX(-50%) translateY(-50%); + position: fixed; + top: 50%; + left: 50%; + -webkit-transform: translateX(-50%) translateY(-50%); + -moz-transform: translateX(-50%) translateY(-50%); + -ms-transform: translateX(-50%) translateY(-50%); + transform: translateX(-50%) translateY(-50%); } .loading-text { - line-height: 1.4; - font-size: 1.2rem; - font-weight: bold; - margin-bottom: 1rem; + line-height: 1.4; + font-size: 1.2rem; + font-weight: bold; + margin-bottom: 1rem; } .loading-anim { - width: 35px; - height: 35px; - border: 5px solid rgba(189, 189, 189, 0.25); - border-left-color: rgba(66, 185, 131, 0.9); - border-top-color: rgba(66, 185, 131, 0.9); - border-radius: 50%; - display: inline-block; - animation: rotate 600ms infinite linear; + width: 35px; + height: 35px; + border: 5px solid rgba(189, 189, 189, 0.25); + border-left-color: rgba(66, 185, 131, 0.9); + border-top-color: rgba(66, 185, 131, 0.9); + border-radius: 50%; + display: inline-block; + animation: rotate 600ms infinite linear; } @keyframes rotate { - to { - transform: rotate(1turn) - } -} + to { + transform: rotate(1turn) + } +} \ No newline at end of file diff --git a/assets/css/style-mirror.css b/assets/css/style-mirror.css index bf98442..8c74dff 100644 --- a/assets/css/style-mirror.css +++ b/assets/css/style-mirror.css @@ -14,91 +14,111 @@ font-size: 16px; padding: 20px; line-height: 25px; - } - .cm-s-style-mirror div.CodeMirror-selected { +} + +.cm-s-style-mirror div.CodeMirror-selected { 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 { +} + +.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::-moz-selection, - .cm-s-style-mirror .CodeMirror-line > span::-moz-selection, - .cm-s-style-mirror .CodeMirror-line > span > span::-moz-selection { +} + +.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-gutters { +} + +.cm-s-style-mirror .CodeMirror-gutters { background: #f5f5f5; border-right: 0px; - } - .cm-s-style-mirror .CodeMirror-guttermarker { +} + +.cm-s-style-mirror .CodeMirror-guttermarker { color: #ac4142; - } - .cm-s-style-mirror .CodeMirror-guttermarker-subtle { +} + +.cm-s-style-mirror .CodeMirror-guttermarker-subtle { color: #b0b0b0; - } - .cm-s-style-mirror .CodeMirror-linenumber { +} + +.cm-s-style-mirror .CodeMirror-linenumber { color: #b0b0b0; - } - .cm-s-style-mirror .CodeMirror-cursor { +} + +.cm-s-style-mirror .CodeMirror-cursor { border-left: 1px solid #505050; - } - - .cm-s-style-mirror span.cm-comment { - color:green; - } - .cm-s-style-mirror span.cm-atom { +} + +.cm-s-style-mirror span.cm-comment { + color: green; +} + +.cm-s-style-mirror span.cm-atom { color: #aa759f; - } - .cm-s-style-mirror span.cm-number { +} + +.cm-s-style-mirror span.cm-number { color: #aa759f; - } - - .cm-s-style-mirror span.cm-property, - .cm-s-style-mirror span.cm-attribute { +} + +.cm-s-style-mirror span.cm-property, +.cm-s-style-mirror span.cm-attribute { color: #90a959; - } - .cm-s-style-mirror span.cm-keyword { +} + +.cm-s-style-mirror span.cm-keyword { color: #023a52; - } - .cm-s-style-mirror span.cm-string { +} + +.cm-s-style-mirror span.cm-string { color: #e46918; - } - - .cm-s-style-mirror span.cm-variable { +} + +.cm-s-style-mirror span.cm-variable { color: #90a959; - } - .cm-s-style-mirror span.cm-variable-2 { +} + +.cm-s-style-mirror span.cm-variable-2 { color: #00695f; - } - .cm-s-style-mirror span.cm-variable-3 { +} + +.cm-s-style-mirror span.cm-variable-3 { color: #2e6e8a; - } - .cm-s-style-mirror span.cm-def { +} + +.cm-s-style-mirror span.cm-def { color: #d28445; - } - .cm-s-style-mirror span.cm-bracket { +} + +.cm-s-style-mirror span.cm-bracket { color: #202020; - } - .cm-s-style-mirror span.cm-tag { - color:#000; - } - .cm-s-style-mirror span.cm-link { +} + +.cm-s-style-mirror span.cm-tag { + color: #000; +} + +.cm-s-style-mirror span.cm-link { color: #b26a00; - } - .cm-s-style-mirror span.cm-error { +} + +.cm-s-style-mirror span.cm-error { /* background: #ac4142; color: #f5f5f5; */ text-decoration: underline; text-decoration-style: wavy; text-decoration-color: #df8d8e; - } - .cm-s-style-mirror .CodeMirror-activeline-background { +} + +.cm-s-style-mirror .CodeMirror-activeline-background { 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 +} + +.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 diff --git a/index.html b/index.html index 5560a61..1761f51 100644 --- a/index.html +++ b/index.html @@ -1 +1 @@ -
['.concat(e[0],"]
: ").concat(e[1],"['.concat(e[0],"]
").concat(e[1],": ").concat(e[2],"").concat(e.join("\n"),"
")},this.buildAddition=function(){return'\n \n '},this.setOptions=function(e){t.opts=s(t.opts,e)},this.hasFootnotes=function(){return 0!==o.length},this.getRenderer=function(e){o=[],i=0,r=t.buildTheme(t.opts.theme);var a=new je.a.Renderer;return a.heading=function(e,t){switch(t){case 1:return"")),"
").concat(e,"")},a.code=function(e,t){e=e.replace(//g,">");for(var n=e.split("\n"),o=[],i=[],r=0;r
\n ').concat(o.join(""),"\n\n
").concat(e,"
")},a.listitem=function(e){return"<%s/>').concat(e,"")},a.list=function(e,t,n){e=e.replace(/<\/*p.*?>/g,"");var o=e.split("<%s/>");if(!t)return e=o.join("•"),"").concat(e,"
");e=o[0];for(var i=1;i扫码关注我的公众号,原创技术文章第一时间推送!
\n \n[${x[0]}]
: ${x[1]}[${x[0]}]
${x[1]}: ${x[2]}${footnoteArray.join('\\n')}
`\n }\n\n this.buildAddition = () => {\n return `\n \n `\n }\n\n this.setOptions = newOpts => {\n this.opts = merge(this.opts, newOpts)\n }\n\n this.hasFootnotes = () => footnotes.length !== 0\n\n this.getRenderer = (status) => {\n footnotes = []\n footnoteIndex = 0\n\n styleMapping = this.buildTheme(this.opts.theme)\n let renderer = new marked.Renderer()\n\n renderer.heading = (text, level) => {\n switch (level) {\n case 1:\n return ``)\n return `
${text}`\n }\n renderer.code = (text, infoString) => {\n text = text.replace(//g, '>')\n\n let lines = text.split('\\n')\n let codeLines = []\n let numbers = []\n\n for (let i = 0; i < lines.length; i++) {\n const line = lines[i]\n codeLines.push(`
${(line || '
')}
`)\n numbers.push('')\n }\n let lang = infoString || ''\n\n return `\n \n ${codeLines.join('')}\n\n
${text}
`\n renderer.listitem = text => `<%s/>${text}`\n\n renderer.list = (text, ordered, start) => {\n text = text.replace(/<\\/*p.*?>/g, '')\n let segments = text.split(`<%s/>`)\n if (!ordered) {\n text = segments.join('•')\n return `${text}
`\n }\n text = segments[0]\n for (let i = 1; i < segments.length; i++) {\n text = text + i + '.' + segments[i]\n }\n return `${text}
`\n }\n renderer.image = (href, title, text) => {\n let subText = ''\n if (text) {\n subText = `=h&&(c+=2);f>=k&&(w+=2)}}finally{g&&(g.style.display=a)}}catch(y){D.console&&console.log(y&&y.stack||y)}}var D=\"undefined\"!==typeof window?\nwindow:{},B=[\"break,continue,do,else,for,if,return,while\"],F=[[B,\"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,restrict,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile\"],\"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof\"],H=[F,\"alignas,alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,delegate,dynamic_cast,explicit,export,friend,generic,late_check,mutable,namespace,noexcept,noreturn,nullptr,property,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where\"],\nO=[F,\"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient\"],P=[F,\"abstract,add,alias,as,ascending,async,await,base,bool,by,byte,checked,decimal,delegate,descending,dynamic,event,finally,fixed,foreach,from,get,global,group,implicit,in,interface,internal,into,is,join,let,lock,null,object,out,override,orderby,params,partial,readonly,ref,remove,sbyte,sealed,select,set,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,value,var,virtual,where,yield\"],\nF=[F,\"abstract,async,await,constructor,debugger,enum,eval,export,from,function,get,import,implements,instanceof,interface,let,null,of,set,undefined,var,with,yield,Infinity,NaN\"],Q=[B,\"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None\"],R=[B,\"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END\"],\nB=[B,\"case,done,elif,esac,eval,fi,function,in,local,set,then,until\"],S=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\\d*)\\b/,W=/\\S/,X=x({keywords:[H,P,O,F,\"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END\",Q,R,B],hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0}),\nI={};t(X,[\"default-code\"]);t(G([],[[\"pln\",/^[^]+/],[\"dec\",/^]*(?:>|$)/],[\"com\",/^<\\!--[\\s\\S]*?(?:-\\->|$)/],[\"lang-\",/^<\\?([\\s\\S]+?)(?:\\?>|$)/],[\"lang-\",/^<%([\\s\\S]+?)(?:%>|$)/],[\"pun\",/^(?:<[%?]|[%?]>)/],[\"lang-\",/^