aboutsummaryrefslogtreecommitdiff
path: root/src/Post.js
diff options
context:
space:
mode:
authorLibravatar Renard 2019-09-22 12:50:45 -0300
committerLibravatar Renard 2019-09-22 12:50:45 -0300
commit5adcc8d6b34e0e2db145e5609248b477eaa16e0c (patch)
tree5f4882254da04e58872589b6d6846d810ef3747c /src/Post.js
parent39d3bf2e7e4b9ed4d0cb0e9f090fef4a35f30d6d (diff)
downloadbai-client-5adcc8d6b34e0e2db145e5609248b477eaa16e0c.tar.gz
bai-client-5adcc8d6b34e0e2db145e5609248b477eaa16e0c.tar.xz
bai-client-5adcc8d6b34e0e2db145e5609248b477eaa16e0c.zip
Hue filter avatars
Diffstat (limited to 'src/Post.js')
-rw-r--r--src/Post.js9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/Post.js b/src/Post.js
index 1140d49..6e09dd2 100644
--- a/src/Post.js
+++ b/src/Post.js
@@ -62,13 +62,15 @@ const Post = ({ index, post, locked, threadId, currentBoard, nightMode }) => {
Math.round(idRng() * 200) +
")";
- let rndAvatar;
+ let rndAvatar, hue;
if (user_id !== "") {
- let i = Math.round(idRng() * avatars.length);
+ let i = Math.round(idRng() * avatars.length - 1);
rndAvatar = avatars[i];
+ hue = Math.round(idRng() * 360);
} else {
- let i = Math.round(rng() * avatars.length);
+ let i = Math.round(rng() * avatars.length - 1);
rndAvatar = avatars[i];
+ hue = Math.round(rng() * 360);
}
let flag;
@@ -105,6 +107,7 @@ const Post = ({ index, post, locked, threadId, currentBoard, nightMode }) => {
<Comment inverted={nightMode}>
<Comment.Avatar
src={`https://bienvenidoainternet.org/static/ico/${rndAvatar}.gif`}
+ style={{ filter: `hue-rotate(${hue}deg)` }}
/>
<Comment.Content>
<Comment.Author