locale update

This commit is contained in:
gerchek 2024-03-16 11:24:27 +05:00
parent b2a363e4d9
commit 4bbbbdf1d6
35 changed files with 441 additions and 61 deletions

View File

@ -133,13 +133,14 @@ li {
/* Handle */
::-webkit-scrollbar-thumb {
background: #DFDFDF;
background: #474545;
border-radius: 10px;
@include transition;
}
/* Handle on hover */
::-webkit-scrollbar-thumb:hover {
background: #DFDFDF;
background: #000000;
}
input[type=date]::-webkit-calendar-picker-indicator {

View File

@ -1811,6 +1811,24 @@
.shops {
padding: 20px 0 40px;
&_sort {
flex-direction: column;
.custom-select {
width: 100%;
}
}
&_search {
margin-bottom: 15px;
margin-right: 0;
width: 100%;
input {
width: calc(100% - 60px);
}
}
&_tab {
margin-bottom: 25px;
@ -2194,7 +2212,6 @@
line-height: 1.8;
}
&-photo {}
}
}

View File

@ -4,6 +4,10 @@
.custom-select {
position: relative;
&.w150 {
width: 150px;
}
}
.select-selected {
@ -14,30 +18,32 @@
padding: 12px 40px 12px 20px;
cursor: pointer;
background-color: #fff;
background-color: #292929;
border-radius: 4px;
border: 1px solid #ced4da;
border: 1px solid #292929;
color: #fff;
&.select-arrow-active {
border: 4px 4px 0 0;
&:after {
transform: translateY(5px) rotate(225deg);
transform: rotate(90deg);
}
}
&::after {
position: absolute;
content: "";
top: 40px;
transform: rotate(45deg);
top: 17px;
right: 20px;
width: 8px;
height: 8px;
width: 15px;
height: 15px;
z-index: 4;
border-bottom: 1.5px solid #868686;
border-right: 1.5px solid #868686;
// border-bottom: 1.5px solid #868686;
// border-right: 1.5px solid #868686;
@include transition;
background: url("../images/svg/select-arrow.svg") no-repeat center;
background-size: contain;
}
}
@ -47,12 +53,16 @@
left: 0;
right: 0;
z-index: 99;
cursor: pointer;
animation-name: select;
animation-duration: 0.3s;
background: #fff;
background: #292929;
color: #fff;
max-height: 500px;
text-align: center;
max-height: 350px;
overflow-y: auto;
div {
@ -60,26 +70,21 @@
font-size: 14px;
line-height: 1.4;
color: black;
color: #fff;
padding: 10px;
cursor: pointer;
@include transition;
background-color: rgba(200,200,200,.5);;
border: 1px solid #EDEDED;
border-radius: 4px;
margin-bottom: 2px;
&:last-child {
margin-bottom: 30px;
}
&:hover {
border: 1px solid #EDEDED;
// border: 1px solid #EDEDED;
background: #fff;
}
}
&::-webkit-scrollbar {
width: 10px;
width: 0px;
}
&::-webkit-scrollbar-track {

View File

@ -100,6 +100,53 @@
.shops {
padding: 80px 0;
&_sort {
display: flex;
align-items: center;
margin-bottom: 30px;
}
&_search {
display: block;
position: relative;
margin-right: 25px;
input {
background: #292929;
padding: 12px 40px 12px 20px;
font-size: 16px;
font-weight: 400;
line-height: 1.3;
color: #fff;
border-radius: 4px;
&::placeholder {
color: #fff;
}
}
button {
position: absolute;
top: 55%;
right: 15px;
display: block;
@include transformY;
background: transparent;
cursor: pointer;
border: none;
width: 16px;
height: 16px;
svg {
@include ImgCon;
}
}
}
&_tab {
display: flex;
align-items: center;
@ -145,7 +192,7 @@
&_block {
display: flex;
flex-wrap: wrap;
justify-content: center;
// justify-content: center;
margin: -5px auto;
max-width: 1440px;
@ -844,7 +891,6 @@
.pag {
display: flex;
align-items: center;
justify-content: space-between;
margin-top: 50px;
&_group {
@ -877,6 +923,7 @@
font-size: 18px;
line-height: 25px;
color: #7D7D7D;
margin-left: 20px;
}
}

View File

@ -134,13 +134,16 @@ li {
/* Handle */
::-webkit-scrollbar-thumb {
background: #DFDFDF;
background: #474545;
border-radius: 10px;
-webkit-transition: all 0.2s ease-in-out 0s;
transition: all 0.2s ease-in-out 0s;
-moz-transition: all 0.2s ease-in-out 0s;
}
/* Handle on hover */
::-webkit-scrollbar-thumb:hover {
background: #DFDFDF;
background: #000000;
}
input[type=date]::-webkit-calendar-picker-indicator {
@ -973,6 +976,105 @@ input[type=date]::-webkit-calendar-picker-indicator {
-moz-transition: all 0.2s ease-in-out 0s;
}
.custom-select select {
display: none;
}
.custom-select {
position: relative;
}
.custom-select.w150 {
width: 150px;
}
.select-selected {
font-weight: 400;
font-size: 16px;
line-height: 1.4;
padding: 12px 40px 12px 20px;
cursor: pointer;
background-color: #292929;
border-radius: 4px;
border: 1px solid #292929;
color: #fff;
}
.select-selected.select-arrow-active {
border: 4px 4px 0 0;
}
.select-selected.select-arrow-active:after {
-webkit-transform: rotate(90deg);
transform: rotate(90deg);
}
.select-selected::after {
position: absolute;
content: "";
top: 17px;
right: 20px;
width: 15px;
height: 15px;
z-index: 4;
-webkit-transition: all 0.2s ease-in-out 0s;
transition: all 0.2s ease-in-out 0s;
-moz-transition: all 0.2s ease-in-out 0s;
background: url("../images/svg/select-arrow.svg") no-repeat center;
background-size: contain;
}
.select-items {
position: absolute;
top: calc(100% + 10px);
left: 0;
right: 0;
z-index: 99;
cursor: pointer;
-webkit-animation-name: select;
animation-name: select;
-webkit-animation-duration: 0.3s;
animation-duration: 0.3s;
background: #292929;
color: #fff;
text-align: center;
max-height: 350px;
overflow-y: auto;
}
.select-items div {
font-weight: 400;
font-size: 14px;
line-height: 1.4;
color: #fff;
padding: 10px;
cursor: pointer;
-webkit-transition: all 0.2s ease-in-out 0s;
transition: all 0.2s ease-in-out 0s;
-moz-transition: all 0.2s ease-in-out 0s;
border-radius: 4px;
margin-bottom: 2px;
}
.select-items div:hover {
background: #fff;
}
.select-items::-webkit-scrollbar {
width: 0px;
}
.select-items::-webkit-scrollbar-track {
background: #ededed;
border-radius: 10px;
}
.select-items::-webkit-scrollbar-thumb {
background: #aeaeae;
-webkit-box-shadow: 0 0 6px rgba(0, 0, 0, 0.5);
box-shadow: 0 0 6px rgba(0, 0, 0, 0.5);
}
.select-hide {
display: none;
}
.select-items div:hover,
.same-as-selected {
background-color: rgba(250, 250, 250, 0.5);
}
.modal {
position: fixed;
top: 0;
@ -1416,6 +1518,66 @@ input[type=date]::-webkit-calendar-picker-indicator {
.shops {
padding: 80px 0;
}
.shops_sort {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
margin-bottom: 30px;
}
.shops_search {
display: block;
position: relative;
margin-right: 25px;
}
.shops_search input {
background: #292929;
padding: 12px 40px 12px 20px;
font-size: 16px;
font-weight: 400;
line-height: 1.3;
color: #fff;
border-radius: 4px;
}
.shops_search input::-webkit-input-placeholder {
color: #fff;
}
.shops_search input::-moz-placeholder {
color: #fff;
}
.shops_search input:-ms-input-placeholder {
color: #fff;
}
.shops_search input::-ms-input-placeholder {
color: #fff;
}
.shops_search input::placeholder {
color: #fff;
}
.shops_search button {
position: absolute;
top: 55%;
right: 15px;
display: block;
transform: translateY(-50%);
-moz-ransform: translateY(-50%);
-o-transform: translateY(-50%);
-ms-transform: translateY(-50%);
-webkit-transform: translateY(-50%);
background: transparent;
cursor: pointer;
border: none;
width: 16px;
height: 16px;
}
.shops_search button svg {
width: 100%;
height: 100%;
object-fit: contain;
-o-object-fit: contain;
}
.shops_tab {
display: -webkit-box;
display: -ms-flexbox;
@ -1465,9 +1627,6 @@ input[type=date]::-webkit-calendar-picker-indicator {
display: flex;
-ms-flex-wrap: wrap;
flex-wrap: wrap;
-webkit-box-pack: center;
-ms-flex-pack: center;
justify-content: center;
margin: -5px auto;
max-width: 1440px;
}
@ -2152,9 +2311,6 @@ input[type=date]::-webkit-calendar-picker-indicator {
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
-webkit-box-pack: justify;
-ms-flex-pack: justify;
justify-content: space-between;
margin-top: 50px;
}
.pag_group {
@ -2190,6 +2346,7 @@ input[type=date]::-webkit-calendar-picker-indicator {
font-size: 18px;
line-height: 25px;
color: #7D7D7D;
margin-left: 20px;
}
@-webkit-keyframes tabActive {
@ -4881,6 +5038,23 @@ input[type=date]::-webkit-calendar-picker-indicator {
.shops {
padding: 20px 0 40px;
}
.shops_sort {
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
-ms-flex-direction: column;
flex-direction: column;
}
.shops_sort .custom-select {
width: 100%;
}
.shops_search {
margin-bottom: 15px;
margin-right: 0;
width: 100%;
}
.shops_search input {
width: calc(100% - 60px);
}
.shops_tab {
margin-bottom: 25px;
}

View File

@ -1,15 +1,14 @@
// 1-main components
@import "./components/1-main/mixin.scss";
@import "./components/1-main/nulifier.scss";
@import "./components/1-main/variables.scss";
@import "./components/1-main/mixin.scss";
// 2-layout components
@import "./components/2-layout/header.scss";
@import "./components/2-layout/breadcrumb.scss";
@import "./components/2-layout/slider.scss";
// @import "./components/2-layout/select.scss";
@import "./components/2-layout/select.scss";
@import "./components/2-layout/modal.scss";
@import "./components/2-layout/footer.scss";
// @import "./components/2-layout/file-input.scss";
@ -22,7 +21,6 @@
@import "./components/3-page/post.scss";
@import "./components/3-page/result.scss";
@import "./components/3-page/404.scss";
@import "./components/2-layout/slick.scss";
@import "./components/2-layout/slick-theme.scss";
@import "./components/2-layout/responsive.scss";

Binary file not shown.

After

Width:  |  Height:  |  Size: 314 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 383 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 353 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 393 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 708 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 758 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 940 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 698 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 911 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 MiB

After

Width:  |  Height:  |  Size: 2.5 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 454 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 147 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 141 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 395 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 390 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 396 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 221 B

View File

@ -0,0 +1,3 @@
<svg width="74" height="100" viewBox="0 0 74 100" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M1.28016 99.7279C1.62331 99.9052 2.00392 99.9978 2.39016 99.9979C2.87222 99.9973 3.34282 99.8508 3.74016 99.5779L72.7902 51.9979C73.1078 51.7791 73.3675 51.4864 73.5469 51.145C73.7263 50.8035 73.8201 50.4236 73.8201 50.0379C73.8201 49.6522 73.7263 49.2723 73.5469 48.9309C73.3675 48.5894 73.1078 48.2967 72.7902 48.0779L3.74016 0.417905C3.37919 0.170774 2.95732 0.027456 2.52051 0.0035669C2.08371 -0.0203222 1.64872 0.0761344 1.26295 0.282426C0.877189 0.488718 0.555442 0.796932 0.332773 1.17348C0.110104 1.55003 -0.00494465 1.98047 0.000162956 2.41791V97.6179C0.000262589 98.053 0.119637 98.4798 0.34531 98.8518C0.570983 99.2238 0.894317 99.5268 1.28016 99.7279Z" fill="white"/>
</svg>

After

Width:  |  Height:  |  Size: 794 B

View File

@ -7,6 +7,7 @@ function initializeCustomSelect() {
for (i = 0; i < l; i++) {
selElmnt = x[i].getElementsByTagName("select")[0];
var onSelectFunc = x[i].getAttribute('onCustomSelect')
ll = selElmnt.length;
@ -25,11 +26,26 @@ function initializeCustomSelect() {
c.addEventListener("click", function (e) {
var y, i, k, s, h, sl, yl;
s = this.parentNode.parentNode.getElementsByTagName("select")[0];
// console.log(s);
// console.log(s);
sl = s.length;
h = this.parentNode.previousSibling;
for (i = 0; i < sl; i++) {
if (s.options[i].innerHTML == this.innerHTML) {
s.selectedIndex = i;
// console.log(s.options[i]);
// for (var j = 0; j < s.options.length; j++) {
// s.options[j].removeAttribute("selected");
// }
// s.options[i].setAttribute("selected", "selected");
// console.log(s.options[i]);
handleChange(s.selectedIndex);
h.innerHTML = this.innerHTML;
y = this.parentNode.getElementsByClassName("same-as-selected");
yl = y.length;
@ -93,3 +109,20 @@ function closeAllSelect(elmnt) {
then close all select boxes: */
document.addEventListener("click", closeAllSelect);
initializeCustomSelect();
function handleChange(selectElement) {
var floorID = selectElement; // Get the selected value of the dropdown
console.log("Selected Value:", floorID);
$.request('onUpdate', {
data: { floorID: floorID },
update: {
'home/shop_item': '#rest-all',
'home/pagination': '#pagination-container' // Update this with the correct ID or selector
}
});
return false;
}

View File

@ -119,10 +119,25 @@ function onStart(){
<script src="{{ 'assets/js/slider.js'|theme }}"></script>
<script src="{{ 'assets/js/tabs.js'|theme }}"></script>
<script src="{{ 'assets/js/modal-close.js'|theme }}"></script>
<script src="{{ 'assets/js/customSelect.js'|theme }}"></script>
{% framework extras %}
{% scripts %}
<!-- <script>
function onSelectChange(){
// d = document.getElementById("select_id").value;
// $(this).request('onFilter',{data: {region: d}}); return false;
console.log(111);
}
</script> -->
</body>
</html>

View File

@ -160,7 +160,7 @@ function onStart(){
<div class="post_link">
<!-- <a href="{{ url('/') }}/category/{{shop.category.id}}/{{shop.category.name}}"> -->
<a href="{{ url('/') }}/category/{{shop.category.id}}">
Посмотреть все
{{'Посмотреть все'|_}}
<span>
<svg width="14" height="12" viewBox="0 0 14 12" fill="none"
xmlns="http://www.w3.org/2000/svg">

View File

@ -4,20 +4,67 @@ layout = "default"
is_hidden = 0
==
<?php
function onStart(){
function onStart()
{
$currentUrl = url()->full();
$urlComponents = parse_url($currentUrl);
$queryString = $urlComponents['query'] ?? '';
parse_str($queryString, $queryParams);
$floorID = $queryParams['floor'] ?? null;
if (!is_null($floorID)) {
$this['id'] = $this->param('id');
if ($this['id'] != 0) {
$this['top_category'] = Tps\Shops\Models\TopCategory::where("id", $this['id'])->get()->first();
$this['top_category'] = Tps\Shops\Models\TopCategory::where("id", $this['id'])->first();
$categories = $this['top_category']->categories->pluck('id')->toArray();
$this['shops'] = Tps\Shops\Models\Shop::whereIn('category_id', $categories)
->where('floor', $floorID)
->paginate(12)
->appends(['floor' => $floorID]);
} else {
$this['shops'] = Tps\Shops\Models\Shop::where('floor', $floorID)
->orderBy('created_at')
->paginate(12)
->appends(['floor' => $floorID]);
}
} else {
$this['id'] = $this->param('id');
if ($this['id'] != 0) {
$this['top_category'] = Tps\Shops\Models\TopCategory::where("id", $this['id'])->first();
$categories = $this['top_category']->categories->pluck('id')->toArray();
$this['shops'] = Tps\Shops\Models\Shop::whereIn('category_id', $categories)->paginate(12);
} else {
$this['shops'] = Tps\Shops\Models\Shop::orderBy('created_at')->paginate(12);
}
}
}
function onUpdate()
{
$floorID = post('floorID');
$data = Tps\Shops\Models\Shop::orderBy('created_at')
->where('floor', $floorID)
->paginate(12)
->appends(['floor' => $floorID]);
return [
'home/shop_item' => $this->renderPartial('home/shop_item', ['shops' => $data]),
'home/pagination' => $this->renderPartial('home/pagination', ['result' => $data]) // Update this with the correct data
];
}
?>
==
<section class="crumb">
@ -52,14 +99,54 @@ function onStart(){
<section class="rest page">
<div class="auto_container">
<div class="rest_wrap">
<div class="shops_wrap">
<div class="shops_sort">
<form action="{{ 'search'|page }}" method="GET" class="menu_search">
<div class="shops_search">
<input type="text" name="q" placeholder="Поиск магазина">
<button type="submit">
<svg width="19" height="19" viewBox="0 0 19 19" fill="none"
xmlns="http://www.w3.org/2000/svg">
<path
d="M17.71 16.29L14.31 12.9C15.407 11.5025 16.0022 9.77666 16 8C16 6.41775 15.5308 4.87103 14.6518 3.55544C13.7727 2.23985 12.5233 1.21447 11.0615 0.608967C9.59966 0.00346625 7.99113 -0.15496 6.43928 0.153721C4.88743 0.462403 3.46197 1.22433 2.34315 2.34315C1.22433 3.46197 0.462403 4.88743 0.153721 6.43928C-0.15496 7.99113 0.00346625 9.59966 0.608967 11.0615C1.21447 12.5233 2.23985 13.7727 3.55544 14.6518C4.87103 15.5308 6.41775 16 8 16C9.77666 16.0022 11.5025 15.407 12.9 14.31L16.29 17.71C16.383 17.8037 16.4936 17.8781 16.6154 17.9289C16.7373 17.9797 16.868 18.0058 17 18.0058C17.132 18.0058 17.2627 17.9797 17.3846 17.9289C17.5064 17.8781 17.617 17.8037 17.71 17.71C17.8037 17.617 17.8781 17.5064 17.9289 17.3846C17.9797 17.2627 18.0058 17.132 18.0058 17C18.0058 16.868 17.9797 16.7373 17.9289 16.6154C17.8781 16.4936 17.8037 16.383 17.71 16.29ZM2 8C2 6.81332 2.3519 5.65328 3.01119 4.66658C3.67047 3.67989 4.60755 2.91085 5.7039 2.45673C6.80026 2.0026 8.00666 1.88378 9.17055 2.11529C10.3344 2.3468 11.4035 2.91825 12.2426 3.75736C13.0818 4.59648 13.6532 5.66558 13.8847 6.82946C14.1162 7.99335 13.9974 9.19975 13.5433 10.2961C13.0892 11.3925 12.3201 12.3295 11.3334 12.9888C10.3467 13.6481 9.18669 14 8 14C6.4087 14 4.88258 13.3679 3.75736 12.2426C2.63214 11.1174 2 9.5913 2 8Z"
fill="white" />
</svg>
</button>
</div>
<div class="custom-select w150" id="mySelect">
<select name="floorSelect" data-request="onChangeValue" onchange="handleChange(this)">
<option value="01">Все этажы</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
</select>
<div id="output"></div>
</div>
</form>
</div>
<div class="rest_box">
<div class="rest_block tabItem active" id="rest-all">
{% for shop in shops%}
{% partial 'home/shop_item' shop=shop %}
{% endfor %}
{% partial 'home/shop_item' shops=shops %}
</div>
{% partial 'home/pagination' result=shops %}
</div>
</div>
</div>
</section>

View File

@ -1,6 +1,6 @@
{% if result.hasPages %}
<div class="pag">
<div class="pag" id="pagination-container">
<div class="pag_group">
{% if result.currentPage > 1 %}
<a href="{{ result.previousPageUrl }}" class="pag_btn prev">

View File

@ -1,4 +1,6 @@
==
{% for shop in shops%}
<a href="{{ url('/') }}/shop/{{shop.id}}" class="rest_item">
<div class="rest_item-photo">
<img src="{{shop.badge.path}}" alt="restaurant-photo" />
@ -19,3 +21,4 @@
</div>
</div>
</a>
{% endfor %}

View File

@ -51,10 +51,7 @@
// updateSliderCounter(slick);
});
<!-- $slider.on('afterChange', function (event, slick, currentSlide) {
updateSliderCounter(slick, currentSlide);
});
-->
$slider.slick();
}