From eaa809513e6ba455405b0f10856861bcbce5af6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=87=E5=A4=A9?= Date: Fri, 8 Sep 2017 20:33:56 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9F=BA=E7=A1=80=E6=A0=B7=E5=BC=8F=E4=BC=98?= =?UTF-8?q?=E5=8C=96;=E5=88=86=E9=A1=B5=E7=BB=84=E4=BB=B6=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F=E4=BC=98=E5=8C=96;=E5=A2=9E=E5=8A=A04=E4=B8=AA?= =?UTF-8?q?=E5=9B=BE=E6=A0=87=E5=AD=97=E4=BD=93;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- css/basic-elem.css | 2 +- css/basic-elem.scss | 43 +++++++++------ css/var.scss | 10 ++++ font/ui-font.eot | Bin 26468 -> 27596 bytes font/ui-font.js | 2 +- font/ui-font.ttf | Bin 26300 -> 27428 bytes js/lib/marked/main.js | 2 +- js/lib/meditor/main.js | 4 +- js/lib/pages/main.css | 61 +-------------------- js/lib/pages/main.js | 2 +- js/lib/pages/main.scss | 77 +++++++++++++++++++++++++++ js/lib/router/{router.js => main.js} | 0 js/lib/router/router.min.js | 1 - 13 files changed, 120 insertions(+), 84 deletions(-) create mode 100644 css/var.scss create mode 100644 js/lib/pages/main.scss rename js/lib/router/{router.js => main.js} (100%) delete mode 100644 js/lib/router/router.min.js diff --git a/css/basic-elem.css b/css/basic-elem.css index f018693..aeb6591 100644 --- a/css/basic-elem.css +++ b/css/basic-elem.css @@ -1 +1 @@ -.do-ui-button{display:inline-block;padding:0 5px;border:1px solid #ddd;text-align:center;font-size:12px;background:none;cursor:pointer;transition:all .1s ease-in-out}.do-ui-button.medium{min-width:100px;height:35px;padding:0 8px;line-height:35px;font-size:15px}.do-ui-button.large{min-width:150px;height:50px;padding:0 13px;line-height:50px;font-size:18px}.do-ui-button.radius-3{border-radius:3px}.do-ui-button.radius-5{border-radius:5px}.do-ui-button.green{border:0;background:#1abc9c;color:#fff}.do-ui-button.green:hover{background:#48c9b0}.do-ui-button.green:active{background:#16a085}.do-ui-button.blue{border:0;background:#3498db;color:#fff}.do-ui-button.blue:hover{background:#5dade2}.do-ui-button.blue:active{background:#2c81ba}.do-ui-button.red{border:0;background:#e74c3c;color:#fff}.do-ui-button.red:hover{background:#ec7063}.do-ui-button.red:active{background:#c54133}.do-ui-button.orange{border:0;background:#f39c12;color:#fff}.do-ui-button.orange:hover{background:#f1c40f}.do-ui-button.orange:active{background:#e67e22}.do-ui-button.plain{border:0;background:#e7e8eb;color:#34495e}.do-ui-button.plain:hover{background:#ecf0f1}.do-ui-button.plain:active{background:#bdc3c7}.do-ui-button.grey{border:0;background:#34495e;color:#fff}.do-ui-button.grey:hover{background:#5d6d7e}.do-ui-button.grey:active{background:#2c3e50}.do-ui-button.disabled{border-color:#e7e8eb;color:#bdc3c7;cursor:not-allowed}.do-ui-button.medium.with-style,.do-ui-button.large.with-style{position:relative;padding-right:43px}.do-ui-button.medium.with-style::after,.do-ui-button.large.with-style::after{position:absolute;right:0;top:0;width:35px;text-align:center;background:rgba(0,0,0,0.2);font-family:"ui font" !important;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.do-ui-button.large.with-style{padding-right:58px}.do-ui-button.large.with-style::after{width:50px}.do-ui-button.icon-del::after{content:"\e6f0"}.do-ui-button.icon-add::after{content:"\e64c"}.do-ui-button.icon-send::after{content:"\e64b"}.do-ui-button.icon-bad::after{content:"\e8ee"}.do-ui-button.icon-good::after{content:"\e62d"}.do-ui-button.icon-download::after{content:"\e611"}.do-ui-button.icon-upload::after{content:"\e6f7"}.do-ui-button.icon-mac::after{content:"\e60a"}.do-ui-button.icon-ios::after{content:"\e609"}.do-ui-button.icon-windows::after{content:"\e601"}.do-ui-button.icon-linux::after{content:"\e602"}.do-ui-button.icon-android::after{content:"\e600"}.do-ui-input{display:inline-block;min-height:30px;padding:0 5px;border:1px solid #bdc3c7;background:#fff;color:#34495e;outline:none;transition:all .1s ease-in-out}.do-ui-input::-webkit-input-placeholder{color:#bdc3c7}.do-ui-input.radius-3{border-radius:3px}.do-ui-input.radius-5{border-radius:5px}.do-ui-input:focus{border-color:#1abc9c}.do-ui-input.alert{border-color:#e74c3c;color:#e74c3c}.do-ui-input.disabled{border-color:transparent;background:#e7e8eb;color:#bdc3c7}.do-ui-input.area{padding:5px}.do-ui-select{display:inline-block;min-height:30px;padding:0 25px 0 5px;border:1px solid #bdc3c7;background:#fff url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAQCAMAAADOBMQXAAAAFVBMVEUAAAD///8wMDAwMDAyMjIzMzMyMjLeZPLMAAAAB3RSTlMAABAwkLDARx1RgwAAAD9JREFUeAGlz0UChFAAgFB+3v/GMwZ2K8u3g7DXI40s6zWnuaXaK7IYVVlElUV14lQik8opw6SyiCqLXB9/0D/ZNQE+FhzMpgAAAABJRU5ErkJggg==) no-repeat right 6px;color:#34495e;outline:none;-webkit-appearance:none;-moz-appearance:none;transition:all .1s ease-in-out}.do-ui-select::-ms-expand{display:none}.do-ui-select.radius-3{border-radius:3px}.do-ui-select.radius-5{border-radius:5px}.do-ui-select:focus{border-color:#1abc9c}.do-ui-select.alert{border-color:#e74c3c;color:#e74c3c}.do-ui-select.disabled{border-color:transparent;background:#e7e8eb;color:#bdc3c7}.do-ui-radio,.do-ui-checkbox{display:inline-block;position:relative;width:auto;height:auto;min-height:30px;padding-left:35px;line-height:30px;border-radius:3px;color:#34495e}.do-ui-radio{padding-left:50px}.do-ui-radio>input{position:absolute;left:10px;top:10px;width:35px;height:10px;border-radius:10px;border:0;background:#bdc3c7;-webkit-appearance:none;-moz-appearance:none}.do-ui-radio>input:checked{background:#bdc3c7}.do-ui-radio>input:disabled{background:#ecf0f1}.do-ui-radio>input:disabled:checked{background:#bdc3c7}.do-ui-radio>input::after{position:absolute;display:block;left:-2px;top:-5px;width:20px;height:20px;border-radius:50%;content:"";background:#ecf0f1;box-shadow:0 1px 2px rgba(0,0,0,0.2)}.do-ui-radio>input:checked::after{left:auto;right:-2px;background:#5d6d7e}.do-ui-radio>input:checked:disabled::after{background:#bdc3c7}.do-ui-radio.green>input:checked{background:#48c9b0}.do-ui-radio.green>input:checked::after{background:#16a085}.do-ui-radio.blue>input:checked{background:#5dade2}.do-ui-radio.blue>input:checked::after{background:#2c81ba}.do-ui-radio.red>input:checked{background:#ec7063}.do-ui-radio.red>input:checked::after{background:#c54133}.do-ui-radio.orange>input:checked{background:#f1c40f}.do-ui-radio.orange>input:checked::after{background:#e67e22}.do-ui-radio.grey>input:checked{background:#5d6d7e}.do-ui-radio.grey>input:checked::after{background:#2c3e50}.do-ui-radio.disabled{color:#bdc3c7}.do-ui-checkbox>input{position:absolute;left:2px;top:2px;width:26px;height:26px;line-height:22px;border:2px solid #bdc3c7;border-radius:3px;text-align:center;font-size:18px;font-family:"ui font" !important;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-appearance:none;-moz-appearance:none}.do-ui-checkbox>input:checked::after{content:"\e60f"}.do-ui-checkbox>input:disabled{border-color:#bdc3c7;color:#bdc3c7}.do-ui-checkbox.green>input{color:#1abc9c !important;border-color:#1abc9c}.do-ui-checkbox.blue>input{color:#3498db !important;border-color:#3498db}.do-ui-checkbox.red>input{color:#e74c3c !important;border-color:#e74c3c}.do-ui-checkbox.orange>input{color:#f39c12 !important;border-color:#f39c12}.do-ui-checkbox.grey>input{color:#34495e !important;border-color:#34495e}.do-ui-checkbox.disabled{color:#bdc3c7}.do-ui-checkbox.with-style{padding-left:5px;padding-right:35px;line-height:26px;border:2px solid #e7e8eb;background:#e7e8eb;text-align:center}.do-ui-checkbox.with-style>input{left:auto;right:0;top:0;line-height:26px;border:0;background:#fff;color:#5d6d7e}.do-ui-checkbox.with-style>input:disabled{color:#bdc3c7 !important}.do-ui-checkbox.with-style.green{border-color:#1abc9c;background:#1abc9c;color:#fff}.do-ui-checkbox.with-style.blue{border-color:#3498db;background:#3498db;color:#fff}.do-ui-checkbox.with-style.red{border-color:#e74c3c;background:#e74c3c;color:#fff}.do-ui-checkbox.with-style.orange{border-color:#f39c12;background:#f39c12;color:#fff}.do-ui-checkbox.with-style.grey{border-color:#34495e;background:#34495e;color:#fff}.do-ui-checkbox.with-style.disabled{border-color:#e7e8eb;background:#e7e8eb;color:#bdc3c7}.do-ui-quote{position:relative;min-height:60px;margin:10px 0;padding:15px 5px 5px 50px;border:1px solid #ddd;border-radius:10px;background:#f7f7f7}.do-ui-quote::before{position:absolute;left:8px;top:0;font:30px/1.5 "ui font";color:#bdc3c7;content:"\e61b"}.do-ui-warn,.do-ui-mark{display:inline-block;position:relative;min-height:50px;margin:10px 0;padding:8px 8px 8px 50px;border:1px solid #f39c12;border-radius:10px;background:#fffbed;color:#e67e22}.do-ui-warn::before,.do-ui-mark::before{position:absolute;left:8px;top:0;font:30px/1.5 "ui font";color:#e74c3c;content:"\e6f6"}.do-ui-mark{border-color:#48c9b0;color:#16a085;background:#edfbf8}.do-ui-mark::before{color:#16a085;content:"\e657"} +.do-ui-button{display:inline-block;padding:0 5px;border:1px solid #ddd;text-align:center;font-size:12px;background:none;cursor:pointer;transition:all .1s ease-in-out}.do-ui-button.medium{min-width:100px;height:35px;padding:0 8px;line-height:35px;font-size:15px}.do-ui-button.large{min-width:150px;height:50px;padding:0 13px;line-height:50px;font-size:18px}.do-ui-button.radius-3{border-radius:3px}.do-ui-button.radius-5{border-radius:5px}.do-ui-button.green{border:0;background:#1abc9c;color:#fff}.do-ui-button.green:hover{background:#48c9b0}.do-ui-button.green:active{background:#16a085}.do-ui-button.blue{border:0;background:#3498db;color:#fff}.do-ui-button.blue:hover{background:#5dade2}.do-ui-button.blue:active{background:#2c81ba}.do-ui-button.red{border:0;background:#e74c3c;color:#fff}.do-ui-button.red:hover{background:#ec7063}.do-ui-button.red:active{background:#c54133}.do-ui-button.orange{border:0;background:#f39c12;color:#fff}.do-ui-button.orange:hover{background:#fbbb56}.do-ui-button.orange:active{background:#e67e22}.do-ui-button.plain{border:0;background:#e7e8eb;color:#34495e}.do-ui-button.plain:hover{background:#ecf0f1}.do-ui-button.plain:active{background:#bdc3c7}.do-ui-button.grey{border:0;background:#34495e;color:#fff}.do-ui-button.grey:hover{background:#5d6d7e}.do-ui-button.grey:active{background:#2c3e50}.do-ui-button.disabled{border-color:#e7e8eb;color:#bdc3c7;cursor:not-allowed}.do-ui-button.medium.with-style,.do-ui-button.large.with-style{position:relative;padding-right:43px}.do-ui-button.medium.with-style::after,.do-ui-button.large.with-style::after{position:absolute;right:0;top:0;width:35px;text-align:center;background:rgba(0,0,0,0.2);font-family:"ui font" !important;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.do-ui-button.large.with-style{padding-right:58px}.do-ui-button.large.with-style::after{width:50px}.do-ui-button.icon-del::after{content:"\e6f0"}.do-ui-button.icon-add::after{content:"\e64c"}.do-ui-button.icon-send::after{content:"\e64b"}.do-ui-button.icon-confirm::after{content:"\e60f"}.do-ui-button.icon-share::after{content:"\e631"}.do-ui-button.icon-bad::after{content:"\e8ee"}.do-ui-button.icon-good::after{content:"\e62d"}.do-ui-button.icon-download::after{content:"\e611"}.do-ui-button.icon-upload::after{content:"\e6f7"}.do-ui-button.icon-mac::after{content:"\e60a"}.do-ui-button.icon-ios::after{content:"\e609"}.do-ui-button.icon-windows::after{content:"\e601"}.do-ui-button.icon-linux::after{content:"\e602"}.do-ui-button.icon-android::after{content:"\e600"}.do-ui-input{position:relative;min-height:30px;padding:0 5px;border:1px solid #bdc3c7;background:#fff;color:#34495e;outline:none;transition:all .1s ease-in-out}.do-ui-input::-webkit-input-placeholder{color:#bdc3c7}.do-ui-input.area{padding:5px}.do-ui-input.radius-3{border-radius:3px}.do-ui-input.radius-5{border-radius:5px}.do-ui-input:focus,.do-ui-input:hover{border-color:#1abc9c;color:#1abc9c}.do-ui-input.alert{border-color:#e74c3c;color:#e74c3c}.do-ui-input.alert input{color:#e74c3c}.do-ui-input.disabled{border-color:transparent;background:#e7e8eb;color:#bdc3c7}.do-ui-input.with-style{display:inline-block;padding:0}.do-ui-input.with-style input{width:100%;height:100%;min-height:30px;padding:0 30px 0 5px;border:0;background:transparent}.do-ui-input.with-style::after{position:absolute;right:0;top:0;width:35px;height:30px;line-height:30px;text-align:center;font-family:"ui font" !important;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.do-ui-input.with-style.icon-user::after{content:"\e6f4"}.do-ui-input.with-style.icon-pwd::after{content:"\e655"}.do-ui-input.with-style.icon-mail::after{content:"\e66e"}.do-ui-input.with-style.icon-date::after{content:"\e650"}.do-ui-input.with-style.icon-phone::after{content:"\e651"}.do-ui-select{display:inline-block;min-height:30px;padding:0 25px 0 5px;border:1px solid #bdc3c7;background:#fff url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAQCAMAAADOBMQXAAAAFVBMVEUAAAD///8wMDAwMDAyMjIzMzMyMjLeZPLMAAAAB3RSTlMAABAwkLDARx1RgwAAAD9JREFUeAGlz0UChFAAgFB+3v/GMwZ2K8u3g7DXI40s6zWnuaXaK7IYVVlElUV14lQik8opw6SyiCqLXB9/0D/ZNQE+FhzMpgAAAABJRU5ErkJggg==) no-repeat right 6px;color:#34495e;outline:none;-webkit-appearance:none;-moz-appearance:none;transition:all .1s ease-in-out}.do-ui-select::-ms-expand{display:none}.do-ui-select.radius-3{border-radius:3px}.do-ui-select.radius-5{border-radius:5px}.do-ui-select:focus{border-color:#1abc9c}.do-ui-select.alert{border-color:#e74c3c;color:#e74c3c}.do-ui-select.disabled{border-color:transparent;background:#e7e8eb;color:#bdc3c7}.do-ui-radio,.do-ui-checkbox{display:inline-block;position:relative;width:auto;height:auto;min-height:30px;padding-left:35px;line-height:30px;border-radius:3px;color:#34495e}.do-ui-radio{padding-left:50px}.do-ui-radio>input{position:absolute;left:10px;top:10px;width:35px;height:10px;border-radius:10px;border:0;background:#bdc3c7;-webkit-appearance:none;-moz-appearance:none}.do-ui-radio>input:checked{background:#bdc3c7}.do-ui-radio>input:disabled{background:#ecf0f1}.do-ui-radio>input:disabled:checked{background:#bdc3c7}.do-ui-radio>input::after{position:absolute;display:block;left:-2px;top:-5px;width:20px;height:20px;border-radius:50%;content:"";background:#ecf0f1;box-shadow:0 1px 2px rgba(0,0,0,0.2)}.do-ui-radio>input:checked::after{left:auto;right:-2px;background:#5d6d7e}.do-ui-radio>input:checked:disabled::after{background:#bdc3c7}.do-ui-radio.green>input:checked{background:#48c9b0}.do-ui-radio.green>input:checked::after{background:#16a085}.do-ui-radio.blue>input:checked{background:#5dade2}.do-ui-radio.blue>input:checked::after{background:#2c81ba}.do-ui-radio.red>input:checked{background:#ec7063}.do-ui-radio.red>input:checked::after{background:#c54133}.do-ui-radio.orange>input:checked{background:#fbbb56}.do-ui-radio.orange>input:checked::after{background:#e67e22}.do-ui-radio.grey>input:checked{background:#5d6d7e}.do-ui-radio.grey>input:checked::after{background:#2c3e50}.do-ui-radio.disabled{color:#bdc3c7}.do-ui-checkbox>input{position:absolute;left:2px;top:2px;width:26px;height:26px;line-height:22px;border:2px solid #bdc3c7;border-radius:3px;text-align:center;font-size:18px;font-family:"ui font" !important;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-appearance:none;-moz-appearance:none}.do-ui-checkbox>input:checked::after{content:"\e60f"}.do-ui-checkbox>input:disabled{border-color:#bdc3c7;color:#bdc3c7}.do-ui-checkbox.green>input{color:#1abc9c !important;border-color:#1abc9c}.do-ui-checkbox.blue>input{color:#3498db !important;border-color:#3498db}.do-ui-checkbox.red>input{color:#e74c3c !important;border-color:#e74c3c}.do-ui-checkbox.orange>input{color:#f39c12 !important;border-color:#f39c12}.do-ui-checkbox.grey>input{color:#34495e !important;border-color:#34495e}.do-ui-checkbox.disabled{color:#bdc3c7}.do-ui-checkbox.with-style{padding-left:5px;padding-right:35px;line-height:26px;border:2px solid #e7e8eb;background:#e7e8eb;text-align:center}.do-ui-checkbox.with-style>input{left:auto;right:0;top:0;line-height:26px;border:0;background:#fff;color:#5d6d7e}.do-ui-checkbox.with-style>input:disabled{color:#bdc3c7 !important}.do-ui-checkbox.with-style.green{border-color:#1abc9c;background:#1abc9c;color:#fff}.do-ui-checkbox.with-style.blue{border-color:#3498db;background:#3498db;color:#fff}.do-ui-checkbox.with-style.red{border-color:#e74c3c;background:#e74c3c;color:#fff}.do-ui-checkbox.with-style.orange{border-color:#f39c12;background:#f39c12;color:#fff}.do-ui-checkbox.with-style.grey{border-color:#34495e;background:#34495e;color:#fff}.do-ui-checkbox.with-style.disabled{border-color:#e7e8eb;background:#e7e8eb;color:#bdc3c7}.do-ui-quote{display:block;position:relative;min-height:60px;margin:10px 0;padding:15px 5px 5px 50px;border:1px solid #ddd;border-radius:10px;background:#f7f7f7}.do-ui-quote::before{position:absolute;left:8px;top:0;font:30px/1.5 "ui font";color:#bdc3c7;content:"\e61b"}.do-ui-warn,.do-ui-mark{display:inline-block;position:relative;min-height:50px;margin:10px 0;padding:8px 8px 8px 50px;border:1px solid #f39c12;border-radius:10px;background:#fffbed;color:#e67e22}.do-ui-warn p,.do-ui-mark p{margin:0 !important}.do-ui-warn::before,.do-ui-mark::before{position:absolute;left:8px;top:0;font:30px/1.5 "ui font";color:#e74c3c;content:"\e6f6"}.do-ui-mark{border-color:#48c9b0;color:#16a085;background:#edfbf8}.do-ui-mark::before{color:#16a085;content:"\e657"} diff --git a/css/basic-elem.scss b/css/basic-elem.scss index 7eab763..06f278a 100644 --- a/css/basic-elem.scss +++ b/css/basic-elem.scss @@ -6,16 +6,7 @@ * @version $Id$ */ -$cg: #1abc9c #48c9b0 #16a085; -$cb: #3498db #5dade2 #2c81ba; -$cr: #e74c3c #ec7063 #c54133; -$co: #f39c12 #f1c40f #e67e22; -$cp: #e7e8eb #ecf0f1 #bdc3c7; -$cgr: #34495e #5d6d7e #2c3e50; - -@mixin ts($c: all, $t: .1s, $m: ease-in-out){ - transition:$c $t $m; -} +@import "var.scss"; /*--------各种按钮---------*/ @@ -60,6 +51,8 @@ $cgr: #34495e #5d6d7e #2c3e50; &.icon-del::after {content:"\e6f0"} &.icon-add::after {content:"\e64c"} &.icon-send::after {content:"\e64b"} + &.icon-confirm::after {content:"\e60f"} + &.icon-share::after {content:"\e631"} &.icon-bad::after {content:"\e8ee"} &.icon-good::after {content:"\e62d"} &.icon-download::after {content:"\e611"} @@ -79,18 +72,33 @@ $cgr: #34495e #5d6d7e #2c3e50; /*--------各种input---------*/ -.do-ui-input {display:inline-block;min-height:30px;padding:0 5px;border:1px solid nth($cp, 3);background:#fff;color:nth($cgr, 1);outline:none;@include ts; - +.do-ui-input {position:relative;min-height:30px;padding:0 5px;border:1px solid nth($cp, 3);background:#fff;color:nth($cgr, 1);outline:none;@include ts; + &::-webkit-input-placeholder {color:nth($cp, 3);} + + &.area {padding:5px;} &.radius-3 {border-radius:3px;} &.radius-5 {border-radius:5px;} - &:focus {border-color:nth($cg, 1);} - &.alert {border-color:nth($cr, 1);color:nth($cr, 1)} + &:focus,&:hover {border-color:nth($cg, 1);color:nth($cg, 1);} + &.alert {border-color:nth($cr, 1);color:nth($cr, 1); + input {color:nth($cr, 1);} + } &.disabled {border-color:transparent;background:nth($cp, 1);color:nth($cp, 3)} - &.area {padding:5px;} + &.with-style {display:inline-block;padding:0; + + input {width:100%;height:100%;min-height:30px;padding:0 30px 0 5px;border: 0;background:transparent;} + + &::after {position:absolute;right:0;top:0;width:35px;height:30px;line-height:30px;text-align:center;font-family:"ui font" !important;-webkit-font-smoothing: antialiased;-moz-osx-font-smoothing: grayscale;} + + &.icon-user::after {content:"\e6f4"} + &.icon-pwd::after {content:"\e655"} + &.icon-mail::after {content:"\e66e"} + &.icon-date::after {content:"\e650"} + &.icon-phone::after {content:"\e651"} + } } @@ -171,14 +179,15 @@ $cgr: #34495e #5d6d7e #2c3e50; } /* 引用文本 */ -.do-ui-quote {position:relative;min-height:60px;margin:10px 0;padding:15px 5px 5px 50px;border:1px solid #ddd;border-radius:10px;background:#f7f7f7; +.do-ui-quote {display:block;position:relative;min-height:60px;margin:10px 0;padding:15px 5px 5px 50px;border:1px solid #ddd;border-radius:10px;background:#f7f7f7; &::before {position:absolute;left:8px;top:0;font:30px/1.5 "ui font";color:nth($cp, 3);content:"\e61b";} } /* 提醒文本 */ .do-ui-warn,.do-ui-mark {display:inline-block;position:relative;min-height:50px;margin:10px 0;padding:8px 8px 8px 50px;border:1px solid nth($co, 1);border-radius:10px;background:#fffbed;color:nth($co, 3); - + + p {margin:0!important;} &::before {position:absolute;left:8px;top:0;font:30px/1.5 "ui font";color:nth($cr, 1);content:"\e6f6";} } .do-ui-mark {border-color:nth($cg, 2);color:nth($cg, 3);background:#edfbf8; diff --git a/css/var.scss b/css/var.scss new file mode 100644 index 0000000..4f6c98d --- /dev/null +++ b/css/var.scss @@ -0,0 +1,10 @@ +$cg: #1abc9c #48c9b0 #16a085; +$cb: #3498db #5dade2 #2c81ba; +$cr: #e74c3c #ec7063 #c54133; +$co: #f39c12 #fbbb56 #e67e22; +$cp: #e7e8eb #ecf0f1 #bdc3c7; +$cgr: #34495e #5d6d7e #2c3e50; + +@mixin ts($c: all, $t: .1s, $m: ease-in-out){ + transition:$c $t $m; +} \ No newline at end of file diff --git a/font/ui-font.eot b/font/ui-font.eot index 03f3907832e09867ebaff17cfdac55a692780565..b295f75dc6c1b39424874b2815b8fb4cb6c6f810 100644 GIT binary patch delta 2796 zcmY+FZA@F&9mbz?{eoY>#_wPV#5T4uCcpsWG$e$j3(X5j^R_fw69@q(1Oh<`RoJG? zX%ltRN~a{=ly%dzs$%(srm0NRR%KJgrYIjsK6P!hP1ROaCur-ceAu!m!e-CmG-~JT z-+8(B+~fOy{?GsV<9lN117Ten2O7q&S-Z@$v$qDW_5LXT)1KE%fawxY_KQ%b^bZUc_IH<}w7agXl%5WwF^*Cjr^m^ypDVmdNa&J9lW^C9jRMno(= z4#CA_;MVNypnLOw;573D@TdE)^3il(m>1PzeBrhj5ru^5Lg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2YS6v%wy`5?x zjKxfr>b4D0pXlpcc~q?jCdbMnb%V*lcDLQhocqg*UZIwE#`u<7m>)=4#CYNT;d?f5 zT8z<>X9{y8ui0(GXD6m!n$DdoWO9dWwyB}>=P#T+SNLx3sMV627&?7s;p1G5aM*{3 bCeP$1r-#lJR!??VEmNasCv%1NQ*HkPe!*wM delta 1634 zcmYk5S!`8R7=^#n-d^hM1f_JIZ*OS}B2Xw(!3s!gkpfxM_sZ*^Lh=yIINo>Y#oiqqzut$mOVED1zo)Z1Yft(+ zz>lJ#UmK|>A|pDV5LNvH$4-vj_~$MJUx=|ohr2pYJb0@PVpF<)YoPPwQ1EK-t*+&3 zT|U@3(6grf@0X!t43Y+h4j;`pcCO{XC(xCykN7a`4&sSE0{vNBtx0Lyo7H%qw1_s~ z%g?*l|2Kyp1O-9g`1PPW2p1$D4c|@P6rNAY3R5CwVNGOq{rTyK5S%4>`fR@DnBIAw zNN`9GsiK^S#z{-F&DL%^Y+pDSi6?K@d?vDP_%fHd^1tyJZd{)p?&D^VMmj0XB76Et zF>=XgH3^~=kwq~jddC7D<58YqE$dj!dY<+RRTk4V7Sc6BlW6L}W0Jhwt zC}1l*3I(>(qj+GeJPHcd=uu=a=c7<~Fjs_7j8KBhX?5nhm!$)Su zX1+G7an`l$;_Qa(k=dg;tvNe$j^vEYxsY3&dnGS3Z#3^-{u}w<6|5{6Eo>~jR``1n zMH`Bnitm*)mb_o`ptQJjtZaMPM0u>drF^XXRz+?_Q$<_F!^*{#6Y;kArTF!#?5ed@ zr>ZU|G82`F_o~yY_f)?.svgfont {display: inline-block;width: 1em;height: 1em;fill: currentColor;vertical-align: -0.1em;font-size:16px;}")}catch(e){console&&console.log(e)}}ready(appendSvg)})(window) \ No newline at end of file +(function(window){var svgSprite='';var script=function(){var scripts=document.getElementsByTagName("script");return scripts[scripts.length-1]}();var shouldInjectCss=script.getAttribute("data-injectcss");var ready=function(fn){if(document.addEventListener){if(~["complete","loaded","interactive"].indexOf(document.readyState)){setTimeout(fn,0)}else{var loadFn=function(){document.removeEventListener("DOMContentLoaded",loadFn,false);fn()};document.addEventListener("DOMContentLoaded",loadFn,false)}}else if(document.attachEvent){IEContentLoaded(window,fn)}function IEContentLoaded(w,fn){var d=w.document,done=false,init=function(){if(!done){done=true;fn()}};var polling=function(){try{d.documentElement.doScroll("left")}catch(e){setTimeout(polling,50);return}init()};polling();d.onreadystatechange=function(){if(d.readyState=="complete"){d.onreadystatechange=null;init()}}}};var before=function(el,target){target.parentNode.insertBefore(el,target)};var prepend=function(el,target){if(target.firstChild){before(el,target.firstChild)}else{target.appendChild(el)}};function appendSvg(){var div,svg;div=document.createElement("div");div.innerHTML=svgSprite;svgSprite=null;svg=div.getElementsByTagName("svg")[0];if(svg){svg.setAttribute("aria-hidden","true");svg.style.position="absolute";svg.style.width=0;svg.style.height=0;svg.style.overflow="hidden";prepend(svg,document.body)}}if(shouldInjectCss&&!window.__iconfont__svg__cssinject__){window.__iconfont__svg__cssinject__=true;try{document.write("")}catch(e){console&&console.log(e)}}ready(appendSvg)})(window) \ No newline at end of file diff --git a/font/ui-font.ttf b/font/ui-font.ttf index 0dbdd6da28de8a5e09195d68737fc874521da239..49e81a81b41484911c17f80157c429c7c4630bfa 100644 GIT binary patch delta 2740 zcmY+EZERE59mbz?ukFNkV#o1YVh0D?u^q=D$?|4O(vVR|c?lFKEo_B^kQYKiLIkPE zI)Q1K_|U=xcoUkosZ+)Hgr=#PP=(M`WfS59^i$WN4OLw~9MINPY}yz@wzKDOirV?+ zci!%~C-?vSpZ~paM_m3yoNvqhyzd}?#b<+ z0{Dz{PjaFBxa9{N-yjW>GxG~q?<{`-h>ywD!$(F({y6pJS-{!G`*&wX7Usm;;?KNS z!}-eDk(u$nU8NJi*ge3QnLBcBWc`6Zw6AO8c=QMN&ngH-7xIFR3F57sJORKf`D2&ocAFq%JU59XAbN`FF= zLMr_U((GCE3i=jOWr5JakSYs=UWQazAapgP$^xOkA(irkPKQ*g5_%p|sY>X6NQ#<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lib/marked/main.js +++ b/js/lib/marked/main.js @@ -852,7 +852,7 @@ Renderer.prototype.blockquote = function(quote) { return '
\n' + quote + '
\n'; }; Renderer.prototype.mark = function(mark, t) { - return '\n' + mark + '\n'; + return '\n' + mark + '\n'; }; Renderer.prototype.task = function(task, t) { diff --git a/js/lib/meditor/main.js b/js/lib/meditor/main.js index 0aeef8e..d518826 100644 --- a/js/lib/meditor/main.js +++ b/js/lib/meditor/main.js @@ -10,8 +10,8 @@ var log = console.log; define([ 'yua', - 'lib/prism/main', - 'lib/marked', + 'lib/prism/base', + 'lib/marked/main', 'css!./skin/main', ], function(yua){ diff --git a/js/lib/pages/main.css b/js/lib/pages/main.css index cae7303..954ffe4 100644 --- a/js/lib/pages/main.css +++ b/js/lib/pages/main.css @@ -1,60 +1 @@ -.do-pages {height:auto;text-align:center;font-size:13px;} -.do-pages a {color:#34495e;} -.do-pages.skin-1 {width:100%;} -.do-pages.skin-2 {float:right;width:auto;} -.do-pages.skin-1 a.normal, -.do-pages.skin-1 a.disabled, -.do-pages.skin-1 a.curr {display:inline-block;width:auto;min-width:40px;height:40px;padding:0 10px;margin:0 3px;line-height:40px;text-decoration:none;cursor:pointer;} -.do-pages.skin-2 a.normal, -.do-pages.skin-2 a.disabled, -.do-pages.skin-2 a.curr {float:left;width:auto;min-width:40px;height:40px;margin:0;padding:0 5px;line-height:40px;} - - -.do-pages.green a.normal {background: #1abc9c;color: #fff; } -.do-pages.green a.normal:hover {background: #48c9b0; } -.do-pages.green.skin-2 a.curr, -.do-pages.green a.normal:active {background: #16a085;color: #fff;} - -.do-pages.blue a.normal {background: #3498db;color: #fff; } -.do-pages.blue a.normal:hover {background: #5dade2; } -.do-pages.blue.skin-2 a.curr, -.do-pages.blue a.normal:active {background: #2c81ba;color: #fff;} - -.do-pages.red a.normal {background: #e74c3c;color: #fff; } -.do-pages.red a.normal:hover {background: #ec7063; } -.do-pages.red.skin-2 a.curr, -.do-pages.red a.normal:active {background: #c54133;color: #fff;} - -.do-pages.orange a.normal {background: #f39c12;color: #fff; } -.do-pages.orange a.normal:hover {background: #f1c40f; } -.do-pages.orange.skin-2 a.curr, -.do-pages.orange a.normal:active {background: #e67e22;color: #fff;} - -.do-pages.plain a.normal {background: #e7e8eb;color: #34495e; } -.do-pages.plain a.normal:hover {background: #ecf0f1; } -.do-pages.plain.skin-2 a.curr, -.do-pages.plain a.normal:active {background: #bdc3c7;color: #34495e; } - -.do-pages.grey a.normal {background: #34495e;color: #fff; } - -.do-pages.grey a.normal:hover {background: #5d6d7e; } -.do-pages.grey.skin-2 a.curr, -.do-pages.grey a.normal:active {background: #2c3e50; color: #fff;} - -.do-pages.skin-1 a.disabled, -.do-pages.skin-1 a.curr {background:none;color:#666;cursor:default} - -.do-pages.skin-1 a.disabled {min-width:0;padding:0;} -.do-pages.skin-1 a.curr {font-weight:bold;font-size:15px;} - -.do-pages.skin-2 a.disabled {display:none;} - - -.do-pages.skin-1 .input-box, -.do-pages.skin-1 .input-box span, -.do-pages.skin-1 .input-box input {display:inline-block} -.do-pages.skin-1 .input-box input {width:25px;height:20px;padding:0 3px;background:#fff;border:1px solid #ddd} -.do-pages.skin-1 .input-box a.normal{height:30px;line-height:30px;} - -.do-pages.skin-2 .input-box {display:none;} - +.do-pages{height:auto;text-align:center;font-size:13px}.do-pages a{display:inline-block;width:auto;min-width:40px;height:40px;line-height:40px;color:#34495e;text-decoration:none;cursor:pointer}.do-pages a.curr,.do-pages a.disabled{cursor:default}.do-pages.skin-1{width:100%}.do-pages.skin-1 a.normal,.do-pages.skin-1 a.disabled,.do-pages.skin-1 a.curr{padding:0 10px;margin:0 3px}.do-pages.skin-1 a.curr{font-weight:bold;font-size:15px}.do-pages.skin-1 a.disabled{min-width:0;padding:0}.do-pages.skin-1 .input-box,.do-pages.skin-1 .input-box span,.do-pages.skin-1 .input-box input{display:inline-block}.do-pages.skin-1 .input-box input{width:25px;height:20px;padding:0 3px;background:#fff;border:1px solid #ddd}.do-pages.skin-1 .input-box a.normal{height:30px;line-height:30px}.do-pages.skin-2{float:right;width:auto}.do-pages.skin-2 a.normal,.do-pages.skin-2 a.disabled,.do-pages.skin-2 a.curr{float:left;margin:0;padding:0 5px;color:#fff}.do-pages.skin-2 a.disabled{display:none}.do-pages.skin-2 .input-box{display:none}.do-pages.plain a.normal{background:#e7e8eb}.do-pages.plain a.normal:hover{background:#ecf0f1}.do-pages.skin-2.plain a.curr,.do-pages.plain a.normal:active{background:#bdc3c7}.do-pages.grey a.normal{background:#34495e;color:#fff}.do-pages.grey a.normal:hover{background:#5d6d7e}.do-pages.skin-2.grey a.curr,.do-pages.grey a.normal:active{background:#2c3e50}.do-pages.red a.normal{background:#e74c3c;color:#fff}.do-pages.red a.normal:hover{background:#ec7063}.do-pages.skin-2.red a.curr,.do-pages.red a.normal:active{background:#c54133}.do-pages.orange a.normal{background:#f39c12;color:#fff}.do-pages.orange a.normal:hover{background:#fbbb56}.do-pages.skin-2.orange a.curr,.do-pages.orange a.normal:active{background:#e67e22}.do-pages.green a.normal{background:#1abc9c;color:#fff}.do-pages.green a.normal:hover{background:#48c9b0}.do-pages.skin-2.green a.curr,.do-pages.green a.normal:active{background:#16a085}.do-pages.blue a.normal{background:#3498db;color:#fff}.do-pages.blue a.normal:hover{background:#5dade2}.do-pages.skin-2.blue a.curr,.do-pages.blue a.normal:active{background:#2c81ba} diff --git a/js/lib/pages/main.js b/js/lib/pages/main.js index 51cddb2..31b5df8 100644 --- a/js/lib/pages/main.js +++ b/js/lib/pages/main.js @@ -1,7 +1,7 @@ "use strict"; define(["yua","text!./main.htm", "css!./main"], function(yua, tpl) { - yua.ui.pages = '0.0.1' + yua.ui.pages = '1.0.0' var colors = {plain: 1, green: 1, blue: 1, red: 1, orange: 1, grey: 1}, themes = ['skin-1 ', 'skin-2 ']; //计算页码列表 diff --git a/js/lib/pages/main.scss b/js/lib/pages/main.scss new file mode 100644 index 0000000..ab62520 --- /dev/null +++ b/js/lib/pages/main.scss @@ -0,0 +1,77 @@ +@charset "UTF-8"; +/** + * + * @authors yutent (yutent@doui.cc) + * @date 2017-09-08 20:03:06 + * @version $Id$ + */ + +@import "../../../css/var.scss"; + + +.do-pages {height:auto;text-align:center;font-size:13px; + + a {display:inline-block;width:auto;min-width:40px;height:40px;line-height:40px;color: nth($cgr, 1);text-decoration:none;cursor:pointer;} + a.curr, a.disabled {cursor:default;} + + &.skin-1 {width:100%; + + a.normal, + a.disabled, + a.curr {padding:0 10px;margin:0 3px;} + + a.curr {font-weight:bold;font-size:15px;} + a.disabled {min-width:0;padding:0} + + .input-box, + .input-box span, + .input-box input {display:inline-block} + .input-box input {width:25px;height:20px;padding:0 3px;background:#fff;border:1px solid #ddd} + .input-box a.normal{height:30px;line-height:30px;} + } + + + &.skin-2 {float:right;width:auto; + + a.normal, + a.disabled, + a.curr {float:left;margin:0;padding:0 5px;color:#fff;} + + a.disabled {display:none;} + + .input-box {display:none;} + } + + &.plain a.normal {background:nth($cp, 1)} + &.plain a.normal:hover {background:nth($cp, 2)} + &.skin-2.plain a.curr, + &.plain a.normal:active {background:nth($cp, 3)} + + &.grey a.normal {background:nth($cgr, 1);color: #fff;} + &.grey a.normal:hover {background:nth($cgr, 2)} + &.skin-2.grey a.curr, + &.grey a.normal:active {background:nth($cgr, 3)} + + &.red a.normal {background:nth($cr, 1);color: #fff;} + &.red a.normal:hover {background:nth($cr, 2)} + &.skin-2.red a.curr, + &.red a.normal:active {background:nth($cr, 3)} + + &.orange a.normal {background:nth($co, 1);color: #fff;} + &.orange a.normal:hover {background:nth($co, 2)} + &.skin-2.orange a.curr, + &.orange a.normal:active {background:nth($co, 3)} + + &.green a.normal {background:nth($cg, 1);color: #fff;} + &.green a.normal:hover {background:nth($cg, 2)} + &.skin-2.green a.curr, + &.green a.normal:active {background:nth($cg, 3)} + + &.blue a.normal {background:nth($cb, 1);color: #fff;} + &.blue a.normal:hover {background:nth($cb, 2)} + &.skin-2.blue a.curr, + &.blue a.normal:active {background:nth($cb, 3)} + +} + + diff --git a/js/lib/router/router.js b/js/lib/router/main.js similarity index 100% rename from js/lib/router/router.js rename to js/lib/router/main.js diff --git a/js/lib/router/router.min.js b/js/lib/router/router.min.js deleted file mode 100644 index 99a30c8..0000000 --- a/js/lib/router/router.min.js +++ /dev/null @@ -1 +0,0 @@ -define(["yua"],function(){function t(){this.table={get:[]},this.errorFn=null,this.history=null,this.hash="",this.started=!1,this.init={}}function e(t){return!t||t===window.name||"_self"===t||"top"===t&&window==window.top}var r={prefix:/^(#!|#)[\/]?/,historyOpen:!0,allowReload:!0},i=!0,a=/(:id)|(\{id\})|(\{id:([A-z\d\,\[\]\{\}\-\+\*\?\!:\^\$]*)\})/g;return t.prototype={error:function(t){this.errorFn=t},config:function(t){if(this.started)return console.error("Router config has been set");this.started=!0,t.allowReload||(t.historyOpen=!0),this.init=yua.mix({},r,t)},_getRegExp:function(t,e){var r=t.replace(a,function(t,e,r,i,a){var n="([\\w.-]";return e||r?n+"+)":(/^\{[\d\,]+\}$/.test(a)||(n="("),n+a+")")});return r=r.replace(/(([^\\])([\/]+))/g,"$2\\/").replace(/(([^\\])([\.]+))/g,"$2\\.").replace(/(([^\\])([\-]+))/g,"$2\\-").replace(/(\(.*)(\\[\-]+)(.*\))/g,"$1-$3"),r="^"+r+"$",e.regexp=new RegExp(r),e},_add:function(t,e,r){this.started||this.config({});var i=this.table[t.toLowerCase()];if("/"===e.charAt(0)){e=e.replace(/^[\/]+|[\/]+$|\s+/g,"");var a={};a.rule=e,a.callback=r,yua.Array.ensure(i,this._getRegExp(e,a))}else console.error('char "/" must be in front of router rule')},_route:function(t,e){var e=e.trim(),r=this.table[t],i=this.init;if(i.allowReload||e!==this.history){i.historyOpen&&(this.history=e,yua.ls&&yua.ls("lastHash",e));for(var a,n=0;a=r[n++];){var o=e.match(a.regexp);if(o)return o.shift(),a.callback.apply(a,o)}this.errorFn&&this.errorFn(e)}},on:function(t,e){var r=this;Array.isArray(t)?t.forEach(function(t){r._add("get",t,e)}):this._add("get",t,e)}},yua.bind(window,"load",function(){if(yua.router.started){var t=yua.router.init.prefix,e=location.hash;e=e.replace(t,"").trim(),yua.router._route("get",e)}}),"onhashchange"in window&&window.addEventListener("hashchange",function(t){if(i){var e=yua.router.init.prefix,r=location.hash.replace(e,"").trim();yua.router._route("get",r)}}),yua.bind(document,"mousedown",function(t){if(!(("defaultPrevented"in t?t.defaultPrevented:!1===t.returnValue)||t.ctrlKey||t.metaKey||2===t.which)){for(var r=t.target;"A"!==r.nodeName;)if(!(r=r.parentNode)||"BODY"===r.tagName)return;if(e(r.target)){if(!yua.router.started)return;var a=r.getAttribute("href")||r.getAttribute("xlink:href"),n=yua.router.init.prefix;if(null===a||!n.test(a))return;yua.router.hash=a.replace(n,"").trim(),t.preventDefault(),location.hash=a,i=!1}}}),yua.bind(document,"mouseup",function(){i||(yua.router._route("get",yua.router.hash),i=!0)}),yua.ui.router="0.0.1",yua.router=new t}); \ No newline at end of file