pinafore/routes/_components/Status.html
2018-01-12 23:24:05 -08:00

127 lines
2.5 KiB
HTML

<article on:click="alert(event)">
{{#if status.reblog}}
<div class="header">
<a href="{{status.account.url}}">{{status.account.username}}</a> boosted
</div>
{{/if}}
<div class="sidebar">
<Avatar account={{status.reblog ? status.reblog.account : status.account}} />
</div>
<div class="content">{{{status.content}}}</div>
<div class="footer">
<button aria-label="Reply" aria-pressed="false" type="button">
<svg>
<use xlink:href="#fa-reply" />
</svg>
</button>
<button aria-label="Boost" aria-pressed="false" type="button">
<svg>
<use xlink:href="#fa-retweet" />
</svg>
</button>
<button aria-label="Favorite" aria-pressed="false" type="button">
<svg>
<use xlink:href="#fa-star" />
</svg>
</button>
<button aria-label="More" aria-pressed="false" type="button">
<svg>
<use xlink:href="#fa-ellipsis-h" />
</svg>
</button>
</div>
</article>
<style>
article {
pointer-events: none;
max-width: 600px;
margin: 0 auto;
padding: 10px 0;
border-bottom: 1px solid var(--border-color);
display: grid;
width: 100%;
grid-template-areas:
"....... header"
"sidebar content"
"....... footer";
grid-template-columns: 70px 1fr;
}
.sidebar {
grid-area: sidebar;
display: flex;
}
.content {
margin: 5px;
grid-area: content;
word-wrap: break-word;
overflow: hidden;
white-space: pre-wrap;
font-size: 0.9em;
}
:global(.content a) {
pointer-events: auto;
}
:global(.header a) {
pointer-events: auto;
color: #333;
}
:global(.content p) {
margin: 0 0 10px;
}
.header {
grid-area: header;
margin: 5px 5px;
}
.footer {
grid-area: footer;
display: flex;
margin: 5px;
justify-content: space-between;
}
.footer button {
pointer-events: auto;
padding: 0;
background: none;
border: none;
}
.footer button svg {
pointer-events: none;
width: 24px;
height: 24px;
fill: var(--action-button-fill-color);
}
.footer button:hover svg {
fill: var(--action-button-fill-color-hover);
}
.footer button:active svg {
fill: var(--action-button-fill-color-active);
}
</style>
<script>
import Avatar from './Avatar.html'
export default {
components: {
Avatar
},
data: () => ({
status: null
}),
methods: {
alert: function (e) {
e.preventDefault()
window.alert(e.target)
}
}
}
</script>