Skip to content

Commit

Permalink
UPD - Microsoft login button + fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
LeWarpy committed Mar 7, 2024
1 parent 2ada41f commit 0450cd9
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 13 deletions.
4 changes: 4 additions & 0 deletions src/assets/css/panels/login.css
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,8 @@
width: 50%;
padding: 0.4rem 1rem;
margin-top: 10px;
}

.store {
text-decoration: underline;
}
1 change: 1 addition & 0 deletions src/assets/images/misc/ms-symbollockup_signin_dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/assets/images/misc/ms-symbollockup_signin_light.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions src/assets/js/panels/home.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ class Home {
for (let instance of instancesList) {
if (instance.is_staff) {
let staff = await config.GetStaffUsernames().then(res => res);
if (!staff.includes(auth.name)) {
if (!staff.includes(auth?.name)) {
if (instance.name == instanceSelect) {
let newInstanceSelect = instancesList.find(i => i.is_staff == false)
let configClient = await this.db.readData('configClient')
Expand Down Expand Up @@ -171,7 +171,7 @@ class Home {
instancesListPopup.innerHTML = ''
for (let instance of instancesList) {
if (instance.is_staff) {
if (staff.includes(auth.name)) {
if (staff.includes(auth?.name)) {
if (instance.name == instanceSelect) {
instancesListPopup.innerHTML += `<div id="${instance.name}" class="instance-elements active-instance">${instance.fullname}</div>`
} else {
Expand Down
10 changes: 5 additions & 5 deletions src/assets/js/panels/login.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class Login {
console.log('Initializing Microsoft login...');
let popupLogin = new popup();
let loginHome = document.querySelector('.login-home');
let microsoftBtn = document.querySelector('.connect-home');
let microsoftBtn = document.querySelector('#loginwithmicrosoft');
loginHome.style.display = 'block';

microsoftBtn.addEventListener("click", () => {
Expand Down Expand Up @@ -199,11 +199,11 @@ class Login {
configClient.account_selected = account.ID;

for (let instance of instancesList) {
if (instance.whitelistActive) {
let whitelist = instance.whitelist.find(whitelist => whitelist == account.name)
if (whitelist !== account.name) {
if (instance.is_staff) {
let staff = await config.GetStaffUsernames().then(res => res);
if (staff.includes(account.name)) {
if (instance.name == instanceSelect) {
let newInstanceSelect = instancesList.find(i => i.whitelistActive == false)
let newInstanceSelect = instancesList.find(i => i.is_staff == false)
configClient.instance_selct = newInstanceSelect.name
await setStatus(newInstanceSelect.status)
}
Expand Down
31 changes: 25 additions & 6 deletions src/panels/login.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,30 @@
<div class="container">
<style>
p, h5 {
color: #fff;
}
#loginwithmicrosoft {
background: transparent;
border: none !important;
cursor: pointer;
}
</style>
<div class="container dark">
<div class="login-home login-tabs">
<div class="login-text">Veuillez vous identifier afin de jouer.</div>

<div class="login-options">
<button class="connect connect-home">Connexion</button>
<button class="cancel cancel-home" style="display: none;">annuler</button>
<img alt="logo" style="height: 120px" src="assets/images/logo/AO.png"/>
<p>Connectez-vous avec votre compte <span class="store">Microsoft</span> pour vous connecter au launcher.</p>
<p>Vos données de connexion restent sur votre ordinateur, elles ne sont pas partagées.</p>
<div class="login-type">
<div class="login-options">
<button id="loginwithmicrosoft">
<img src="assets/images/misc/ms-symbollockup_signin_light.svg">
</button>
<button class="cancel cancel-home" style="display: none;">annuler</button>
</div>
</div>
<br>
<button class="cancel cancel-login" style="display:none">Annuler</button>
<hr>
<div class="no-acc"><h5>Politique de confidentialté disponible sur www.almyria.fr/legal</h5></div>
</div>

<div class="login-offline login-tabs">
Expand Down

0 comments on commit 0450cd9

Please sign in to comment.