mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-07-14 16:02:14 +00:00
refactor(avatar): support minimal avatar displays (using for mobile sidebar)
This commit is contained in:
parent
979d7d85a4
commit
3a7c994f1a
2 changed files with 12 additions and 9 deletions
|
|
@ -3,10 +3,11 @@
|
|||
Removing it will remove the user's name, but will allow more room for mounts & helms. IMO this is the lesser of two evils, revisit
|
||||
//-figure.herobox(ng-click='clickMember(profile._id)', data-name='{{profile.profile.name}}', ng-class='{isUser: profile.id==user.id, hasPet: profile.items.currentPet}', data-level='{{profile.stats.lvl}}', data-uid='{{profile.id}}', rel='popover', data-placement='bottom', data-trigger='hover', data-html='true', data-content="<div ng-hide='profile.id == user.id'> <div class='progress progress-danger' style='height:5px;'> <div class='bar' style='height: 5px; width: {{percent(profile.stats.hp, 50)}}%;'></div> </div> <div class='progress progress-warning' style='height:5px;'> <div class='bar' style='height: 5px; width: {{percent(profile.stats.exp, tnl(profile.stats.lvl))}}%;'></div> </div> <div>Level: {{profile.stats.lvl}}</div> <div>GP: {{profile.stats.gp | number:0}}</div> <div>{{count(profile.items.pets)}} / 90 Pets Found</div> </div>")
|
||||
|
||||
mixin avatar
|
||||
mixin avatar(opts)
|
||||
.character-sprites
|
||||
// Mount Body
|
||||
span(ng-if='profile.items.currentMount', class='Mount_Body_{{profile.items.currentMount}}')
|
||||
if !opts.minimal
|
||||
span(ng-if='profile.items.currentMount', class='Mount_Body_{{profile.items.currentMount}}')
|
||||
|
||||
span(ng-if='profile.stats.buffs.snowball')
|
||||
span.snowman
|
||||
|
|
@ -60,16 +61,18 @@ mixin avatar
|
|||
|
||||
|
||||
// Mount Head
|
||||
span(ng-if='profile.items.currentMount', class='Mount_Head_{{profile.items.currentMount}}')
|
||||
if !opts.minimal
|
||||
span.current-mount(ng-if='profile.items.currentMount', class='Mount_Head_{{profile.items.currentMount}}')
|
||||
|
||||
// Resting
|
||||
span(ng-class='{zzz:profile.preferences.sleep}')
|
||||
// FIXME handle @minimal, this might have to be a directive
|
||||
span.current-pet(class='Pet-{{profile.items.currentPet}}', ng-show='profile.items.currentPet && !minimal')
|
||||
if !opts.minimal
|
||||
span.current-pet(class='Pet-{{profile.items.currentPet}}', ng-show='profile.items.currentPet')
|
||||
|
||||
mixin herobox
|
||||
figure.herobox(ng-click='spell ? castEnd(profile, "user", $event) : clickMember(profile._id)', data-name='{{profile.profile.name}}', ng-class='{isUser: user._id==profile._id, hasPet:profile.items.currentPet, hasMount:profile.items.currentMount, "cast-target": applyingAction, isLeader: party.leader==profile._id}')
|
||||
+avatar()
|
||||
mixin herobox(opts)
|
||||
- if (!opts) {opts = {minimal:false,main:false}}
|
||||
figure.herobox(ng-click='spell ? castEnd(profile, "user", $event) : clickMember(profile._id)', data-name='{{profile.profile.name}}', class='#{opts.main ? "isUser" : ""} #{opts.minimal ? "minimal" : ""}', ng-class='{hasPet: (#{!opts.minimal} && profile.items.currentPet), hasMount: (#{!opts.minimal} && profile.items.currentMount), "cast-target": applyingAction, isLeader: party.leader==profile._id}')
|
||||
+avatar(opts)
|
||||
.avatar-level.label.label-default(ng-class='userLevelStyle(profile)')
|
||||
span.glyphicon.glyphicon-circle-arrow-up(ng-show='profile.stats.buffs.str || profile.stats.buffs.per || profile.stats.buffs.con || profile.stats.buffs.int || profile.stats.buffs.stealth', tooltip=env.t('buffed'))
|
||||
|
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
header.site-header(ng-hide='user.preferences.hideHeader', role='banner', data-partysize='{{party.members.length>1 ? truarr(party.members.length) : 0}}')
|
||||
// avatar
|
||||
.herobox-wrap.main-herobox(ng-controller='UserCtrl')
|
||||
+herobox()
|
||||
+herobox({main:1})
|
||||
|
||||
// stat bars
|
||||
.hero-stats
|
||||
|
|
|
|||
Loading…
Reference in a new issue