采用ACE界面

This commit is contained in:
yubaolee
2016-10-14 11:22:16 +08:00
parent 007c901002
commit 9606a71f72
1536 changed files with 285929 additions and 7686 deletions

View File

@@ -0,0 +1,617 @@
//some checkbox & switch variables
@checkbox-color: #32A3CE;
@checkbox-border-color: #C8C8C8;
@checkbox-checked-border: #ADB8C0;
@checkbox-hover-border: #FF893C;
@checkbox2-bg: #F9A021;
@switch-checked-bg: #8AB2C9;
@switch-checked-border: #6A8CA8;
@switch4-bg: #8B9AA3;
@switch4-color: #939393;
@switch4-checked-bg: #468FCC;
@switch6-checked-border: #B7D3E5;
@switch6-checked-bg: #FF893C;
@switch7-checked-bg: #468FCC;
@switch7-checked-border: #6FB3E0;
@switch-1-text: "ON\a0\a0\a0\a0\a0\a0\a0\a0\a0OFF";
@switch-2-text: "YES\a0\a0\a0\a0\a0\a0\a0\a0\a0NO";
@switch-4-text: "ON\a0\a0\a0\a0\a0\a0\a0\a0\a0\a0\a0OFF";
@switch-5-text: "YES\a0\a0\a0\a0\a0\a0\a0\a0\a0\a0\a0NO";
@switch-7-text: "OFF\a0\a0\a0\a0\a0\a0\a0\a0\a0\a0\a0\a0\a0\a0ON";
@lbl_selector: ~"+ .lbl";
//@lbl_selector: ~"~ .lbl";//uncomment for ASP.NET or use css builder tool
.enable_checkbox() when(@enable-checkbox = true) {
//Checkbox & Radio
@lbl: @lbl_selector;//+ .lbl or ~ .lbl (for ASP.NET)
input[type=checkbox].ace , input[type=radio].ace {
opacity: 0;
position: absolute;
z-index: 1;//so that it is clickable and above (.lbl)
width: 18px;
height: 18px;
cursor: pointer;
label & {
z-index: -100 !important;
width: 1px !important;//width '0' has issues with jQuery Validate not recognizing this
height: 1px !important;
clip: rect(1px, 1px, 1px, 1px);
position: absolute;//"fixed" causes issues on iOS safari?!
//we don't need it to be hoverable/clickable when inside a label
}
&:checked, &:focus {
outline: none !important;
}
@{lbl} {
position: relative;
display:inline-block;
margin:0;
line-height:20px;
min-height:18px;
min-width:18px;
font-weight:normal;
cursor: pointer;
&::before {
cursor: pointer;
font-family: fontAwesome;
font-weight: normal;
font-size: @font-size-checkbox;
color: #FFF;
content: "\a0";
display: inline-block;
background-color: #FAFAFA;
border: 1px solid @checkbox-border-color;
box-shadow: 0 1px 2px rgba(0,0,0,0.05);/*, inset 0px -15px 10px -12px rgba(0,0,0,0.05);*/
border-radius: 0;
display: inline-block;
text-align: center;
//vertical-align: text-bottom;
//vertical-align: middle;
height: 16px;
line-height: 14px;
min-width: 16px;
margin-right: 1px;
position: relative;
top: -1px;
}
}//.lbl
&:checked @{lbl}::before ,
{
display:inline-block;
content: '\f00c';
color: @checkbox-color;
background-color: #F5F8FC;
border-color: @checkbox-checked-border;
box-shadow: 0 1px 2px rgba(0,0,0,0.05), inset 0px -15px 10px -12px rgba(0,0,0,0.05), inset 15px 10px -12px rgba(255,255,255,0.1);
}
&:hover @{lbl}::before , @{lbl}:hover::before {
border-color:@checkbox-hover-border;
}
&:focus @{lbl}::before {
border-color: @input-border-focus;
}
&:active , &:checked:active {
@{lbl}::before {
box-shadow: 0 1px 2px rgba(0,0,0,0.05), inset 0px 1px 3px rgba(0,0,0,0.1);
}
}
&.ace-checkbox-2 @{lbl}::before {
box-shadow: none;
}
&.ace-checkbox-2:checked @{lbl}::before {
background-color: @checkbox2-bg;
border-color: @checkbox2-bg;
color: #FFF;
}
&:disabled @{lbl}::before ,
&[disabled] @{lbl}::before ,
&.disabled @{lbl}::before {
background-color:#DDD !important;
border-color:#CCC !important;
box-shadow:none !important;
color:#BBB;
}
}
//opera fix
//no_such_element:-o-prefocus, input[type=checkbox].ace @{lbl}::before, input[type=radio].ace @{lbl}::before {
//vertical-align: middle;
//}
.checkbox label input[type=checkbox].ace @{lbl}, .radio label input[type=radio].ace @{lbl} {
margin-left: -10px;
}
/**
input[type=radio].ace @{lbl}::before {
border-radius:100%;
font-size: 34px;
font-family: Helvetica, Arial, "Sans-Serif";//looks better but incosistent
line-height: 13px;
}
*/
input[type=radio].ace @{lbl}::before {
border-radius: 100%;
font-size: @font-size-radio;
font-family: FontAwesome;//let's use a fonts that's available everywhere
text-shadow: 0 0 1px @checkbox-color;
line-height: 15px;
height: 17px;
min-width: 17px;
}
input[type=radio].ace:checked @{lbl}::before {
content:"\f111";
}
input[type=checkbox].ace.input-lg @{lbl}::before{
border-radius: 4px;
font-size: @font-size-checkbox-large;
height: 24px;
line-height: 21px;
min-width: 24px;
top: auto;
}
input[type=radio].ace.input-lg @{lbl}::before {
font-size: @font-size-radio-large;
height: 24px;
line-height: 22px;
min-width: 24px;
top: auto;
}
/* CSS3 on/off switches */
//use like <input type="checkbox" class="ace ace-switch" /> <span class="lbl"></span>
.enable_switches() when(@enable-switch = true) {
input[type=checkbox].ace.ace-switch {
width: 55px;
height: 25px;
@{lbl} {
margin:0 4px;
min-height:24px;
&::before {
font-family: 'Open Sans';
content: @switch-1-text;
color: #999;
text-shadow: 0 0 0 #999;
font-weight: normal;
font-size: @font-size-switch-1-text;
line-height: 17px;// line-height:21px \9;/*ie9*/
height: 20px;
overflow: hidden;
border-radius: 12px;
background-color: #F5F5F5;
//.box-shadow(~"inset 0px 2px 2px 0px rgba(0,0,0,.2)");
.box-shadow(~"inset 0 1px 1px 0 rgba(0, 0, 0, 0.15)");
border: 1px solid #CCC;
text-align: left;
float: left;
padding: 0;
width: 52px;
text-indent: -21px;// text-indent: -21px \9;
margin-right: 0;
.transition(~"text-indent 0.25s ease");
top: auto;
}
&::after {
font-family: 'Open Sans';
content: 'III';
font-size: @font-size-switch-1-bar;
font-weight: normal;
letter-spacing: 0;
color: #AAA;
text-shadow: none;
//text-shadow: 0 0 0 #999;
background-color: #FFF;
//text-align: center;
//text-indent: -2px;
border-radius: 100%;
width: 22px;
height: 22px;
line-height: 22px;
text-align: center;
position: absolute;
top: -2px;
left: -3px;
.box-shadow(~"0px 1px 1px 1px rgba(0,0,0,.3)");
//text-shadow:0px 1px 1px rgba(0,0,0,0.3) inset;
.transition(~"left 0.25s ease");
}
}
&:checked @{lbl} {
&::before {
text-indent: 8px;
color: #FFF;
text-shadow: 0 0 0 #FFF;
background-color: @switch-checked-bg;
border-color: @switch-checked-border;
}
&::after {
left: 34px;
background-color: #FFF;
color: #98A0A5;
//text-shadow: 0 0 0 #465868;
}
}
&.ace-switch-2 @{lbl}::before {
content: @switch-2-text;
}
&.ace-switch-3 @{lbl}::after {
font-family: FontAwesome;
font-size: @font-size-switch-3-text;
line-height: 22px;
content: "\f00d";
top: -1px;
text-shadow: none;
padding: 0;
text-align: center;
color: #BBB;
letter-spacing: 0;
}
&.ace-switch-3:checked @{lbl}::after {
content: "\f00c";
color: #8AB2C9;
text-shadow: none;
}
//switch style 4 & 5
.enable_switch_style_4() when(@enable-switch-style-4 = true) {
&.ace-switch-4 , &.ace-switch-5 {
width: 60px;
@{lbl}::before {
content: @switch-4-text;
//font-family:Arial, Helvetica, sans-serif;
//font-weight:bolder;
font-size: @font-size-switch-4-text;
line-height: 21px;
height: 24px;
overflow: hidden;
//line-height:25px \9;
border-radius: 12px;
display: inline-block;
background-color: @switch4-bg;
border: 1px solid @switch4-bg;
color: #FFF;
width: 56px;
text-indent: -25px;// text-indent: -28px \9;
text-shadow: 0 0 0 #FFF;
display: inline-block;
position: relative;
//margin-right:8px;
box-shadow:none;
.transition(~"all 0.25s ease");
}
@{lbl}::after {
content: 'III';
font-size: @font-size-switch-4-bar;
position: absolute;
top: 2px;
left: 2px;
letter-spacing: 0;
width: 20px;
height: 20px;
line-height: 19px;
text-shadow: none !important;
color: @switch4-color;
background-color:#FFF;
.transition(~"all 0.25s ease");
}
&:checked @{lbl} {
&::before {
text-indent: 9px;
background-color: @switch4-checked-bg;
border-color: #468FCC;
}
&::after {
left: 34px;
background-color: #FFF;
color: darken(@switch4-color , 6%);
}
}
}
&.ace-switch-5 @{lbl}::before {
content: @switch-5-text;
}
&.ace-switch-5:checked @{lbl}::before {
text-indent: 8px;
}
}
.enable_switch_style_4();
.enable_switch_style_6() when(@enable-switch-style-6 = true) {
//switch style 6
&.ace-switch-6 {
@{lbl} {
position: relative;
&::before {
font-family: FontAwesome;
content: "\f00d";
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
box-shadow: none;
border-width: 0;
font-weight: lighter;
font-size: @font-size-switch-6-text;
border-radius: 12px;
display: inline-block;
background-color: #888;
color: #F2F2F2;
width: 52px;
height: 22px;
line-height: 21px;
text-indent: 32px;
.transition(~"background 0.25s ease");
}
&::after {
content: ''; text-shadow:0 -1px 0 rgba(0, 0, 0, 0.25);
position: absolute;
top: 2px;
left: 3px;
border-radius: 12px;
box-shadow:0 -1px 0 rgba(0, 0, 0, 0.25);
width: 18px;
height: 18px;
text-align: center;
background-color: #F2F2F2;
border: 4px solid #F2F2F2;
.transition(~"left 0.25s ease");
}
}
&:checked @{lbl} {
&::before {
content: "\f00c";
text-indent:6px;
color:#FFF;
border-color:@switch6-checked-border;
background-color:@switch6-checked-bg;
}
&::after {
left:32px;
background-color:#FFF;
border:4px solid #FFF;
text-shadow:0 -1px 0 rgba(0, 200, 0, 0.25);
}
}
}
}
.enable_switch_style_6();
.enable_switch_style_7() when(@enable-switch-style-7 = true) {
&.ace-switch-7 {
width:75px;
@{lbl} {
position: relative;
&::before {
content: @switch-7-text;
font-weight: bolder;
font-size: @font-size-switch-7-text;
line-height: 20px;
display: inline-block;
background-color: #FFF;
border: 2px solid #AAA;
border-radius: 0;
box-shadow: none;
color: #AAA;
width: 74px;
height: 26px;
line-height: 22px;
overflow: hidden;
text-indent: 5px;
display: inline-block;
position: relative;
//margin-right:8px;
.transition(~"all 0.25s ease");
}
&::after {
content: '\f00d';
font-family: FontAwesome;
font-size: @font-size-switch-7-bar;
position: absolute;
top: 3px;
left: 39px;
width: 32px;
height: 20px;
line-height: 18px;
text-align: center;
padding: 0;
text-indent: 0;
background-color: #AAA;
color: #FFF;
border-radius: 0;
box-shadow: none;
.transition(~"all 0.25s ease");
}
}
&:checked @{lbl} {
&::before {
color: @switch7-checked-bg;
background-color: #FFF;
text-indent: -28px;
border-color: @switch7-checked-border;
}
&::after {
left: 3px;
content: '\f00c';
background-color: @switch7-checked-bg;
color: #FFF;
}
}
}
}
.enable_switch_style_7();
}
//any custom text
input[type=checkbox].ace.ace-switch @{lbl}[data-lbl]::before {
content: attr(data-lbl);
}
input[type=checkbox].ace.ace-switch.btn-empty @{lbl}::after {
content: "";
}
input[type=checkbox].ace.ace-switch.btn-rotate @{lbl}::after {
content: "\2261";// the 3 line (menu) character
line-height: 20px;
font-size: @font-size-switch-rotated-bar;
}
input[type=checkbox].ace.ace-switch-4.btn-rotate @{lbl}::after,
input[type=checkbox].ace.ace-switch-5.btn-rotate @{lbl}::after {
line-height: 17px;
}
//flat, square
input[type=checkbox].ace.ace-switch.btn-flat @{lbl}::before,
input[type=checkbox].ace.ace-switch.btn-flat @{lbl}::after {
border-radius: 0 !important;
}
input[type=checkbox].ace.ace-switch.ace-switch-4 , input[type=checkbox].ace.ace-switch.ace-switch-5 {
@{lbl}::before {
text-indent: -24px;
}
&:checked @{lbl}::before {
text-indent: 7px;
}
}
}
.enable_switches();
input.ace @{lbl} {
.checkbox-paddings() {// a little paddings for .lbl
.checkbox-paddingX (@index) when (@index >= 0) {
&.padding-@{index}::before {
margin-right: unit(@index,px);
}
.checkbox-paddingX(@index - 2);
}
.checkbox-paddingX(16);
}
.checkbox-paddings();
}
}
.enable_checkbox();

View File

@@ -0,0 +1,454 @@
//some file input variables
@file-input-bg:#FFF;
@file-input-border:#D5D5D5;
@file-input-shadow:~"0 0 0 4px rgba(0,0,0,0.06)";
@file-input-hover-border:#F59942;
@file-input-hover-shadow:~"0 0 0 4px rgba(245, 153, 66, 0.3)";
@file-input-btn-bg:#6FB3E0;
@file-input-name-color:#888;
@file-input-selected-name-color:#666;
@file-input-icon-bg:#D1D1D1;//!ignore
@file-input-selected-icon-bg:#EFAD62;//!ignore
@file-input-selected-icon-picture-bg:#BD7A9D;//!ignore
@file-input-selected-icon-film-bg:#87B87F;//!ignore
@file-input-selected-icon-music-bg:#8B7AC9;//!ignore
@file-input-selected-icon-archive-bg:#EFAD62;//!ignore
@file-remove-bg:#FB7142;
@file-multi-remove-color:#F4C0B1;
@file-multi-border:#AAA;
.enable_file_input() when(@enable-file-input = true) {
.ace-file-input {
display: block;
font-size: inherit;
position: relative;
height: 30px;
//line-height: 38px;
//margin-bottom: 9px;
input[type=file] {
position: absolute;
z-index: -999;
width: 1px;
height: 1px;
overflow: hidden;
.opacity(0);
&:focus {
outline: none;
}
}
.ace-file-container {
display: block;
position: absolute;
top: 0;
left: 0;
right: 0;
height: 30px;
background-color:@file-input-bg;
border:1px solid @file-input-border;
cursor:pointer;
//.box-shadow(@file-input-shadow);
.box-shadow(none);
.transition(~"all 0.15s");
&:hover {
//.box-shadow(@file-input-hover-shadow);
.box-shadow(none);
border-color:@file-input-hover-border;
}
//the button
&:before {
display: inline-block;
content: attr(data-title);
position: absolute;
right: 0;
top: 0;
bottom: 0;
line-height: 24px;
text-align: center;
padding: 0 8px;
background-color: @file-input-btn-bg;
color: #FFF;
font-size: @font-size-file-input-btn;
font-weight: bold;
border: 2px solid #FFF;
border-left-width: 4px;
.transition(~"all 0.3s");
}
.ace-file-name { //the file name container
display: inline-block;
height: 28px;
max-width: 80%;
white-space: nowrap;
overflow: hidden;
line-height: 28px;
color:@file-input-name-color;
font-size: @font-size-file-input-name;
vertical-align: top;
position: static;
padding-left: 30px;
&:after { //the file name
display: inline-block;
content: attr(data-title);
}
}
&.selected {
right: 16px;
.ace-file-name {
color:@file-input-selected-name-color;
}
}
.@{icon} {
.ace-file-icon();
background-color:@file-input-icon-bg;//should be here
}
&.selected .ace-file-name {
.@{icon} {
background-color:@file-input-selected-icon-bg;
}
.file-image {
background-color:@file-input-selected-icon-picture-bg;
}
.file-video {
background-color:@file-input-selected-icon-film-bg;
}
.file-audio {
background-color:@file-input-selected-icon-music-bg;
}
.file-archive {
background-color:@file-input-selected-icon-archive-bg;
}
}
&.hide-placeholder:before {
display:none;
}
}
a:hover{
text-decoration:none;
}
.remove { // the remove button
position: absolute;
right: -8px;
top: 6px;
display: none;
width: 17px;
text-align: center;
height: 17px;
line-height: 15px;
font-size: @font-size-file-input-reset;
font-weight: normal;
background-color: @file-remove-bg;
.border-radius(100%);
color: #FFF;
text-decoration: none;
}
.ace-file-container.selected + .remove {
display: inline-block;
}
}
@media screen and (-webkit-min-device-pixel-ratio:0) {
.ace-file-input input[type=file] {
position: absolute;
width: 0; height: 0;
}
}
.ace-file-input input[type=file] {
&.disabled , &[disabled] , &[readonly] {
+ .ace-file-container {
cursor: not-allowed;
background-color:#EEE;
&:hover {
//box-shadow: 0 0 0 4px rgba(0,0,0,0.06);
.box-shadow(none);
border-color:#E3E3E3;
}
&:before {
border-color:#EEE;
background-color:#A1AAAF;
}
}
}
&[readonly] + .ace-file-container {
cursor:default;
}
}
.ace-file-icon() {
display: inline-block;
position: absolute;
left: 0;
top: 0;
bottom: 0;
line-height: 24px;
width: 26px;
text-align: center;
font-family: FontAwesome;
font-size: @font-size-file-input-icon;
border: 2px solid #FFF;
color: #FFF;
.transition(~"all 0.1s");
}
.ace-file-input .ace-file-overlay {
position: absolute;
top: -2px;
bottom: -2px;
left: -2px;
right: -10px;
z-index: 99;
background-color: rgba(0,0,0,0.5);
> .overlay-content {
display: inline-block;
position: relative;
top: 10%;
left: 0;
right: 0;
text-align: center;
}
}
.enable_file_input_multiple() when(@enable-file-input-multiple = true) {
.ace-file-multiple {
height:auto;
.ace-file-container {
position:relative;
height:auto;
border:1px dashed @file-multi-border;
border-radius:4px;
text-align:center;
&:before {//the button
display: inline-block;
content: attr(data-title);
position: relative;
right: 0;
left: 0;
margin: 12px;
line-height: 22px;
background-color: #FFF;
color: #CCC;
font-size: @font-size-file-input-name-large;
font-weight: bold;
border-width: 0;
}
&.selected .ace-file-name .@{icon} {
.ace-file-icon();
}
.ace-file-name {
position: relative;
display: block;
padding: 0;
height: auto;
width: auto;
max-width: 100%;
margin: 0 4px;
border-bottom: 1px solid #DDD;
text-align: left;
&:first-child {
margin-top: 1px;
}
&:last-child {
border-bottom-width: 0;
margin-bottom: 1px;
}
img {
padding: 2px;
border: 1px solid #D7D7D7;
background-color: #FFF;
background-repeat: no-repeat;
background-position: center;
margin: 4px 8px 4px 1px;
}
&:after {//the file name
display: none;
}
}
&.selected .ace-file-name:after {//the file name
display: inline-block;
white-space: pre;
}
.ace-file-name img + .@{icon} , &.selected .ace-file-name img + .@{icon} {
display: none;
}
}
.remove {
right: -11px;
top: -11px;
border: 3px solid #BBB;
border-radius: 32px;
background-color: #FFF;
color: red;
width: 23px;
height: 23px;
line-height: 16px;
}
.ace-file-container.selected + .remove:hover {
border-color: @file-multi-remove-color;
}
.ace-file-overlay {
position: absolute;
top: -12px;
bottom: -6px;
left: -12px;
right: -12px;
> .overlay-content {
top: 20%;
}
}
}
.ace-file-multiple .ace-file-container {
.ace-file-name .@{icon} {
position: relative;
display: block;
text-align: center;
height: auto;
line-height: 64px;
width: auto;
font-size: @font-size-file-input-icon-large;
color: #D5D5D5;
margin: 4px 0;
background-color: transparent;
}
&.selected:after {
display:none;
}
&.selected .ace-file-name .@{icon} {
position:relative;
margin-right:4px; margin-left:2px;
line-height:24px;
}
.ace-file-name.large {
text-align: center;
border-bottom: 1px solid #222;
margin: 0 1px 3px;
&:last-child {
margin: 0 1px;
//border-bottom-width: 0;
}
&:after { //image caption
position: absolute;
top: auto;
bottom: 0;
left: 0;
right: 0;
padding: 0 4px;
background-color: #555;
color: #FFF;
.opacity(0.8);
}
img {
border-width: 0;
margin: 0 !important;//to override .RTL's
padding: 0;
}
}
}
.ace-file-multiple input[type=file] {
&.disabled , &[disabled] , &[readonly] {
+ .ace-file-container {
&:hover {
border-color:#AAA;
}
&:before {
background-color:transparent;
}
.@{icon} {
border-color:#EEE;
}
}
}
}
}
.enable_file_input_multiple();
}
.enable_file_input();