Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 28 additions & 1 deletion css/slider.1.css
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,43 @@
/* width: 3000px; */
/* height: 90px; */
}
.taskdone {
position: relative;
margin: 1px;
background: #CCC;
float: left;
text-align: center;
padding: 0px;
}
.clickOut {
border: 1px solid #999999;
}
.clickIn {
border: 1px solid blue;
background: red;
}
.clickIn .after {
position: absolute;
top: 0;
left: 0;
display: none;
color: #FFF;
}

.clickIn .after {
display: block;
background: rgba(0, 0, 0, .6);
}
.photolist-wrapper .photolist img {
padding: 2px;
margin: 2px;
cursor: pointer;
vertical-align: top;
background: #F6F6F6;
border: 1px solid #666;
opacity: 0.3;
transition: .5s ease;
}

.photolist-wrapper .photolist img:hover {
opacity: 1.0;
transition: .5s ease;
Expand Down
2 changes: 1 addition & 1 deletion css/slider.1.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 11 additions & 7 deletions tags/images-slider.tag.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,12 @@
</div>
<div class="photolist-wrapper " style="width: calc(100% - 160px); height: 90px;">
<div id="photolist" class="photolist">
<!-- <span each={ thumbnails } class="d-inline-block">
<span class="delete" onclick={ deleteThumbnail }></span> -->
<img id="thumbnail_{index}" each={ thumbnail,index in thumbnails } src={ thumbnail.src } label={
<span each={ thumbnail,index in thumbnails } class="thum_{index} taskdone clickOut" height="90px" width={thumbnailWidth}>
<!-- <span class="delete" onclick={ deleteThumbnail }></span> -->
<img id="thumbnail_{index}" src={ thumbnail.src } label={
thumbnail.name } title={ thumbnail.name } width={thumbnailWidth} onclick={ loadIntoWorkArea}>
<!-- </span> -->
<span class="after" height="90px" width={thumbnailWidth}></span>
</span>
</div>
</div>
<div id="rightpaddle" class="align-middle" style="height: 100%;">
Expand Down Expand Up @@ -143,7 +144,7 @@
if (this.sliding === false) {
this.sliding = true;
photolist.css({ left: "-" + this.sliderMove })
.prepend(photolist.children('img:last-child'))
.prepend(photolist.children('span:last-child'))
.animate({ left: 0 }, 200, 'linear', () => {
this.sliding = false;
});
Expand All @@ -154,8 +155,9 @@
if (this.sliding === false) {
this.sliding = true;
photolist.animate({ left: "-" + this.sliderMove }, 200, 'linear', () => {
console.log(this.sliderMove)
photolist.css({ left: 0 })
.append(photolist.children('img:first-child'));
.append(photolist.children('span:first-child'));
this.sliding = false;
});
}
Expand All @@ -173,6 +175,8 @@
}

function loadIntoWorkArea(e) {
console.log(e.item.index);
$(".thum_" + e.item.index).toggleClass('clickOut clickIn');
imgSelected = tag.thumbnails[e.item.index];

let preZoom = localStorage.getItem("zoom");
Expand All @@ -188,4 +192,4 @@
riot.mount("workarea", { img: imgSelected });
}
</script>
</images-slider>
</images-slider>