login & anim ok
This commit is contained in:
+31
-21
@@ -16,7 +16,7 @@ body {
|
||||
transform-origin: right;
|
||||
animation: colorChange 5s linear infinite;
|
||||
animation: fadeaway 30s forwards;
|
||||
left: calc(50% + var(--j) * 50%);
|
||||
left: calc(50%);
|
||||
transform: translateX(-50%);
|
||||
}
|
||||
|
||||
@@ -25,14 +25,8 @@ body {
|
||||
}
|
||||
|
||||
@keyframes colorChange {
|
||||
0% {
|
||||
filter: hue-rotate(0deg);
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
100% {
|
||||
filter: hue-rotate(360deg);
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
0% { filter: hue-rotate(0deg); }
|
||||
100% { filter: hue-rotate(360deg); }
|
||||
}
|
||||
|
||||
.glowing span {
|
||||
@@ -83,7 +77,7 @@ body {
|
||||
}
|
||||
|
||||
.glowing span:nth-child(3n + 1) {
|
||||
animation: rotatedots 15s alternate infinite;
|
||||
animation: rotatedots1 15s alternate infinite;
|
||||
}
|
||||
|
||||
.glowing span:nth-child(3n + 2) {
|
||||
@@ -91,7 +85,7 @@ body {
|
||||
}
|
||||
|
||||
.glowing span:nth-child(3n + 3) {
|
||||
animation: rotatedots 11s alternate infinite;
|
||||
animation: rotatedots1 11s alternate infinite;
|
||||
}
|
||||
|
||||
@keyframes fadeaway {
|
||||
@@ -100,16 +94,17 @@ body {
|
||||
100% { opacity: 0; }
|
||||
}
|
||||
|
||||
@keyframes rotatedots {
|
||||
0% { transform: rotate(180deg); }
|
||||
50% { transform: rotate(0deg); }
|
||||
100% { transform: rotate(360deg); }
|
||||
@keyframes rotatedots1 {
|
||||
0% { transform: rotate(calc(180deg * var(--i))); }
|
||||
50% { transform: rotate(calc(0deg * var(--i))); }
|
||||
100% { transform: rotate(calc(360deg * var(--i))); }
|
||||
}
|
||||
|
||||
|
||||
@keyframes rotatedots-reverse {
|
||||
0% { transform: rotate(360deg); }
|
||||
50% { transform: rotate(180deg); }
|
||||
100% { transform: rotate(0deg); }
|
||||
0% { transform: rotate(calc(135deg * var(--i))); }
|
||||
50% { transform: rotate(calc(-45deg * var(--i))); }
|
||||
100% { transform: rotate(calc(315deg * var(--i))); }
|
||||
}
|
||||
.logointro{
|
||||
filter: blur(14px);
|
||||
@@ -153,21 +148,23 @@ body {
|
||||
#login-dialog{
|
||||
width: 22rem;
|
||||
z-index: 99;
|
||||
border-radius: 2rem;
|
||||
border-radius: 1rem;
|
||||
box-shadow: 2px 2px 10px #BAFFEF, -2px -2px 10px #BAFFEF, -2px 0 10px #BAFFEF, 0 -2px 10px #BAFFEF;
|
||||
background: radial-gradient(#82cc50, #0a8200);
|
||||
padding: 2rem 3rem 0 3rem;
|
||||
padding: 2rem 3rem 1rem 3rem;
|
||||
margin-top: -68vh;
|
||||
opacity: 0;
|
||||
visibility: hidden;
|
||||
transition: opacity 0.5s ease;
|
||||
font-size: 1.3rem;
|
||||
transform: perspective(200px) rotateY(0deg) rotateX(6deg) rotateZ(0deg);
|
||||
transform-style: preserve-3d;
|
||||
}
|
||||
#login-dialog.show {
|
||||
opacity: 1;
|
||||
visibility: visible;
|
||||
}
|
||||
#login-dialog > div{
|
||||
#login-dialog > div.cols2{
|
||||
display: grid !important;
|
||||
grid-gap: 10px;
|
||||
grid-template-columns: 7rem 15rem;
|
||||
@@ -185,4 +182,17 @@ body {
|
||||
#login-dialog button{
|
||||
justify-self: end;
|
||||
font-size: 1.3rem;
|
||||
float: right;
|
||||
}
|
||||
#login-dialog div.loginerr{
|
||||
background-color: #326A1E;
|
||||
font-size: 1rem;
|
||||
color: #FFF;
|
||||
padding: .1rem .5rem;
|
||||
border-radius: 5px;
|
||||
text-align: center;
|
||||
display:none;
|
||||
}
|
||||
#login-dialog div.loginerr.show{
|
||||
display:block!important;
|
||||
}
|
||||
+2
-13
@@ -12,12 +12,7 @@
|
||||
"path": "/EIC",
|
||||
"classes": [ "EICController", "EICDomContent", "EICDialogContent", "EICMetaData", "EICModel", "EICPluralModel", "EICBusModel" ],
|
||||
"dependencies" : { "EICPluralModel": [ "EICModel" ] }
|
||||
},
|
||||
{ "onlyIfClasses": [ "MessageBus" ],
|
||||
"path": "/Bus/rendezVous",
|
||||
"classes": [ "MBRendezVous" ],
|
||||
"dependencies" : { }
|
||||
}
|
||||
}
|
||||
],
|
||||
"masterController": "EICAppController",
|
||||
"defaultMasterTemplate": "templates/EICAppTemplate"
|
||||
@@ -31,15 +26,10 @@
|
||||
"userLib": {
|
||||
"className": "myUser",
|
||||
"checkauthEndpoint": "/api/checkauth",
|
||||
"loginEndpoint": "/api/logout",
|
||||
"loginEndpoint": "/api/login",
|
||||
"logoutEndpoint": "/api/logout",
|
||||
"keepAliveSeconds": 0
|
||||
},
|
||||
"matomo4sparc": {
|
||||
"enabled": true,
|
||||
"trackUrl": "https://analytics.test.eismea.eu/matomo.php",
|
||||
"idsite":7
|
||||
},
|
||||
"messageBus":{
|
||||
"enabled": true,
|
||||
"debug": true,
|
||||
@@ -59,7 +49,6 @@
|
||||
"autoReconnectJitterPercent": 10,
|
||||
"frontBusPrefix": "",
|
||||
"userNotifChan": "system:notifs:{uid}",
|
||||
"rendezVousChan": "rendezVous:{uid}",
|
||||
"ptpChanPrefix": "peer2peer:"
|
||||
},
|
||||
"squeeze": {
|
||||
|
||||
@@ -8,8 +8,6 @@ class EICAppController extends MasterController {
|
||||
}
|
||||
|
||||
onBusConnected() {
|
||||
//if('MBRendezVous' in app.LoadedClasses) app.MessageBus.rendezVous = new MBRendezVous(this)
|
||||
|
||||
app.MessageBus.addBusListener(
|
||||
'growl',
|
||||
['system:notifs',
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
"views": [ "templates/EICAppTemplate", "templates/dialogs/ConfirmDialog" ],
|
||||
"controllerDependencies": [
|
||||
"/thirdparty/eicui/eicui-2.1",
|
||||
"/thirdparty/Matomo/Matomo4Sparc",
|
||||
"/controllers/common/errorController"
|
||||
],
|
||||
"assets": {
|
||||
|
||||
+69
-67
@@ -90,81 +90,46 @@ class myUser extends app.LoadedClasses.User {
|
||||
* @param {*} callBack
|
||||
*/
|
||||
async checkAuthenticated(callBack){
|
||||
const startbtn = document.querySelector('#startbtn')
|
||||
const gobtn = document.querySelector('#login-dialog button')
|
||||
|
||||
document.getElementById('startbtn').addEventListener('click', async () => {
|
||||
document.getElementById('startbtn').disabled = true
|
||||
gobtn.addEventListener('click', async () => {
|
||||
gobtn.disabled = true
|
||||
if(await this.login()) {
|
||||
document.querySelector('div.loginerr').classList.remove('show')
|
||||
console.log('Successful login !!!')
|
||||
callBack()
|
||||
} else {
|
||||
gobtn.disabled = false
|
||||
}
|
||||
})
|
||||
|
||||
startbtn.addEventListener('click', async () => {
|
||||
startbtn.disabled = true
|
||||
this.isAuthenticated = false
|
||||
const response = await fetch(app.config.userLib.checkauthEndpoint+'?'+crypto.randomUUID())
|
||||
let payload = null
|
||||
if(response.ok) { payload = await response.json() }
|
||||
if(!payload) {
|
||||
let jsonresp = null
|
||||
if(response.ok) { jsonresp = await response.json() }
|
||||
if(!jsonresp ||(!jsonresp.payload)) {
|
||||
console.error('No valid response from checkauth !?')
|
||||
document.getElementById('startbtn').disabled = false
|
||||
} else if(!payload.authenticated){
|
||||
console.log('==>login',app)
|
||||
startbtn.disabled = false
|
||||
} else if(!jsonresp.payload.authenticated){
|
||||
document.querySelector('div.loginerr').classList.remove('show')
|
||||
document.getElementById('login-dialog').classList.add('show')
|
||||
if(jsonresp.payload.locked){
|
||||
document.querySelector('div.loginerr').classList.add('show')
|
||||
document.querySelector('div.loginerr').innerHTML = `
|
||||
The account has been locked !<br>
|
||||
(Ask an admin to unlock it.)
|
||||
`
|
||||
}
|
||||
} else {
|
||||
console.log('authenticated!')
|
||||
this.isAuthenticated = true
|
||||
callBack()
|
||||
}
|
||||
|
||||
})
|
||||
// console.log('====> click')
|
||||
// callBack()
|
||||
// })
|
||||
// this.identity = {
|
||||
// uuid: 'nike',
|
||||
// email: 'info@nicsys.eu'
|
||||
// };
|
||||
// this.roles = ['admin']
|
||||
// this.isAuthenticated = true
|
||||
|
||||
//setTimeout(callBack, 20000);
|
||||
/*
|
||||
|
||||
fetch(app.config.userLib.authEndpoint+'?'+crypto.randomUUID(),{
|
||||
headers: headers,
|
||||
method: 'GET',
|
||||
credentials: 'include'
|
||||
})
|
||||
.then(response => response.json())
|
||||
.then(async resp => {
|
||||
if(resp.success){
|
||||
this.authenticationDone = true
|
||||
this.isAuthenticated = resp.payload.isAuthenticated;
|
||||
if(resp.payload.isAuthenticated) {
|
||||
if((!this.identity) || (!this.identity.uuid)) {
|
||||
this.logoutUrl = resp.payload.logoutUri;
|
||||
this.parseUserInfo(resp.payload.userInfo);
|
||||
}
|
||||
|
||||
this.platformRestrictions = resp.payload.platformRestrictions || null
|
||||
if((this.platformRestrictions) && (!this.isVIP())){
|
||||
this.ShowCurtain()
|
||||
this.stopKeepAlive()
|
||||
return // not triggering callback avoids any further ctrl loading by the router
|
||||
}
|
||||
|
||||
if(!app.config.api) await this.getApiServices()
|
||||
|
||||
if(app.config.userLib.keepAliveSeconds && (app.config.userLib.keepAliveSeconds>0)) this.startKeepAlive()
|
||||
|
||||
callBack();
|
||||
} else {
|
||||
console.warn('Authorizer said User was not authenticated !');
|
||||
this.authUrl = resp.payload.authUrl;
|
||||
this.logoutUrl = resp.payload.logoutUri;
|
||||
callBack();
|
||||
}
|
||||
} else {
|
||||
console.error('Server error calling authorizer checkAuthenticated (success not true)');
|
||||
this.stopKeepAlive() // Just in case KAL is active, because we arrive here from KAL itself
|
||||
document.location.href = '/eulogin-error.html';
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error('Server error calling authorizer checkAuthenticated (Network error)',err);
|
||||
document.location.href = '/eulogin-error.html';
|
||||
});
|
||||
*/
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -173,6 +138,43 @@ class myUser extends app.LoadedClasses.User {
|
||||
*/
|
||||
getMessageBusUserInfo() { return(this.identity.uuid) }
|
||||
|
||||
async login(){
|
||||
const response = await fetch(app.config.userLib.loginEndpoint+'?'+crypto.randomUUID(), {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify({
|
||||
username: document.querySelector('input[name="username"]').value,
|
||||
passwd: document.querySelector('input[name="password"]').value,
|
||||
})
|
||||
})
|
||||
let jsonresp = null
|
||||
if(response.ok) { jsonresp = await response.json() }
|
||||
if(jsonresp && jsonresp.success && jsonresp.payload){
|
||||
if(jsonresp.payload.authenticated){
|
||||
this.isAuthenticated = true
|
||||
this.userInfos = jsonresp.payload.userInfos
|
||||
return(true)
|
||||
} else {
|
||||
document.querySelector('div.loginerr').classList.add('show')
|
||||
if(!jsonresp.payload.locked){
|
||||
document.querySelector('div.loginerr').innerHTML = `
|
||||
Bad username or password !<br>
|
||||
(${jsonresp.payload.trials} trials left.)
|
||||
`
|
||||
} else {
|
||||
document.querySelector('div.loginerr').innerHTML = `
|
||||
The account has been locked !<br>
|
||||
(Ask an admin to unlock it.)
|
||||
`
|
||||
}
|
||||
}
|
||||
}
|
||||
this.isAuthenticated = false
|
||||
this.userInfos = null
|
||||
return(false)
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
|
||||
+12
-11
@@ -9,33 +9,34 @@
|
||||
|
||||
<body>
|
||||
|
||||
<div class="glowing" style="--j:-1;">
|
||||
<div class="glowing">
|
||||
<span style="--i:1;"></span>
|
||||
<span style="--i:2;"></span>
|
||||
<span style="--i:3;"></span>
|
||||
</div>
|
||||
<div class="glowing" style="--j:0;">
|
||||
<span style="--i:1;"></span>
|
||||
<span style="--i:2;"></span>
|
||||
<span style="--i:3;"></span>
|
||||
<div class="glowing">
|
||||
<span style="--i:4;"></span>
|
||||
<span style="--i:5;"></span>
|
||||
<span style="--i:6;"></span>
|
||||
</div>
|
||||
<div class="glowing" style="--j:1;">
|
||||
<span style="--i:1;"></span>
|
||||
<span style="--i:2;"></span>
|
||||
<div class="glowing">
|
||||
<span style="--i:5;"></span>
|
||||
<span style="--i:3;"></span>
|
||||
<span style="--i:1;"></span>
|
||||
</div>
|
||||
<img src="/app/assets/images/logop42-intro.png" class="logointro"/>
|
||||
<button id="startbtn">START</button>
|
||||
<div id="login-dialog">
|
||||
<div>
|
||||
<div class="cols2">
|
||||
<label>Username:</label>
|
||||
<input type="text" name="username"/>
|
||||
</div>
|
||||
<div>
|
||||
<div class="cols2">
|
||||
<label>Password:</label>
|
||||
<input type="password" name="password"/>
|
||||
</div>
|
||||
<div><span></span><button>GO</button></div>
|
||||
<div class="loginerr"></div>
|
||||
<button>GO</button>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
-124
@@ -1,124 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en-US">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>European Innovation Council</title>
|
||||
<script src="/core/Sparc-core-1.0.js"></script>
|
||||
</head>
|
||||
<body eicapp>
|
||||
<style>
|
||||
body {
|
||||
align-items: center;
|
||||
background: radial-gradient(#4786da, #1b4986);
|
||||
background-position: center;
|
||||
color: white;
|
||||
display: grid;
|
||||
padding: 150px 15px 100px;
|
||||
position: relative;
|
||||
text-align: center;
|
||||
width: 100vw;
|
||||
background-size: cover;
|
||||
height: 100vh;
|
||||
box-sizing: border-box;
|
||||
overflow: hidden;
|
||||
font-family: sans-serif;
|
||||
}
|
||||
.sparc-loader {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
align-self: center;
|
||||
justify-self: center;
|
||||
}
|
||||
.sparc {
|
||||
position: absolute;
|
||||
width: 0.1rem;
|
||||
height: 0.1rem;
|
||||
bottom: 50%;
|
||||
left: 50%;
|
||||
transform: rotate(var(--loader-rotate));
|
||||
color: red;
|
||||
}
|
||||
.sparc::after {
|
||||
content: '*';
|
||||
display: block;
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
width: 0.3rem;
|
||||
height: 100%;
|
||||
border-radius: 0.9rem;
|
||||
opacity: 0;
|
||||
transform-origin: bottom center;
|
||||
animation: ignite 3s infinite linear;
|
||||
animation-delay: 0s;
|
||||
animation-delay: calc(10*var(--loader-delay));
|
||||
font-size: 3em;
|
||||
}
|
||||
@keyframes ignite {
|
||||
0% { transform: translateY(-0.5rem) scaleY(0.2); opacity: 0; }
|
||||
10% { transform: translateY(-1rem) scaleY(0.5); opacity: 0.35; }
|
||||
30% { transform: translateY(-2rem) scaleY(0.5); opacity: 0.7; }
|
||||
50% { transform: translateY(-4rem) scaleY(1.5); opacity: 0.7; }
|
||||
51% { transform: translateY(-4rem) scaleY(1); opacity: 0; }
|
||||
100% { transform: translateY(0) scaleY(0.2); opacity: 0; }
|
||||
}
|
||||
.auth-error{
|
||||
display: none!important;
|
||||
max-width: 40vw!important;
|
||||
margin: auto!important;
|
||||
}
|
||||
</style>
|
||||
<div class="sparc-loader">
|
||||
<div class="sparc" style="--loader-rotate: 10deg; --loader-delay: 223ms"></div>
|
||||
<div class="sparc" style="--loader-rotate: 20deg; --loader-delay: 842ms"></div>
|
||||
<div class="sparc" style="--loader-rotate: 30deg; --loader-delay: 131ms"></div>
|
||||
<div class="sparc" style="--loader-rotate: 40deg; --loader-delay: 746ms"></div>
|
||||
<div class="sparc" style="--loader-rotate: 50deg; --loader-delay: 925ms"></div>
|
||||
<div class="sparc" style="--loader-rotate: 60deg; --loader-delay: 390ms"></div>
|
||||
<div class="sparc" style="--loader-rotate: 70deg; --loader-delay: 483ms"></div>
|
||||
<div class="sparc" style="--loader-rotate: 80deg; --loader-delay: 621ms"></div>
|
||||
<div class="sparc" style="--loader-rotate: 90deg; --loader-delay: 814ms"></div>
|
||||
<div class="sparc" style="--loader-rotate: 100deg; --loader-delay: 802ms"></div>
|
||||
<div class="sparc" style="--loader-rotate: 110deg; --loader-delay: 837ms"></div>
|
||||
<div class="sparc" style="--loader-rotate: 120deg; --loader-delay: 238ms"></div>
|
||||
<div class="sparc" style="--loader-rotate: 130deg; --loader-delay: 642ms"></div>
|
||||
<div class="sparc" style="--loader-rotate: 140deg; --loader-delay: 60ms"></div>
|
||||
<div class="sparc" style="--loader-rotate: 150deg; --loader-delay: 405ms"></div>
|
||||
<div class="sparc" style="--loader-rotate: 160deg; --loader-delay: 575ms"></div>
|
||||
<div class="sparc" style="--loader-rotate: 170deg; --loader-delay: 945ms"></div>
|
||||
<div class="sparc" style="--loader-rotate: 180deg; --loader-delay: 635ms"></div>
|
||||
<div class="sparc" style="--loader-rotate: 190deg; --loader-delay: 205ms"></div>
|
||||
<div class="sparc" style="--loader-rotate: 200deg; --loader-delay: 91ms"></div>
|
||||
<div class="sparc" style="--loader-rotate: 210deg; --loader-delay: 829ms"></div>
|
||||
<div class="sparc" style="--loader-rotate: 220deg; --loader-delay: 970ms"></div>
|
||||
<div class="sparc" style="--loader-rotate: 230deg; --loader-delay: 861ms"></div>
|
||||
<div class="sparc" style="--loader-rotate: 240deg; --loader-delay: 201ms"></div>
|
||||
<div class="sparc" style="--loader-rotate: 250deg; --loader-delay: 173ms"></div>
|
||||
<div class="sparc" style="--loader-rotate: 260deg; --loader-delay: 967ms"></div>
|
||||
<div class="sparc" style="--loader-rotate: 270deg; --loader-delay: 548ms"></div>
|
||||
<div class="sparc" style="--loader-rotate: 280deg; --loader-delay: 392ms"></div>
|
||||
<div class="sparc" style="--loader-rotate: 290deg; --loader-delay: 273ms"></div>
|
||||
<div class="sparc" style="--loader-rotate: 300deg; --loader-delay: 6ms"></div>
|
||||
<div class="sparc" style="--loader-rotate: 310deg; --loader-delay: 1ms"></div>
|
||||
<div class="sparc" style="--loader-rotate: 320deg; --loader-delay: 854ms"></div>
|
||||
<div class="sparc" style="--loader-rotate: 330deg; --loader-delay: 159ms"></div>
|
||||
<div class="sparc" style="--loader-rotate: 340deg; --loader-delay: 60ms"></div>
|
||||
<div class="sparc" style="--loader-rotate: 350deg; --loader-delay: 986ms"></div>
|
||||
<div class="sparc" style="--loader-rotate: 360deg; --loader-delay: 559ms"></div>
|
||||
</div>
|
||||
|
||||
<article class="auth-error" eiccard="" aria-enabled="true" >
|
||||
<header><h1>Server error</h1></header>
|
||||
<section>
|
||||
<div>
|
||||
<section>
|
||||
<alert eicalert="" danger="">
|
||||
Unfortunately, the server cannot authenticate you at the moment,<br>
|
||||
Please try again later.
|
||||
</alert>
|
||||
</section>
|
||||
</div>
|
||||
</section>
|
||||
</article>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user