Skip to content

Commit

Permalink
Santa (#1299)
Browse files Browse the repository at this point in the history
  • Loading branch information
DrSharky authored Dec 13, 2023
1 parent bc1a72d commit a699d84
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 14 deletions.
Binary file added react_main/public/images/santahat.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 5 additions & 2 deletions react_main/src/css/user.css
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,11 @@ iframe {
align-items: center;
justify-content: center;

width: 100%;
height: 100%;
/* width: 100%;
height: 100%; */
width: inherit;
height: inherit;
position: fixed;

border-radius: 50px;

Expand Down
46 changes: 34 additions & 12 deletions react_main/src/pages/User/User.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,8 @@ export function Avatar(props) {
const avatarId = props.avatarId;
const deckProfile = props.deckProfile;

const santaDir = "/images/santahat.png";

const siteInfo = useContext(SiteInfoContext);
const style = {};
const colors = [
Expand Down Expand Up @@ -214,19 +216,39 @@ export function Avatar(props) {
style.backgroundColor = colors[Math.floor(rand * colors.length)];
}

var santaWidth;
var santaHorizAdjust;
var santaVertAdjust;

if (large) {
santaWidth = "100px";
santaHorizAdjust = -35;
santaVertAdjust = -40;
} else if (small) {
santaWidth = "20px;"
santaHorizAdjust = -5;
santaVertAdjust = -8;
}
else {
santaWidth = "40px";
santaHorizAdjust = -12;
santaVertAdjust = -15;
}

return (
<div
className={`avatar ${size} ${dead ? "dead" : ""} ${
active ? "active" : ""
}`}
style={style}
>
{edit && (
<HiddenUpload className="edit" name="avatar" onFileUpload={onUpload}>
<i className="far fa-file-image" />
</HiddenUpload>
)}
</div>
<div
className={`avatar ${size} ${dead ? "dead" : ""} ${
active ? "active" : ""
}`}
style={style}
>
{edit && (
<HiddenUpload className="edit" name="avatar" onFileUpload={onUpload}>
<i className="far fa-file-image" />
</HiddenUpload>
)}
<img className="santa" width={santaWidth} style={{position: "relative", top: santaVertAdjust, left: santaHorizAdjust}} src={santaDir}></img>
</div>
);
}

Expand Down

0 comments on commit a699d84

Please sign in to comment.