0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-04 23:22:42 +00:00

Add dropdownTexture for user theme options

If a user theme document has a thumbnail, this will include that thumbnail as a dropdown texture in the options.
This commit is contained in:
Gazook89
2024-05-07 11:00:20 -05:00
parent f936b8b12b
commit 295fea7581
2 changed files with 21 additions and 9 deletions

View File

@@ -200,9 +200,12 @@ const MetadataEditor = createClass({
const listThemes = (renderer)=>{ const listThemes = (renderer)=>{
return _.map(_.values(mergedThemes[renderer]), (theme)=>{ return _.map(_.values(mergedThemes[renderer]), (theme)=>{
const preview = theme?.thumbnail ? theme.thumbnail : `/themes/${theme.renderer}/${theme.path}/dropdownPreview.png`; const preview = theme?.thumbnail ? theme.thumbnail : `/themes/${theme.renderer}/${theme.path}/dropdownPreview.png`;
const texture = theme?.thumbnail ? theme.thumbnail : `/themes/${theme.renderer}/${theme.path}/dropdownTexture.png`;
return <div className='item' key={`${renderer}_${theme.name}`} onClick={()=>this.handleTheme(theme, renderer)} title={''}> return <div className='item' key={`${renderer}_${theme.name}`} onClick={()=>this.handleTheme(theme, renderer)} title={''}>
{`${renderer} : ${theme.name}`} {`${renderer} : ${theme.name}`}
<img src={`/themes/${theme.renderer}/${theme.path}/dropdownTexture.png`}/> <div className='texture-container'>
<img src={`${texture}`}/>
</div>
<div className='preview'> <div className='preview'>
<h6>{`${theme.name}`} preview</h6> <h6>{`${theme.name}`} preview</h6>
<img src={`${preview}`}/> <img src={`${preview}`}/>

View File

@@ -230,14 +230,23 @@
&:hover > .preview { &:hover > .preview {
opacity: 1; opacity: 1;
} }
>img { .texture-container {
mask-image : linear-gradient(90deg, transparent, black 20%); position: absolute;
-webkit-mask-image : linear-gradient(90deg, transparent, black 20%); width: 100%;
position : absolute; height: 100%;
right : 0; min-height: 100%;
top : 0px; top: 0;
width : 50%; left: 0;
height : 100%; overflow: hidden;
> img {
mask-image : linear-gradient(90deg, transparent, black 20%);
-webkit-mask-image : linear-gradient(90deg, transparent, black 20%);
position : absolute;
right : 0;
top : 0px;
width : 50%;
min-height: 100%;
}
} }
} }
} }