Last active
July 24, 2018 15:32
-
-
Save HerbCaudill/71712428fc3cd50085079d14e385bc42 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
customjsReady("div[data-test='skill-tree']", () => { | |
const userName = $("div#root div[data-test='user-dropdown'] > span:first").text(); | |
$.get(`/users/${userName}`, (d) => { | |
const language = Object.keys(d.language_data)[0]; | |
const skills = d.language_data[language].skills; | |
const $skills = $("div[data-test='skill-tree'] > div > a"); | |
$skills.each((i, d) => { | |
const $skill = $(d); | |
const skillName = $skill.find("> div > span").text() | |
if (skillName && skillName.length) { | |
const skill = skills.find((skill) => skill.short == skillName); | |
if (skill && skill.strength < 1 && skill.learned) { | |
const opacity = 0.5 * skill.strength; | |
const $skillIcon = $skill.find("> div:first > div:first") | |
$skillIcon.css("opacity", opacity) | |
} | |
} | |
}) | |
}); | |
}); |
Author
HerbCaudill
commented
Jul 24, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment