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

to main #6

Merged
merged 12 commits into from
Jan 28, 2024
10 changes: 9 additions & 1 deletion backend/MemeBE/cards.csv
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,12 @@
50;Buffeddoge;/static/jpg/Buffeddoge.png;Buff,2;2
51;Cheers;/static/jpg/Cheers.png;MakeLaugh,1;1
52;Disastergirl;/static/jpg/Disastergirl.png;MakeLaugh,2;1
53;DisappointedFan;/static/jpg/DisappointedFan.png;Shield,1;2
53;DisappointedFan;/static/jpg/DisappointedFan.png;Shield,1;2
54;Coughingcat;/static/jpg/Coughingcat.png;MakeLaugh,2;0
55;ConspiracyKeanu;/static/jpg/ConspiracyKeanu.png;Shield,1;2
56;CommunistBugsBunny;/static/jpg/CommunistBugsBunny.png;MakeGrumpy,1;0
57;Calculating;/static/jpg/Calculating.png;MakeLaugh,1;0
58;AwkwardMonkeyPuppet;/static/jpg/AwkwardMonkeyPuppet.png;MakeGrumpy,1;1
59;Youaregettingpaid;/static/jpg/Youaregettingpaid.png;MakeGrumpy,1;0
60;Momtricked;/static/jpg/Momtricked.png;MakeLaugh,2;1

8 changes: 7 additions & 1 deletion backend/MemeBE/hubs/GameHub.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ public GameHub()
Console.WriteLine(ex.Message);
}
}


public async Task SendMessage(string user, string message)
{
await Clients.All.SendAsync("ReceiveMessage", user, message);
Expand All @@ -30,7 +32,11 @@ public async Task SendMessage(string user, string message)

public async Task GetRooms()
{
await Clients.All.SendAsync("RoomsList", Groups);
string[] roomIDs = rooms.Values
.Where(r => r.GameStarted == false)
.Select(r => r.RoomId)
.ToArray();
await Clients.All.SendAsync("RoomsList", roomIDs);
}

public async Task CreateRoom(string playerName)
Expand Down
1 change: 1 addition & 0 deletions client/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ <h1 class="rotating-text game-title">Meme: The Gathering</h1>
<div id="playerData" class="playerData">
<h2 id="playerName">PlayerName</h2>
<h3 id="playerHP">LP: 0</h3>
<div class="rules">rules!</div>
</div>
<div id="playerPersistentCards" class="playerRow player">
<h3>In Game Player Cards</h3>
Expand Down
36 changes: 30 additions & 6 deletions client/static/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ body {
}

#lobby {



position: relative;
width: 100%;
min-height: 100%;
Expand Down Expand Up @@ -113,9 +112,10 @@ body {
}

#playersZones {
height: 200px;
height: 220px;
display: flex;
flex-direction: row;
margin: 0 -10px;
}

#playersZones h1,h2,h3,h4 {
Expand All @@ -142,7 +142,8 @@ body {
.otherPlayerName {
text-align: left;
font-family: 'Honk', sans-serif;
font-size: 22px;;
font-size: 22px;
margin-right: 50px;
}

.points {
Expand All @@ -153,8 +154,9 @@ body {
}

.laughIcon {
margin-top: 10px;
margin-left: 10px;
background-image: url("../../smile.png");
width: 20px;
max-width: 30px;
}

Expand Down Expand Up @@ -230,8 +232,12 @@ body {
}

#playerZone .playerData {
text-align: left;
font-family: 'Honk', sans-serif;
font-size: 22px;;
flex: 0.2;
padding: 20px;
height: auto;
background: linear-gradient(rgba(221, 110, 112, 0.3), rgba(33, 130, 156, 0.3) );
}

Expand Down Expand Up @@ -333,4 +339,22 @@ body {
.rotating-text {

animation: rotateText 2s linear; /* 'infinite' for looping */
}
}

#game-rules {
position: fixed;
top: 30%;
left: 30%;
width: 40%;
background-image: url('../../rules.png');
}

.rules {
cursor: pointer;
font-size: 18pt;
padding: 10px 5px;
border: 3px solid aqua;
text-align: center;
margin: 30px 5px 5px;
background: rgba(0,0,0, 0.5);
}
Binary file added client/static/jpg/AwkwardMonkeyPuppet.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added client/static/jpg/Calculating.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added client/static/jpg/CommunistBugsBunny.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added client/static/jpg/ConspiracyKeanu.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added client/static/jpg/Coughingcat.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added client/static/jpg/Momtricked.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added client/static/jpg/Youaregettingpaid.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 14 additions & 5 deletions client/static/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ $(document).ready(function () {

function initServer() {
connection = new signalR.HubConnectionBuilder()
//.withUrl("https://578d-87-206-130-93.ngrok-free.app/GameHub")
.withUrl("https://magicthememeingapiprod.azurewebsites.net/GameHub")
// .withUrl("https://578d-87-206-130-93.ngrok-free.app/GameHub")
.withAutomaticReconnect()
Expand Down Expand Up @@ -214,9 +213,15 @@ function initSendMethods() {
showCardPreview(this, false);
});

$(document).on('mouseleave', '.card, #lastCard', function () {
$(document).on('mouseenter', '.rules', function () {
showRules();
});

$(document).on('mouseleave', '.card, #lastCard, .rules', function () {
hideCardPreview();
});


}

function removeAllSelectedOnCard() {
Expand Down Expand Up @@ -271,9 +276,7 @@ function addPlayerZone(playerName) {
nameElement.className = 'otherPlayerName';
nameElement.textContent = playerName;

const laughIconElement = document.createElement('img');
laughIconElement.className = 'laughIcon';
laughIconElement.src='../../smile.png';


const laughElement = document.createElement('h3');
laughElement.textContent = "LP: " + 0;
Expand Down Expand Up @@ -340,6 +343,12 @@ function showCardPreview(card, player = false) {
$(".card-preview img").attr('src', $('img', card).attr('src'));
}

function showRules(card, player = false) {
$(".card-preview").removeClass('offset');
$(".card-preview").show();
$(".card-preview img").attr('src', '/static/rules.png');
}

function hideCardPreview() {
$(".card-preview").hide();
}
Expand Down
Binary file added client/static/rules.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
Loading