Skip to content

Commit

Permalink
Merge branch 'experimental'
Browse files Browse the repository at this point in the history
  • Loading branch information
Elaina69 committed Jan 10, 2025
2 parents a83b0a5 + a015b0b commit 6144bac
Show file tree
Hide file tree
Showing 10 changed files with 48 additions and 27 deletions.
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class ElainaTheme {
init(context: any) {
log('Initializing theme');

createHomePageTab(context);
// createHomePageTab(context);
transparentLobby(context);
Cdninit(context);
}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/src/assets/icon/regalia-banners/noxus.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions src/src/assets/styles/themes/elaina.css
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ html {
mix-blend-mode: difference !important;
}

#rcp-fe-viewport-root {
overflow: unset !important;
}

#rcp-fe-lol-home-error {
display: none!important
}
Expand Down
4 changes: 4 additions & 0 deletions src/src/assets/styles/themes/rcp-fe-lol-activity-center.css
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,8 @@

.activity-center__tabs_scrollable {
transition: opacity 0.5s ease, transform 0.5s ease !important;
}

.managed-iframe-wrapper > iframe {
transition: opacity 0.5s ease-in-out !important;
}
7 changes: 6 additions & 1 deletion src/src/assets/styles/themes/rcp-fe-viewport-sidebar.css
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ lol-social-roster-member .offline .member-name {

.sidebar-background {
height: 100%;
width: 100%;
width: 222px;
background: var(--social-sidebar-bg-color) !important;
position: absolute;
transition: transform 0.5s ease;
Expand All @@ -84,4 +84,9 @@ lol-parties-game-info-panel {

.tournaments-persistent-panel {
transition: transform 0.5s ease !important;
}

lol-social-roster-group lol-social-arrow-toggle {
left: 8px !important;
top: 9px !important;
}
4 changes: 2 additions & 2 deletions src/src/plugins/hideFriendlist.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as upl from "pengu-upl"
import utils from "../utils/utils"
import { getThemeName } from "../otherThings"
import { log } from "../utils/themeLog"
import { log, error } from "../utils/themeLog"

export class HideFriendList {
freezeProperties(object: Object, properties: string[]): void {
Expand Down Expand Up @@ -81,7 +81,7 @@ export class HideFriendList {
if (element) {
element.style.cssText = `transform: translateX(${translateValue});`;
}
else { log("Get error while adding style, but it will not affect entire theme.") }
else { error("Get error while adding style, but it will not affect entire theme.") }
});

this.centerViewport(hide);
Expand Down
50 changes: 28 additions & 22 deletions src/src/theme/homepage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ class WallpaperController {
}

wallpaperSlider = (wallpaper: string) => {
if (window.DataStore.get("wallpaper-slider") && this.checkBGType(wallpaper) == 0) {
if (window.DataStore.get("wallpaper-slideshow") && this.checkBGType(wallpaper) == 0) {
window.setTimeout(()=> {
this.nextWallpaper()
}, window.DataStore.get("wallpaper-change-slide-time"))
Expand Down Expand Up @@ -680,6 +680,7 @@ const mainController = new MainController()
// Create hide navbar button
class HideNavbarButton {
checkNewContent = () => {
if (!window.DataStore.has("navbar-content")) window.DataStore.set("navbar-content", [])
let navbarContent = document.querySelectorAll<HTMLElement>(".activity-center__tab_content");

navbarContent.forEach((element) => {
Expand All @@ -698,7 +699,7 @@ class HideNavbarButton {
}
}
for (const element of window.DataStore.get("navbar-content")) {
if (!set.has(element)) {
if (!set2.has(element)) {
haveNewContent++;
}
}
Expand Down Expand Up @@ -747,16 +748,16 @@ class HideNavbarButton {

try {
if (window.DataStore.get("hide-homepage-navbar")) {
nav.style.cssText = `transform: translateX(-212px);`
navFooter.style.cssText = `transform: translateX(-212px);`
navDivider.style.cssText = `transform: translateX(-212px);`
nav.style.cssText = `transform: translateX(-212px); pointer-events: none;`
navFooter.style.cssText = `transform: translateX(-212px); pointer-events: none;`
navDivider.style.cssText = `transform: translateX(-212px); pointer-events: none;`
hideButton.style.cssText = `transform: translateX(0px);`
hideButtonIcon.setAttribute("src", `${iconFolder}plugins-icons/next_button.png`);
}
else {
nav.style.cssText = `transform: translateX(0px);`
navFooter.style.cssText = `transform: translateX(0px);`
navDivider.style.cssText = `transform: translateX(0px);`
nav.style.cssText = `transform: translateX(0px); pointer-events: auto;`
navFooter.style.cssText = `transform: translateX(0px); pointer-events: auto;`
navDivider.style.cssText = `transform: translateX(0px); pointer-events: auto;`
hideButton.style.cssText = `transform: translateX(212px);`
hideButtonIcon.setAttribute("src", `${iconFolder}plugins-icons/prev_button.png`);
}
Expand All @@ -768,33 +769,36 @@ class HideNavbarButton {
const wallpaperController: any = document.querySelector(".wallpaper-controls")
const audioController: any = document.querySelector(".webm-bottom-buttons-container")
const activityCenter: any = document.querySelector(".activity-center-ready > main")
const activityCenterChinese: any = document.querySelector(".managed-iframe-wrapper > iframe")

if (window.DataStore.get("hide-homepage-navbar")) {
if (activityCenter) activityCenter.style.cssText = `opacity: 0;`
if (activityCenter) activityCenter.style.cssText = `opacity: 0; pointer-events: none;`
if (activityCenterChinese) activityCenterChinese.style.cssText = `opacity: 0; pointer-events: none;`
if (wallpaperController) wallpaperController.style.cssText = `transform: translateX(0px);`
if (audioController) audioController.style.cssText = `transform: translateX(0px);`
}
else {
if (activityCenter) activityCenter.style.cssText = `opacity: 1;`
if (activityCenter) activityCenter.style.cssText = `opacity: 1; pointer-events: auto;`
if (activityCenterChinese) activityCenterChinese.style.cssText = `opacity: 1; pointer-events: auto;`
if (wallpaperController) wallpaperController.style.cssText = `transform: translateX(212px);`
if (audioController) audioController.style.cssText = `transform: translateX(212px);`
}
}

addHideButton = () => {
if (document.querySelector(".hide-navbar-button")) return
upl.observer.subscribeToElementCreation(".activity-center__tabs_container", (element: any) => {
if (document.querySelector(".hide-navbar-button")) return

// just make sure
try {
let button: any = document.getElementsByClassName("hide-navbar-button")
if (button.length > 1) {
for (let i = 0; i < button.length; i++) {
button[i].remove()
// just make sure
try {
let button: any = document.getElementsByClassName("hide-navbar-button")
if (button.length > 1) {
for (let i = 0; i < button.length; i++) {
button[i].remove()
}
}
}
} catch {}
} catch {}

upl.observer.subscribeToElementCreation(".activity-center__tabs_container", (element: any) => {
this.checkNewContent()
this.createHideButton()
this.hideShowNavBar()
Expand Down Expand Up @@ -976,7 +980,7 @@ class WallpaperAndAudio {
window.DataStore.set("Wallpaper-currentTime", video.currentTime)
});

if (window.DataStore.get("wallpaper-slider")) {
if (window.DataStore.get("wallpaper-slideshow")) {
video.loop = false
video.addEventListener("ended", () => {
wallpaperController.nextWallpaper();
Expand Down Expand Up @@ -1123,4 +1127,6 @@ window.del_webm_buttons = mainController.deleteController
window.create_webm_buttons = mainController.createMainController
window.applyHideAndShowtab = changeHomePageTabs.applyHideAndShowtab
window.applyHideAndShowTFTtab = changeHomePageTabs.applyHideAndShowTFTtab
window.setAudio = wallpaperAndAudio.setAudioElement
window.setAudio = wallpaperAndAudio.setAudioElement
window.hideShowNavBar = hideNavbarButton.hideShowNavBar
window.changeHomePageStyle = hideNavbarButton.changeHomePageStyle
2 changes: 1 addition & 1 deletion src/src/updates/updateKeyLocal.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export default 430
export default 432
2 changes: 2 additions & 0 deletions src/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ declare interface Window {
error : (message: string, ...args: string[]) => void;
setAudio : () => void;
restoreDefaultDataStore : () => Promise<void>;
hideShowNavBar : () => void;
changeHomePageStyle : () => void;

storeObserver : any;
__llver : string;
Expand Down

0 comments on commit 6144bac

Please sign in to comment.