Fix profile locks
This commit is contained in:
fraxle
2026-06-05 12:09:53 +01:00
parent 14a4b4623a
commit 8540ae6782
3 changed files with 32 additions and 22 deletions
+16 -16
View File
@@ -187,16 +187,16 @@ export function DayTabs({
<button
key=${key}
class=${`profile-btn${activeProfile === key ? ' active' : ''}${locked ? ' locked' : ''}`}
style=${{ filter: locked ? 'grayscale(100%)' : 'none', cursor: 'pointer', position: 'relative' }}
style=${{ cursor: 'pointer', position: 'relative' }}
title=${locked ? `Profile ${profile.label} is part of SunScope Extra` : ''}
onClick=${() => {
if (locked) { setProPromptSource(`profile:${key}`); setProPromptDay(0); return; }
activateProfile(key);
}}
>
<span class="profile-btn-scene" style=${{ background: profile.scene }}>${profile.scene.includes('url(') ? null : profile.icon}</span>
<span class="profile-btn-label">${profile.label}</span>
${locked && html`<span style=${{ position: 'absolute', top: '3px', right: '5px', fontSize: '10px', opacity: 0.85 }}>🔒</span>`}
<span class="profile-btn-scene" style=${{ background: profile.scene, filter: locked ? 'grayscale(100%)' : 'none' }}>${profile.scene.includes('url(') ? null : profile.icon}</span>
<span class="profile-btn-label">${locked ? '🔒 ' : ''}${profile.label}</span>
${locked && html`<span class="profile-lock-badge">🔒</span>`}
</button>`;
})}
@@ -204,7 +204,7 @@ export function DayTabs({
<button
key=${opt.value}
class=${`profile-btn${placeValue === opt.value ? ' active' : ''}${opt.disabled ? ' locked' : ''}`}
style=${{ filter: opt.disabled ? 'grayscale(100%)' : 'none', cursor: 'pointer', position: 'relative' }}
style=${{ cursor: 'pointer', position: 'relative' }}
onClick=${() => {
if (opt.disabled) { setProPromptSource(`variant:${opt.value}`); setProPromptDay(0); return; }
try { localStorage.setItem('sunscope_profile', 'outdoors'); } catch(e) {}
@@ -215,9 +215,9 @@ export function DayTabs({
setIndoorManaged(false);
}}
>
<span class="profile-btn-scene" style=${{ background: opt.scene }}></span>
<span class="profile-btn-label">${opt.name}</span>
${opt.disabled && html`<span style=${{ position: 'absolute', top: '3px', right: '5px', fontSize: '10px', opacity: 0.85 }}>🔒</span>`}
<span class="profile-btn-scene" style=${{ background: opt.scene, filter: opt.disabled ? 'grayscale(100%)' : 'none' }}></span>
<span class="profile-btn-label">${opt.disabled ? '🔒 ' : ''}${opt.name}</span>
${opt.disabled && html`<span class="profile-lock-badge">🔒</span>`}
</button>
`)}
@@ -225,7 +225,7 @@ export function DayTabs({
<button
key=${opt.value}
class=${`profile-btn${activityValue === opt.value ? ' active' : ''}${opt.disabled ? ' locked' : ''}`}
style=${{ filter: opt.disabled ? 'grayscale(100%)' : 'none', cursor: 'pointer', position: 'relative' }}
style=${{ cursor: 'pointer', position: 'relative' }}
onClick=${() => {
if (opt.disabled) { setProPromptSource(`variant:${opt.value}`); setProPromptDay(0); return; }
try { localStorage.setItem('sunscope_profile', 'outdoors'); } catch(e) {}
@@ -236,9 +236,9 @@ export function DayTabs({
setIndoorManaged(false);
}}
>
<span class="profile-btn-scene" style=${{ background: opt.scene }}></span>
<span class="profile-btn-label">${opt.name}</span>
${opt.disabled && html`<span style=${{ position: 'absolute', top: '3px', right: '5px', fontSize: '10px', opacity: 0.85 }}>🔒</span>`}
<span class="profile-btn-scene" style=${{ background: opt.scene, filter: opt.disabled ? 'grayscale(100%)' : 'none' }}></span>
<span class="profile-btn-label">${opt.disabled ? '🔒 ' : ''}${opt.name}</span>
${opt.disabled && html`<span class="profile-lock-badge">🔒</span>`}
</button>
`)}
@@ -246,7 +246,7 @@ export function DayTabs({
<button
key=${opt.value}
class=${`profile-btn${workValue === opt.value ? ' active' : ''}${opt.disabled ? ' locked' : ''}`}
style=${{ filter: opt.disabled ? 'grayscale(100%)' : 'none', cursor: 'pointer', position: 'relative' }}
style=${{ cursor: 'pointer', position: 'relative' }}
onClick=${() => {
if (opt.disabled) { setProPromptSource(`variant:${opt.value}`); setProPromptDay(0); return; }
if (opt.value === 'farming') { activateProfile('farming'); return; }
@@ -258,9 +258,9 @@ export function DayTabs({
else { setIndoorMode('off'); setIndoorManaged(false); }
}}
>
<span class="profile-btn-scene" style=${{ background: opt.scene }}></span>
<span class="profile-btn-label">${opt.name}</span>
${opt.disabled && html`<span style=${{ position: 'absolute', top: '3px', right: '5px', fontSize: '10px', opacity: 0.85 }}>🔒</span>`}
<span class="profile-btn-scene" style=${{ background: opt.scene, filter: opt.disabled ? 'grayscale(100%)' : 'none' }}></span>
<span class="profile-btn-label">${opt.disabled ? '🔒 ' : ''}${opt.name}</span>
${opt.disabled && html`<span class="profile-lock-badge">🔒</span>`}
</button>
`)}