metazeta / 101 - Adventurers

// ==UserScript==
// @name 101 - Adventurers
// @namespace https://openuserjs.org/scripts/metazeta/101_-_Adventurers
// @version 0.1
// @author Emmanuel Ruaud
// @description Does funny stuff with your profile
// @match https://profile.intra.42.fr/users/*
// @match https://profile.intra.42.fr/
// @updateURL https://openuserjs.org/meta/metazeta/101_-_Adventurers.meta.js
// @license MIT
// ==/UserScript==

function add_hat(my_hat) {
  let img = document.createElement("IMG");
  let div = document.getElementsByClassName('user-image profile-image bg-image-item rounded');
  if (my_hat == 'wizard') {
    img.src = 'http://icons.iconarchive.com/icons/aha-soft/desktop-halloween/128/Hat-icon.png';
  }
  img.width = 90;
  img.height = 90;
  img.style.left = '50%';
  img.style.top = '50%';
  img.style.marginLeft = '20px';
  img.style.marginTop = '-200px';
  div[0].appendChild(img);
}