Skip to content
This repository has been archived by the owner on Oct 11, 2023. It is now read-only.

Status entry #230

Merged
merged 3 commits into from
May 11, 2021
Merged
Show file tree
Hide file tree
Changes from 2 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
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import MissionCompleteMessage from "./MissionCompleteMessage";
import HelpMessage from "./HelpMessage";
import SettingMessage from "./SettingMessage";
import SoulSpawnEventMessage from "./SoulSpawnEventMessage";
import StatusMessage from "./StatusMessage";

function get_msg_actor(msg) {
if (msg.actors === undefined) {
Expand Down Expand Up @@ -36,11 +37,15 @@ const Entry = ({
"ErrorEvent",
"HelpEvent",
"text",
"HealthEvent",
].includes(msg.caller) ||
msg.caller === null
) {
if (msg.caller == "HelpEvent") {
return <HelpMessage text={msg.text} />;
}
if (msg.caller == "HealthEvent") {
Comment on lines +46 to +47
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: control flow here is probably clearer with explicit else if

return <StatusMessage text={msg.text} />;
} else {
return <SettingMessage text={msg.text} />;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import React, { useState } from "react";

import { FaHeart, FaStar } from "react-icons/fa";
import { Tooltip } from "react-tippy";

const StatusMessage = ({ text }) => {
let statusArr = text.split("\n");
console.log("STATUS ARR", statusArr);
let expStats = parseInt(statusArr[0].split(":")[1]);
let rewardStats = parseInt(statusArr[1].split(":")[1]);
let strengthStats = statusArr[2];
let sizeStats = statusArr[3];
let toughnessStats = statusArr[4];
let dexterityStats = statusArr[45];
return (
<div className=" status-container">
<div className="status-heart__container">
<FaHeart className="status-heart" color="red" size="20em" />

<div className="status-content">
<p className="status-content__entry" style={{ marginTop: "1px" }}>
EXPERIENCE POINTS: {expStats}
<span>
<FaStar color="yellow" />
</span>
</p>
<p className="status-content__entry" style={{ marginTop: "1px" }}>
REWARDS LEFT TO GIVE: {rewardStats}
<span>
<FaStar color="yellow" />
</span>
</p>
<p className="status-content__entry" style={{ marginTop: "1px" }}>
{strengthStats}
</p>
<p className="status-content__entry" style={{ marginTop: "1px" }}>
{sizeStats}
</p>
<p className="status-content__entry" style={{ marginTop: "1px" }}>
{toughnessStats}
</p>
<p className="status-content__entry" style={{ marginTop: "1px" }}>
{dexterityStats}
</p>
</div>
</div>
</div>
);
};
export default StatusMessage;
Original file line number Diff line number Diff line change
Expand Up @@ -270,3 +270,51 @@
.helpmessage-text {
margin: 0 0 3px 1em;
}

/*Status Message*/
.status-container {
display: flex;
justify-content: center;
height: 10em;
width: 100%;
z-index: 1;
}

#status-header {
color: black;
z-index: 10;
text-align: center;
position: absolute;
top: -6%;
font-family: fantasy;
font-weight: bolder;
}

.status-heart__container {
position: relative;
width: 20em;
z-index: 3;
}

.status-heart {
position: absolute;
z-index: 1;
}

.status-content {
position: absolute;
z-index: 4;
top: 36%;
left: 5%;
padding-top: 1px;
margin: 0;
width: 90%;
}

.status-content__entry {
color: white;
z-index: 6;
text-align: center;
font-size: 14px;
font-weight: bolder;
}
7 changes: 7 additions & 0 deletions deploy/web/landingapp/src/pages/TutorialPage/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ const TutorialPage = (props) => {
<CharacterBasics />
<InteractingWithTheWorld />
<Actions />
<div
style={{ width: "100%", display: "flex", justifyContent: "center" }}
>
<a style={{ textDecoration: "none" }} href="/play/">
<div className="tutorial-button ">PLAY LIGHT</div>
</a>
</div>
</div>
</div>
);
Expand Down
34 changes: 34 additions & 0 deletions deploy/web/landingapp/src/pages/TutorialPage/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,37 @@
.tutorial-text {
font-size: 1.25em;
}

@keyframes pulse {
from {
text-shadow: 0 0 5px #fff, 0 0 10px #fff, 0 0 15px #eef079, 0 0 20px #eef079,
0 0 25px #eef079, 0 0 30px #eef079, 0 0 35px #eef079;
}
to {
text-shadow: 0 0 10px #fff, 0 0 20px #fff, 0 0 30px #eef079,
0 0 40px #eef079, 0 0 50px #eef079, 0 0 60px #eef079, 0 0 70px #eef079;
}
}

.tutorial-button {
color: white;
font-size: 1em;
background-color: gold;
width: 5em;
text-align: center;
padding: 0.5em;
border-radius: 15px;
border-style: double;
border-color: white;
box-shadow: 1px 1px 4px black;
cursor: pointer;
}

.tutorial-button:hover {
animation: pulse 1s infinite;
}

.tutorial-button:active {
animation: pulse 1s infinite;
box-shadow: 0px 0px 0px black;
}