Files
flood/client/source/sass/components/_torrents.scss
T
2016-03-26 21:42:25 -07:00

261 lines
4.8 KiB
SCSS

$torrent-list--background: #fff;
$torrent-list--border: rgba($background, 0.15);
$torrent--primary--foreground: #5b6d7c;
$torrent--primary--foreground--stopped: rgba(#333332, 0.5);
$torrent--primary--foreground--selected: #fff;
$torrent--primary--foreground--selected--stopped: rgba($torrent--primary--foreground--selected, 0.6);
$torrent--secondary--foreground: #8899a8;
$torrent--secondary--foreground--stopped: rgba(#8899a8, 0.5);
$torrent--secondary--foreground--selected: #fff;
$torrent--secondary--foreground--selected--stopped: rgba(#fff, 0.6);
$torrent--tertiary--foreground: #8899a8;
$torrent--tertiary--foreground--stopped: rgba(#8899a8, 0.5);
$torrent--tertiary--foreground--selected: rgba(#fff, 0.9);
$torrent--tertiary--foreground--selected--stopped: rgba(#fff, 0.5);
$torrent--background--hover: #f6f8fa;
$torrent--background--selected: $blue;
$torrent--background--error: #e95779;
.torrents {
display: flex;
flex: 1 1 100px;
position: relative;
&:after {
background: $torrent-list--background;
bottom: 0;
box-shadow: -1px 0 0 0 $torrent-list--border;
content: '';
height: auto;
left: 10px;
position: absolute;
right: 0;
top: 0;
}
.loading-indicator {
left: 50%;
position: absolute;
top: 50%;
transform: translate(-50%, -50%);
}
}
.torrent {
&__list {
margin: 0 0 0 10px;
padding: 10px 0;
position: relative;
&__wrapper {
list-style: none;
max-width: 100%;
opacity: 1;
overflow: auto;
transition: opacity 1s;
user-select: none;
z-index: 1;
}
&--loading {
&-enter {
opacity: 0;
transition: opacity 1s;
&-active {
opacity: 1;
}
}
&-leave {
opacity: 1;
transition: opacity 1s;
&-active {
opacity: 0;
}
}
}
&--empty {
opacity: 0;
}
}
}
.torrent {
cursor: default;
padding: 10px 20px;
position: relative;
transition: background 0.25s;
&:hover {
background: $torrent--background--hover;
.torrent {
&__more-info {
opacity: 1;
}
}
}
&.is-selected {
background: $torrent--background--selected;
&.has-error {
background: $torrent--background--error;
}
}
&__more-info {
height: 20px;
margin-top: -10px;
position: absolute;
left: -7px;
opacity: 0;
top: 50%;
transition: background 0.25s, box-shadow 0.25s, opacity 0.25s;
width: 20px;
}
}
.torrent {
&__details {
align-items: center;
display: flex;
flex: 1;
flex-flow: row wrap;
list-style: none;
&--primary,
&--secondary,
&--tertiary {
transition: color 0.25s;
}
&--primary {
color: $torrent--primary--foreground;
flex: 4;
line-height: 1.3;
white-space: nowrap;
.is-stopped & {
color: $torrent--primary--foreground--stopped;
}
.is-selected & {
color: $torrent--primary--foreground--selected;
}
.is-selected.is-stopped & {
color: $torrent--primary--foreground--selected--stopped;
}
}
&--secondary {
align-items: flex-end;
color: $torrent--secondary--foreground;
flex: 1;
font-size: 0.75em;
min-width: 200px;
li {
flex: 1 1 auto;
min-width: 15%;
&.torrent__details--ratio {
max-width: 30px;
}
}
.is-stopped & {
color: $torrent--secondary--foreground--stopped;
}
.is-selected & {
color: $torrent--secondary--foreground--selected;
}
.is-selected.is-stopped & {
color: $torrent--secondary--foreground--selected--stopped;
}
}
&--tertiary {
color: $torrent--tertiary--foreground;
display: block;
font-size: 0.75em;
margin: 0 0 3px 0;
li {
display: inline-block;
margin-right: 1em;
&:last-child {
margin-right: 0;
}
}
.is-stopped & {
color: $torrent--tertiary--foreground--stopped;
}
.is-selected & {
color: $torrent--tertiary--foreground--selected;
}
.is-selected.is-stopped & {
color: $torrent--tertiary--foreground--selected--stopped;
}
}
&__label {
margin-right: 0.5em;
opacity: 0.5;
}
}
}
.torrent {
&__details {
&--eta {
opacity: 0;
transition: opacity 1s, visibility 1s;
visibility: hidden;
.torrent__details--segment {
margin-right: 0.25em;
&:last-child {
margin-right: 0;
}
}
.is-actively-downloading & {
opacity: 1;
visibility: visible;
}
}
}
}
.view {
&--torrent-list {
background: #e9eef2;
box-shadow: -1px 0 $torrent-list--border;
display: flex;
flex-direction: column;
flex: 1;
flex: 0 1 100%;
}
}