Favorite button basic implementation added

This commit is contained in:
Lucas Patenaude
2024-04-16 20:30:30 -06:00
parent b8be46a89b
commit 8db9c37c9d
8 changed files with 22 additions and 2 deletions

View File

@@ -4,7 +4,7 @@ CREATE TABLE users (
Password CHAR(60) NOT NULL Password CHAR(60) NOT NULL
); );
CREATE TABLE FavoriteTeam ( CREATE TABLE FavoriteTeams (
UserID INT REFERENCES users(UserID) ON DELETE CASCADE ON UPDATE CASCADE, UserID INT REFERENCES users(UserID) ON DELETE CASCADE ON UPDATE CASCADE,
TeamID INT, TeamID INT,
TeamName VARCHAR(50), TeamName VARCHAR(50),

View File

@@ -1,4 +1,13 @@
#club-information-container #club-information-container
{ {
margin-right: 20px; margin-right: 20px;
}
#club-favorite-button
{
width: 35px;
transform: skewX(20deg);
margin-right: 25px;
filter: drop-shadow(0px 0px 8px rgba(0, 0, 0, 0.3));
filter: outline(2px solid red);
} }

View File

@@ -85,7 +85,7 @@
{ {
transform: skewX(20deg); /* Skew the banner to create a triangular side */ transform: skewX(20deg); /* Skew the banner to create a triangular side */
height: 20px; height: 20px;
margin-right: 200px; margin-right: 130px;
} }
/* /*

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

View File

@@ -0,0 +1,8 @@
document.addEventListener("DOMContentLoaded", function() {
var favoriteButton = document.getElementById("club-favorite-button");
if (favoriteButton) {
favoriteButton.addEventListener("click", function() {
favoriteButton.src = "/img/club-page/favorited.png";
});
}
});

View File

@@ -5,6 +5,7 @@
<img id="generated-page-header-logo" src="{{club.crest}}" alt="{{club.name}} Logo"> <img id="generated-page-header-logo" src="{{club.crest}}" alt="{{club.name}} Logo">
<h1 id="generated-page-header-title">{{club.name}}</h1> <h1 id="generated-page-header-title">{{club.name}}</h1>
<img id="generated-page-header-flag" src="{{club.area.club_flag}}" alt="{{club.name}} Flag"> <img id="generated-page-header-flag" src="{{club.area.club_flag}}" alt="{{club.name}} Flag">
<img id="club-favorite-button" src="/img/club-page/unfavorited.png" alt="Favorite Button">
</div> </div>
<div id="club-page-contents-container" class="page-content-container"> <div id="club-page-contents-container" class="page-content-container">

View File

@@ -17,5 +17,7 @@
<script src="/js/league-page/change-goal-difference-color.js"></script> <script src="/js/league-page/change-goal-difference-color.js"></script>
<script src="/routes/club-pages/redirect-to-club-url.js"></script> <script src="/routes/club-pages/redirect-to-club-url.js"></script>
<!-- Club Pages Scripts -->
<script src="/js/club-page/favorite-button.js"></script>
</footer> </footer>