update skama_code, profile end (no css)

main
Makaci Michael Gabriel ago%!(EXTRA string=11 months)
parent 8985bf48a4
commit 03f8a9a30a
  1. 19
      css/profile.css
  2. 21
      html/templates/modal_profile.html
  3. 1
      index.html
  4. 1
      js/controllers/menu_mod.js
  5. 26
      js/controllers/profile.js
  6. 17
      js/index.js
  7. 2
      js/skama_code

@ -0,0 +1,19 @@
#modal_profile
{
padding: 0;
color: rgb(0, 17, 255);
background-color: rgb(0, 17, 255);
}
.profile-modal
{
margin: 20px;
color: white;
display: flex;
flex-direction: column;
}
.profile-footer button
{
background-color: red;
}

@ -1,3 +1,20 @@
<div>
<p class="title">Profile</p>
<div class="profile-modal">
<div class="profile-header">
<h1>Profile</h1>
</div>
<div class="profile-content">
<hr>
<p id="name">Name: </p>
<p id="faction">Faction: </p>
<p id="credit">Credit: </p>
<p id="hq">Headquarters: </p>
<p id="shipcount">Ship count: </p>
<p id="token">Token: <button id="btn-token">COPY</button></p>
<hr>
</div>
<div class="profile-footer">
<button id="btn-logout">Logout</button>
</div>
</div>

@ -10,6 +10,7 @@
<script type="module" src="js/index.js" defer></script>
<link rel="stylesheet" href="css/global.css">
<link rel="stylesheet" href="css/auth.css">
<link rel="stylesheet" href="css/profile.css">
</head>
<body>

@ -1,5 +1,4 @@
import { My } from "../skama_code/commun/my.js";
import login from "./login.js";
import profile from "./profile.js";
function loged_links(temp_engine) {

@ -1,9 +1,29 @@
import { Modal } from "../skama_code/ui/modal.js"
import { Auth } from "../skama_code/auth/auth.js"
import { My } from "../skama_code/commun/my.js"
import login from "./login.js";
export default function profile(temp_engine) {
let modal = new Modal("profile-modal", temp_engine);
modal.load("templates/modal_profile.html");
modal.after_load((temp_engine) => {
let modal = new Modal("modal_profile", temp_engine);
modal.after_load(() => {
modal.show();
$('#name').append(My.agent.name);
$('#faction').append(My.agent.faction);
$('#credit').append(My.agent.credit);
$('#hq').append(My.agent.hq);
$('#shipcount').append(My.agent.ships_cpt);
$('#btn-token').on('click', () => {
navigator.clipboard.writeText(My.agent.token);
alert('Token copied !');
})
$('#btn-logout').on('click', () => {
const auth = new Auth();
auth.unload_token();
login(temp_engine);
})
});
modal.load("templates/modal_profile.html");
}

@ -2,6 +2,23 @@
"use strict";
import { TemplateEngine } from "./skama_code/ui/templeting_engine.js";
import login from "./controllers/login.js";
import { Auth } from "./skama_code/auth/auth.js";
import { AgentBuilder } from "./skama_code/api/agent.js";
import { My } from "./skama_code/commun/my.js";
import home from "./controllers/home.js";
let temp_engine = new TemplateEngine("html");
//Auth
const auth = new Auth;
if(auth.relog())
{
AgentBuilder.get(localStorage.getItem('token'), (agent) => {
My.agent = agent;
home(temp_engine);
})
}
else
{
login(temp_engine);
}

@ -1 +1 @@
Subproject commit f6268ed6d83e077ddf4ff362530e9469f8f8a738
Subproject commit df0d1be1df444b48cd1b6c09e5188af501bc9793
Loading…
Cancel
Save