mirror of https://github.com/4xmen/xshop.git
added live card
parent
971143fa16
commit
24bb2f8e56
@ -0,0 +1,17 @@
|
||||
window.addEventListener('load', function () {
|
||||
document.querySelectorAll('.live-card-show')?.forEach(function (el) {
|
||||
el.addEventListener('click', async function (e) {
|
||||
e.preventDefault();
|
||||
const url = this.getAttribute('data-url');
|
||||
let response = await axios.get(url);
|
||||
document.querySelector('#live-card-list').innerHTML = response.data;
|
||||
document.querySelector('#live-card-modal').style.display = 'block';
|
||||
});
|
||||
});
|
||||
|
||||
document.querySelector('#live-card-modal').addEventListener('click',function (e) {
|
||||
if (e.target == this){
|
||||
document.querySelector('#live-card-modal').style.display = 'none';
|
||||
}
|
||||
});
|
||||
})
|
@ -0,0 +1,48 @@
|
||||
#live-card-modal{
|
||||
display: none;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
background: #ffffff11;
|
||||
backdrop-filter: blur(7px);
|
||||
z-index: 9999;
|
||||
|
||||
#live-card-container{
|
||||
background: var(--xshop-background);
|
||||
width: 300px;
|
||||
padding: 1rem;
|
||||
height: 100vh;
|
||||
overflow-y: auto;
|
||||
max-width: 85%;
|
||||
|
||||
#live-card-list{
|
||||
margin: 0;
|
||||
list-style: none;
|
||||
padding: 1rem 0;
|
||||
|
||||
li{
|
||||
border-radius: var(--xshop-border-radius);
|
||||
border: 1px solid var(--xshop-text);
|
||||
margin-bottom: .5rem;
|
||||
.product-card-item{
|
||||
padding: 5px;
|
||||
display: grid;
|
||||
grid-template-columns: 4fr 8fr;
|
||||
grid-gap: 5px;
|
||||
img{
|
||||
width: 100%;
|
||||
height: 75px;
|
||||
object-fit: cover;
|
||||
|
||||
}
|
||||
h3{
|
||||
font-size: 18px;
|
||||
margin: .5rem 0 ;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
@foreach(\App\Models\Product::whereIn('id', json_decode(\Cookie::get('card'), true))
|
||||
->where('status', 1)
|
||||
->get() as $product)
|
||||
<li>
|
||||
<div class="product-card-item">
|
||||
<img src="{{$product->imgUrl()}}" alt="{{$product->name}}">
|
||||
<div class="product-card-content">
|
||||
<h3>
|
||||
{{$product->name}}
|
||||
</h3>
|
||||
<span>
|
||||
{{$product->getPrice()}}
|
||||
</span>
|
||||
<a href="{{ route('client.product-card-toggle',$product->slug) }}"
|
||||
class="btn btn-outline-danger btn-sm float-end mt-2">
|
||||
<i class="ri-delete-bin-line"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</li>
|
||||
@endforeach
|
Loading…
Reference in New Issue