|
2 | 2 | @inject BcssService Bc
|
3 | 3 | @inject NavigationManager NavigationManager
|
4 | 4 |
|
5 |
| -<MudText>BCSS</MudText> |
| 5 | +<MudContainer Class="@Bc["h-40vh d-flex flex-column justify-center align-center"]"> |
| 6 | + <MudText Style="font-weight:700" Typo="Typo.h3" Color="Color.Primary"><b>BCSS</b></MudText> |
| 7 | + <MudText Typo="Typo.h6" Color="Color.Primary">by CodeBeam</MudText> |
| 8 | + <MudText Class="mt-4" Align="Align.Center" Color="Color.Primary">Revolutionary runtime CSS generator for Blazor.</MudText> |
| 9 | + <MudButton Class="mt-8" Variant="Variant.Outlined" Color="Color.Primary" Href="/gettingstarted">GET STARTED</MudButton> |
| 10 | +</MudContainer> |
6 | 11 |
|
7 |
| -<MudPaper Class="@Bc[_cssString]" Width="200px" Height="200px" tabindex="1"> |
| 12 | +<MudContainer Class="@Bc["hmin-60vh"]"> |
| 13 | + <MudGrid> |
| 14 | + <MudItem xs="12" sm="6" md="4"> |
| 15 | + <BcssCard Icon="@Icons.Material.Filled.Public" Header="OpenSource" Description="BCSS is open source and free forever with MIT license." /> |
| 16 | + </MudItem> |
| 17 | + <MudItem xs="12" sm="6" md="4"> |
| 18 | + <BcssCard Icon="@Icons.Material.Filled.Assistant" Header="Dynamic" Description="All content can be created and changed on runtime." /> |
| 19 | + </MudItem> |
| 20 | + <MudItem xs="12" sm="6" md="4"> |
| 21 | + <BcssCard Icon="@Icons.Material.Filled.Pages" Header="Optimized" Description="Not allowed any repeated values and unnecessary render cycles for the best performance." /> |
| 22 | + </MudItem> |
| 23 | + <MudItem xs="12" sm="6" md="4"> |
| 24 | + <BcssCard Icon="@Icons.Material.Filled.AutoStories" Header="Smart Usage" Description="Easy to learn and use. Does not require advanced CSS knowledge." /> |
| 25 | + </MudItem> |
| 26 | + <MudItem xs="12" sm="6" md="4"> |
| 27 | + <BcssCard Icon="@Icons.Material.Filled.MobileFriendly" Header="Mobile Friendly" Description="Suits for responsive design." /> |
| 28 | + </MudItem> |
| 29 | + <MudItem xs="12" sm="6" md="4"> |
| 30 | + <BcssCard Icon="@Icons.Material.Filled.Code" Header="C#" Description="Not needed to work any css or scss content files. Possible to work with C# variables." /> |
| 31 | + </MudItem> |
| 32 | + </MudGrid> |
| 33 | + |
| 34 | +</MudContainer> |
8 | 35 |
|
9 |
| -</MudPaper> |
| 36 | +<MudContainer Class="@Bc["hmin-80vh mt-32"]"> |
| 37 | + <MudText Typo="Typo.h4" Color="Color.Primary">PlayGround</MudText> |
| 38 | + <MudText Typo="Typo.body1">Try the BCSS abilities and re-style the box.</MudText> |
10 | 39 |
|
11 | 40 |
|
12 |
| - <MudPaper Class="w-500" Width="200px" Height="200px" tabindex="1"> |
| 41 | + <MudGrid Class="@Bc["mud-width-full mud-height-full mt-32"]"> |
| 42 | + <MudItem xs="12" sm="8" Class="d-flex align-center justify-center"> |
| 43 | + <MudPaper Class="@Bc[_cssString]" Width="200px" Height="200px" tabindex="1" /> |
| 44 | + </MudItem> |
13 | 45 |
|
14 |
| - </MudPaper> |
| 46 | + <MudItem xs="12" sm="4"> |
| 47 | + <MudTextFieldExtended @bind-Value="_cssString" Lines="4" Variant="Variant.Outlined" Label="Bcss Class" Immediate="true"> |
| 48 | + <AdornmentEnd> |
| 49 | + <MudTooltip Text="Generate" Delay="300"> |
| 50 | + <MudIconButton Icon="@Icons.Material.Filled.Loop" OnClick="Generate" /> |
| 51 | + </MudTooltip> |
| 52 | + </AdornmentEnd> |
| 53 | + </MudTextFieldExtended> |
| 54 | + </MudItem> |
| 55 | + </MudGrid> |
| 56 | +</MudContainer> |
15 | 57 |
|
16 |
| - |
17 |
| -<MudTextField @bind-Value="_cssString" Immediate="true" /> |
18 |
| - |
19 |
| -<MudButton OnClick="StateHasChanged">Refresh</MudButton> |
20 |
| -<MudButton OnClick="@(() => NavigationManager.NavigateTo("/testpage"))">Go To Second Page</MudButton> |
| 58 | +<MudContainer Class="@Bc["hmin-60vh d-flex flex-column align-center justify-start"]"> |
| 59 | + <MudText Typo="Typo.h3" Align="Align.Center">Like It?</MudText> |
| 60 | + <MudText>Learn the Fundamentals</MudText> |
| 61 | + <div class="mud-width-full d-flex flex-wrap justify-center gap-4 mt-8"> |
| 62 | + <MudButton Variant="Variant.Outlined">Syntax</MudButton> |
| 63 | + <MudButton Variant="Variant.Outlined">Usage</MudButton> |
| 64 | + </div> |
| 65 | +</MudContainer> |
21 | 66 |
|
22 | 67 | @code {
|
23 |
| - string _cssString = "bg-blue w-400"; |
24 |
| - protected override void OnInitialized() |
| 68 | + string _cssString = ""; |
| 69 | + string[] _possibleWidth = new string[] { "w-100", "w-125", "w-150", "w-175", "w-200", "w-225", "w-250", "w-275", "w-300" }; |
| 70 | + string[] _possibleHeight = new string[] { "h-100", "h-125", "h-150", "h-175", "h-200", "h-225", "h-250", "h-275", "h-300" }; |
| 71 | + string[] _possibleColors = new string[] { "bg-purple", "bg-blue", "bg-red", "bg-green", "bg-[#123456]", "bg-[#efefef]" }; |
| 72 | + string[] _possibleRounded = new string[] { "r-0", "r-10", "r-20", "r-30", "r-40", "r-50" }; |
| 73 | + string[] _possibleBorders = new string[] { "", "b--8px-solid-yellow", "b--8px-dotted-yellow", "b--4px-dashed-yellow" }; |
| 74 | + |
| 75 | + private void Generate() |
25 | 76 | {
|
26 |
| - Bc.Add("w-500"); |
| 77 | + Random rnd = new(); |
| 78 | + int val = rnd.Next(0, 9); |
| 79 | + _cssString = _possibleWidth[val]; |
| 80 | + val = rnd.Next(0, 9); |
| 81 | + _cssString += $" {_possibleHeight[val]}"; |
| 82 | + val = rnd.Next(0, 5); |
| 83 | + _cssString += $" {_possibleColors[val]}"; |
| 84 | + val = rnd.Next(0, 6); |
| 85 | + _cssString += $" {_possibleRounded[val]}"; |
| 86 | + val = rnd.Next(0, 4); |
| 87 | + _cssString += $" {_possibleBorders[val]}"; |
27 | 88 | }
|
28 | 89 | }
|
0 commit comments