super-productivity/src/app/tasks/task/task.component.scss
2018-11-23 00:45:30 +01:00

418 lines
No EOL
7 KiB
SCSS

@import '../../../_variables.scss';
//$this-task-text-color: #333333;
//$this-task-text-color-dark: #dddddd;
$this-task-text-color-done: #aaaaaa;
$task-inner-padding-left-right: 6px;
$this-active-shadow: $whiteframe-shadow-6dp;
$this-first-line-min-height: 40px;
$this-icon-default-opacity: 0.7;
%standardTaskOpacityChange {
opacity: $this-icon-default-opacity;
transition: transform $transition-standard;
:host:focus &,
.isCurrent &,
&:hover,
&:focus {
opacity: 1;
}
}
%standardTaskZoom {
&:hover,
&:focus {
transform: scale(1.1);
}
}
:host {
display: block;
position: relative;
> .inner-wrapper {
padding: 2px 0;
margin-bottom: 7px;
transition: transform $transition-standard;
.title-bar-wrapper,
.first-line {
background: inherit;
}
.first-line {
min-height: $this-first-line-min-height;
}
}
&:last-child > .inner-wrapper {
margin-bottom: 0;
}
.sub-tasks {
margin: 0 $s;
}
&:focus {
z-index: 4;
outline: none;
> .inner-wrapper {
outline: 2px dashed $c-accent;
}
}
.title-bar-wrapper {
display: flex;
flex-wrap: nowrap;
align-items: center;
justify-content: center;
min-height: 36px;
flex-grow: 1;
flex-basis: 70%;
@include mq(xs, max) {
margin-bottom: 5px;
flex-shrink: 0;
flex-basis: 100%;
}
}
.isNotesOpen > .first-line {
.title {
font-weight: bold;
}
}
$this-button-spacer: 1px;
.toggle-sub-tasks-btn,
.first-line .ico-btn {
margin: 0 $this-button-spacer;
padding: 0;
z-index: 4;
@extend %standardTaskOpacityChange;
@extend %standardTaskZoom;
&:hover {
z-index: 5;
}
&:focus {
outline: none;
}
//&:after {
// position: absolute;
// top: 0;
// right: 0;
// bottom: 0;
// left: 0;
// content: '';
// border: 1px solid #dddddd;
// border-radius: 100%;
//}
}
.first-line {
display: flex;
flex-wrap: nowrap;
user-select: none;
justify-content: space-between;
align-items: center;
@include mq(xs, max) {
flex-wrap: wrap;
}
}
.ico-btn {
&.delete-btn {
mat-icon.delete-icon {
color: $red !important;
@include darkTheme {
color: $red !important;
}
}
&:hover {
background: $red-danger !important;
mat-icon.delete-icon {
color: #ffffff !important;
@include darkTheme {
color: #ffffff !important;
}
}
}
}
}
}
// Button Stuff
.play-btn {
padding-left: 0;
margin-left: -2px;
margin-right: 3px;
// move over original link btn
position: relative;
z-index: 1;
}
.show-notes-btn {
mat-icon {
transition: transform $transition-standard;
backface-visibility: hidden;
}
&.isActive mat-icon {
transform: rotate(45deg);
}
}
.controls {
white-space: nowrap;
text-align: right;
margin-right: 2px;
@include mq(xs, max) {
white-space: normal;
margin-left: 5px;
}
}
// transparent controls for desktop
@include mq(xs) {
.controls {
opacity: 1;
position: relative;
transition: $transition-fast;
// hitarea
&:after {
position: absolute;
top: -$s;
right: -$s;
left: -2*$s;
bottom: -$s;
content: '';
}
}
.first-line:hover {
> .controls {
opacity: 1;
z-index: 12;
}
}
.controls:hover {
opacity: 1;
z-index: 12;
//transform: scale(1.0714285714);
}
}
.inner-wrapper {
//color: $this-task-text-color;
position: relative;
box-shadow: $shadow-card-shadow;
//box-shadow: $shadow-bottom-boxed;
border-radius: $card-border-radius;
border: 1px solid #dddddd;
@include darkTheme {
border-color: #333333;
}
&.isCurrent {
transform: scale(1.0178571428);
box-shadow: $this-active-shadow;
}
&.isDone {
.time,
.task-title {
color: $this-task-text-color-done;
}
.task-title {
text-decoration: line-through;
}
.play-btn {
display: none;
}
}
}
.drag-handle {
margin: 0 4px 0 9px;
position: relative;
z-index: 3;
cursor: grab;
@extend %standardTaskOpacityChange;
&:after {
content: '';
top: -$s*2;
bottom: -$s*2;
left: -$s*2;
right: -$s*0.5;
position: absolute;
}
}
.task-title {
flex-direction: row;
align-items: center;
align-content: center;
flex: 1 1 auto;
flex-grow: 1;
text-align: left;
outline: none;
margin-left: 4px;
padding: 4px 0 4px 6px;
line-height: 1.5;
min-height: 20px;
text-overflow: ellipsis;
cursor: text;
transition: $transition-leave;
transition-property: opacity, transform;
display: block;
background: inherit;
position: relative;
overflow: visible;
user-select: none;
caret-color: #000000;
z-index: 4;
.isCurrent & {
font-weight: bold;
}
@include darkTheme() {
caret-color: #ffffff;
}
&:after {
transition: $transition-leave;
position: absolute;
width: 100%;
height: 100%;
top: 0;
right: 0;
bottom: 0;
left: 0;
content: '';
box-shadow: $shadow-edit-on-click;
opacity: 0;
z-index: -1;
border: 1px solid black;
pointer-events: none;
@include darkTheme() {
border: 1px solid #ffffff;
box-shadow: 0 0 4px 0 rgba(255, 255, 255, 0.8), $whiteframe-shadow-13dp;
}
}
&:focus {
z-index: 5;
user-select: all;
// thee magic number is 16/14 so we scale to whole pixels
transform: scale(1.142857143);
transition: $transition-standard;
.is-hide-controls & {
transform-origin: center center;
transform: scale(1.142857143) translateX(20px);
}
&:after {
opacity: 1;
transition: $transition-standard;
}
@include mq(xs, max) {
transform: scale(1);
}
}
}
input {
width: 100%;
display: block;
box-sizing: border-box;
height: 30px;
padding: 4px 10px;
border: none;
}
.time {
font-style: italic;
white-space: nowrap;
margin-left: 10px;
margin-right: 10px;
opacity: 0.3;
:host:focus > .inner-wrapper > .first-line &,
//:host:hover > .inner-wrapper > .first-line &,
.inner-wrapper.isCurrent > .first-line & {
opacity: 1;
}
@include mq(xs, max) {
margin-left: 8px;
font-size: 13px;
}
}
.notes {
display: block;
// required as sort of a clearfix (fixes padding issue)
overflow: hidden;
}
.toggle-sub-tasks-btn {
position: absolute !important;
transform: scale(0.8);
left: -23px;
top: 1px;
z-index: 2;
min-width: 0;
min-height: 0;
opacity: 1 !important;
// overwrite ripple transparency
}
.drag-over-msg {
pointer-events: none;
position: absolute;
top: 0;
right: 0;
left: 0;
bottom: 0;
opacity: 1;
justify-content: center;
align-items: center;
font-weight: bold;
display: flex;
z-index: 12;
}
.time-btn {
position: relative;
overflow: visible;
::ng-deep .svg-wrapper {
z-index: 5455;
position: absolute;
width: 44px;
height: 44px;
top: 50%;
left: 50%;
transform: translate3d(-50%, -50%, 0);
}
}