Compare commits

...

9 commits

Author SHA1 Message Date
Henry Jameson
4704f57cbf Merge branch 'settings-shuffle' into shigusegubu-themes3 2025-11-27 19:34:23 +02:00
Henry Jameson
16f456eaea fun UI for profile background 2025-11-27 19:33:47 +02:00
Henry Jameson
0d04b1c8ce fix scroll again 2025-11-27 18:20:47 +02:00
Henry Jameson
3bc8800c35 i18n 2025-11-27 12:27:38 +02:00
Henry Jameson
e4c5a88913 fix fun content not hiding properly 2025-11-27 12:27:36 +02:00
Henry Jameson
ad13f2417f fix tab cutoff 2025-11-27 12:27:33 +02:00
Henry Jameson
ea8218d855 i18n 2025-11-27 12:26:44 +02:00
Henry Jameson
ba8be56bc4 fix fun content not hiding properly 2025-11-27 12:03:15 +02:00
Henry Jameson
b1c338a976 fix tab cutoff 2025-11-27 12:03:07 +02:00
6 changed files with 175 additions and 67 deletions

View file

@ -43,7 +43,7 @@ export default {
return {
active: findFirstUsable(this.slots()),
resizeHandler: null,
navSide: 'tabs'
navSide: 'tabs',
}
},
computed: {
@ -144,6 +144,7 @@ export default {
<button
type="button"
onClick={() => this.changeNavSide('tabs')}
title={this.$t('nav.back')}
class="button-unstyled"
>
<FAIcon

View file

@ -65,8 +65,10 @@
}
.tab-content-wrapper {
flex: 1 1 auto;
display: flex;
flex-direction: column;
height: 100%;
flex: 1 1 auto;
&.-hidden {
display: none;

View file

@ -236,6 +236,10 @@ const AppearanceTab = {
noIntersectionObserver () {
return !window.IntersectionObserver
},
instanceWallpaper () {
console.log(this.$store.state.instance.background)
this.$store.state.instance.background
},
instanceWallpaperUsed () {
return this.$store.state.instance.background &&
!this.$store.state.users.currentUser.background_image
@ -411,6 +415,9 @@ const AppearanceTab = {
this.submitBackground('')
}
},
resetUploadedBackground () {
this.backgroundPreview = null
},
submitBackground (background) {
if (!this.backgroundPreview && background !== '') { return }

View file

@ -18,7 +18,31 @@
height: auto;
}
.banner-background {
display: flex;
gap: 1em;
flex-wrap: wrap;
h4 {
margin: 0;
}
}
.banner-background-input {
flex: 1;
display: flex;
flex-direction: column;
gap: 0.5em;
.custom-bg-control {
display: grid;
gap: 0.5em;
grid-template-columns: 1fr 1fr;
}
}
.banner-background-preview {
display: flex;
max-width: 100%;
width: 300px;
position: relative;
@ -26,33 +50,86 @@
img {
width: 100%;
}
}
.reset-button {
position: absolute;
top: 0.2em;
right: 0.2em;
border-radius: var(--roundness);
background-color: rgb(0 0 0 / 60%);
opacity: 0.7;
width: 1.5em;
height: 1.5em;
text-align: center;
line-height: 1.5em;
font-size: 1.5em;
cursor: pointer;
.fun-monitor {
position: relative;
pointer-events: none;
display: flex;
flex-direction: column;
align-items: center;
&:hover {
opacity: 1;
}
* {
line-height: 1;
}
svg {
color: white;
&-display-bezel,
&-display-screen {
aspect-ratio: 16 / 9;
width: 16em;
}
img {
object-fit: cover;
}
.wallpaper {
position: absolute;
inset: 0;
background-color: var(--wallpaper);
}
&-display-uploading {
position: absolute;
inset: 0;
z-index: 1;
display: flex;
place-items: center;
place-content: center;
background-color: rgb(0 0 0 / 60%);
font-size: 4em;
}
&-display-screen {
padding: 0;
overflow: hidden;
position: relative;
&-overlay {
background: transparent;
position: absolute;
inset: 0;
z-index: 2;
}
&-image {
aspect-ratio: 16 / 9
}
}
&-display-bezel {
padding: 1em;
margin: 0;
order: 1;
z-index: 3;
}
&-neck {
width: 5em;
height: 3em;
margin-top: -1em;
margin-bottom: -0.5em;
order: 2
}
&-stand {
width: 8em;
height: 1em;
order: 3;
z-index: 1
}
}
}
.palettes-container {
height: 15em;
overflow: hidden auto;

View file

@ -154,46 +154,67 @@
</div>
</div>
<h3>{{ $t('settings.background') }}</h3>
<div class="banner-background-preview">
<img :src="user.background_image">
<button
v-if="!isDefaultBackground"
class="button-unstyled reset-button"
:title="$t('settings.reset_profile_background')"
@click="resetBackground"
>
<FAIcon
icon="times"
type="button"
/>
</button>
<div class="banner-background">
<div class="banner-background-preview">
<div class="fun-monitor">
<div class="fun-monitor-stand button-default" />
<div class="fun-monitor-neck button-default" />
<div class="fun-monitor-display-bezel button-default">
<div class="fun-monitor-display-screen input">
<img
v-if="backgroundPreview || user.background_image || instanceWallpaper"
class="fun-monitor-display-screen-image"
:src="backgroundPreview || user.background_image || instanceWallpaper"
/>
<div v-else class="wallpaper" />
<div class="fun-monitor-display-screen-overlay input" />
<div
v-if="backgroundUploading"
class="fun-monitor-display-uploading"
>
<FAIcon
class="fun-monitor-display-screen-uploading"
spin
icon="circle-notch"
/>
</div>
</div>
</div>
</div>
</div>
<div class="banner-background-input">
<h4>{{ $t('settings.set_new_background') }}</h4>
<input
type="file"
class="input"
@change="uploadFile('background', $event)"
>
<div class="custom-bg-control">
<button
:disabled="!backgroundPreview"
class="btn button-default"
@click="submitBackground(background)"
>
{{ $t('settings.save') }}
</button>
<button
:disabled="!backgroundPreview"
class="btn button-default"
@click="resetUploadedBackground"
>
{{ $t('settings.reset') }}
</button>
</div>
<button
v-if="!isDefaultBackground"
class="btn button-default reset-button"
:title="$t('settings.reset_profile_background')"
@click="resetBackground"
>
{{ $t('settings.reset_profile_background') }}
</button>
</div>
</div>
<p>{{ $t('settings.set_new_background') }}</p>
<img
v-if="backgroundPreview"
class="banner-background-preview"
:src="backgroundPreview"
>
<div>
<input
type="file"
class="input"
@change="uploadFile('background', $event)"
>
</div>
<FAIcon
v-if="backgroundUploading"
class="uploading"
spin
icon="circle-notch"
/>
<button
v-else-if="backgroundPreview"
class="btn button-default"
@click="submitBackground(background)"
>
{{ $t('settings.save') }}
</button>
<h3>{{ $t('settings.visual_tweaks') }}</h3>
<div class="alert neutral theme-notice">
{{ $t("settings.style.visual_tweaks_section_note") }}

View file

@ -239,12 +239,12 @@
<h3 v-if="expertLevel > 0">
{{ $t('settings.fun') }}
</h3>
<ul class="setting-list">
<ul
v-if="expertLevel > 0"
class="setting-list"
>
<li v-if="user">
<BooleanSetting
path="mentionLinkShowYous"
expert="1"
>
<BooleanSetting path="mentionLinkShowYous">
{{ $t('settings.show_yous') }}
</BooleanSetting>
</li>