Skip to content

Commit

Permalink
따봉
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinDog committed Aug 25, 2024
1 parent 9b4cb58 commit e8aa768
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 30 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ With simple swipe, users can access various products easily and funny

## How to build

ng build
ng build / npm run build

## How to Run

Expand Down
22 changes: 2 additions & 20 deletions src/app/scene/scene.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@
<div class="like-icon icon">
<img src="icons/thumb_up.png" alt="like icon" />
</div>
<!-- <span class="like-cnt">{{ slide.like_count }}</span> -->
<span class="like-cnt">{{ curSlideLikeCount }}</span>
<span class="like-cnt">{{ slide.like_count }} </span>
</div>
<div
class="dislike-button action-button"
Expand All @@ -35,8 +34,7 @@
<div class="dislike-icon icon">
<img src="icons/thumb_down.png" alt="dislike icon" />
</div>
<!-- <span class="dislike-cnt">{{ slide.dislike_count }}</span> -->
<span class="dislike-cnt">{{ curSlideDislikeCount }}</span>
<span class="dislike-cnt">{{ slide.dislike_count }} </span>
</div>
</div>
</div>
Expand All @@ -45,22 +43,6 @@
</div>
</div>
</div>

<!-- wonjin lee - start -->
<!-- loading backdrop -->
<!-- <div
class="loading-backdrop"
style="
width: 100vh;
height: 100vh;
background-color: rgba(0, 0, 0, 0.6);
position: fixed;
top: 0;
left: 0;
"
[ngClass]="showBackdrop(isLoading)"
></div> -->
<!-- wonjin lee - end -->
</div>

<router-outlet />
17 changes: 8 additions & 9 deletions src/app/scene/scene.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,22 +55,22 @@ export class scene implements OnInit {
// like = (proId: number, usrId: number, slide: any) => {
like = async (proId: number, usrId: number, slide: any) => {
this.api.like(proId, usrId);
if (this.isLike(slide) != 'selected') {
slide.like_count++;
if (this.isDisLike(slide) == 'selected') slide.dislike_count--;
}
slide.is_like = true;
slide.is_dislike = false;

// wonjin lee - start
await this.updateCurCount();
// wonjin lee - end
};

dislike = async (proId: number, usrId: number, slide: any) => {
this.api.dislike(proId, usrId);
if (this.isDisLike(slide) != 'selected') {
if (this.isLike(slide) == 'selected') slide.like_count--;
slide.dislike_count++;
}
slide.is_like = false;
slide.is_dislike = true;

// wonjin lee - start
await this.updateCurCount();
// wonjin lee - end
};

isLike(slide: any) {
Expand Down Expand Up @@ -189,7 +189,6 @@ export class scene implements OnInit {
this.swiper?.update();
// wonjin lee - start
this.curSlideIdx = swiper.activeIndex;
console.log(this.curSlideIdx);
this.updateCurCount();
// wonjin lee - end
},
Expand Down

0 comments on commit e8aa768

Please sign in to comment.