congdantoancau

Youtube view-count and publish-date absolute position

Aug 6th, 2022 (edited)
1,565
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CSS 0.83 KB | None | 0 0
  1. // JAVASCRIPT
  2. (function(){
  3.   //console.log("1")
  4.   var func = document.getElementsByTagName("ytd-video-primary-info-renderer");
  5.   console.log(func);
  6.   const child = document.createElement('div');
  7.   child.setAttribute("id", "info-panel");
  8.   child.innerHTML = `<h1>Hello World!</h1>`;
  9.   func[0].appendChild(child);
  10.   //console.log("2")
  11. })();
  12.  
  13. // CSS
  14. #info-text {
  15.   background-color: red;
  16.   position: absolute;
  17.   top: 0;
  18.   left: 0;
  19.   padding: 0 10px;
  20. }
  21.  
  22. #info-text * {
  23.   color: white;
  24. }
  25.  
  26. #info-panel {
  27.     display: block;
  28.     height: 20px;
  29.     position: absolute;
  30.     top: 2px;
  31.     right: 3px;
  32.     z-index: 9;
  33.     color: #666;
  34.     font-size: 11px;
  35.     font-weight: bold;
  36.     line-height: 17px;
  37.     text-decoration: none;
  38.     font-weight: normal;
  39.     -webkit-animation: fadeInOut 14s;
  40.     animation: fadeInOut 14s;
  41. }
Advertisement
Add Comment
Please, Sign In to add comment