Skip to content
This repository was archived by the owner on Dec 17, 2024. It is now read-only.

Commit 41f3c6d

Browse files
Minor Tweaks
1 parent 1794b74 commit 41f3c6d

File tree

5 files changed

+34
-12
lines changed

5 files changed

+34
-12
lines changed

dashboard/profile.html

+6-6
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,13 @@ <h1>Ronak Kothari <img src="../icons/verified.svg" alt=""></h1>
5454
<h2>@ronakkothari123</h2>
5555
<p>👋 Hello! I am a cricket enthusiast that is a developer of this Cricket Fantasy League website. My hobbies include, cricket, programming, Minecraft, and mathematics.</p>
5656
<div id="profile-buttons">
57-
<button class="profile-button">
58-
<img src="../icons/friends.svg" alt="">
59-
Add Friend
57+
<button class="profile-button" onclick="toggleBtn(0)">
58+
<img src="../icons/addfriend.svg" alt="" id="friend-img">
59+
<p id="friend-btn">Add Friend</p>
6060
</button>
61-
<button class="profile-button">
62-
<img src="../icons/nostar.svg" alt="">
63-
Follow User
61+
<button class="profile-button" onclick="toggleBtn(1)">
62+
<img src="../icons/nostar.svg" alt="" id="follow-img">
63+
<p id="follow-btn">Follow User</p>
6464
</button>
6565
</div>
6666
<div id="profile-text">

icons/addfriend.svg

+1
Loading

icons/unfriend.svg

+1
Loading

js/login.js

-6
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,6 @@ function toggleTheme() {
8585
document
8686
.querySelector(":root")
8787
.style.setProperty("--background-1", "#1b2028");
88-
document
89-
.querySelector(":root")
90-
.style.setProperty("--border-color", "#171a1f");
9188
document
9289
.querySelector(":root")
9390
.style.setProperty("--icon-brightness", 1);
@@ -99,9 +96,6 @@ function toggleTheme() {
9996
document
10097
.querySelector(":root")
10198
.style.setProperty("--background-1", "#ffffff");
102-
document
103-
.querySelector(":root")
104-
.style.setProperty("--border-color", "#cccccc");
10599
document
106100
.querySelector(":root")
107101
.style.setProperty("--icon-brightness", 0);

js/profile.js

+26
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ const profileModal = document.querySelector("#profile-modal")
77
const nameUpperCase = true;
88
let modalActive = false;
99

10+
let friend = false;
11+
let follow = false;
12+
1013
const patterns = [
1114
"https://www.toptal.com/designers/subtlepatterns/patterns/double-bubble.png",
1215
"https://www.toptal.com/designers/subtlepatterns/patterns/moroccan-flower.png",
@@ -34,6 +37,29 @@ function hexToRgb(hex) {
3437
} : null;
3538
}
3639

40+
function toggleBtn(btnNum){
41+
if(btnNum == 0){
42+
friend = !friend;
43+
44+
if(friend){
45+
document.getElementById('friend-btn').innerHTML = "Unfriend User"
46+
document.getElementById('friend-img').src = "../icons/unfriend.svg"
47+
} else {
48+
document.getElementById('friend-btn').innerHTML = "Friend User"
49+
document.getElementById('friend-img').src = "../icons/addfriend.svg"
50+
}
51+
} else if(btnNum == 1){
52+
follow = !follow;
53+
54+
if(follow){
55+
document.getElementById('follow-btn').innerHTML = "Unfollow User"
56+
document.getElementById('follow-img').src = "../icons/fullstar.svg"
57+
} else {
58+
document.getElementById('follow-btn').innerHTML = "Follow User"
59+
document.getElementById('follow-img').src = "../icons/nostar.svg"
60+
}
61+
}
62+
}
3763

3864
function toggleModal(){
3965
modalActive = !modalActive;

0 commit comments

Comments
 (0)