aboutsummaryrefslogtreecommitdiff
path: root/src/lib/sections/Infobox.svelte
blob: f8d28897e435225c0d0dcf57a9c30c43f806cd48 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<script lang="ts">
	import { generateInfobox } from '$lib/profile'
	import Username from '$lib/minecraft/Username.svelte'
	import Emoji from '$lib/Emoji.svelte'

	export let data
</script>

<div id="infobox-container">
	<div id="infobox">
		<h2>
			<Username player={data.member} prefix /> ({data.member.left
				? 'Removed'
				: data.member.profileName})
		</h2>
		{#each generateInfobox(data) as item}
			<!-- hack so fairy souls is clickable to get to the leaderboards -->
			{#if item.includes('Fairy souls')}
				<a href="/leaderboards/fairy_souls" class="fairy-souls-leaderboard"
					><p><Emoji value={item} /></p></a
				>
			{:else}
				<p><Emoji value={item} /></p>
			{/if}
		{/each}
	</div>
	<div id="infobox-extra">
		<p>Player UUID:</p>
		<b><code>{data.member.uuid}</code></b>
		<p>Profile UUID:</p>
		<b><code>{data.profile.uuid}</code></b>
	</div>
</div>

<style>
	#infobox-container {
		float: right;
		max-width: 95%;
		width: 20em;
	}
	#infobox {
		background-color: rgba(20, 20, 20, 0.4);
		padding: 1em;
		margin-top: 2em;
		border-radius: 0.5em;
		box-shadow: 0 0 1em #000;
	}
	#infobox-extra {
		opacity: 0.5;
		margin-top: 0.5rem;
	}
	#infobox-extra p {
		margin: 0;
	}
	p {
		margin: 0 0 0.25em 0;
	}
	.fairy-souls-leaderboard {
		color: inherit;
		text-decoration: none;
	}
	@media only screen and (max-width: 600px) {
		#infobox {
			position: relative;
			right: -2em;
			margin-top: 0;
		}
	}
	@media only screen and (max-width: 550px) {
		#infobox {
			position: unset;
			box-shadow: none;
			float: none;
			border: 1px solid var(--theme-lighter-background);
		}
	}
	@media only screen and (max-width: 460px) {
		#infobox-container {
			max-width: 100%;
			float: left;
		}
	}
</style>