the browser-facing portion of osu!
at master 22 lines 863 B view raw
1{{-- 2 Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the GNU Affero General Public License v3.0. 3 See the LICENCE file in the repository root for full licence text. 4--}} 5@php 6 $class = class_with_modifiers('beatmapset-cover', $modifiers); 7 8 $isNsfw = $beatmapset->nsfw; 9 if ($isNsfw) { 10 $attributesBag = Request::instance()->attributes; 11 $userShowNsfw = $attributesBag->get('user_beatmapset_show_nsfw'); 12 if ($userShowNsfw === null) { 13 $userShowNsfw = App\Models\UserProfileCustomization::forUser(Auth::user())['beatmapset_show_nsfw']; 14 $attributesBag->set('user_beatmapset_show_nsfw', $userShowNsfw); 15 } 16 } 17 18 $style = !$isNsfw || $userShowNsfw 19 ? css_var_2x('--bg', $beatmapset->coverURL($size)) 20 : ''; 21@endphp 22<div class="{{ $class }}" style="{{ $style }}"></div>