Pinafore-Web-Client-Frontend/routes/_components/Status.html

127 lines
2.5 KiB
HTML
Raw Normal View History

2018-01-11 06:31:33 +01:00
<article on:click="alert(event)">
2018-01-11 05:45:02 +01:00
{{#if status.reblog}}
<div class="header">
2018-01-11 06:31:33 +01:00
<a href="{{status.account.url}}">{{status.account.username}}</a> boosted
2018-01-11 05:45:02 +01:00
</div>
{{/if}}
<div class="sidebar">
<Avatar account={{status.reblog ? status.reblog.account : status.account}} />
</div>
<div class="content">{{{status.content}}}</div>
<div class="footer">
2018-01-13 08:24:05 +01:00
<button aria-label="Reply" aria-pressed="false" type="button">
<svg>
<use xlink:href="#fa-reply" />
</svg>
2018-01-11 05:45:02 +01:00
</button>
2018-01-13 08:24:05 +01:00
<button aria-label="Boost" aria-pressed="false" type="button">
<svg>
<use xlink:href="#fa-retweet" />
</svg>
2018-01-11 05:45:02 +01:00
</button>
2018-01-13 08:24:05 +01:00
<button aria-label="Favorite" aria-pressed="false" type="button">
<svg>
<use xlink:href="#fa-star" />
</svg>
2018-01-11 05:45:02 +01:00
</button>
2018-01-13 08:24:05 +01:00
<button aria-label="More" aria-pressed="false" type="button">
<svg>
<use xlink:href="#fa-ellipsis-h" />
</svg>
2018-01-11 05:45:02 +01:00
</button>
</div>
</article>
<style>
article {
2018-01-11 06:31:33 +01:00
pointer-events: none;
2018-01-11 05:59:04 +01:00
max-width: 600px;
margin: 0 auto;
2018-01-11 09:26:35 +01:00
padding: 10px 0;
border-bottom: 1px solid var(--main-border);
2018-01-11 05:45:02 +01:00
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;
2018-01-11 09:26:35 +01:00
font-size: 0.9em;
2018-01-11 05:45:02 +01:00
}
2018-01-11 06:31:33 +01:00
:global(.content a) {
pointer-events: auto;
}
:global(.header a) {
pointer-events: auto;
color: #333;
}
2018-01-11 09:26:35 +01:00
:global(.content p) {
margin: 0 0 10px;
}
2018-01-11 05:45:02 +01:00
.header {
grid-area: header;
2018-01-11 09:26:35 +01:00
margin: 5px 5px;
2018-01-11 05:45:02 +01:00
}
.footer {
grid-area: footer;
display: flex;
2018-01-11 05:59:04 +01:00
margin: 5px;
2018-01-11 09:26:35 +01:00
justify-content: space-between;
2018-01-11 05:45:02 +01:00
}
.footer button {
2018-01-11 06:31:33 +01:00
pointer-events: auto;
2018-01-11 09:26:35 +01:00
padding: 0;
background: none;
border: none;
2018-01-11 05:45:02 +01:00
}
2018-01-13 03:12:39 +01:00
.footer button svg {
2018-01-11 06:31:33 +01:00
pointer-events: none;
2018-01-11 09:26:35 +01:00
width: 24px;
height: 24px;
2018-01-13 03:12:39 +01:00
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);
2018-01-11 05:45:02 +01:00
}
</style>
<script>
import Avatar from './Avatar.html'
export default {
components: {
Avatar
},
data: () => ({
status: null
2018-01-11 06:31:33 +01:00
}),
methods: {
alert: function (e) {
e.preventDefault()
window.alert(e.target)
}
}
2018-01-11 05:45:02 +01:00
}
</script>