Adjust placement of scrolling torrent list

This commit is contained in:
John Furrow
2015-11-14 19:26:19 -08:00
parent e090fd4954
commit b6ecffa6ae
4 changed files with 69 additions and 23 deletions

View File

@@ -42,8 +42,10 @@ body {
} }
&__list { &__list {
flex: 5;
margin: 0 10px; &__wrapper {
flex: 5;
}
} }
} }

View File

@@ -48,6 +48,18 @@
background: $action-bar--background; background: $action-bar--background;
color: $action-bar--foreground; color: $action-bar--foreground;
display: flex; display: flex;
position: relative;
&:after {
background: $torrent-list--border;
bottom: 0;
content: '';
height: 1px;
left: 9px;
position: absolute;
right: 0;
width: auto;
}
&__item { &__item {
flex: 3; flex: 3;

View File

@@ -1,16 +1,30 @@
.torrent { .torrent {
&__list { &__list {
background: $torrent-list--background; box-shadow: -1px 0 0 0 $torrent-list--border;
border-radius: 4px 4px 0 0; margin: 0 0 0 10px;
box-shadow: 0 0 0 1px $torrent-list--border;
list-style: none;
opacity: 1;
overflow: auto;
padding: 10px 0; padding: 10px 0;
position: relative; position: relative;
transition: opacity 1s;
user-select: none; &__wrapper {
list-style: none;
opacity: 1;
overflow: auto;
position: relative;
transition: opacity 1s;
user-select: none;
}
&:before {
background: $torrent-list--background;
bottom: 0;
content: '';
left: 0;
position: absolute;
right: 0;
top: 0;
z-index: 0;
}
&--empty { &--empty {
opacity: 0; opacity: 0;
@@ -20,16 +34,33 @@
.torrent { .torrent {
cursor: default; cursor: default;
padding: 10px 25px; padding: 10px 20px;
position: relative;
transition: background 0.25s; transition: background 0.25s;
&:hover { &:hover {
background: $torrent--background--hover; background: $torrent--background--hover;
.torrent {
&__more-info {
opacity: 1;
}
}
} }
&.is-selected { &.is-selected {
background: $torrent--background--selected; background: $torrent--background--selected;
} }
&__more-info {
margin-top: -8px;
position: absolute;
left: -8px;
opacity: 0;
top: 50%;
transition: opacity 0.25s;
}
} }
.torrent { .torrent {

View File

@@ -173,18 +173,19 @@ class TorrentList extends React.Component {
} }
return ( return (
<ul className="torrent__list" ref="torrentList" <div className="torrent__list__wrapper" onScroll={this.handleScroll} ref="torrentList">
onScroll={this.handleScroll}> <ul className="torrent__list">
<li className="torrent__spacer torrent__spacer--top" <li className="torrent__spacer torrent__spacer--top"
style={{ style={{
height: listPadding.top + 'px' height: listPadding.top + 'px'
}}></li> }}></li>
{torrentList} {torrentList}
<li className="torrent__spacer torrent__spacer--bottom" <li className="torrent__spacer torrent__spacer--bottom"
style={{ style={{
height: listPadding.bottom + 'px' height: listPadding.bottom + 'px'
}}></li> }}></li>
</ul> </ul>
</div>
); );
} }