mirror of
https://github.com/Acamaeda/The-Modding-Tree.git
synced 2024-11-24 09:21:46 +00:00
Redesigned lore component to be minimized individually rather than disabled globally
This commit is contained in:
parent
31e069dd2f
commit
46c9aadbbd
4 changed files with 38 additions and 7 deletions
|
@ -91,7 +91,6 @@
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><button class="opt" onclick="toggleOpt('hideChallenges')">Completed Challenges: {{ player.hideChallenges?"HIDDEN":"SHOWN" }}</button></td>
|
<td><button class="opt" onclick="toggleOpt('hideChallenges')">Completed Challenges: {{ player.hideChallenges?"HIDDEN":"SHOWN" }}</button></td>
|
||||||
<td><button class="opt" onclick="toggleOpt('showStory')">Story: {{ player.showStory?"SHOWN":"HIDDEN" }}</button></td>
|
|
||||||
<!-- <td><button class="opt" onclick="toggleOpt('oldStyle')">Style: {{ player.oldStyle?"v1.0":"NEW" }}</button></td>-->
|
<!-- <td><button class="opt" onclick="toggleOpt('oldStyle')">Style: {{ player.oldStyle?"v1.0":"NEW" }}</button></td>-->
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
|
@ -122,6 +122,7 @@ function getStartPlayer() {
|
||||||
for (item in layers[layer].microtabs)
|
for (item in layers[layer].microtabs)
|
||||||
playerdata.subtabs[layer][item] = Object.keys(layers[layer].microtabs[item])[0]
|
playerdata.subtabs[layer][item] = Object.keys(layers[layer].microtabs[item])[0]
|
||||||
}
|
}
|
||||||
|
playerdata[layer].loreHidden = false
|
||||||
}
|
}
|
||||||
return playerdata
|
return playerdata
|
||||||
}
|
}
|
||||||
|
|
12
js/v.js
12
js/v.js
|
@ -72,9 +72,15 @@ function loadVue() {
|
||||||
Vue.component('lore', {
|
Vue.component('lore', {
|
||||||
props: ['layer', 'data'],
|
props: ['layer', 'data'],
|
||||||
template: `
|
template: `
|
||||||
<div v-if="player.showStory"
|
<div class="story" v-bind:style="{'border-color': tmp[layer].color}">
|
||||||
v-bind:class="{ story: true }"
|
<button class="story-title" v-bind:style="{'background-color': tmp[layer].color}"
|
||||||
v-html="layers[layer].lore">
|
v-on:click="player[layer].loreHidden = player[layer].loreHidden !== true">
|
||||||
|
<span class="story-toggle">{{player[layer].loreHidden === true ? "+" : "-"}}</span>
|
||||||
|
{{layers[layer].name}}
|
||||||
|
</button>
|
||||||
|
<div v-if="player[layer].loreHidden !== true" class="story-text">
|
||||||
|
<span v-html="data ? data : layers[layer].lore"></span>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
`
|
`
|
||||||
})
|
})
|
||||||
|
|
31
style.css
31
style.css
|
@ -599,8 +599,33 @@ button > * {
|
||||||
}
|
}
|
||||||
|
|
||||||
.story {
|
.story {
|
||||||
max-width: 600px;
|
width: 600px;
|
||||||
border: solid 5px;
|
max-width: 95%;
|
||||||
padding: 8px;
|
border: solid 4px;
|
||||||
|
border-radius: 8px;
|
||||||
margin-bottom: 8px;
|
margin-bottom: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.story-title {
|
||||||
|
text-align: left;
|
||||||
|
font-size: 24px;
|
||||||
|
color: black;
|
||||||
|
cursor: pointer;
|
||||||
|
border: none;
|
||||||
|
width: 100%;
|
||||||
|
padding: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.story-toggle {
|
||||||
|
border: none;
|
||||||
|
background: black;
|
||||||
|
color: white;
|
||||||
|
font-size: 20px;
|
||||||
|
pointer-events: none;
|
||||||
|
width: 1em;
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.story-text {
|
||||||
|
padding: 2px;
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue