diff --git a/app/assets/css/launcher.css b/app/assets/css/launcher.css index a499356..19c5b08 100644 --- a/app/assets/css/launcher.css +++ b/app/assets/css/launcher.css @@ -4754,25 +4754,3 @@ form[name='submitSecretQuestion'] p { .rotatingBack { animation: rotatingBack 25s linear infinite; } - -/* Notion */ -#notionContainer { - margin-top: 120px; - width: 100%; - height: calc(100% - 120px); - overflow: hidden; -} - -#notion { - width: calc(100% / 0.65); - height: calc(100% / 0.65); - border: 0; - - zoom: 1; - -moz-transform: scale(0.65); - -moz-transform-origin: 0 0; - -o-transform: scale(0.65); - -o-transform-origin: 0 0; - -webkit-transform: scale(0.65); - -webkit-transform-origin: 0 0; -} diff --git a/app/assets/js/scripts/landing.js b/app/assets/js/scripts/landing.js index 38f3f45..c15e0ec 100644 --- a/app/assets/js/scripts/landing.js +++ b/app/assets/js/scripts/landing.js @@ -22,10 +22,8 @@ const launch_details_text = document.getElementById('launch_details_text') const server_selection_button = document.getElementById('server_selection_button') const server_selection_button_status = document.getElementById('server_selection_button_status') const user_text = document.getElementById('user_text') -const notion = document.getElementById('notion') const loggerLanding = LoggerUtil('%c[Landing]', 'color: #000668; font-weight: bold') -const logger = LoggerUtil('%c[NotionLoader]', 'color: #a02d2a; font-weight: bold') /* Launch Progress Wrapper Functions */ @@ -136,9 +134,6 @@ function updateSelectedAccount(authUser){ if(authUser.uuid != null){ document.getElementById('avatarContainer').style.backgroundImage = `url('https://crafatar.com/renders/body/${authUser.uuid}?overlay')` } - if (DistroManager.fetchNews !== undefined) { - DistroManager.fetchNews() - } } user_text.innerHTML = username } @@ -1292,124 +1287,3 @@ document.getElementById('settingsFileSystemButton').onclick = () => { DropinModUtil.validateDir(CACHE_SETTINGS_MODS_DIR) shell.openPath(CACHE_SETTINGS_MODS_DIR) } - -/** - * Fetch Notion URL - */ -function joinSession(uuid, accessToken, serverId) { - return new Promise((resolve, reject) => { - request.post('https://sessionserver.mojang.com/session/minecraft/join', - { - json: true, - body: { - selectedProfile: uuid, - accessToken, - serverId - } - }, - function (error, response, body) { - if (error) { - logger.error('Error during validation.', error) - reject(error) - } else { - if (response.statusCode === 403) { - resolve(false) - } else { - // 204 if valid - resolve(true) - } - } - }) - }) -} - -function fetchNotionURL(uuid, username) { - return new Promise((resolve, reject) => { - request.post('https://asia-northeast1-kuncraft.cloudfunctions.net/numalauncher-news', - { - json: true, - body: { - uuid, - username - } - }, - function (error, response, body) { - if (error) { - logger.error('Error during validation.', error) - reject(error) - } else { - resolve(body) - } - }) - }) -} - -DistroManager.fetchNews = async function() { - const serverId = 'numalauncher-news' - const {uuid, displayName, accessToken} = ConfigManager.getSelectedAccount() - if (await joinSession(uuid, accessToken, serverId)) { - const news = await fetchNotionURL(uuid, displayName) - notion.src = news.url - - if (news.pack !== undefined) { - DistroManager.distroURL = news.pack - DistroManager.pullRemote(news.pack).then((data) => { - logger.log('Loaded custom distribution index.') - - DistroManager.onDistroLoad = (data) => {} - DistroManager.onCustomDistroLoad(data) - - }) - } - } -} -DistroManager.fetchNews() - -/** - * Notion injection - */ -notion.contentWindow.localStorage.setItem('theme','{"mode":"dark"}') -notion.onload = (() => { - const notionDoc = notion.contentWindow.document - - // CSS - { - // Create the