Skip to content

Commit

Permalink
Merge pull request #10889 from nanaya/score-legacy-toggle-ui
Browse files Browse the repository at this point in the history
Add menu to switch score display mode
  • Loading branch information
peppy authored Jan 30, 2024
2 parents 96ec1f4 + fc6cec6 commit 004185a
Show file tree
Hide file tree
Showing 11 changed files with 355 additions and 5 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: 6 additions & 0 deletions resources/css/bem/simple-menu.less
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,12 @@
}
}

&__extra {
background-color: hsl(var(--hsl-b5));
padding: @_padding-vertical @_gutter;
margin: -@_padding-vertical -@_gutter @_padding-vertical;
}

&__form {
margin: -@_padding-vertical -@_gutter;
}
Expand Down
2 changes: 2 additions & 0 deletions resources/lang/en/layout.php
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,8 @@
'account-edit' => 'Settings',
'follows' => 'Watchlists',
'friends' => 'Friends',
'legacy_score_only_toggle' => 'Lazer mode',
'legacy_score_only_toggle_tooltip' => 'Lazer mode shows scores set from lazer with a new scoring algorithm',
'logout' => 'Sign Out',
'profile' => 'My Profile',
],
Expand Down
4 changes: 4 additions & 0 deletions resources/views/layout/_popup_user.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ class="simple-menu__header simple-menu__header--link js-current-user-cover"
<div class="u-relative">{{ Auth::user()->username }}</div>
</a>

<div class="simple-menu__extra">
@include('layout._score_mode_toggle', ['class' => 'simple-menu__item'])
</div>

<a
class="simple-menu__item"
href="{{ route('users.show', Auth::user()) }}"
Expand Down
Loading

0 comments on commit 004185a

Please sign in to comment.