PIAPS_CW/WebApp/Pages/Index.cshtml

79 lines
3.6 KiB
Plaintext
Raw Normal View History

2024-06-25 15:03:16 +04:00
@page
@model WebApp.Pages.IndexModel
2024-05-09 17:45:03 +04:00
@{
2024-06-25 15:03:16 +04:00
ViewData["Title"] = "Catalog Page";
2024-05-09 17:45:03 +04:00
}
<!-- Шапка -->
<nav class="navbar navbar-expand-lg navbar-light bg-light">
2024-06-25 15:03:16 +04:00
<div class="container">
<a class="navbar-brand" href="#">Catalog</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdownMenuLink" role="button" data-bs-toggle="dropdown" aria-expanded="false">
2024-06-25 20:26:34 +04:00
Category
2024-06-25 15:03:16 +04:00
</a>
@* МОЖНО РЕАЛИЗОВАТЬ ПОЗЖЕ *@
<ul class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
2024-06-25 20:26:34 +04:00
<li><a class="dropdown-item" href="#">Pistols</a></li>
<li><a class="dropdown-item" href="#">Rifles</a></li>
<li><a class="dropdown-item" href="#">Hard Weapons</a></li>
2024-06-25 15:03:16 +04:00
</ul>
</li>
</ul>
<form class="d-flex" method="get">
2024-06-25 20:26:34 +04:00
<input asp-for="ProductsModel" type="search" placeholder="Поиск" name="search" value="">
<button class="btn btn-outline-success" type="submit"><i class="fas fa-search"></i></button>
</form>
2024-06-25 15:03:16 +04:00
<div class="form-group ms-3">
<div class="d-flex align-items-center">
2024-06-25 20:26:34 +04:00
<input type="range" step="1000" min="0" max="10000" value="" class="custom-range me-2" id="priceFrom">
2024-06-25 15:03:16 +04:00
<label for="priceFrom">От: <span id="priceLabelFrom">50 000</span> руб.</label>
</div>
<div class="d-flex align-items-center">
2024-06-25 20:26:34 +04:00
<input type="range" step="1000" min="0" max="100000" value="" class="custom-range me-2" id="priceTo">
2024-06-25 15:03:16 +04:00
<label for="priceTo">До: <span id="priceLabelTo">50 000</span> руб.</label>
</div>
</div>
</div>
</div>
</nav>
2024-06-25 15:03:16 +04:00
@* КАРТОЧКИ ТОВАРОВ *@
2024-06-25 20:26:34 +04:00
<div id="Row">
<div class="row row-cols-1 row-cols-md-3 g-5">
@foreach (var weapon in @Model.ProductsModel)
{
<div class="col mb-4">
<div class="card h-100">
<img src="data:image/png;base64,@Convert.ToBase64String(Model.GetMediaByProduct(weapon))" class="card-img-top" alt="@weapon.Name">
<div class="card-body">
<h5 class="card-title">@weapon.Name</h5>
<p class="card-text">Цена: @weapon.Price руб.</p>
<a href="#" class="btn btn-primary">В корзину</a>
<a href="#" class="btn btn-secondary">Просмотр</a>
</div>
</div>
2024-06-25 15:03:16 +04:00
</div>
2024-06-25 20:26:34 +04:00
}
</div>
2024-06-25 15:03:16 +04:00
</div>
@section Scripts {
<script>
2024-06-25 15:03:16 +04:00
// СЛАЙДЕРЫ
document.getElementById("priceFrom").addEventListener("input", function () {
var price = this.value;
2024-06-25 15:03:16 +04:00
document.getElementById("priceLabelFrom").textContent = price + " р.";
});
document.getElementById("priceTo").addEventListener("input", function () {
var price = this.value;
2024-06-25 15:03:16 +04:00
document.getElementById("priceLabelTo").textContent = price + " р.";
});
</script>
}