|
| 1 | +$gantt-bar-layer-append-width: 32px; |
| 2 | +$gantt-bar-layer-append-height: 42px; |
| 3 | +$gantt-bar-dependency-height: 16px; |
| 4 | +$gantt-bar-dependency-drop-border: 5px; |
| 5 | + |
| 6 | +@mixin dependency-handles { |
| 7 | + .dependency-handles { |
| 8 | + .handle { |
| 9 | + position: absolute; |
| 10 | + display: inline-block; |
| 11 | + cursor: pointer; |
| 12 | + width: $gantt-bar-dependency-height; |
| 13 | + height: $gantt-bar-dependency-height; |
| 14 | + display: flex; |
| 15 | + align-items: center; |
| 16 | + justify-content: center; |
| 17 | + z-index: 1001; |
| 18 | + |
| 19 | + &:first-child { |
| 20 | + left: 0; |
| 21 | + top: 0; |
| 22 | + } |
| 23 | + |
| 24 | + &:last-child { |
| 25 | + right: 0; |
| 26 | + bottom: 0; |
| 27 | + } |
| 28 | + |
| 29 | + .point { |
| 30 | + color: #348fe4; |
| 31 | + width: 10px; |
| 32 | + height: 10px; |
| 33 | + border-radius: 50%; |
| 34 | + background: #348fe4; |
| 35 | + transition: 0.3 ease; |
| 36 | + |
| 37 | + &:hover { |
| 38 | + width: 12px; |
| 39 | + height: 12px; |
| 40 | + } |
| 41 | + } |
| 42 | + } |
| 43 | + } |
| 44 | +} |
| 45 | + |
| 46 | +@mixin drag-handles { |
| 47 | + .drag-handles { |
| 48 | + background: $gantt-bar-layer-bg; |
| 49 | + width: 100%; |
| 50 | + height: calc(100% - #{$gantt-bar-dependency-height} * 2); |
| 51 | + position: absolute; |
| 52 | + border-radius: 4px; |
| 53 | + top: $gantt-bar-dependency-height; |
| 54 | + box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.15); |
| 55 | + |
| 56 | + .handle { |
| 57 | + width: 15px; |
| 58 | + height: 100%; |
| 59 | + position: absolute; |
| 60 | + cursor: col-resize; |
| 61 | + display: flex; |
| 62 | + align-items: center; |
| 63 | + justify-content: center; |
| 64 | + |
| 65 | + &:before, |
| 66 | + &:after { |
| 67 | + content: ''; |
| 68 | + display: inline-block; |
| 69 | + width: 1px; |
| 70 | + height: $gantt-bar-handle-height; |
| 71 | + background: $gantt-bar-handle-color; |
| 72 | + } |
| 73 | + |
| 74 | + &::before { |
| 75 | + margin-right: 2px; |
| 76 | + } |
| 77 | + |
| 78 | + &:first-child { |
| 79 | + left: 0; |
| 80 | + } |
| 81 | + |
| 82 | + &:last-child { |
| 83 | + right: 0; |
| 84 | + } |
| 85 | + } |
| 86 | + } |
| 87 | +} |
| 88 | + |
| 89 | +@mixin active-bar { |
| 90 | + z-index: 1000; |
| 91 | + |
| 92 | + .gantt-bar-layer { |
| 93 | + display: block; |
| 94 | + z-index: 1; |
| 95 | + } |
| 96 | + |
| 97 | + .gantt-bar-content { |
| 98 | + z-index: 1; |
| 99 | + box-shadow: none; |
| 100 | + } |
| 101 | + |
| 102 | + .cdk-drag { |
| 103 | + transition: none; |
| 104 | + } |
| 105 | +} |
| 106 | + |
| 107 | +.gantt-bar { |
| 108 | + position: absolute; |
| 109 | + background-color: $gantt-item-bg-color; |
| 110 | + border-radius: 4px; |
| 111 | + z-index: 1; |
| 112 | + background: #348fe4; |
| 113 | + |
| 114 | + .gantt-bar-layer { |
| 115 | + width: calc(100% + #{$gantt-bar-layer-append-width}); |
| 116 | + height: calc(100% + #{$gantt-bar-layer-append-height}); |
| 117 | + position: absolute; |
| 118 | + border-radius: 4px; |
| 119 | + left: $gantt-bar-layer-append-width / 2 * -1; |
| 120 | + top: $gantt-bar-layer-append-height / 2 * -1; |
| 121 | + display: none; |
| 122 | + @include drag-handles(); |
| 123 | + @include dependency-handles(); |
| 124 | + } |
| 125 | + |
| 126 | + .gantt-bar-border { |
| 127 | + width: calc(100% + #{$gantt-bar-dependency-drop-border} * 2); |
| 128 | + height: calc(100% + #{$gantt-bar-dependency-drop-border} * 2); |
| 129 | + position: absolute; |
| 130 | + border-radius: 4px; |
| 131 | + left: $gantt-bar-dependency-drop-border * -1; |
| 132 | + top: $gantt-bar-dependency-drop-border * -1; |
| 133 | + display: none; |
| 134 | + background: #fff; |
| 135 | + box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.1); |
| 136 | + } |
| 137 | + |
| 138 | + .gantt-bar-content { |
| 139 | + width: 100%; |
| 140 | + height: 100%; |
| 141 | + position: absolute; |
| 142 | + cursor: pointer; |
| 143 | + box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.1); |
| 144 | + border-radius: 4px; |
| 145 | + } |
| 146 | + |
| 147 | + &-active { |
| 148 | + @include active-bar(); |
| 149 | + } |
| 150 | + |
| 151 | + &-dependency-drop { |
| 152 | + .gantt-bar-border { |
| 153 | + display: block; |
| 154 | + } |
| 155 | + |
| 156 | + .gantt-bar-content { |
| 157 | + box-shadow: none; |
| 158 | + } |
| 159 | + } |
| 160 | +} |
0 commit comments