Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added button like and dislike #30

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
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
50 changes: 50 additions & 0 deletions src/components/DislikeCollab.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<script>
import IconCollab from '../components/IconCollab.svelte'
let dislikes = 0

function handleClick() {
dislikes += 1;
}
</script>

<style>
.dislike-button {
height: 40px;
width: 100px;
border-radius: 20px;
border: none;
cursor: pointer;
padding: 5px 15px;
background: rgb(255, 252, 238, 0.1);
margin: 20px 0 20px 16px;
}

.dislike-button:last-child {
margin: 20px 0 0 5px;
}

.dislike-button > .items {
display: flex;
justify-content: space-evenly;
align-items: center;
}

.dislike-button > .items > .text {
color: #FFF;
font-size: 16px;
line-height: 24px;
letter-spacing: 0.5px;
font-family: Comfortaa;
}
</style>

<button
on:click={handleClick}
class="dislike-button">
<div class="items">
<IconCollab
name="dislike_button"
alt="Dislike Button" />
<p class="text">{dislikes}</p>
</div>
</button>
46 changes: 46 additions & 0 deletions src/components/LikeCollab.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<script>
import IconCollab from '../components/IconCollab.svelte'
let likes = 0

function handleClick() {
likes += 1;
}
</script>

<style>
.like-button {
height: 40px;
width: 100px;
border-radius: 20px;
border: none;
cursor: pointer;
padding: 5px 15px;
background: rgb(255, 252, 238, 0.1);
margin: 20px 0 20px 16px;
}

.like-button > .items {
display: flex;
justify-content: space-evenly;
align-items: center;
}

.like-button > .items > .text {
color: #FFF;
font-size: 16px;
line-height: 24px;
letter-spacing: 0.5px;
font-family: Comfortaa;
}
</style>

<button
on:click={handleClick}
class="like-button">
<div class="items">
<IconCollab
name="like_button"
alt="Like Button" />
<p class="text">{likes}</p>
</div>
</button>
4 changes: 4 additions & 0 deletions src/routes/_layout.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<script>
import HeaderCollab from '../containers/HeaderCollab.svelte'
import LikeCollab from '../components/LikeCollab.svelte'
import DislikeCollab from '../components/DislikeCollab.svelte'

export let segment
</script>
Expand All @@ -12,4 +14,6 @@

<main>
<slot />
<LikeCollab />
<DislikeCollab />
</main>
3 changes: 3 additions & 0 deletions static/img/dark/icon/dislike_button.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions static/img/dark/icon/like_button.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.