Ver código fonte

fix: css bundle fetching error

Sv443 1 mês atrás
pai
commit
0c4d93a5b4
6 arquivos alterados com 31 adições e 40 exclusões
  1. 1 0
      assets/resources.json
  2. 12 18
      dist/BetterYTM.css
  3. 5 6
      src/components/BytmDialog.css
  4. 7 12
      src/menu/menu_old.css
  5. 1 1
      src/types.ts
  6. 5 3
      src/utils/misc.ts

+ 1 - 0
assets/resources.json

@@ -5,6 +5,7 @@
     "css-above_queue_btns_sticky": "style/aboveQueueBtnsSticky.css",
     "css-anchor_improvements": "style/anchorImprovements.css",
     "css-auto_like": "style/autoLike.css",
+    "css-bundle": "/dist/BetterYTM.css",
     "css-fix_hdr": "style/fixHDR.css",
     "css-fix_playerpage_theming": "style/fixPlayerPageTheming.css",
     "css-fix_spacing": "style/fixSpacing.css",

+ 12 - 18
dist/BetterYTM.css

@@ -13,7 +13,7 @@
   height: 100%;
   top: 0;
   left: 0;
-  z-index: 5;
+  z-index: 3005;
   background-color: rgba(0, 0, 0, 0.6);
 }
 
@@ -29,7 +29,7 @@
   left: 50%;
   top: 50%;
   transform: translate(-50%, -50%);
-  z-index: 6;
+  z-index: 3006;
   color: #fff;
   background-color: var(--bytm-dialog-bg);
 }
@@ -112,7 +112,7 @@
   left: 0;
   font-size: 10px;
   font-weight: normal;
-  z-index: 7;
+  z-index: 3007;
 }
 
 #bytm-dialog-version .bytm-link {
@@ -223,7 +223,7 @@
   transform: translateX(-50%);
   width: 32px;
   height: 32px;
-  z-index: 7;
+  z-index: 3007;
   background-color: var(--bytm-scroll-indicator-bg);
   border-radius: 50%;
   cursor: pointer;
@@ -350,8 +350,7 @@ select.bytm-ftconf-input {
   border: 1px solid #777;
   border-radius: 5px;
   box-shadow: inset 0 -2px 0 #515559;
-  transition:
-    padding 0.1s var(--bytm-kbd-easing),
+  transition: padding 0.1s var(--bytm-kbd-easing),
     margin-top 0.1s var(--bytm-kbd-easing),
     box-shadow 0.1s var(--bytm-kbd-easing);
 }
@@ -1076,7 +1075,7 @@ body.bytm-dom-ytm
   height: 100%;
   top: 0;
   left: 0;
-  z-index: 5;
+  z-index: 3005;
   background-color: rgba(0, 0, 0, 0.6);
 }
 
@@ -1091,7 +1090,7 @@ body.bytm-dom-ytm
   left: 50%;
   top: 50%;
   transform: translate(-50%, -50%);
-  z-index: 6;
+  z-index: 3006;
   color: #fff;
   background-color: var(--bytm-menu-bg);
 }
@@ -1179,7 +1178,7 @@ body.bytm-dom-ytm
   left: 0;
   font-size: 10px;
   font-weight: normal;
-  z-index: 7;
+  z-index: 3007;
 }
 
 #bytm-menu-subtitle-cont,
@@ -1213,9 +1212,7 @@ body.bytm-dom-ytm
   border-radius: 50%;
   padding: 0px;
   transform: translateY(0px);
-  transition:
-    transform 0.15s ease-out,
-    padding 0.15s ease-out;
+  transition: transform 0.15s ease-out, padding 0.15s ease-out;
 }
 
 .bytm-menu-link:hover .bytm-menu-img {
@@ -1234,9 +1231,7 @@ body.bytm-dom-ytm
   color: var(--bytm-menu-subtitle-color) !important;
   white-space: pre;
   font-size: 1.1rem;
-  transition:
-    visibility 0.15s ease-out,
-    opacity 0.15s ease-out;
+  transition: visibility 0.15s ease-out, opacity 0.15s ease-out;
 }
 
 .bytm-menu-link:hover .extended-link {
@@ -1307,7 +1302,7 @@ body.bytm-dom-ytm
   transform: translateX(-50%);
   width: 32px;
   height: 32px;
-  z-index: 7;
+  z-index: 3007;
   background-color: var(--bytm-scroll-indicator-bg);
   border-radius: 50%;
   cursor: pointer;
@@ -1443,8 +1438,7 @@ body.bytm-dom-ytm
   border: 1px solid #777;
   border-radius: 5px;
   box-shadow: inset 0 -2px 0 #515559;
-  transition:
-    padding 0.1s var(--bytm-kbd-easing),
+  transition: padding 0.1s var(--bytm-kbd-easing),
     margin-top 0.1s var(--bytm-kbd-easing),
     box-shadow 0.1s var(--bytm-kbd-easing);
 }

+ 5 - 6
src/components/BytmDialog.css

@@ -13,7 +13,7 @@
   height: 100%;
   top: 0;
   left: 0;
-  z-index: 5;
+  z-index: 3005;
   background-color: rgba(0, 0, 0, 0.6);
 }
 
@@ -29,7 +29,7 @@
   left: 50%;
   top: 50%;
   transform: translate(-50%, -50%);
-  z-index: 6;
+  z-index: 3006;
   color: #fff;
   background-color: var(--bytm-dialog-bg);
 }
@@ -112,7 +112,7 @@
   left: 0;
   font-size: 10px;
   font-weight: normal;
-  z-index: 7;
+  z-index: 3007;
 }
 
 #bytm-dialog-version .bytm-link {
@@ -223,7 +223,7 @@
   transform: translateX(-50%);
   width: 32px;
   height: 32px;
-  z-index: 7;
+  z-index: 3007;
   background-color: var(--bytm-scroll-indicator-bg);
   border-radius: 50%;
   cursor: pointer;
@@ -350,8 +350,7 @@ select.bytm-ftconf-input {
   border: 1px solid #777;
   border-radius: 5px;
   box-shadow: inset 0 -2px 0 #515559;
-  transition:
-    padding 0.1s var(--bytm-kbd-easing),
+  transition: padding 0.1s var(--bytm-kbd-easing),
     margin-top 0.1s var(--bytm-kbd-easing),
     box-shadow 0.1s var(--bytm-kbd-easing);
 }

+ 7 - 12
src/menu/menu_old.css

@@ -16,7 +16,7 @@
   height: 100%;
   top: 0;
   left: 0;
-  z-index: 5;
+  z-index: 3005;
   background-color: rgba(0, 0, 0, 0.6);
 }
 
@@ -31,7 +31,7 @@
   left: 50%;
   top: 50%;
   transform: translate(-50%, -50%);
-  z-index: 6;
+  z-index: 3006;
   color: #fff;
   background-color: var(--bytm-menu-bg);
 }
@@ -119,7 +119,7 @@
   left: 0;
   font-size: 10px;
   font-weight: normal;
-  z-index: 7;
+  z-index: 3007;
 }
 
 #bytm-menu-subtitle-cont,
@@ -153,9 +153,7 @@
   border-radius: 50%;
   padding: 0px;
   transform: translateY(0px);
-  transition:
-    transform 0.15s ease-out,
-    padding 0.15s ease-out;
+  transition: transform 0.15s ease-out, padding 0.15s ease-out;
 }
 
 .bytm-menu-link:hover .bytm-menu-img {
@@ -174,9 +172,7 @@
   color: var(--bytm-menu-subtitle-color) !important;
   white-space: pre;
   font-size: 1.1rem;
-  transition:
-    visibility 0.15s ease-out,
-    opacity 0.15s ease-out;
+  transition: visibility 0.15s ease-out, opacity 0.15s ease-out;
 }
 
 .bytm-menu-link:hover .extended-link {
@@ -247,7 +243,7 @@
   transform: translateX(-50%);
   width: 32px;
   height: 32px;
-  z-index: 7;
+  z-index: 3007;
   background-color: var(--bytm-scroll-indicator-bg);
   border-radius: 50%;
   cursor: pointer;
@@ -383,8 +379,7 @@
   border: 1px solid #777;
   border-radius: 5px;
   box-shadow: inset 0 -2px 0 #515559;
-  transition:
-    padding 0.1s var(--bytm-kbd-easing),
+  transition: padding 0.1s var(--bytm-kbd-easing),
     margin-top 0.1s var(--bytm-kbd-easing),
     box-shadow 0.1s var(--bytm-kbd-easing);
 }

+ 1 - 1
src/types.ts

@@ -47,7 +47,7 @@ export type SiteSelection = Domain | "all";
 export type SiteSelectionOrNone = SiteSelection | "none";
 
 /** Key of a resource in `assets/resources.json` and extra keys defined by `tools/post-build.ts` */
-export type ResourceKey = keyof typeof resources["resources"] | `trans-${keyof typeof locales}` | "css-bundle";
+export type ResourceKey = keyof typeof resources["resources"] | `trans-${keyof typeof locales}`;
 
 /** Describes a single hotkey */
 export type HotkeyObj = {

+ 5 - 3
src/utils/misc.ts

@@ -276,13 +276,15 @@ export async function getResourceUrl(name: ResourceKey | "_", uncached = false)
             let path = pathName;
             if(path.startsWith("/"))
               path = path.slice(1);
+            else
+              path = `assets/${path}`;
             switch(assetSource) {
             case "jsdelivr":
-              return `https://cdn.jsdelivr.net/gh/${repo}@${ghRef}/assets/${path}`;
+              return `https://cdn.jsdelivr.net/gh/${repo}@${ghRef}/${path}`;
             case "github":
-              return `https://raw.githubusercontent.com/${repo}/${ghRef}/assets/${path}`;
+              return `https://raw.githubusercontent.com/${repo}/${ghRef}/${path}`;
             case "local":
-              return `http://localhost:${devServerPort}/assets/${path}`;
+              return `http://localhost:${devServerPort}/${path}`;
             }
           })();
       }