-
Notifications
You must be signed in to change notification settings - Fork 21
/
user-card.blade.php
183 lines (171 loc) · 10.3 KB
/
user-card.blade.php
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
<div>
<div class="flex flex-col rounded shadow-sm bg-discord-gray-1 overflow-hidden">
@isset($title)
<div class="py-4 px-5 lg:px-6 w-full flex items-center border-b border-discord-gray-4">
<h3 class="font-semibold">{{ $title }}</h3>
</div>
@endisset
<div class="py-4 px-5 lg:px-6 w-full flex items-center border-b border-discord-gray-4">
<div class="flex flex-col gap-y-5 md:gap-y-0.5 grow w-full">
<div class="grid grid-cols-1 md:grid-cols-8 gap-y-3">
<div class="col-span-1 text-center md:text-left my-auto">
<a href="{{ $user['avatarUrl'] }}" target="_blank">
@if($user['avatarDecorationUrl'])
<img src="{{ $user['avatarDecorationUrl'] }}" loading="lazy" class="absolute user-avatar-decoration" width="80px" height="80px" alt="user avatar decoration">
@endif
<img src="{{ $user['avatarUrl'] }}" loading="lazy" alt="User Avatar" class="inline-block w-16 h-16 rounded-full" />
</a>
</div>
<div class="col-span-4 text-center md:text-left my-auto">
@if($user['discriminator'] === "0")
<p class="font-bold">{{ $user['global_name'] }}</p>
<p>@{{ $user['username'] }}</p>
@else
@if($user['global_name'])
<p class="font-extrabold">{{ $user['global_name'] }}</p>
@endif
@{{ $user['username'] }}<span class="text-gray-400 text-sm font-semibold">#{{ $user['discriminator'] }}</span>
@endif
@if($user['isBot'])
<span class="font-semibold inline-flex px-2 py-1 leading-3 text-sm rounded text-white bg-discord-blurple">
@if($user['isVerifiedBot'] || $user['id'] === '643945264868098049' || $user['id'] === '1081004946872352958')
<i class="fas fa-check"></i>
@endif
<span class="font-medium uppercase">
@if($user['id'] === '643945264868098049')
{{ __('System') }}
@elseif($user['id'] === '1081004946872352958')
{{ __('AI') }}
@else
{{ __('App') }}
@endif
</span>
</span>
@endif
<p class="text-gray-500 text-sm">
{{ $user['id'] }}
</p>
</div>
@if($user['bannerUrl'])
<div class="col-span-3 text-center md:text-right my-auto">
<a href="{{ $user['bannerUrl'] }}" target="_blank">
<img src="{{ $user['bannerUrl'] }}" loading="lazy" alt="User Banner" class="inline-block h-16 rounded-md" />
</a>
</div>
@endif
</div>
</div>
</div>
<div class="p-5 lg:p-6 grow w-full">
<div class="flex flex-col gap-y-5 md:gap-y-0.5 mb-5 md:mb-3">
@if($user['id'])
<div class="grid grid-cols-1 md:grid-cols-2">
<span class="font-semibold">{{ __('Created') }}<span class="hidden md:inline">:</span></span>
<p>
<a href="{{ route('timestamp', ['timestampSlug' => round(getTimestamp($user['id']) / 1000)]) }}">
{{ date('Y-m-d G:i:s \(T\)', getTimestamp($user['id']) / 1000) }}
<span class="text-sm">({{ \Carbon\Carbon::createFromTimestamp(getTimestamp($user['id']) / 1000)->diffForHumans() }})</span>
</a>
</p>
</div>
@endif
<div class="grid grid-cols-1 md:grid-cols-2">
<span class="font-semibold">{{ __('Bot') }}<span class="hidden md:inline">:</span></span>
<p class="my-auto">
@if($user['isBot'])
<img src="{{ asset('images/discord/icons/check.svg') }}" class="h-4 w-4" alt="Check" />
@else
<img src="{{ asset('images/discord/icons/cross.svg') }}" class="h-4 w-4" alt="Cross" />
@endif
</p>
</div>
@if($user['isBot'])
<div class="grid grid-cols-1 md:grid-cols-2">
<span class="font-semibold">{{ __('Verified Bot') }}<span class="hidden md:inline">:</span></span>
<p class="my-auto">
@if($user['isVerifiedBot'] || $user['id'] === '643945264868098049' || $user['id'] === '1081004946872352958')
<img src="{{ asset('images/discord/icons/check.svg') }}" class="h-4 w-4" alt="Check">
@else
<img src="{{ asset('images/discord/icons/cross.svg') }}" class="h-4 w-4" alt="Cross">
@endif
</p>
</div>
@endif
<div class="grid grid-cols-1 md:grid-cols-2">
<span class="font-semibold">{{ __('Spammer') }}<span class="hidden md:inline">:</span></span>
<p class="my-auto">
@if($user['isSpammer'])
<img src="{{ asset('images/discord/icons/check.svg') }}" class="h-4 w-4" alt="Check" />
@else
<img src="{{ asset('images/discord/icons/cross.svg') }}" class="h-4 w-4" alt="Cross" />
@endif
</p>
</div>
@if($user['bannerColor'])
<div class="grid grid-cols-1 md:grid-cols-2">
<span class="font-semibold">{{ __('Banner Color') }}<span class="hidden md:inline">:</span></span>
<x-color-preview :hexColor="$user['bannerColor']" />
</div>
@endif
@if($user['accentColor'])
<div class="grid grid-cols-1 md:grid-cols-2">
<span class="font-semibold">{{ __('Accent Color') }}<span class="hidden md:inline">:</span></span>
<x-color-preview :hexColor="$user['accentColor']" />
</div>
@endif
@if($user['avatarDecorationSku'])
<div class="grid grid-cols-1 md:grid-cols-2">
<span class="font-semibold">{{ __('Avatar Decoration SKU ID') }}<span class="hidden md:inline">:</span></span>
<p>
<a href="https://discord.com/shop#itemSkuId={{ $user['avatarDecorationSku'] }}" target="_blank" class="text-discord-blurple hover:text-[#4e5acb] active:text-[#414aa5]">
{{ $user['avatarDecorationSku'] }}
</a>
</p>
</div>
@endif
@if(array_key_exists('clan', $user) && $user['clan'] && array_key_exists('tag', $user['clan']) && $user['clan']['tag'])
<div class="grid grid-cols-1 md:grid-cols-2">
<span class="font-semibold">{{ __('Clan Tag') }}<span class="hidden md:inline">:</span></span>
<p>
{{ $user['clan']['tag'] }}
</p>
</div>
@endif
@if(array_key_exists('clan', $user) && $user['clan'] && array_key_exists('identity_guild_id', $user['clan']) && $user['clan']['identity_guild_id'])
<div class="grid grid-cols-1 md:grid-cols-2">
<span class="font-semibold">{{ __('Clan Guild ID') }}<span class="hidden md:inline">:</span></span>
<p>
<a href="{{ route('guildlookup', ['snowflake' => $user['clan']['identity_guild_id']]) }}" class="text-discord-blurple hover:text-[#4e5acb] active:text-[#414aa5]">
{{ $user['clan']['identity_guild_id'] }}
</a>
</p>
</div>
@endif
</div>
@if(!empty($user['flagsList']))
<div class="space-y-1">
<div class="font-semibold">{{ __('Badges') }}<span class="hidden md:inline">:</span></div>
<div>
<ul class="list-none space-y-1">
@if(array_key_exists('premiumType', $user) && $user['premiumType'] != null && $user['premiumType'] > 0)
<li class="flex space-x-2">
<img src="{{ asset('images/discord/icons/badges/nitro.svg') }}" loading="lazy" height="18" width="18" alt="{{ $user['premiumTypeName'] }} Badge Icon" />
<span>{{ $user['premiumTypeName'] }}</span>
</li>
@endif
@foreach($user['flagsList'] as $flag)
<li class="flex space-x-2">
@if($flag['image'])
<img src="{{ $flag['image'] }}" loading="lazy" height="18" width="18" alt="{{ $flag['name'] }} Badge Icon" />
@endif
<span>{{ $flag['name'] }}</span>
</li>
@endforeach
</ul>
</div>
</div>
@endif
{{-- TODO: top.gg API fetch for bots? --}}
</div>
</div>
</div>