Facilitating learncpp.com

Move the control button from top to bottom. This is not a responsive script.

目前为 2024-07-04 提交的版本。查看 最新版本

  1. // ==UserScript==
  2. // @name Facilitating learncpp.com
  3. // @namespace http://github.com/basilguo
  4. // @description Move the control button from top to bottom. This is not a responsive script.
  5. // @author Basil Guo
  6. // @match https://www.learncpp.com/cpp-tutorial/*
  7. // @icon https://www.learncpp.com/blog/wp-content/uploads/learncpp.png
  8. // @homepageURL https://gist.github.com/BasilGuo/84350a125bcb864abe2a779a2768c381
  9. // @license MIT
  10. // @version 2024-07-04-01
  11. // @note 2024-07-04-01 Modify the description.
  12. // @note 2024-07-04-00 Conceal the text as default and will appear after hovering the control buttons.
  13. // @note 2024-05-23-00 Create the script.
  14. // @grant none
  15. // ==/UserScript==
  16.  
  17. (function() {
  18. 'use strict';
  19. // Your code here...
  20. document.body.style.cssText += 'font-size: 1em';
  21. let pndiv = document.querySelector('.prevnext');
  22. pndiv.style.cssText = `position:fixed;top:0;width:100%;z-index:101;background-color:#fff`;
  23. let header = document.querySelector('header')
  24. header.appendChild(pndiv);
  25.  
  26. let prevnext_inline = document.querySelector('.prevnext-inline');
  27. prevnext_inline.style.cssText = `width:100%;display:flex;flex-direction:row-reverse;max-width:100%;justify-content:space-around;align-items:center;background-color:#fff;margin-top:0`;
  28.  
  29.  
  30. let prevBtn = document.querySelector('.nav-button-prev');
  31. let prevBtnText = document.querySelector('.nav-button-prev .nav-button-text');
  32. prevBtn.onmouseover = function(){prevBtnText.style.display = '';};
  33. prevBtn.onmouseout = function(){prevBtnText.style.display = 'none';};
  34. prevBtnText.style.display = 'none';
  35.  
  36. let nextBtn = document.querySelector('.nav-button-next');
  37. let nextBtnText = document.querySelector('.nav-button-next .nav-button-text');
  38. nextBtn.onmouseover = function(){nextBtnText.style.display = '';};
  39. nextBtn.onmouseout = function(){nextBtnText.style.display = 'none';};
  40. nextBtnText.style.display = 'none';
  41.  
  42. let homeBtn = document.querySelector('.nav-button-index');
  43. let homeBtnText = document.querySelector('.nav-button-index .nav-button-text');
  44. let homeBtnIcon = document.querySelector('.nav-button-index .nav-button-icon');
  45. homeBtn.onmouseover = function(){homeBtnText.style.display = '';};
  46. homeBtn.onmouseout = function(){homeBtnText.style.display = 'none';};
  47. homeBtnText.style.cssText = `display:none;line-height:42px;font-size:42px;margin:auto;padding:0 0 0 10px`;
  48. homeBtnIcon.style.cssText = `width:42px;height:42px;line-height:42px;font-size:42px;margin:auto`;
  49. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址