mirror of
https://codeberg.org/ashley/poke.git
synced 2024-11-10 03:28:35 +01:00
add masterpiece video :3
This commit is contained in:
parent
34c7b787e7
commit
b765e8eb06
1 changed files with 53 additions and 42 deletions
|
@ -678,6 +678,13 @@ background-color: #0000;
|
|||
border: 2px solid red;
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
.rainbow-gradient {
|
||||
background: linear-gradient(to right, red, orange, yellow, green, blue, indigo, violet);
|
||||
-webkit-background-clip: text;
|
||||
color: transparent;
|
||||
}
|
||||
|
||||
</style>
|
||||
<noscript>
|
||||
<style>
|
||||
|
@ -1658,61 +1665,65 @@ WIP! </a>
|
|||
Rating : <%=engagement.rating.toLocaleString()%> (<%=engagement.dislikes.toLocaleString()%>/<%=engagement.likes.toLocaleString()%> <abbr title="Like To dislike ratio - the number to the left is dislike count and the one to the right is like count :3">LTDR</abbr>) <br>
|
||||
|
||||
<%
|
||||
const likes = parseInt(engagement.likes) || 0;
|
||||
const dislikes = parseInt(engagement.dislikes) || 0;
|
||||
const total = likes + dislikes;
|
||||
const likes = parseInt(engagement.likes) || 0;
|
||||
const dislikes = parseInt(engagement.dislikes) || 0;
|
||||
const total = likes + dislikes;
|
||||
|
||||
const likePercentage = total > 0 ? ((likes / total) * 100).toFixed(2) : 0;
|
||||
const dislikePercentage = total > 0 ? ((dislikes / total) * 100).toFixed(2) : 0;
|
||||
const likePercentage = total > 0 ? ((likes / total) * 100).toFixed(2) : 0;
|
||||
const dislikePercentage = total > 0 ? ((dislikes / total) * 100).toFixed(2) : 0;
|
||||
|
||||
const getLikePercentageColor = (percentage) => {
|
||||
if (percentage >= 80) {
|
||||
return 'green';
|
||||
} else if (percentage >= 50) {
|
||||
return 'orange';
|
||||
} else {
|
||||
return 'red';
|
||||
}
|
||||
};
|
||||
const getLikePercentageColor = (percentage) => {
|
||||
if (percentage >= 80) {
|
||||
return 'green';
|
||||
} else if (percentage >= 50) {
|
||||
return 'orange';
|
||||
} else {
|
||||
return 'red';
|
||||
}
|
||||
};
|
||||
|
||||
const getDislikePercentageColor = (percentage) => {
|
||||
if (percentage >= 50) {
|
||||
return 'red';
|
||||
} else if (percentage >= 20) {
|
||||
return 'orange';
|
||||
} else {
|
||||
return 'green';
|
||||
}
|
||||
};
|
||||
const getDislikePercentageColor = (percentage) => {
|
||||
if (percentage >= 50) {
|
||||
return 'red';
|
||||
} else if (percentage >= 20) {
|
||||
return 'orange';
|
||||
} else {
|
||||
return 'green';
|
||||
}
|
||||
};
|
||||
|
||||
const likeColor = getLikePercentageColor(likePercentage);
|
||||
const dislikeColor = getDislikePercentageColor(dislikePercentage);
|
||||
const likeColor = getLikePercentageColor(likePercentage);
|
||||
const dislikeColor = getDislikePercentageColor(dislikePercentage);
|
||||
|
||||
const userScore = (parseFloat(likePercentage) - parseFloat(dislikePercentage) / 2).toFixed(2);
|
||||
const userScore = (parseFloat(likePercentage) - parseFloat(dislikePercentage) / 2).toFixed(2);
|
||||
|
||||
const getUserScoreLabel = (score) => {
|
||||
if (score >= 80) {
|
||||
return 'Overwhelmingly Positive';
|
||||
} else if (score >= 60) {
|
||||
return 'Positive';
|
||||
} else if (score >= 40) {
|
||||
return 'Mixed';
|
||||
} else if (score >= 20) {
|
||||
return 'Negative';
|
||||
} else {
|
||||
return 'Overwhelmingly Negative';
|
||||
}
|
||||
};
|
||||
const getUserScoreLabel = (score) => {
|
||||
if (score >= 98) {
|
||||
return 'Masterpiece Video';
|
||||
} else if (score >= 80) {
|
||||
return 'Overwhelmingly Positive';
|
||||
} else if (score >= 60) {
|
||||
return 'Positive';
|
||||
} else if (score >= 40) {
|
||||
return 'Mixed';
|
||||
} else if (score >= 20) {
|
||||
return 'Negative';
|
||||
} else {
|
||||
return 'Overwhelmingly Negative';
|
||||
}
|
||||
};
|
||||
|
||||
const userScoreLabel = getUserScoreLabel(userScore);
|
||||
const userScoreColor = userScore >= 80 ? 'green' : userScore >= 50 ? 'orange' : 'red';
|
||||
const userScoreLabel = getUserScoreLabel(userScore);
|
||||
const userScoreColor = userScore >= 80 ? 'green' : userScore >= 50 ? 'orange' : 'red';
|
||||
|
||||
const userScoreClass = userScore >= 98.00 ? 'rainbow-gradient' : '';
|
||||
%>
|
||||
|
||||
|
||||
|
||||
<br><span style="color: <%= likeColor %>;"><%= likePercentage %>%</span> of the users lieked the video!! <br>
|
||||
<span style="color: <%= dislikeColor %>;"><%= dislikePercentage %>%</span> of the users dislieked the video!! <br>
|
||||
User score: <span style="color: <%= userScoreColor %>;"><%= userScore %></span>- <%= userScoreLabel %><br><br>
|
||||
User score: <span class="<%= userScoreClass %>" style="color: <%= userScoreColor %>;"><%= userScore %></span>- <%= userScoreLabel %><br><br>
|
||||
RYD date created : <%=engagement.dateCreated.toLocaleString()%> <br>
|
||||
<a href="https://returnyoutubedislikeapi.com/votes?videoId=<%=inv_vid.videoId%>">See in json</a>
|
||||
|
||||
|
|
Loading…
Reference in a new issue