Skip to content

Commit

Permalink
Merge pull request #26 from Elessar1802/master
Browse files Browse the repository at this point in the history
Initialized with hide youtube shorts & loading indicator
  • Loading branch information
ephraimduncan authored Apr 21, 2024
2 parents 2281324 + da4a491 commit 91d85ae
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 1 deletion.
3 changes: 2 additions & 1 deletion content.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,12 @@ function init() {
observer.observe(bodyList, config);
titleObserver.observe(headList, config);
replaceHomePage();
removeUnreadCountFromTitle()
removeUnreadCountFromTitle();
}

function replaceHomePage() {
document.querySelector("body").style.cssText = "display:block !important";
// document.querySelector("body").classList.add("no-pseudo");
if (window.location.pathname === "/") {
document.querySelector("body").innerHTML = `
<div class="home-container">
Expand Down
52 changes: 52 additions & 0 deletions loader.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
html,
body {
height: 100vh;
position: relative;
}

body:before {
/* content: attr(showpseudo, ''); */
content: '';
position: fixed;
top: 0;
left: 0;
height: 100vh;
width: 100%;
z-index: 9998;
background-color: black;
}

body:after {
/* content: attr(showpseudo, ''); */
content: '';
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 48px;
height: 48px;
border: 5px solid #FFF;
border-bottom-color: transparent;
border-radius: 50%;
display: inline-block;
box-sizing: border-box;
animation: rotation 1s linear infinite;
z-index: 9999;
}

@keyframes rotation {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}

body.no-pseudo:after {
content: none;
}

body.no-pseudo:before {
content: none;
}
6 changes: 6 additions & 0 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@
},

"content_scripts": [
{
"run_at": "document_start",
"css": ["loader.css"],
"matches": ["https://*.youtube.com/*"],
"exclude_matches": ["https://music.youtube.com/*"]
},
{
"css": ["styles.css"],
"js": ["content.js"],
Expand Down
8 changes: 8 additions & 0 deletions styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -169,3 +169,11 @@ ytd-watch-flexy:not([theater]):not([fullscreen]) video {
ytd-playlist-sidebar-renderer {
left: 0 !important;
}

ytd-reel-shelf-renderer {
display: none;
}

ytd-button-renderer {
display: flex;
}

0 comments on commit 91d85ae

Please sign in to comment.