Pārlūkot izejas kodu

simplified color picker

master
Flo Smilari pirms 4 gadiem
vecāks
revīzija
3a34c28151

+ 1
- 1
CaritasPWA.csproj.user Parādīt failu

</PropertyGroup> </PropertyGroup>
<PropertyGroup> <PropertyGroup>
<ActiveDebugProfile>CaritasPWA</ActiveDebugProfile> <ActiveDebugProfile>CaritasPWA</ActiveDebugProfile>
<NameOfLastUsedPublishProfile>FolderProfile</NameOfLastUsedPublishProfile>
<NameOfLastUsedPublishProfile>IISProfile</NameOfLastUsedPublishProfile>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<EmbeddedResource Update="Shared\ResourceFiles\Resources.it.resx"> <EmbeddedResource Update="Shared\ResourceFiles\Resources.it.resx">

+ 37
- 18
Pages/CaritasServiceFundVeloKeyDataPage.razor Parādīt failu

<div class="mat-layout-grid-cell mat-layout-grid-cell-span-4-phone mat-layout-grid-cell-span-8-tablet mat-layout-grid-cell-span-4-desktop"> <div class="mat-layout-grid-cell mat-layout-grid-cell-span-4-phone mat-layout-grid-cell-span-8-tablet mat-layout-grid-cell-span-4-desktop">
<div class="mat-layout-grid-inner"> <div class="mat-layout-grid-inner">
<div class="mat-layout-grid-cell mat-layout-grid-cell-span-12-phone mat-layout-grid-cell-span-4-tablet mat-layout-grid-cell-span-12-desktop"> <div class="mat-layout-grid-cell mat-layout-grid-cell-span-12-phone mat-layout-grid-cell-span-4-tablet mat-layout-grid-cell-span-12-desktop">
<MatButton Class="btn btn-light w-100 mdc-text-field--outlined" @onclick="OpenModal">
<div style="background-color:@color" class="buttonColor"></div> @i18n["Color"]
</MatButton>
<ColorPicker Title="My Blazor ColorPicker" IsOpened="isOpened" Closed="ClosedEvent" MyColor="@color">
</ColorPicker>
<MatSelectValue FullWidth="true" Outlined="true" Label="@i18n["Color"]" @bind-Value="colorValue" Items="@colorItems" ValueSelector="@(i=>i.RGB)">
<ChildContent>
<span>@colorValue</span>
@*<span>@selectedColor?.RGB</span>*@
</ChildContent>
<ItemTemplate>
<div>
<span class="btn-sm" style="background-color:rgb(@context.RGB);
display:initial;
border:1px solid black;
box-shadow:0.2em 0.2em 0.3em 0.025em #3f4244" />
<span class="btn">@context?.Name</span>
</div>
</ItemTemplate>
</MatSelectValue>
</div> </div>
<div class="mat-layout-grid-cell mat-layout-grid-cell-span-12-phone mat-layout-grid-cell-span-4-tablet mat-layout-grid-cell-span-12-desktop"> <div class="mat-layout-grid-cell mat-layout-grid-cell-span-12-phone mat-layout-grid-cell-span-4-tablet mat-layout-grid-cell-span-12-desktop">
<MatStringField Class="w-100 form-check-label" Label="@i18n["Brand"]" Outlined="true" type="text"></MatStringField> <MatStringField Class="w-100 form-check-label" Label="@i18n["Brand"]" Outlined="true" type="text"></MatStringField>
</div> </div>
<div class="mat-layout-grid-cell mat-layout-grid-cell-span-12-phone mat-layout-grid-cell-span-4-tablet mat-layout-grid-cell-span-12-desktop"> <div class="mat-layout-grid-cell mat-layout-grid-cell-span-12-phone mat-layout-grid-cell-span-4-tablet mat-layout-grid-cell-span-12-desktop">
<MatSelect Class="w-100" Label="@i18n["Type"]" @bind-Value="value">
<MatSelect Class="w-100" Outlined="true" Label="@i18n["Type"]" @bind-Value="value">
<MatOptionString></MatOptionString> <MatOptionString></MatOptionString>
<MatOptionString Value="Mountain-Bike">Mountain-Bike</MatOptionString> <MatOptionString Value="Mountain-Bike">Mountain-Bike</MatOptionString>
<MatOptionString Value="City-Bike">City-Bike</MatOptionString> <MatOptionString Value="City-Bike">City-Bike</MatOptionString>
public string FromRoute { get; set; } public string FromRoute { get; set; }
string value; string value;
bool isOpened = false;
string color = "#F1F7E9";
void OpenModal() {
isOpened = true;
}
void ClosedEvent(string value) {
color = value;
isOpened = false;
}
string colorValue;
ColorItem selectedColor;
private void Next() { private void Next() {
NavigationManager.NavigateTo("account/" + @FromRoute); NavigationManager.NavigateTo("account/" + @FromRoute);
NavigationManager.NavigateTo("caritas_services"); NavigationManager.NavigateTo("caritas_services");
} }
ColorItem[] colorItems = new[] {
new ColorItem(3, "Blue","0,0,255"),
new ColorItem(14, "Brown", "165,42,42"),
new ColorItem(4, "Yellow", "255, 255, 0"),
};
class ColorItem {
public int Index { get; }
public string Name { get; }
public string RGB { get; }
public ColorItem(int index, string name, string rgb) {
Index = index;
Name = name;
RGB = rgb;
}
}
} }

+ 2
- 2
Pages/CaritasServiceFundVeloLostFoundPage.razor Parādīt failu

<div class="mat-layout-grid-cell mat-layout-grid-cell-span-2"> <div class="mat-layout-grid-cell mat-layout-grid-cell-span-2">
<MatCard Class="demo-mat-card"> <MatCard Class="demo-mat-card">
<MatCardContent> <MatCardContent>
<MatCardMedia Square="true" ImageUrl="/images/batch_found.png" @onclick="Found"></MatCardMedia>
<MatCardMedia Square="true" ImageUrl="./images/batch_found.png" @onclick="Found"></MatCardMedia>
</MatCardContent> </MatCardContent>
</MatCard> </MatCard>
</div> </div>
<div class="mat-layout-grid-cell mat-layout-grid-cell-span-2"> <div class="mat-layout-grid-cell mat-layout-grid-cell-span-2">
<MatCard Class="demo-mat-card"> <MatCard Class="demo-mat-card">
<MatCardContent> <MatCardContent>
<MatCardMedia Square="true" ImageUrl="/images/batch_missing.png" @onclick="Missing"></MatCardMedia>
<MatCardMedia Square="true" ImageUrl="./images/batch_missing.png" @onclick="Missing"></MatCardMedia>
</MatCardContent> </MatCardContent>
</MatCard> </MatCard>
</div> </div>

+ 3
- 3
Pages/CaritasServicesPage.razor Parādīt failu

<div class="mat-layout-grid-cell mat-layout-grid-cell-span-2-phone mat-layout-grid-cell-span-3-tablet mat-layout-grid-cell-span-4-desktop"> <div class="mat-layout-grid-cell mat-layout-grid-cell-span-2-phone mat-layout-grid-cell-span-3-tablet mat-layout-grid-cell-span-4-desktop">
<MatCard class="demo-mat-card"> <MatCard class="demo-mat-card">
<MatCardContent> <MatCardContent>
<MatCardMedia Square="true" ImageUrl="/images/batch_kulturlegi.png"></MatCardMedia>
<MatCardMedia Square="true" ImageUrl="./images/batch_kulturlegi.png"></MatCardMedia>
</MatCardContent> </MatCardContent>
</MatCard> </MatCard>
</div> </div>
<div class="mat-layout-grid-cell mat-layout-grid-cell-span-2-phone mat-layout-grid-cell-span-3-tablet mat-layout-grid-cell-span-4-desktop"> <div class="mat-layout-grid-cell mat-layout-grid-cell-span-2-phone mat-layout-grid-cell-span-3-tablet mat-layout-grid-cell-span-4-desktop">
<MatCard class="demo-mat-card"> <MatCard class="demo-mat-card">
<MatCardContent> <MatCardContent>
<MatCardMedia Square="true" ImageUrl="/images/batch_markt.png"></MatCardMedia>
<MatCardMedia Square="true" ImageUrl="./images/batch_markt.png"></MatCardMedia>
</MatCardContent> </MatCardContent>
</MatCard> </MatCard>
<div class="mat-layout-grid-cell mat-layout-grid-cell-span-2-phone mat-layout-grid-cell-span-3-tablet mat-layout-grid-cell-span-4-desktop"> <div class="mat-layout-grid-cell mat-layout-grid-cell-span-2-phone mat-layout-grid-cell-span-3-tablet mat-layout-grid-cell-span-4-desktop">
<MatCard class="demo-mat-card"> <MatCard class="demo-mat-card">
<MatCardContent> <MatCardContent>
<MatCardMedia Square="true" ImageUrl="/images/batch_fundvelo.png" @onclick="Next"></MatCardMedia>
<MatCardMedia Square="true" ImageUrl="./images/batch_fundvelo.png" @onclick="Next"></MatCardMedia>
</MatCardContent> </MatCardContent>
</MatCard> </MatCard>
</div> </div>

+ 1
- 1
Pages/DoneImage.razor Parādīt failu

@page "/doneimage" @page "/doneimage"
<div class="text-center"> <div class="text-center">
<img src="/images/done.png" class="w-50" />
<img src="./images/done.png" class="w-50" />
</div> </div>
@code { @code {

+ 1
- 1
Pages/IndexPage.razor Parādīt failu

<div class="row h-100 justify-content-center"> <div class="row h-100 justify-content-center">
<div class="row d-flex align-items-center justify-content-center px-4 w-100"> <div class="row d-flex align-items-center justify-content-center px-4 w-100">
<img src="/images/caritas_logo.png" style="padding:1em;max-width:320px" class="w-100">
<img src="./images/caritas_logo.png" style="padding:1em;max-width:320px" class="w-100">
</div> </div>
<div class="row align-items-center vw-100 h-75"> <div class="row align-items-center vw-100 h-75">

+ 2
- 2
Pages/InfoPage.razor Parādīt failu

<div class="row px-3 h-100"> <div class="row px-3 h-100">
<div class="text-center w-100"> <div class="text-center w-100">
<img class="w-100" src="/images/caritas_logo.png" style="padding:1em;max-width:320px" />
<img class="w-100" src="./images/caritas_logo.png" style="padding:1em;max-width:320px" />
</div> </div>
<div class="row no-gutters align-items-center w-100"> <div class="row no-gutters align-items-center w-100">
<table class="w-100"> <table class="w-100">
</tr> </tr>
<tr> <tr>
<td class="text-right"> <td class="text-right">
<img src="/images/integrate_logo.png" style="max-width:200px"/>
<img src="./images/integrate_logo.png" style="max-width:200px"/>
</td> </td>
</tr> </tr>
<tr> <tr>

Binārs
wwwroot/icons/icon-60@3x.png Parādīt failu


+ 1
- 1
wwwroot/index.html Parādīt failu

<link href="css/united/_variables.min.css" rel="stylesheet" /> <link href="css/united/_variables.min.css" rel="stylesheet" />
<link href="css/app.css" rel="stylesheet" /> <link href="css/app.css" rel="stylesheet" />
<link href="manifest.json" rel="manifest" /> <link href="manifest.json" rel="manifest" />
<link rel="apple-touch-icon" sizes="96x96" href="/icons/icon-96.png" />
<link rel="apple-touch-icon" href="/icons/icon-60@3x.png" />
<meta name="apple-mobile-web-app-status-bar" content="#db001b"> <meta name="apple-mobile-web-app-status-bar" content="#db001b">
<meta name="theme-color" content="#db001b"> <meta name="theme-color" content="#db001b">
</head> </head>

+ 1
- 1
wwwroot/manifest.json Parādīt failu

"short_name": "CaritasPWA", "short_name": "CaritasPWA",
"start_url": "./", "start_url": "./",
"display": "standalone", "display": "standalone",
"background_color": "#db001b",
"background_color": "#ffffff",
"theme_color": "#db001b", "theme_color": "#db001b",
"orientation": "portrait-primary", "orientation": "portrait-primary",
"icons": [ "icons": [

Notiek ielāde…
Atcelt
Saglabāt