Browse Source

Update the profile view

The items are now arranged in columns properly, and the exit
button has its own space.
master
Fen Dweller 5 years ago
parent
commit
c833a67f03
2 changed files with 34 additions and 16 deletions
  1. +8
    -2
      src/components/Explore.vue
  2. +26
    -14
      src/components/Profile.vue

+ 8
- 2
src/components/Explore.vue View File

@@ -4,11 +4,13 @@
<div class="explore-log-filler"></div> <div class="explore-log-filler"></div>
</div> </div>
<div class="explore-worldinfo"> <div class="explore-worldinfo">
<button @click="$emit('profile')">Show profile</button>
<p class="worldinfo-date">{{ world.time.format("MMMM Do Y") }}</p> <p class="worldinfo-date">{{ world.time.format("MMMM Do Y") }}</p>
<p class="worldinfo-date">{{ world.time.format("hh:mm:ss a") }}</p> <p class="worldinfo-date">{{ world.time.format("hh:mm:ss a") }}</p>
</div> </div>
<Statblock :subject="world.player" :initiative="0" />
<div class="explore-statblock">
<Statblock :subject="world.player" :initiative="0" />
<button @click="$emit('profile')">Show profile</button>
</div>
<div class="explore-containers"> <div class="explore-containers">
<transition-group name="container"> <transition-group name="container">
<ContainerView v-show="container.contents.concat(container.digested).length > 0" :container="container" v-for="(container, index) in world.player.containers" :key="'explore-container-' + index" /> <ContainerView v-show="container.contents.concat(container.digested).length > 0" :container="container" v-for="(container, index) in world.player.containers" :key="'explore-container-' + index" />
@@ -146,6 +148,10 @@ export default class Explore extends Vue {
font-size: 1.25rem; font-size: 1.25rem;
} }


.explore-statblock {
grid-area: statblock;
}

.explore-info { .explore-info {
grid-area: info; grid-area: info;
background: #333; background: #333;


+ 26
- 14
src/components/Profile.vue View File

@@ -1,7 +1,7 @@
<template> <template>
<div class="character-layout"> <div class="character-layout">
<button @click="$emit('exit')" class="profile-exit">Exit</button>
<div class="character-items"> <div class="character-items">
<button @click="$emit('exit')" class="profile-exit">Exit</button>
<ItemView :item="item" v-for="(item, index) in world.player.items" :key="'item-' + index" /> <ItemView :item="item" v-for="(item, index) in world.player.items" :key="'item-' + index" />
</div> </div>
<div class="character-containers"> <div class="character-containers">
@@ -41,31 +41,27 @@ export default class Explore extends Vue {
position: relative; position: relative;
display: grid; display: grid;
grid-template-areas: grid-template-areas:
"exit void"
"items stats" "items stats"
"containers containers"; "containers containers";
grid-template-rows: 1fr 0.25fr;
grid-template-rows: 100px 1fr 0.25fr;
grid-template-columns: 1fr 1fr; grid-template-columns: 1fr 1fr;
width: 100%; width: 100%;
height: 100%; height: 100%;
max-width: 1500px; max-width: 1500px;
margin: auto; margin: auto;
overflow: hidden;
} }


.character-items { .character-items {
background: #222; background: #222;
grid-area: items; grid-area: items;
display: grid; display: grid;
grid-template-columns: repeat(3, 1fr);
grid-template-rows: repeat(100, 1fr);
grid-template-columns: repeat(auto-fill, minmax(6rem, 1fr));
grid-template-rows: repeat(10, 1fr);
justify-items: center; justify-items: center;
align-items: start; align-items: start;
}

@media (max-width: 800px) {
.character-items {
grid-template-columns: repeat(2, 1fr);
}
overflow-x: hidden;
overflow-y: scroll;
} }


.character-items > .item-view { .character-items > .item-view {
@@ -89,8 +85,24 @@ export default class Explore extends Vue {
} }


.profile-exit { .profile-exit {
position: absolute;
top: 0;
left: 0;
grid-area: exit;
width: 100%;
padding: 4pt;
flex: 0 1;
background: #333;
border-color: #666;
border-style: outset;
user-select: none;
color: #eee;
font-size: 36px;
}

.profile-exit:hover {
background: #444;
}

.profile-exit:active {
background: #666;
border-style: inset;
} }
</style> </style>

Loading…
Cancel
Save