Skip to content

Commit

Permalink
Update icon for lazer mode
Browse files Browse the repository at this point in the history
  • Loading branch information
nanaya committed Jan 29, 2024
1 parent e7ed418 commit fc6cec6
Show file tree
Hide file tree
Showing 7 changed files with 320 additions and 8 deletions.
257 changes: 257 additions & 0 deletions public/images/layout/osu-lazer-logo-triangles.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
46 changes: 46 additions & 0 deletions public/images/layout/osu-lazer-logo-white.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions resources/css/bem/nav2.less
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,15 @@
transition: all 100ms ease-in-out;
will-change: opacity, transform;

background-image: url('~@images/layout/osu-logo-white.svg');
background-image: var(--nav-logo);

.@{_top}__logo-link:hover & {
// be careful of weird snapping at the end of animation on Firefox (with 1.1, ~60px).
transform: scale(1.11);
}

&--bg {
background-image: url('~@images/layout/osu-logo-triangles.svg');
background-image: var(--nav-logo-bg);
opacity: 0;

.@{_top}__logo-link:hover & {
Expand Down
2 changes: 1 addition & 1 deletion resources/css/bem/navbar-mobile.less
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
&__logo {
flex: none;
display: block;
background-image: url('~@images/layout/osu-logo-white.svg');
background-image: var(--nav-logo);
background-size: contain;
background-repeat: no-repeat;
background-position: center;
Expand Down
8 changes: 8 additions & 0 deletions resources/css/bem/osu-layout.less
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
transition: filter 200ms ease-in-out, opacity 200ms ease-in-out; // for fading in after &--masked is removed

&--body {
--nav-logo: url('~@images/layout/osu-logo-white.svg');
--nav-logo-bg: url('~@images/layout/osu-logo-triangles.svg');

background-color: @osu-colour-b6;
}

Expand All @@ -35,6 +38,11 @@
}
}

&--body-lazer {
--nav-logo: url('~@images/layout/osu-lazer-logo-white.svg');
--nav-logo-bg: url('~@images/layout/osu-lazer-logo-triangles.svg');
}

&--full {
flex: 1 0 auto;
width: 100%;
Expand Down
6 changes: 3 additions & 3 deletions resources/views/layout/_score_mode_toggle.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
See the LICENCE file in the repository root for full licence text.
--}}
@php
$legacyScoreOnlyValue = App\Libraries\Search\ScoreSearchParams::showLegacyForUser(Auth::user());
$icon = $legacyScoreOnlyValue
$legacyScoreMode ??= App\Libraries\Search\ScoreSearchParams::showLegacyForUser($currentUser) === true;
$icon = $legacyScoreMode
? 'far fa-square'
: 'fas fa-check-square';
@endphp
<button
class="{{ $class }}"
type="button"
data-url="{{ route('account.options', ['user_profile_customization[legacy_score_only]' => !$legacyScoreOnlyValue]) }}"
data-url="{{ route('account.options', ['user_profile_customization[legacy_score_only]' => !$legacyScoreMode]) }}"
data-method="PUT"
data-remote="1"
data-reload-on-success="1"
Expand Down
5 changes: 3 additions & 2 deletions resources/views/master.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
$currentUser = Auth::user();
$legacyScoreMode = App\Libraries\Search\ScoreSearchParams::showLegacyForUser($currentUser) === true;
$titleTree = [];
if (isset($titleOverride)) {
Expand Down Expand Up @@ -50,9 +52,8 @@

<body
class="
osu-layout
osu-layout--body
t-section
{{ class_with_modifiers('osu-layout', 'body', ['body-lazer' => !$legacyScoreMode]) }}
{{ $bodyAdditionalClasses ?? '' }}
"
>
Expand Down

0 comments on commit fc6cec6

Please sign in to comment.