mirror of
https://github.com/Facepunch/sbox-public.git
synced 2026-08-01 00:08:05 -04:00
* Common components * Replace PackageCard with GameCard in content blocks, wrapped grid layout * Move GameCard to New/ folder, use ThumbWide for all sizes * Add `overflow: clip` and `overflow: clip-whole` modes * New game hub layout, hero * Layout + hero tweaks * Hero tweaks * Clean up content blocks, make it so that game cards don't clip on hover * Dynamic mask * Don't bother building CL for panels outside scroll view (400% perf benefit in main game hub) * Disable 3D bg when not visible (50% performance benefit) * Cards take their sizes from the image within them * Stash tweaks before big refactor * Initial hero carousel * Better carousel transitions * Try and reduce allocs inside CL combos * `background-playback-state` CSS property (`paused` or `running`, applies to video `background-image`) * Make out-of-focus carousel elements more obvious (no playing video, darkened) * New branding * Tweak navbar * Carousel shows full thumb if not visible, helps with visual noise * Accurate vote percentage 🙈 * Fix some carousel jankiness * Navbar feels less disjointed * Rebake menu lighting & envmaps * Finalize https://files.facepunch.com/alexguthrie/1b0311b1/bZKOQIQD0o.jpg * Trim down visual noise https://files.facepunch.com/alexguthrie/1b0311b1/oJh4qqaPsC.jpg * Gradient https://files.facepunch.com/alexguthrie/1b0511b1/uCyZyolkXE.jpg * Format * .heading labels use heading vars * Carousel slower time between auto switch * No play button on GameCard * Content blocks full width * Adjust GameCard sizes * Content block header padding * Add MenuHelpers.PlayGame, GameModal uses it, make hero "Play Now" button use it --------- Co-authored-by: Matt Stevens <matt@mattstevens.co.uk>
87 lines
1.5 KiB
C#
87 lines
1.5 KiB
C#
using System;
|
|
using System.Globalization;
|
|
|
|
namespace Sandbox.UI
|
|
{
|
|
public abstract partial class BaseStyles
|
|
{
|
|
internal Lazy<Texture> _backgroundImage;
|
|
internal Lazy<Texture> _maskImage;
|
|
internal Lazy<Texture> _borderImageSource;
|
|
internal bool? _backgroundPlaybackPaused;
|
|
|
|
public Texture BackgroundImage
|
|
{
|
|
get
|
|
{
|
|
if ( _backgroundImage == null ) return null;
|
|
|
|
return _backgroundImage?.Value;
|
|
}
|
|
|
|
set
|
|
{
|
|
if ( _backgroundImage?.Value == value )
|
|
return;
|
|
|
|
_backgroundImage = new Lazy<Texture>( value );
|
|
Dirty();
|
|
}
|
|
}
|
|
|
|
public Texture MaskImage
|
|
{
|
|
get
|
|
{
|
|
if ( _maskImage == null ) return null;
|
|
|
|
return _maskImage?.Value;
|
|
}
|
|
|
|
set
|
|
{
|
|
if ( _maskImage?.Value == value )
|
|
return;
|
|
|
|
_maskImage = new Lazy<Texture>( value );
|
|
Dirty();
|
|
}
|
|
}
|
|
|
|
public Texture BorderImageSource
|
|
{
|
|
get
|
|
{
|
|
if ( _borderImageSource == null ) return null;
|
|
|
|
return _borderImageSource?.Value;
|
|
}
|
|
|
|
set
|
|
{
|
|
if ( _borderImageSource?.Value == value )
|
|
return;
|
|
|
|
_borderImageSource = new Lazy<Texture>( value );
|
|
Dirty();
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Controls whether the background video is paused. Mirrors <c>animation-play-state</c>.
|
|
/// Maps to the CSS property <c>background-playback-state: paused | running</c>.
|
|
/// </summary>
|
|
public bool? BackgroundPlaybackPaused
|
|
{
|
|
get => _backgroundPlaybackPaused;
|
|
set
|
|
{
|
|
if ( _backgroundPlaybackPaused == value ) return;
|
|
_backgroundPlaybackPaused = value;
|
|
Dirty();
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|