widgets: add input widget to replace former jquery implementation

This commit is contained in:
jean-emmanuel 2017-07-10 15:41:42 +02:00
parent 2d4c4588a7
commit 53c3ed7a35
20 changed files with 442 additions and 253 deletions

View file

@ -48,53 +48,6 @@
color:var(--color-accent);
}
}
.Xinput {
width:100%;
height:24rem;
border:0;
background:transparent;
color:var(--color-text-fade);
display:block;
padding:4rem 5rem;
position: relative;
display: var(--display-input);
// background: var(--color-track);
// border: 1rem solid var(--color-bg);
input {
position: absolute;
top:0;
left:0;
right:0;
bottom:0;
padding:4rem 5rem;
width: 100%;
font: inherit;
text-align:center;
border:0;
background: transparent;
color:var(--color-accent);
border-radius: 0;
-webkit-appearance:none;
// font-weight: bold;
}
canvas {
width:100%;
height:100%;
opacity: 0.8;
}
input + canvas {
visibility: hidden;
}
&:focus {
color:var(--color-accent);
}
&[disabled] {
color:var(--color-text-fade);
}
}
}

View file

@ -32,6 +32,15 @@
flex-direction: column;
position: relative;
> .input {
height: 25rem;
line-height: 25rem;
flex:initial!important;
display: block;
background: transparent!important;
border: 0!important;
}
.wrapper {
overflow: hidden;
flex:1;
@ -240,6 +249,10 @@
position: absolute;
border:0;
background:transparent;
overflow: hidden;
position: absolute;
top:50%;
left:50%;
}
&.horizontal {
@ -255,8 +268,10 @@
}
.input {
top:50%;
margin-top: calc(var(--input-margin) - 12rem );
width: 100rem;
height: 24rem;
margin-left: -50rem;
margin-top: calc(-1 * 12rem + var(--input-margin));
}
.pips {
@ -274,16 +289,15 @@
&:not(.horizontal) {
.input {
overflow: hidden;
position: absolute;
top:50%;
transform: rotate(-90deg);
width: 100rem;
margin-top: -12rem;
margin-left: calc(-1 * 50rem + var(--input-margin));
left:50%;
height: 100rem;
width: 24rem;
margin-top: -50rem;
margin-left: calc(-1 * 12rem + var(--input-margin));
z-index: 3;
input {
transform: rotate(-90deg);
width: 100rem;
}
}
&.align-right {

View file

@ -0,0 +1,55 @@
.input-container {
width: 100rem;
height: 60rem;
.input {
}
}
.widget {
.input {
display: flex;
flex:1;
background:transparent;
color:var(--color-text-fade);
padding:4rem 5rem;
display: var(--display-input);
overflow: hidden;
// background: var(--color-track);
// border: 1rem solid var(--color-bg);
text-align:center;
margin:1rem;
padding:1rem;
border: 1rem solid var(--color-bg);
background: var(--color-track);
input {
height: 100%;
width: 100%;
font: inherit;
border:0;
padding:0;
background: transparent;
color:var(--color-accent);
border-radius: 0;
-webkit-appearance:none;
text-align:inherit;
vertical-align: top;
// font-weight: bold;
}
canvas {
height: 100%;
width: 100%;
}
input + canvas {
// visibility:hidden;
// position: absolute;
display: none;
}
&:focus {
color:var(--color-accent);
}
}
}

View file

@ -20,6 +20,15 @@
flex-direction: column;
position: relative;
> .input {
height: 25rem;
line-height: 25rem;
flex:initial!important;
display: block;
background: transparent!important;
border: 0!important;
}
.wrapper {
overflow: hidden;
flex:1;

View file

@ -30,13 +30,12 @@
overflow: hidden;
display: flex;
flex-direction: column;
.row {
display: flex;
text-align: center;
flex-shrink: 0;
.input {
flex:1;
}
> .input {
height: 25rem;
line-height: 25rem;
flex:initial!important;
display: block;
flex-shrink: 0!important;
}
> .wrapper {
position: relative;
@ -166,7 +165,7 @@
canvas {
border:0;
}
.row {
.input {
display: none;
}
&:not(:nth-child(2)) {