Skip to content

Commit

Permalink
add: new ui for error hítory page
Browse files Browse the repository at this point in the history
remove: modal support (initial)
  • Loading branch information
RainyXeon committed Nov 12, 2024
1 parent 949a526 commit 7ed3cbf
Show file tree
Hide file tree
Showing 25 changed files with 213 additions and 158 deletions.
7 changes: 3 additions & 4 deletions module/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -201,15 +201,14 @@ androidComponents.onVariants { variant ->

set.add(Pair(root.file("webroot/js/smallPage/language.js").asFile, null))
set.add(Pair(root.file("webroot/js/smallPage/theme.js").asFile, null))

set.add(Pair(root.file("webroot/js/modal/errorHistory.js").asFile, null))
set.add(Pair(root.file("webroot/js/smallPage/errorHistory.js").asFile, null))

set.add(Pair(root.file("webroot/css/index.css").asFile, null))
set.add(Pair(root.file("webroot/css/icons.css").asFile, null))
set.add(Pair(root.file("webroot/css/error.css").asFile, null))

set.add(Pair(root.file("webroot/fonts/font.ttf").asFile, null))
set.add(Pair(root.file("webroot/fonts/outfit.css").asFile, null))
set.add(Pair(root.file("webroot/fonts/poppins.ttf").asFile, null))
set.add(Pair(root.file("webroot/fonts/header.css").asFile, null))

set.add(Pair(root.file("webroot/assets/mark.svg").asFile, null))
set.add(Pair(root.file("webroot/assets/tick.svg").asFile, null))
Expand Down
7 changes: 3 additions & 4 deletions module/src/customize.sh
Original file line number Diff line number Diff line change
Expand Up @@ -139,19 +139,18 @@ extract "$ZIPFILE" 'webroot/js/themes/lightNavbar.js' "$MODPATH/webroot/js/theme
extract "$ZIPFILE" 'webroot/js/themes/lightIcon.js' "$MODPATH/webroot/js/themes" true
extract "$ZIPFILE" 'webroot/js/themes/monochrome.js' "$MODPATH/webroot/js/themes" true

extract "$ZIPFILE" 'webroot/js/modal/errorHistory.js' "$MODPATH/webroot/js/modal" true

extract "$ZIPFILE" 'webroot/js/smallPage/language.js' "$MODPATH/webroot/js/smallPage" true
extract "$ZIPFILE" 'webroot/js/smallPage/theme.js' "$MODPATH/webroot/js/smallPage" true
extract "$ZIPFILE" 'webroot/js/smallPage/errorHistory.js' "$MODPATH/webroot/js/smallPage" true

extract "$ZIPFILE" 'webroot/js/switcher/fontChanger.js' "$MODPATH/webroot/js/switcher" true

extract "$ZIPFILE" 'webroot/css/index.css' "$MODPATH/webroot/css" true
extract "$ZIPFILE" 'webroot/css/icons.css' "$MODPATH/webroot/css" true
extract "$ZIPFILE" 'webroot/css/error.css' "$MODPATH/webroot/css" true

extract "$ZIPFILE" 'webroot/fonts/font.ttf' "$MODPATH/webroot/fonts" true
extract "$ZIPFILE" 'webroot/fonts/outfit.css' "$MODPATH/webroot/fonts" true
extract "$ZIPFILE" 'webroot/fonts/poppins.ttf' "$MODPATH/webroot/fonts" true
extract "$ZIPFILE" 'webroot/fonts/header.css' "$MODPATH/webroot/fonts" true

for lang in en_US ja_JP pt_BR ro_RO ru_RU vi_VN zh_CN zh_TW; do
extract "$ZIPFILE" "webroot/lang/${lang}.json" "$MODPATH/webroot/lang" true
Expand Down
53 changes: 49 additions & 4 deletions webroot/css/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
/* Locked Color */
--lock-desc: #c9c9c9;
--lock: #fff;
--font-family: 'Outfit', sans-serif;
--font-family: 'Poppins', sans-serif;
}

* {
Expand Down Expand Up @@ -231,15 +231,44 @@ a {
}

.errorh_textarea {
field-sizing: content;
resize: none;
height: 100%;
width: 100%;
border: none;
outline: none;
font-size: 14px;
padding-bottom: 25px;
font-family: monospace, monospace;
position: fixed;
bottom: 7em;
top: 15.2em;
left: 1em;
right: 1em;
}

.errorh_button_container {
position: fixed;
top: 5.75em;
left: 1em;
right: 1em;
display: grid;
grid-template-columns: 1fr;
column-gap: 1em;
}

.errorh_button {
border-radius: 25px;
background: var(--small-card);
display: flex;
padding: 0.7em;
align-items: center;
justify-content: center;
margin-bottom: 1em;
cursor: pointer;
transition: transform 0.05s ease-in-out;
user-select: none;
}

.errorh_button:active {
transform: scale(80%)
}

/* Card type */
Expand Down Expand Up @@ -351,6 +380,13 @@ input:checked + .slider:before {
animation: fade-in 0.2s;
}

.panel.showback {
margin-bottom: 119px;
display: block;
animation: fade-in 0.2s;
z-index: 30;
}

.navicon.show {
width: 65px;
animation: openNav 0.15s;
Expand Down Expand Up @@ -388,6 +424,15 @@ input:checked + .slider:before {
.nav_dimc {
background: var(--desktop-navbar);
}
.errorh_button_container {
grid-template-columns: 1fr 1fr;
}
.errorh_textarea {
top: 11em;
}
.errorh_button {
margin-bottom: 0;
}
}

/* Animation KeyFrames */
Expand Down
Binary file removed webroot/fonts/font.ttf
Binary file not shown.
4 changes: 4 additions & 0 deletions webroot/fonts/header.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
@font-face {
font-family: "Poppins";
src: url("./poppins.ttf");
}
4 changes: 0 additions & 4 deletions webroot/fonts/outfit.css

This file was deleted.

Binary file added webroot/fonts/poppins.ttf
Binary file not shown.
56 changes: 25 additions & 31 deletions webroot/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@

<meta id="cache-navbar-previous" />
<meta id="cache-page-small-previous" />
<meta id="cache-modal-error-history-state" />
<meta id="cache-fallback-open" />

<link rel="stylesheet" href="fonts/outfit.css">
<link rel="stylesheet" href="fonts/header.css">
<link rel="stylesheet" href="css/index.css">
<link rel="stylesheet" href="css/error.css">
<link rel="stylesheet" href="css/icons.css">
Expand All @@ -18,12 +18,12 @@
<script src="js/errorScreen.js" type="module"></script>
<script src="js/browserRedirect.js" type="module"></script>
<script src="js/smallPage/theme.js" type="module"></script>
<script src="js/smallPage/language.js" type="module"></script>
<script src="js/smallPage/errorHistory.js" type="module"></script>
<script src="js/restoreError.js" type="module"></script>
<script src="js/navbar.js" type="module"></script>
<script src="js/daemonActions.js" type="module"></script>
<script src="js/switcher/fontChanger.js" type="module"></script>
<script src="js/smallPage/language.js" type="module"></script>
<script src="js/modal/errorHistory.js" type="module"></script>
<script src="js/main.js" type="module"></script>
</head>
<body id="main_body">
Expand Down Expand Up @@ -53,30 +53,6 @@
<div id="backport_errorh" class="loader"></div>
</div>

<!-- INFO: Error History Modal -->
<div id="errorh_modal" class="full_screen" style="top: 100%;">
<div class="liste" style="margin-top: 20px; margin-left: 20px;">
<div style="margin-left: 20px;"></div>
<div id="errorh_modal_close" class="close_icon icon_animation" style="margin-right: 20px; width: 40px; height: 40px;">
<img src="assets/close.svg">
</div>
</div>
<div style="margin: 0 25px 0 25px; display: flex; align-items: center; justify-content: space-between;">
<h1 id="errorh_modal_title">Error History</h1>
<div style="display: flex; align-items: center;">
<div class="icon_animation" id="errorh_copy">
<img src="assets/content.svg">
</div>
<div class="icon_animation" id="errorh_clear_all">
<img src="assets/delete.svg">
</div>
</div>
</div>
<div style="margin-left: 25px; margin-right: 25px; height: fit-content;">
<textarea id="errorh_panel" class="errorh_textarea" placeholder="No error log recorded here!" disabled></textarea>
</div>
</div>

<!-- INFO: Home page -->
<div id="panel_home" class="panel">
<div class="header">ReZygisk</div>
Expand Down Expand Up @@ -209,7 +185,7 @@ <h1 id="errorh_modal_title">Error History</h1>
</div>

<!-- INFO: Error history -->
<div id="rezygisk_errorh" class="small_card dimc card_animation" style="margin-top: 15px; justify-content: space-between; display: flex; align-items: center;">
<div id="errorh_page_toggle" class="small_card dimc card_animation" style="margin-top: 15px; justify-content: space-between; display: flex; align-items: center;">
<div class="dimc" style="display: inline-block;">
<div id="sys_errorh_title" class="dimc content" style="font-size: 1.1em; padding-left: 5px; padding-top: 6px; padding-bottom: 2px;">
Error History
Expand Down Expand Up @@ -306,9 +282,27 @@ <h1 id="errorh_modal_title">Error History</h1>
<!-- N/A -->
</div>
</div>


<!-- INFO: Error small page -->
<div id="small_panel_errorh" class="panel">
<div class="header" style="padding-left: 20px; display: flex; align-items: center; justify-content: initial;">
<div id="sp_errorh_close" style="width: 36px; height: 36px; margin-right: 6px;">
<img src="./assets/back.svg"/>
</div>
<div id="small_panel_errorh_title">Error History</div>
</div>
<div style="display: block; height: 100%;">
<div class="errorh_button_container">
<div id="errorh_copy" class="errorh_button">COPY</div>
<div id="errorh_clear_all" class="errorh_button">CLEAR ALL LOG</div>
</div>
<textarea id="errorh_panel" class="errorh_textarea" placeholder="No error log recorded here!" disabled></textarea>
</div>
</div>


<!-- INFO: Bottom navbar -->
<div id="navbar_support_div">
<div id="navbar_support_div" style="display: none;">
<div id="navbar" class="navbar radios">
<div class="navicon_support nav_dimc">
<input id="n_home" type="radio" name="navbutton" value="home" checked/>
Expand Down
11 changes: 6 additions & 5 deletions webroot/js/language.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,6 @@ export async function setNewLanguage(locate, initialize) {
translateActionPage(old_translations, new_translations)
translateSettingsPage(new_translations)


/* INFO: error history modal */
document.getElementById('errorh_modal_title').innerHTML = new_translations.modal.logs.header
document.getElementById('errorh_panel').placeholder = new_translations.modal.logs.placeholder

/* INFO: navbar info */
document.getElementById('nav_home_title').innerHTML = new_translations.page.home.header
document.getElementById('nav_modules_title').innerHTML = new_translations.page.modules.header
Expand All @@ -34,6 +29,12 @@ export async function setNewLanguage(locate, initialize) {
document.getElementById('small_panel_theme_dark_option').innerHTML = new_translations.smallPage.theme.dark
document.getElementById('small_panel_theme_light_option').innerHTML = new_translations.smallPage.theme.light
document.getElementById('small_panel_theme_system_option').innerHTML = new_translations.smallPage.theme.system

/* INFO: Error history small page */
document.getElementById('errorh_copy').innerHTML = new_translations.smallPage.errorh.buttons.copy
document.getElementById('errorh_clear_all').innerHTML = new_translations.smallPage.errorh.buttons.clear
document.getElementById('errorh_modal_title').innerHTML = new_translations.smallPage.errorh.header
document.getElementById('errorh_panel').placeholder = new_translations.smallPage.errorh.placeholder
}

export async function getTranslations(locate) {
Expand Down
2 changes: 2 additions & 0 deletions webroot/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export function setErrorData(errorLog) {
const translations = await getTranslations(sys_lang)

const loading_screen = document.getElementById('loading_screen')
const bottom_nav = document.getElementById('navbar_support_div')

const rootCss = document.querySelector(':root')

Expand Down Expand Up @@ -204,6 +205,7 @@ export function setErrorData(errorLog) {

/* INFO: This hides the throbber screen */
loading_screen.style.display = 'none'
bottom_nav.style.display = 'flex'

all_modules.forEach((module) => {
modules_list.innerHTML +=
Expand Down
50 changes: 0 additions & 50 deletions webroot/js/modal/errorHistory.js

This file was deleted.

47 changes: 47 additions & 0 deletions webroot/js/smallPage/errorHistory.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import { smallPageDisabler } from '../smallPageDesabler.js'
const panel = document.getElementById('errorh_panel')

/* INFO: Event setup */
const navbar_data_tag = document.getElementById('cache-navbar-previous')
const small_panel_data_tag = document.getElementById('cache-page-small-previous')
const fallback_open = document.getElementById('cache-fallback-open')

document.getElementById('errorh_page_toggle').addEventListener('click', () => {
const previous = !navbar_data_tag.getAttribute('content') ? setData('home', small_panel_data_tag) : navbar_data_tag.getAttribute('content')
document.getElementById(`panel_${previous}`).classList.remove('show')
document.getElementById('small_panel_errorh').classList.toggle('show')
small_panel_data_tag.setAttribute('content', 'errorh')
})

document.getElementById('backport_errorh').addEventListener('click', () => {
const previous = !navbar_data_tag.getAttribute('content') ? setData('home', small_panel_data_tag) : navbar_data_tag.getAttribute('content')
document.getElementById(`panel_${previous}`).classList.remove('show')
document.getElementById('loading_screen').style.display = 'none'
document.getElementById('small_panel_errorh').classList.toggle('show')
document.getElementById('errorh_panel').style.bottom = '1em'
fallback_open.setAttribute('content', 'opened')
small_panel_data_tag.setAttribute('content', 'errorh')
})

document.getElementById('sp_errorh_close').addEventListener('click', () => {
const is_fallback = fallback_open.getAttribute('content')
if (is_fallback) {
document.getElementById('errorh_panel').style.bottom = '1em'
document.getElementById('loading_screen').style.display = 'flex'
}
smallPageDisabler('errorh', is_fallback ? 'home' : 'settings', is_fallback ? 'home' : null)
})
document.getElementById('errorh_copy').addEventListener('click', () => {
navigator.clipboard.writeText(panel.innerHTML)
})

document.getElementById('errorh_clear_all').addEventListener('click', () => {
panel.innerHTML = ''
localStorage.setItem('/system/error', '')
})

function setData(mode, tag) {
tag.setAttribute('content', mode)

return mode
}
4 changes: 2 additions & 2 deletions webroot/js/smallPageDesabler.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export function smallPageDisabler(page_name, new_page) {
export function smallPageDisabler(page_name, new_page, custom_page) {
const navbar_data_tag = document.getElementById('cache-navbar-previous')
const small_panel_data_tag = document.getElementById('cache-page-small-previous')

Expand All @@ -22,5 +22,5 @@ export function smallPageDisabler(page_name, new_page) {
curr_input.setAttribute('checked', '')
i_background.classList.toggle('show')

navbar_data_tag.setAttribute('content', 'settings')
navbar_data_tag.setAttribute('content', custom_page ? custom_page : 'settings')
}
Loading

0 comments on commit 7ed3cbf

Please sign in to comment.