forked from remi.arnal/blazor
parent
bfd897fb3e
commit
9ae5999729
@ -0,0 +1,25 @@
|
||||
**/.classpath
|
||||
**/.dockerignore
|
||||
**/.env
|
||||
**/.git
|
||||
**/.gitignore
|
||||
**/.project
|
||||
**/.settings
|
||||
**/.toolstarget
|
||||
**/.vs
|
||||
**/.vscode
|
||||
**/*.*proj.user
|
||||
**/*.dbmdl
|
||||
**/*.jfm
|
||||
**/azds.yaml
|
||||
**/bin
|
||||
**/charts
|
||||
**/docker-compose*
|
||||
**/Dockerfile*
|
||||
**/node_modules
|
||||
**/npm-debug.log
|
||||
**/obj
|
||||
**/secrets.dev.yaml
|
||||
**/values.dev.yaml
|
||||
LICENSE
|
||||
README.md
|
@ -0,0 +1,51 @@
|
||||
<CascadingValue Value="@this">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
|
||||
<div>Available items:</div>
|
||||
<div>
|
||||
<div class="css-grid">
|
||||
|
||||
@foreach (var item in Items)
|
||||
{
|
||||
<CraftingItem Item="item" NoDrop="true"/>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-6">
|
||||
<div>Recipe</div>
|
||||
|
||||
<div>
|
||||
|
||||
<div class="css-recipe">
|
||||
<CraftingItem Index="0"/>
|
||||
<CraftingItem Index="1"/>
|
||||
<CraftingItem Index="2"/>
|
||||
<CraftingItem Index="3"/>
|
||||
<CraftingItem Index="4"/>
|
||||
<CraftingItem Index="5"/>
|
||||
<CraftingItem Index="6"/>
|
||||
<CraftingItem Index="7"/>
|
||||
<CraftingItem Index="8"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>Result</div>
|
||||
<div>
|
||||
<CraftingItem Item="RecipeResult"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-12">
|
||||
<div>Actions</div>
|
||||
<div class="actions" id="actions">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</CascadingValue>
|
@ -0,0 +1,15 @@
|
||||
@using Blazor.Models
|
||||
<div
|
||||
class="item"
|
||||
ondragover="event.preventDefault();"
|
||||
draggable="true"
|
||||
@ondragstart="@OnDragStart"
|
||||
@ondrop="@OnDrop"
|
||||
@ondragenter="@OnDragEnter"
|
||||
@ondragleave="@OnDragLeave">
|
||||
|
||||
@if (Item != null)
|
||||
{
|
||||
<img src="data:image/png;base64,@(Item.ImageBase64)" class="img-thumbnail" title="@Item.DisplayName" alt="@Item.DisplayName" style="width: 64px; height: 64px"/>
|
||||
}
|
||||
</div>
|
@ -0,0 +1,22 @@
|
||||
#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.
|
||||
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base
|
||||
WORKDIR /app
|
||||
EXPOSE 80
|
||||
EXPOSE 443
|
||||
|
||||
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
|
||||
WORKDIR /src
|
||||
COPY ["Blazor/Blazor.csproj", "Blazor/"]
|
||||
RUN dotnet restore "Blazor/Blazor.csproj"
|
||||
COPY . .
|
||||
WORKDIR "/src/Blazor"
|
||||
RUN dotnet build "Blazor.csproj" -c Release -o /app/build
|
||||
|
||||
FROM build AS publish
|
||||
RUN dotnet publish "Blazor.csproj" -c Release -o /app/publish
|
||||
|
||||
FROM base AS final
|
||||
WORKDIR /app
|
||||
COPY --from=publish /app/publish .
|
||||
ENTRYPOINT ["dotnet", "Blazor.dll"]
|
@ -1,31 +1,5 @@
|
||||
@page "/"
|
||||
@using System.Globalization
|
||||
@using Blazor.Components
|
||||
|
||||
|
||||
<PageTitle>Index</PageTitle>
|
||||
|
||||
<h1>Hello, world!</h1>
|
||||
|
||||
Welcome to your new app.
|
||||
|
||||
<SurveyPrompt Title="How is Blazor working for you?" />
|
||||
|
||||
<p>
|
||||
<b>CurrentCulture</b>: @CultureInfo.CurrentCulture
|
||||
</p>
|
||||
|
||||
|
||||
<Card Item="CakeItem" Context="cakeContext">
|
||||
<CardHeader>
|
||||
<div class="card-header">
|
||||
Cake Token Number - @cakeContext.Id
|
||||
</div>
|
||||
</CardHeader>
|
||||
<CardBody>
|
||||
<div class="card-body">
|
||||
<div>@cakeContext.Name</div>
|
||||
<div>$ @cakeContext.Cost</div>
|
||||
</div>
|
||||
</CardBody>
|
||||
</Card>
|
||||
@using Blazor.Components;
|
||||
<div>
|
||||
<Crafting Items="Items" Recipes="Recipes" />
|
||||
</div>
|
||||
|
@ -0,0 +1,28 @@
|
||||
@typeparam TItem
|
||||
@using System.Diagnostics.CodeAnalysis
|
||||
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>@TableHeader</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var item in Items)
|
||||
{
|
||||
if (RowTemplate is not null)
|
||||
{
|
||||
<tr>@RowTemplate(item)</tr>
|
||||
}
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
@code {
|
||||
[Parameter]
|
||||
public RenderFragment? TableHeader { get; set; }
|
||||
|
||||
[Parameter]
|
||||
public RenderFragment<TItem>? RowTemplate { get; set; }
|
||||
|
||||
[Parameter, AllowNull]
|
||||
public IReadOnlyList<TItem> Items { get; set; }
|
||||
}
|
Loading…
Reference in new issue