fix: bring back the HackerHorse badge!

This commit is contained in:
Floorb 2024-07-07 17:28:31 -04:00
parent d36886c3be
commit 24f8a6a9aa
4 changed files with 31 additions and 6 deletions

View file

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg version="1.1" viewBox="0 0 500 500" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><g transform="matrix(.47414 0 0 .42641 -420.2 126.8)" fill="#2e2e2e"><rect x="1006.1" y="753.36" width="90.914" height="62.629" rx="15.041" ry="25.142"/><rect x="1674.8" y="753.36" width="90.914" height="62.629" rx="15.041" ry="25.142"/></g><g fill="none" stroke-linejoin="round"><path d="m450.18 275.22c33.069-7.3987 66.318 107.72 7.4508 115.13" stroke="#4b4b4b" stroke-width="6.7447"/><path d="m450.18 275.22c33.069-7.3987 66.318 107.72 7.4508 115.13" stroke="#4f4f4f" stroke-dasharray="9.03784, 18.0756" stroke-dashoffset="11.749" stroke-width="9.0378"/><path d="m450.18 275.22c33.069-7.3987 66.318 107.72 7.4508 115.13" stroke="#2e2e2e" stroke-dasharray="13.4893, 13.4893" stroke-width="13.489"/></g><g stroke="#a89985" stroke-linejoin="round" stroke-width="17.986"><path d="m51.049 314.96h379.72l8.6211-63.848h-396.96z" fill="#928775"/><path d="m68.198 44.353h345.42c22.73 0 26.462 18.222 27.207 37.499l6.7054 173.58c0.85659 22.174 0.69755 33.192-22.129 33.192h-368.99c-24.31 0-22.932-12.406-22.129-33.192l6.7054-173.58c0.8031-20.79 5.7999-37.499 27.207-37.499z" fill="#d5bb91"/><path d="m71.404 316.58h339.01c28.668 0 31.599-1.5447 36.878 22.208l20.595 92.659c6.4005 28.796-40.114 27.377-63.96 27.377h-326.04c-26.391 0-70.138 0.41759-63.961-27.377l20.595-92.659c5.5697-25.058 10.546-22.208 36.879-22.208z" fill="#928775"/><path d="m71.404 316.58h339.01c28.668 0 31.446-1.5168 36.878 22.208l13.832 60.409c6.5817 28.745 1.1486 33.782-27.1 33.782h-386.23c-31.263 0-33.15-7.8708-26.761-35.609l13.493-58.582c5.7634-25.023 10.546-22.208 36.879-22.208z" fill="#2e2e2e"/></g><g stroke="#1b1b1b" stroke-linejoin="round" stroke-width="4.6328"><path d="m87.492 341.59h101.64l-0.0389 72.785h-112.37z" fill="#232323"/><path d="m95.273 331.38h87.749l-0.0389 72.785h-97.779z" fill="#404040"/><path d="m191.91 341.59 8.2192-8.7085 92.933 8.7085 5.5578 72.785h-106.67z" fill="#232323"/><path d="m199.36 331.38h89.261l5.5578 72.785h-97.223z" fill="#404040"/></g><g fill="none" stroke="#1b1b1b" stroke-linejoin="round" stroke-width="4.6328"><path d="m77.147 413.64 7.8342-9.4146"/><path d="m87.414 341.62 8.2874-10.513" stroke-linecap="round"/><path d="m188.27 413.01-6.3247-9.5323"/><path d="m193.33 413.64 3.6203-9.5715"/><path d="m299.23 414.27-5.7576-10.827"/><g stroke-linecap="round"><path d="m292.78 341.46-3.6639-9.7284"/><path d="m190.54 342.4 8.4619-10.591"/><path d="m183.47 331.81 7.0662 11.376"/></g></g><g stroke="#1b1b1b" stroke-linejoin="round"><ellipse cx="383.13" cy="382.59" rx="44.562" ry="23.476" fill="#393939" stroke-width="3.4832"/><ellipse cx="384.14" cy="359.9" rx="35.029" ry="31.503" fill="#555" stroke-width="3.5775"/><path d="m353.31 378.3c9.2778 17.028 54.814 16.038 61.145-0.21537-23.255 7.716-37.89 7.9314-61.145 0.21537z" fill="#232323" stroke-width="4.4964"/></g><ellipse cx="384.5" cy="336.48" rx="17.661" ry="6.4611" fill="#404040"/><path d="m39.037 263.04h405.05" fill="none" stroke="#a89985" stroke-width="8.9928"/>
<!--Trixie is best pony--><rect x="71.253" y="42.755" width="256.55" height="194.93" rx="8.7845" ry="8.5519" fill="#404040" stroke="#2e2e2e" stroke-linecap="round" stroke-linejoin="round" stroke-width="16.175"/><rect x="70.949" y="75.445" width="257.16" height="152.77" rx="8.8053" ry="6.702" stroke="#2e2e2e" stroke-linecap="round" stroke-linejoin="round" stroke-width="14.336"/><rect x="350.44" y="204.24" width="75.675" height="17.23" rx="3.7579" ry="3.3796" fill="#2e2e2e"/><rect x="355.18" y="208.2" width="42.485" height="9.3106" rx="2.1097" ry="1.8263" fill="#737373"/><g fill="#c1c1c1"><rect x="775.5" y="-1388.6" width="20.896" height="47.875" rx="2.8764" ry="3.4996"/><rect x="812.64" y="-1388.6" width="20.896" height="47.875" rx="2.8764" ry="3.4996"/><rect x="881.22" y="-1388.6" width="20.896" height="47.875" rx="2.8764" ry="3.4996"/><rect x="924.07" y="-1388.6" width="20.896" height="47.875" rx="2.8764" ry="3.4996"/><rect x="775.5" y="-1148.6" width="10.296" height="23.589" rx="1.4173" ry="1.7243"/><rect x="800.76" y="-1148.6" width="10.296" height="23.589" rx="1.4173" ry="1.7243"/><rect x="827.52" y="-1148.6" width="10.296" height="23.589" rx="1.4173" ry="1.7243"/><rect x="852.78" y="-1148.6" width="10.296" height="23.589" rx="1.4173" ry="1.7243"/><rect x="876.52" y="-1148.6" width="10.296" height="23.589" rx="1.4173" ry="1.7243"/><rect x="901.77" y="-1148.6" width="10.296" height="23.589" rx="1.4173" ry="1.7243"/><rect x="928.54" y="-1148.6" width="10.296" height="23.589" rx="1.4173" ry="1.7243"/><rect x="953.79" y="-1148.6" width="10.296" height="23.589" rx="1.4173" ry="1.7243"/><rect x="1158.3" y="-1148.6" width="10.296" height="23.589" rx="1.4173" ry="1.7243"/><rect x="1183.6" y="-1148.6" width="10.296" height="23.589" rx="1.4173" ry="1.7243"/><rect x="1210.4" y="-1148.6" width="10.296" height="23.589" rx="1.4173" ry="1.7243"/><rect x="1235.6" y="-1148.6" width="10.296" height="23.589" rx="1.4173" ry="1.7243"/>
<!--Get out of here, stalker--></g><path d="m238.25 98.734c-3.9862 0.50733-9.0232 1.2683-14.386 1.2683-8.3709 0-15.945-2.0656-23.627-3.6962-7.7911-1.6669-15.836-3.3701-24.352-3.3701-16.996 0-22.757 3.66-23.337 4.0586l-1.2321 0.8697v111.03h5.798v-51.929c2.1743-0.90595 7.8998-2.5004 18.807-2.5004 7.8998 0 15.292 3.0077 23.156 4.7109 7.9723 1.7032 16.235 3.4788 25.185 3.4788 5.327 0 10.038-0.72475 14.024-1.1958 2.1743-0.25366 4.0949-0.50732 5.798-0.79722v-62.836c-1.7032 0.32613-3.66 0.61605-5.8343 0.90594z" fill="#c1c1c1" stroke-width=".36238"/></svg>

After

Width:  |  Height:  |  Size: 5.5 KiB

View file

@ -331,6 +331,21 @@ table.hidden + .loading_container {
background-position: center;
}
.pp-width-auto {
width: auto;
}
.badges {
display: flex;
align-items: center;
}
.badges > * {
border-radius: 50%;
width: 70px;
height: 70px;
}
.badge--bgcolor-dark {
background-color: #2e2e2eff;
}
.badge--padded > img {
margin: 10px;
}

View file

@ -43,13 +43,17 @@ $total_pfav = array_sum(
$total_yfav = $profile_info->favourites->count();
// Badges
$profile_badge = match ((int) $profile_info['badge']) {
$profile_badge = match ((int) 5) {
1 => '<img src="/img/badges/donate.png" title="[Donated] Donated to Ponepaste" style="margin:5px" alt="Donated to PonePaste" />',
2 => '<img src="/img/badges/spoon.png" title="[TheWoodenSpoon] You had one job" style="margin:5px" alt="You had one job" />',
3 => '<img src="/img/badges/abadge.png" title="[>AFuckingBadge] Won a PasteJam Competition" style="margin:5px" alt="Won a PasteJam competition" />',
default => '',
4 => '<img src="/img/badges/abadge2023.png" title="[>AFuckingBadge] Winner of /PJ2023/" style="margin:5px">',
5 => '<span class="badge--padded badge--bgcolor-dark"><img src="/img/badges/hackerhorse.svg" title="[HackerHorse] Made a CTF write-up for a /mlp/ CTF and posted it on the site." /></span>',
default => ''
};
$profile_total_pastes = $profile_info->pastes->count();
$profile_total_public = $profile_info->pastes->where('visible', 0)->count();
$profile_total_unlisted = $profile_info->pastes->where('visible', 1)->count();

View file

@ -75,6 +75,7 @@ if ($is_current_user && isset($_GET['tab']) && $_GET['tab'] === 'favourites') {
<!-- Badges system -->
<div class="box">
<h2 class="title is-5">Badges</h2>
<div class="badges">
<?php
if (!empty($profile_join_date)) {
if (strtotime($profile_join_date) <= 1604188800) {
@ -86,7 +87,7 @@ if ($is_current_user && isset($_GET['tab']) && $_GET['tab'] === 'favourites') {
}
}
if (!str_contains($profile_badge, '0')) {
if (!empty($profile_badge)) {
echo $profile_badge;
}
@ -100,6 +101,7 @@ if ($is_current_user && isset($_GET['tab']) && $_GET['tab'] === 'favourites') {
}
?>
</div>
</div>
<?php outputFlashes($flashes) ?>