Skip to content

Commit 519be4e

Browse files
authored
feat(showcase): Redesign the gallery as a compact grid of browser-frame cards (#1392)
Replace the tall hero with a short header and show each example site in a small browser window on a panel tinted with the site's accent color, four cards per row on wide screens. - Add a short Summary per site to the showcase catalog for the card text. - Show the first three components per card; the rest stay available to screen readers. - Make the whole card open the live demo through one stretched link. - Give the page's links a solid focus ring and fix the dark-mode contrast of the "How it's built" link. - Cancel the library stylesheet's article padding on the card.
1 parent 2d2c783 commit 519be4e

5 files changed

Lines changed: 87 additions & 117 deletions

File tree

‎BlazorBootstrap.Demo.RCL/Components/Pages/Showcase/Index.razor‎

Lines changed: 42 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -3,37 +3,17 @@
33

44
<PageTitle>Showcase: example websites built with Blazor Bootstrap</PageTitle>
55

6-
<section class="sc-gallery-hero">
7-
<div class="container-xxl py-5">
8-
<div class="col-lg-8">
9-
<span class="sc-gallery-kicker">Showcase</span>
10-
<h1 class="display-5 fw-bold mt-2 mb-3">Example websites you can build with Blazor Bootstrap</h1>
11-
<p class="lead mb-4">
12-
Eleven complete, interactive sample apps &mdash; from AI chat and SaaS dashboards to clinics, travel, and storefronts.
13-
Every screen is built only with Blazor Bootstrap components, runs on fictitious data, and works in Blazor Server and WebAssembly.
14-
</p>
15-
<div class="d-flex flex-wrap gap-2">
16-
<a class="btn btn-light btn-lg fw-semibold" href="#examples">Browse examples</a>
17-
<a class="btn btn-outline-light btn-lg" href="@DemoRouteConstants.Showcase_Source_URL_Prefix" target="_blank" rel="noopener">
18-
<Icon Name="IconName.Github" class="me-1" aria-hidden="true" /> View source
19-
</a>
20-
</div>
21-
</div>
22-
<dl class="sc-gallery-stats row row-cols-3 g-3 mt-4 mb-0 col-lg-6">
23-
<div class="col"><dt>Sites</dt><dd>@ShowcaseCatalog.Sites.Count</dd></div>
24-
<div class="col"><dt>Screens</dt><dd>80+</dd></div>
25-
<div class="col"><dt>Backend</dt><dd>None</dd></div>
26-
</dl>
27-
</div>
28-
</section>
29-
30-
<section class="container-xxl py-5" id="examples" aria-labelledby="examples-heading">
31-
<div class="d-flex flex-column flex-md-row align-items-md-end justify-content-between gap-3 mb-4">
6+
<section class="container-xxl pt-4 pb-5" aria-labelledby="examples-heading">
7+
<div class="d-flex flex-column flex-lg-row align-items-lg-end justify-content-between gap-3 mb-3">
328
<div>
33-
<h2 class="h3 fw-bold mb-1" id="examples-heading">Pick an example</h2>
34-
<p class="text-body-secondary mb-0">Open any site, click around, and toggle light or dark mode &mdash; nothing you do is sent anywhere.</p>
9+
<h1 class="h2 fw-bold mb-1" id="examples-heading">Example websites built with Blazor Bootstrap</h1>
10+
<p class="text-body-secondary mb-0">
11+
@ShowcaseCatalog.Sites.Count complete, interactive sites with 80+ screens and no backend.
12+
Open any site and click around &mdash; nothing you do is sent anywhere.
13+
<a class="text-nowrap" href="@DemoRouteConstants.Showcase_Source_URL_Prefix" target="_blank" rel="noopener">View source</a>
14+
</p>
3515
</div>
36-
<div class="sc-gallery-filters" role="group" aria-label="Filter examples by category">
16+
<div class="d-flex flex-wrap gap-1 flex-shrink-0" role="group" aria-label="Filter examples by category">
3717
@foreach (var category in categories)
3818
{
3919
<button type="button"
@@ -46,38 +26,50 @@
4626
</div>
4727
</div>
4828

49-
<p class="visually-hidden" aria-live="polite">@VisibleSites.Count() examples shown</p>
29+
<p class="visually-hidden" aria-live="polite">@(VisibleSites.Count() == 1 ? "1 example shown" : $"{VisibleSites.Count()} examples shown")</p>
5030

51-
<div class="row row-cols-1 row-cols-sm-2 row-cols-xl-3 g-4">
31+
<div class="row row-cols-1 row-cols-sm-2 row-cols-lg-3 row-cols-xl-4 g-3">
5232
@foreach (var site in VisibleSites)
5333
{
5434
<div class="col" @key="site.Slug">
55-
<article class="card h-100 sc-gallery-card sc-card-hover" style="--sc-card-accent: @site.Accent;">
56-
<a class="sc-gallery-shot" href="@site.Url" tabindex="-1" aria-hidden="true">
57-
<ShowcaseShot Site="site" />
58-
</a>
59-
<div class="card-body d-flex flex-column">
60-
<div class="d-flex align-items-center gap-2 mb-2">
61-
<span class="sc-gallery-icon" aria-hidden="true"><Icon Name="@site.IconName" /></span>
62-
<span class="badge rounded-pill text-bg-light border">@site.Category</span>
35+
@* p-0: the library stylesheet pads every <article> from 641px up. *@
36+
<article class="card h-100 p-0 overflow-hidden sc-gallery-card sc-card-hover" style="--sc-card-accent: @site.Accent;">
37+
<div class="sc-gallery-stage px-3 pt-3 border-bottom">
38+
<div class="bg-body border border-bottom-0 rounded-top-2 overflow-hidden">
39+
<div class="sc-gallery-bar d-flex align-items-center gap-1 px-2 py-1 border-bottom" aria-hidden="true">
40+
<span class="sc-gallery-dot rounded-circle flex-shrink-0"></span>
41+
<span class="sc-gallery-dot rounded-circle flex-shrink-0"></span>
42+
<span class="sc-gallery-dot rounded-circle flex-shrink-0"></span>
43+
<span class="ms-1 text-body-secondary text-truncate">@site.Url</span>
44+
</div>
45+
<ShowcaseShot Site="site" Class="sc-gallery-shot" />
6346
</div>
64-
<h3 class="h5 fw-bold card-title mb-1">
65-
<a class="text-decoration-none text-body" href="@site.Url">@site.Name</a>
66-
</h3>
67-
<p class="card-text text-body-secondary mb-3">@site.Tagline</p>
68-
<ul class="sc-gallery-components list-unstyled d-flex flex-wrap gap-1 mb-3" aria-label="Components used">
69-
@foreach (var component in site.Components.Take(6))
47+
</div>
48+
<div class="card-body d-flex flex-column p-3">
49+
<p class="sc-gallery-category text-body-secondary fw-semibold mb-1">@site.Category</p>
50+
<h2 class="h6 fw-bold card-title mb-1">@site.Name</h2>
51+
<p class="card-text small text-body-secondary mb-2">@site.Summary</p>
52+
<ul class="list-unstyled d-flex flex-wrap gap-1 mb-2" aria-label="Components used">
53+
@foreach (var component in site.Components.Take(VisibleComponentCount))
7054
{
7155
<li><span class="badge bg-body-tertiary text-body-secondary border fw-medium">@component</span></li>
7256
}
73-
@if (site.Components.Count > 6)
57+
@if (site.Components.Count > VisibleComponentCount)
7458
{
75-
<li><span class="badge bg-body-tertiary text-body-secondary border fw-medium">+@(site.Components.Count - 6) more</span></li>
59+
<li>
60+
<span class="badge bg-body-tertiary text-body-secondary border fw-medium">
61+
+@(site.Components.Count - VisibleComponentCount)<span class="visually-hidden"> more: @string.Join(", ", site.Components.Skip(VisibleComponentCount))</span>
62+
</span>
63+
</li>
7664
}
7765
</ul>
78-
<div class="mt-auto d-flex gap-2">
79-
<a class="btn btn-primary btn-sm" href="@site.Url">Live demo <span class="visually-hidden">of @site.Name</span></a>
80-
<a class="btn btn-outline-secondary btn-sm" href="@site.DocsUrl" target="_blank" rel="noopener">How it's built <span class="visually-hidden">: @site.Name</span></a>
66+
<div class="mt-auto d-flex align-items-center justify-content-between gap-2 small">
67+
<a class="stretched-link fw-semibold text-decoration-none py-1" href="@site.Url">
68+
Live demo<span class="visually-hidden"> of @site.Name</span> <Icon Name="IconName.ArrowRight" aria-hidden="true" />
69+
</a>
70+
<a class="text-body-secondary position-relative z-2 py-1" href="@site.DocsUrl" target="_blank" rel="noopener">
71+
How it's built<span class="visually-hidden">: @site.Name</span>
72+
</a>
8173
</div>
8274
</div>
8375
</article>

‎BlazorBootstrap.Demo.RCL/Components/Pages/Showcase/Index.razor.cs‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ public partial class Index : ComponentBase
1212

1313
private const string AllCategories = "All";
1414

15+
private const int VisibleComponentCount = 3;
16+
1517
private readonly IReadOnlyList<string> categories =
1618
new[] { AllCategories }.Concat(ShowcaseCatalog.Sites.Select(site => site.Category).Distinct()).ToList();
1719

Lines changed: 29 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,44 @@
1-
.sc-gallery-hero {
2-
color: #fff;
3-
background:
4-
radial-gradient(ellipse at 15% 10%, rgba(167, 139, 250, .45), transparent 50%),
5-
radial-gradient(ellipse at 85% 30%, rgba(236, 72, 153, .35), transparent 45%),
6-
radial-gradient(ellipse at 60% 110%, rgba(14, 165, 233, .35), transparent 50%),
7-
#0f0a1f;
1+
/* A solid focus ring with at least 3:1 contrast in both color modes. */
2+
a:focus-visible {
3+
outline: 2px solid var(--sc-primary);
4+
outline-offset: 2px;
5+
border-radius: .25rem;
86
}
97

10-
.sc-gallery-hero .lead {
11-
color: #e9e5ff;
12-
}
13-
14-
.sc-gallery-kicker {
15-
display: inline-block;
16-
padding: .25rem .75rem;
17-
border-radius: 999px;
18-
font-size: .8125rem;
19-
font-weight: 700;
20-
letter-spacing: .06em;
21-
text-transform: uppercase;
22-
background: rgba(255, 255, 255, .12);
23-
color: #ede9fe;
8+
.sc-gallery-card {
9+
border-color: var(--bs-border-color-translucent);
2410
}
2511

26-
.sc-gallery-stats dt {
27-
font-size: .75rem;
28-
font-weight: 600;
29-
letter-spacing: .06em;
30-
text-transform: uppercase;
31-
color: #c4b5fd;
32-
}
12+
.sc-gallery-card:focus-within {
13+
box-shadow: 0 0 0 .25rem rgba(var(--sc-primary-rgb), .35);
14+
}
3315

34-
.sc-gallery-stats dd {
35-
font-size: 1.75rem;
36-
font-weight: 800;
37-
margin: 0;
16+
/* The panel behind the browser frame, tinted with the site's accent color. */
17+
.sc-gallery-stage {
18+
background: var(--bs-tertiary-bg);
19+
background: color-mix(in srgb, var(--sc-card-accent) 14%, var(--bs-body-bg));
3820
}
3921

40-
.sc-gallery-filters {
41-
display: flex;
42-
flex-wrap: wrap;
43-
gap: .375rem;
22+
[data-bs-theme=dark] .sc-gallery-stage {
23+
background: color-mix(in srgb, var(--sc-card-accent) 26%, var(--bs-body-bg));
4424
}
4525

46-
.sc-gallery-card {
47-
overflow: hidden;
48-
border-color: var(--bs-border-color-translucent);
49-
border-top: 4px solid var(--sc-card-accent);
26+
.sc-gallery-bar {
27+
font-size: .6875rem;
28+
line-height: 1.2;
5029
}
5130

52-
.sc-gallery-card:focus-within {
53-
box-shadow: 0 0 0 .25rem rgba(var(--sc-primary-rgb), .35);
54-
}
31+
.sc-gallery-dot {
32+
width: .375rem;
33+
height: .375rem;
34+
background: color-mix(in srgb, var(--sc-card-accent) 60%, var(--bs-body-bg));
35+
}
5536

56-
.sc-gallery-shot {
57-
display: block;
58-
border-bottom: 1px solid var(--bs-border-color-translucent);
37+
.sc-gallery-category {
38+
font-size: .75rem;
5939
}
6040

61-
.sc-gallery-icon {
62-
display: inline-flex;
63-
align-items: center;
64-
justify-content: center;
65-
width: 2rem;
66-
height: 2rem;
67-
border-radius: .5rem;
68-
color: #fff;
69-
background: var(--sc-card-accent);
41+
/* The top of the 16:10 screenshot, as a browser window would show it. */
42+
.sc-gallery-card ::deep .sc-gallery-shot {
43+
aspect-ratio: 16 / 9;
7044
}

‎BlazorBootstrap.Demo.RCL/Models/Showcase/ShowcaseSite.cs‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ namespace BlazorBootstrap.Demo.RCL.Models.Showcase;
55
/// </summary>
66
/// <param name="Slug">Stable kebab-case route segment under <c>/showcase</c>.</param>
77
/// <param name="Name">Display name.</param>
8-
/// <param name="Tagline">One-line description shown on the gallery card.</param>
8+
/// <param name="Tagline">One-sentence description shown on the home page.</param>
9+
/// <param name="Summary">Short summary shown on the gallery card.</param>
910
/// <param name="Category">Gallery grouping, such as "SaaS" or "Industry".</param>
1011
/// <param name="IconName">Bootstrap icon shown when no screenshot is available.</param>
1112
/// <param name="Accent">CSS color used for the card accent and placeholder.</param>
@@ -15,6 +16,7 @@ public sealed record ShowcaseSite(
1516
string Slug,
1617
string Name,
1718
string Tagline,
19+
string Summary,
1820
string Category,
1921
IconName IconName,
2022
string Accent,

‎BlazorBootstrap.Demo.RCL/Services/Showcase/ShowcaseCatalog.cs‎

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,27 +13,27 @@ public static class ShowcaseCatalog
1313

1414
private static readonly IReadOnlyList<ShowcaseSite> sites = new List<ShowcaseSite>
1515
{
16-
new("ai-assistant", "AI Assistant Workspace", "Members chat with streaming answers, attachments, and a prompt library; workspace admins manage members, shared prompts, usage, and model policy.", "SaaS", IconName.Stars, "#7c3aed", "AiAssistant",
16+
new("ai-assistant", "AI Assistant Workspace", "Members chat with streaming answers, attachments, and a prompt library; workspace admins manage members, shared prompts, usage, and model policy.", "Chat, prompt library, and workspace admin", "SaaS", IconName.Stars, "#7c3aed", "AiAssistant",
1717
new[] { "Markdown", "Offcanvas", "Sidebar", "Modal", "Charts", "Placeholders", "Progress", "Avatar", "Form inputs" }),
18-
new("saas", "SaaS Product", "Public site, trial sign-up, a customer workspace with team and billing, and an operator console.", "SaaS", IconName.Lightning, "#db2777", "Saas",
18+
new("saas", "SaaS Product", "Public site, trial sign-up, a customer workspace with team and billing, and an operator console.", "Trials, team billing, and operator console", "SaaS", IconName.Lightning, "#db2777", "Saas",
1919
new[] { "Sidebar", "Charts", "Card", "Switch", "Accordion", "Modal", "Progress", "Dropdown", "Form inputs" }),
20-
new("ecommerce", "E-commerce Storefront", "Shoppers filter the catalog, review products, check out with a test card, and track orders and returns; the retailer fulfils orders and manages products, prices, coupons, returns, reviews, and analytics.", "Commerce", IconName.Bag, "#ea580c", "Ecommerce",
20+
new("ecommerce", "E-commerce Storefront", "Shoppers filter the catalog, review products, check out with a test card, and track orders and returns; the retailer fulfils orders and manages products, prices, coupons, returns, reviews, and analytics.", "Shop, checkout, and retailer back office", "Commerce", IconName.Bag, "#ea580c", "Ecommerce",
2121
new[] { "Carousel", "Card", "RatingInput", "RangeInput", "Offcanvas", "Sidebar", "Grid", "Tabs", "Timeline", "Charts", "Form inputs", "Pagination", "Toasts" }),
22-
new("project-board", "Project & Client Board", "Team members work tasks on boards; project managers run projects, workload, the roadmap, and reports; account managers handle clients, the deal pipeline, and the forecast.", "SaaS", IconName.Kanban, "#4f46e5", "ProjectBoard",
22+
new("project-board", "Project & Client Board", "Team members work tasks on boards; project managers run projects, workload, the roadmap, and reports; account managers handle clients, the deal pipeline, and the forecast.", "Task boards, roadmap, and deal pipeline", "SaaS", IconName.Kanban, "#4f46e5", "ProjectBoard",
2323
new[] { "SortableList", "MindMap", "Sidebar", "Charts", "Modal", "Progress", "Form inputs" }),
24-
new("fintech", "Personal Finance", "Customers bank with a one-time-code sign-in, transfers, payees, and disputes; operations review held transfers and disputes.", "Industry", IconName.Wallet2, "#059669", "Fintech",
24+
new("fintech", "Personal Finance", "Customers bank with a one-time-code sign-in, transfers, payees, and disputes; operations review held transfers and disputes.", "Banking, transfers, and dispute review", "Industry", IconName.Wallet2, "#059669", "Fintech",
2525
new[] { "Sidebar", "Charts", "CurrencyInput", "Progress", "Modal", "Alert", "Form inputs" }),
26-
new("healthcare", "Healthcare Clinic Portal", "Patients book visits, read records and lab reports, and pay bills; doctors run visits, charts, and lab results; the front desk checks patients in and keeps doctors' hours.", "Industry", IconName.HeartPulse, "#0891b2", "Healthcare",
26+
new("healthcare", "Healthcare Clinic Portal", "Patients book visits, read records and lab reports, and pay bills; doctors run visits, charts, and lab results; the front desk checks patients in and keeps doctors' hours.", "Appointments, records, and front desk", "Industry", IconName.HeartPulse, "#0891b2", "Healthcare",
2727
new[] { "PdfViewer", "GoogleMap", "Sidebar", "Tabs", "Modal", "Form inputs" }),
28-
new("learning", "Online Learning", "Learners enroll, take scored quizzes, ask questions, and earn verifiable certificates; instructors build and publish courses and quizzes, answer questions, and reply to reviews.", "Industry", IconName.Mortarboard, "#ca8a04", "Learning",
28+
new("learning", "Online Learning", "Learners enroll, take scored quizzes, ask questions, and earn verifiable certificates; instructors build and publish courses and quizzes, answer questions, and reply to reviews.", "Courses, quizzes, and certificates", "Industry", IconName.Mortarboard, "#ca8a04", "Learning",
2929
new[] { "Card", "Accordion", "Progress", "Markdown", "RichTextEditor", "PdfViewer", "Sidebar", "Charts", "Modal" }),
30-
new("travel", "Travel & Stay Booking", "Guests search, book, and manage trips; hosts answer requests and run calendars, listings, inbox, reviews, and earnings.", "Industry", IconName.Airplane, "#0284c7", "Travel",
30+
new("travel", "Travel & Stay Booking", "Guests search, book, and manage trips; hosts answer requests and run calendars, listings, inbox, reviews, and earnings.", "Stay search, booking, and hosting", "Industry", IconName.Airplane, "#0284c7", "Travel",
3131
new[] { "GoogleMap", "Carousel", "Sidebar", "Charts", "DateInput", "RatingInput", "Modal", "Form inputs" }),
32-
new("help-desk", "Help Desk & Ticketing", "Help center for customers, an agent desk with SLAs and saved replies, knowledge base authoring, reports, and admin.", "Industry", IconName.Headset, "#dc2626", "HelpDesk",
32+
new("help-desk", "Help Desk & Ticketing", "Help center for customers, an agent desk with SLAs and saved replies, knowledge base authoring, reports, and admin.", "Help center, agent desk, and reports", "Industry", IconName.Headset, "#dc2626", "HelpDesk",
3333
new[] { "Sidebar", "Charts", "RichTextEditor", "Modal", "Tabs", "Badge", "Breadcrumb", "Toasts" }),
34-
new("monitoring", "IoT & DevOps Monitoring", "A public status page with history and subscriptions; engineers work incidents, publish updates, follow live logs and traces, and share on-call.", "Industry", IconName.Activity, "#16a34a", "Monitoring",
34+
new("monitoring", "IoT & DevOps Monitoring", "A public status page with history and subscriptions; engineers work incidents, publish updates, follow live logs and traces, and share on-call.", "Status page, incidents, and live logs", "Industry", IconName.Activity, "#16a34a", "Monitoring",
3535
new[] { "Charts", "Sidebar", "Progress", "Alert", "Callout", "Modal", "Tooltip", "Toasts" }),
36-
new("hr-portal", "HR & Employee Portal", "Employees find colleagues, request leave, and work through onboarding; managers approve leave and follow new hires; HR admins manage people, leave policies, onboarding templates, and headcount analytics.", "Extras", IconName.People, "#9333ea", "HrPortal",
36+
new("hr-portal", "HR & Employee Portal", "Employees find colleagues, request leave, and work through onboarding; managers approve leave and follow new hires; HR admins manage people, leave policies, onboarding templates, and headcount analytics.", "Directory, leave, and onboarding", "Extras", IconName.People, "#9333ea", "HrPortal",
3737
new[] { "MindMap", "Sidebar", "Charts", "Modal", "Progress", "Form inputs" }),
3838
};
3939

0 commit comments

Comments
 (0)