Skip to content

Commit

Permalink
Tooltip, medalha
Browse files Browse the repository at this point in the history
  • Loading branch information
Relison Galvão committed Mar 15, 2024
1 parent f2c15dd commit 1f029bc
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
11 changes: 9 additions & 2 deletions public/js/components/osc/selo.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,23 @@ class Selo extends React.Component {
total += parseInt(numeros[i]);
}
let nameImg = 'sem_medalha';
let titleImg = 'Sem medalha';
if (total > 50 && total < 70) {
nameImg = 'bronze';
titleImg = 'Bronze';
} else if (total > 71 && total < 90) {
nameImg = 'prata';
titleImg = 'Prata';
} else if (total > 91 && total < 99) {
nameImg = 'ouro';
titleImg = 'Ouro';
} else if (total > 100) {
nameImg = 'diamante';
titleImg = 'Diamante';
}
_this.setState({
nameImg: nameImg
nameImg: nameImg,
titleImg: titleImg
});
},
error: function (xhr, status, err) {
Expand All @@ -56,7 +62,8 @@ class Selo extends React.Component {
render() {
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("img", {
src: "img/selos/" + this.state.nameImg + ".png",
alt: "",
alt: this.state.titleImg,
title: this.state.titleImg,
width: "50",
style: {
float: 'left',
Expand Down
10 changes: 8 additions & 2 deletions resources/js/components/osc/selo.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,23 @@ class Selo extends React.Component {
}

let nameImg = 'sem_medalha';
let titleImg = 'Sem medalha';

if(total>50 && total<70){
nameImg = 'bronze';
titleImg = 'Bronze';
}else if(total>71 && total<90){
nameImg = 'prata';
titleImg = 'Prata';
}else if(total>91 && total<99){
nameImg = 'ouro';
titleImg = 'Ouro';
}else if(total>100){
nameImg = 'diamante';
titleImg = 'Diamante';
}

_this.setState({nameImg: nameImg});
_this.setState({nameImg: nameImg, titleImg: titleImg });

},
error: function(xhr, status, err) {
Expand All @@ -71,7 +76,8 @@ class Selo extends React.Component {
<div>
<img
src={"img/selos/"+this.state.nameImg+".png"}
alt=""
alt={this.state.titleImg}
title={this.state.titleImg}
width="50" style={{float: 'left', marginTop: '-6px'}}/>
</div>
);
Expand Down

0 comments on commit 1f029bc

Please sign in to comment.