mirror of
https://github.com/VickScarlet/lifeRestart.git
synced 2026-03-25 08:34:16 +08:00
Compare commits
5 Commits
eff286199f
...
84785f3e40
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
84785f3e40 | ||
|
|
1b7ae5f1ff | ||
|
|
4a5127fecf | ||
|
|
1c8628bb3d | ||
|
|
160aab5bc2 |
File diff suppressed because one or more lines are too long
31
src/app.js
31
src/app.js
@@ -101,6 +101,9 @@ class App{
|
||||
if(li.hasClass('selected')) {
|
||||
li.removeClass('selected')
|
||||
this.#talentSelected.delete(talent);
|
||||
if(this.#talentSelected.size<3) {
|
||||
talentPage.find('#next').text('请选择3个')
|
||||
}
|
||||
} else {
|
||||
if(this.#talentSelected.size==3) {
|
||||
this.hint('只能选3个天赋');
|
||||
@@ -122,6 +125,9 @@ class App{
|
||||
}
|
||||
li.addClass('selected');
|
||||
this.#talentSelected.add(talent);
|
||||
if(this.#talentSelected.size==3) {
|
||||
talentPage.find('#next').text('开始新人生')
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -139,18 +145,31 @@ class App{
|
||||
})
|
||||
|
||||
// Property
|
||||
const propertyPage = $(`
|
||||
// hint of extension tobermory.es6-string-html
|
||||
const propertyPage = $(/*html*/`
|
||||
<div id="main">
|
||||
<div class="head" style="font-size: 1.6rem">
|
||||
调整初始属性<br>
|
||||
<div id="total" style="font-size:1rem; font-weight:normal;">可用属性点:0</div>
|
||||
</div>
|
||||
<ul id="propertyAllocation" class="propinitial"></ul>
|
||||
<ul class="propinitial" style="top:auto; bottom:23rem">
|
||||
<li>已选天赋</li>
|
||||
</ul>
|
||||
<ul class="selectlist" id="talentSelectedView" style="top:auto; bottom:16rem"></ul>
|
||||
<button id="random" class="mainbtn" style="top:auto; bottom:7rem">随机分配</button>
|
||||
<button id="start" class="mainbtn" style="top:auto; bottom:0.1rem">开始新人生</button>
|
||||
</div>
|
||||
`);
|
||||
|
||||
propertyPage.mounted = ()=>{
|
||||
propertyPage
|
||||
.find('#talentSelectedView').append(
|
||||
`<li>已选天赋</li>` +
|
||||
Array.from(this.#talentSelected)
|
||||
.map(({name,description})=>`<li class="grade0b">${name}(${description})</li>`)
|
||||
.join('')
|
||||
)
|
||||
}
|
||||
const groups = {};
|
||||
const total = ()=>{
|
||||
let t = 0;
|
||||
@@ -307,7 +326,7 @@ class App{
|
||||
<li>智力:${property.INT} </li>
|
||||
<li>体质:${property.STR} </li>
|
||||
<li>家境:${property.MNY} </li>
|
||||
<li>快乐:${property.STR} </li>`);
|
||||
<li>快乐:${property.SPR} </li>`);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -389,6 +408,9 @@ class App{
|
||||
page: propertyPage,
|
||||
clear: ()=>{
|
||||
freshTotal();
|
||||
propertyPage
|
||||
.find('#talentSelectedView')
|
||||
.empty();
|
||||
},
|
||||
},
|
||||
trajectory: {
|
||||
@@ -478,6 +500,9 @@ class App{
|
||||
$('#main').detach();
|
||||
p.clear();
|
||||
p.page.appendTo('body');
|
||||
if(typeof p.page.mounted === 'function'){
|
||||
p.page.mounted()
|
||||
}
|
||||
}
|
||||
|
||||
hint(message, type='info') {
|
||||
|
||||
Reference in New Issue
Block a user