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 03f3907..b295f75 100644 Binary files a/font/ui-font.eot and b/font/ui-font.eot differ diff --git a/font/ui-font.js b/font/ui-font.js index 59a539a..39ad8c5 100644 --- a/font/ui-font.js +++ b/font/ui-font.js @@ -1 +1 @@ -(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 +(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 0dbdd6d..49e81a8 100644 Binary files a/font/ui-font.ttf and b/font/ui-font.ttf differ diff --git a/js/lib/marked/main.js b/js/lib/marked/main.js index f3b701a..e2bda61 100644 --- a/js/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