I have a panel that shows a task. The tasks are being displayed by iterating through an array.
When a task is clicked, I want the panel to expand and show a form which allows the user to edit the clicked task.
How can I realize this behavior?
The panel has already an animation allocated to itself, namely a delete animation. How can I additionally add an expand/collapse animation - and how do I make sure that the edit field is allocated to the task clicked.
<div class="row content-cont" [#EnterLeave]="animation">
<div class="col-11 d-flex todo shadow-sm">
<div class="row w-100 align-self-center">
<div class="col-2 px-0 d-flex justify-content-center">
<button type="button" class="btn btn-default btn-circle shadow-sm exceeded align-self-center" [ngClass]="'state' + task.state"
(click)="updateState(task.id)"></button>
</div>
<div class="col-6 px-0">
<div class="row">
<div class="col-6 d-flex">
<h1 class="align-self-center">{{task.title}}</h1>
</div>
<div class="col-6 d-flex">
<p class="desc align-self-center">{{task.describtion}}</p>
</div>
</div>
<div class="row">
<div class="col-4">
<p *ngIf="task.date !== null">{{task.date | date: 'dd.MM.yyyy'}}
</p>
</div>
</div>
</div>
<div class="col-4 d-flex justify-content-end">
<img *ngIf="task.state !== '2'" class="align-self-center trash-button" src="/assets/icons/trash-2-colorized.svg" alt="Trash" (click)="deleteTask(task.id)">
<img *ngIf="task.state === '2'" class="align-self-center" src="/assets/icons/trash-2.svg" alt="Trash">
</div>
<h1 class="priority position-absolute">{{task.priority}}</h1>
</div>
</div>
</div>
Related
I have 2 "contents" in their divs next to each other. 1) is a slim categorized link list with buttons loading the content on 2). When there is nothing loaded yet on 2) it shows you an overview of the same listed items in 1) with little more information as cards.
Now, after I am having so many buttons I need to show in 1), I made the list scroll-able and added jump-to buttons, so that the user doesn't have to scroll to the bottom to reach the last category of the list. Logically 2) is scroll-able as well, as this is the main content of the site, respectively showing the big cards as an overview.
How do I realize to have the jump-to buttons working for both scroll-able divs at once? And is there maybe a solution without js, since I have absolutely no idea about js coding?
The only thing I am getting to work is only one of both divs jump-to-able
Btw. I am using bootstrap 5.2 . But unfortunately I didn't find a solution to that problem in their docs either :/
I also tried the documented anchors via scrollspy without success ( https://getbootstrap.com/docs/5.2/components/scrollspy/#usage )
Thank you very much in advance for any help!
in CodePen
https://codepen.io/KeenaBiacym/pen/qBYaLVQ
The scroll list
<div id="content">
<div class="container p-5 pt-3">
<div class="gallery d-flex">
<v class="btncontainer gallery nav justify-content-end">
<div class="scrollbar stickynator gallery">
<div class="slidebtn_galtab active" id="tab0" data-bs-toggle="tab" data-bs-target="#tab0-pane" type="button" role="tab" aria-controls="tab0-pane" aria-selected="true">
Overview
</div>
<div class="text-center pt-4">
▼ Category2 ▼
</div>
<h3 class="pt-4 text-center content-title" id="content_cat1">Category1</h3>
<div class="slidebtn_galtab mt-3" id="tab1" data-bs-toggle="tab" data-bs-target="#tab1-pane" type="button" role="tab" aria-controls="tab1-pane" aria-selected="false" style="width:400px">
Title1
</div>
<div class="slidebtn_galtab mt-3" id="tab2" data-bs-toggle="tab" data-bs-target="#tab1-pane" type="button" role="tab" aria-controls="tab1-pane" aria-selected="false" style="width:400px">
Title2
</div>
<br><br><br><br>
<h3 class="pt-4 text-center content-title" id="content_cat2">Category2</h3>
<div class="slidebtn_galtab mt-3" id="tab3" data-bs-toggle="tab" data-bs-target="#tab1-pane" type="button" role="tab" aria-controls="tab1-pane" aria-selected="false" style="width:400px">
Title1
</div>
<div class="slidebtn_galtab mt-3" id="tab4" data-bs-toggle="tab" data-bs-target="#tab1-pane" type="button" role="tab" aria-controls="tab1-pane" aria-selected="false" style="width:400px">
Title2
</div>
<div class="text-center pt-4">
▲ Category1 ▲
</div>
</div>
Content
<div class="tab-content container" id="TabContent">
<!-- CONTENT 0 -->
<div class="tab-pane fade active show" id="tab0-pane" role="tabpanel" aria-labelledby="tab0" tabindex="0">
<div class="container" id="content_cat1"><h3 class="pb-3 text-center content-title">Category1</h3>
<div class="row row-cols-1 row-cols-md-3 g-4 allcards">
<div class="col" id="gallerytablink1">
<div class="card mozoom h-100">
<div class="card-img-top moopacity cardsoverview">
<img src="https://images.unsplash.com/photo-1665597652829-bf80107d7045?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=MnwzMjM4NDZ8MHwxfHJhbmRvbXx8fHx8fHx8fDE2NjYwOTgzNDI&ixlib=rb-1.2.1&q=80&w=400" class="card-img-top">
</div>
<div class="card-body">
<h5 class="card-title">Title1</h5>
<p class="card-text">Subtitle1</p>
</div>
<div class="card-footer">
<small class="text-muted">img1desc</small>
</div>
</div>
</div>
<div class="col" id="gallerytablink2">
<div class="card mozoom h-100">
<div class="card-img-top moopacity cardsoverview">
<img src="https://images.unsplash.com/photo-1665597652829-bf80107d7045?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=MnwzMjM4NDZ8MHwxfHJhbmRvbXx8fHx8fHx8fDE2NjYwOTgzNDI&ixlib=rb-1.2.1&q=80&w=400" class="card-img-top">
</div>
<div class="card-body">
<h5 class="card-title">Title2</h5>
<p class="card-text">Subtitle2</p>
</div>
<div class="card-footer">
<small class="text-muted">img2desc</small>
</div>
</div>
</div>
</div>
<div class="container" id="content_cat2"><h3 class="pb-3 text-center content-title">Category2</h3>
<div class="row row-cols-1 row-cols-md-3 g-4 allcards">
<div class="col" id="gallerytablink3">
<div class="card mozoom h-100">
<div class="card-img-top moopacity cardsoverview">
<img src="https://images.unsplash.com/photo-1665597652829-bf80107d7045?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=MnwzMjM4NDZ8MHwxfHJhbmRvbXx8fHx8fHx8fDE2NjYwOTgzNDI&ixlib=rb-1.2.1&q=80&w=400" class="card-img-top">
</div>
<div class="card-body">
<h5 class="card-title">Title1</h5>
<p class="card-text">Subtitle1</p>
</div>
<div class="card-footer">
<small class="text-muted">img1desc</small>
</div>
</div>
</div>
<div class="col" id="gallerytablink4">
<div class="card mozoom h-100">
<div class="card-img-top moopacity cardsoverview">
<img src="https://images.unsplash.com/photo-1665597652829-bf80107d7045?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=MnwzMjM4NDZ8MHwxfHJhbmRvbXx8fHx8fHx8fDE2NjYwOTgzNDI&ixlib=rb-1.2.1&q=80&w=400" class="card-img-top">
</div>
<div class="card-body">
<h5 class="card-title">Title2</h5>
<p class="card-text">Subtitle2</p>
</div>
<div class="card-footer">
<small class="text-muted">img2desc</small>
</div>
</div>
</div>
Hi I am using Bootstrap 4, I am working on a project here http://eatout.sanaalitech.com/products.php I am facing a very strange problem.I am using bootstrap grid and my columns overlaps on the first page load only on mobile view,on desktop it works fine, when I refresh the page it works fine on the mobile as well.
I have tried the following but still not working
1) .col-lg-3{ display:block; position:relative;}
2) I have tried enclosing every 4 products in a row instead of taking all of them in a single row like this
content here
content here
content here
content here
content here
content here
content here
content here
content here
content here
content here
content here
3) I have also completely deleted this and made it again with cards but they also overlap on the first load only on mobile view.
Problem appears on the first load only.
I have added image on first page load .
<div class="container" style="margin-top:5em;">
<div class="row ">
<div class="col-lg-12" >
<ul class="filter-tabs text-center">
<li data-filter=".maincourse"><a href="#!" >Main Courses</a></li>
<li data-filter=".desserts">Desserts</li>
<li class="active" data-filter="*">View All</li>
<li data-filter=".starters">Starters</li>
<li data-filter=".extras">Extras</li>
</ul>
<div class="projects">
<div class="row">
<div class="col-lg-3 item maincourse mb-3" >
<div class="product ">
<img src="Images/banner-image4.jpg" class="img-fluid">
<div class="text-center mb-3 mt-3">
<h4>Meal Platter</h4>
<h7>£8.99</h7>
</div>
</div>
</div>
<div class="col-lg-3 item desserts mb-3" >
<div class="product ">
<img src="Images/dessert.jpg" class="img-fluid">
<div class="text-center mb-3 mt-3">
<h4>Meal Platter</h4>
<h7>£8.99</h7>
</div>
</div>
</div>
<div class="col-lg-3 item maincourse mb-3">
<div class="product ">
<img src="Images/main-meal-5.jpg" class="img-fluid img-filter">
<div class="text-center mb-3 mt-3">
<h4>Meal Platter</h4>
<h7>£8.99</h7>
</div>
</div>
</div>
<div class="col-lg-3 item starters mb-3">
<div class="product ">
<img src="Images/banner-image3.jpg" class="img-fluid">
<div class="text-center mb-3 mt-3">
<h4>Meal Platter</h4>
<h7>£8.99</h7>
</div>
</div>
</div>
<div class="col-lg-3 item maincourse mb-3">
<div class="product ">
<img src="Images/main-meal-2.jpg" class="img-fluid">
<div class="text-center mb-3 mt-3">
<h4>Roll Platter</h4>
<h7>£8.99</h7>
</div>
</div>
</div>
<div class="col-lg-3 item starters mb-3">
<div class="product ">
<img src="Images/main-meal-4.jpg" class="img-fluid">
<div class="text-center mb-3 mt-3">
<h4>Vege Starter</h4>
<h7>£7.99</h7>
</div>
</div>
</div>
<div class="col-lg-3 item desserts mb-3">
<div class="product ">
<img src="Images/dessert-2.jpg" class="img-fluid img-filter">
<div class="text-center mb-3 mt-3">
<h4>Rasberry cake</h4>
<h7>£4.99</h7>
</div>
</div>
</div>
<div class="col-lg-3 item maincourse mb-3">
<div class="product ">
<img src="Images/main-meal-3.jpg" class="img-fluid">
<div class="text-center mb-3 mt-3">
<h4>Burger Meal</h4>
<h7>£8.99</h7>
</div>
</div>
</div>
<div class="col-lg-3 item extras mb-3">
<div class="product">
<img src="Images/extras-1.jpg" class="img-fluid">
<div class="text-center mb-3 mt-3">
<h4>Macaroni Sallad</h4>
<h7>£7.99</h7>
</div>
</div>
</div>
<div class="col-lg-3 item maincourse mb-3">
<div class="product ">
<img src="Images/main-meal-6.jpg" class="img-fluid">
<div class="text-center mb-3 mt-3">
<h4>Fish & Beans</h4>
<h7>£12.99</h7>
</div>
</div>
</div>
<div class="col-lg-3 item extras mb-3">
<div class="product ">
<img src="Images/extras-2.jpg" class="img-fluid img-filter">
<div class="text-center mb-3 mt-3">
<h4>Avacado Sallad</h4>
<h7>£9.99</h7>
</div>
</div>
</div>
<div class="col-lg-3 item desserts mb-3">
<div class="product">
<img src="Images/dessert-3.jpg" class="img-fluid">
<div class="text-center mb-3 mt-3">
<h4>Chocolate Cake</h4>
<h7>£7.99</h7>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
When your grid overflows, run this in the console.
(Code from javascript.js at line 217)
var $projects = $(".projects");
$projects.isotope({
itemSelector: ".item",
layoutMode:'fitRows'
});
I think that this function runs before everything loads.
I don't know what is going on because sometimes this fixes the issue once called but most of the time it does not. But one is for sure. A function defines the absolute position, so the issue lays somewhere within the javascript source.
I am trying to put a button in a collapse (part of an accordion) that will go to a new page when clicked. But right now when I try to click the button, it instead just closes the collapse.
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css" rel="stylesheet" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.0/js/bootstrap.min.js"></script>
<div id="accordion">
<div class="card">
<div class="card-header p-1">
<a class="card-link stretched-link text-body" data-toggle="collapse" href="#collapseOne">
<div class="row no-gutters">
<div class="col-8 pl-1"><strong>Title </strong></div>
<div class="col-4 text-right"><span class="badge badge-danger p-1">High Priority</span></div>
</div>
<div class="row no-gutters">
<div class="col text-center">
<!-- Lock this to prevent word wrap from too mane names -->
<span class="badge badge-pill badge-primary mr-1">Name</span><span class="badge badge-pill badge-primary mr-1">Name</span><span class="badge badge-pill badge-warning mr-1">Name</span>
</div>
</div>
</a>
</div>
<div id="collapseOne" class="collapse" data-parent="#accordion">
<div class="card-body p-1">
<div class="row no-gutters">
<div class="col-9">
<div class="row m-0 p-0 ">
<div class="col-sm">
<div class="row">
<div class="col text-center">
<small><strong>Start:</small></strong><br>30 May 08:00
</div>
<div class="col text-center">
<small><strong>Late/Expire:</small></strong><br>30 Jun 16:00
</div>
</div>
</div>
<div class="col-sm">
<div class="row">
<div class="col text-center">
<small><strong>Category</small></strong><br>Catering
</div>
<div class="col text-center">
<small><strong>Reward:</small></strong><br>300
</div>
</div>
</div>
</div>
</div>
<!-- Here is the button I can't seem to click -->
<div class="col-3 p-1 align-self-center"><strong>View Chore</strong></div>
</div>
</div>
</div>
</div>
Oddly enough, when I put the snippet and run it on stack overflow, it works fine. But when I run it in my browser, clicking anywhere in the card-body hides the collapse element.
Thanks for the help
Seth
Never mind, I found it. The "stretched-link" in the card header is making the whole card, including the body a stretched-link. For some reason the stack overflow snippet doesn't do that but the Chrome browser does.
I have this piece of code:
<div class="container">
<div class="border rounded-lg" style="height:500px;">
<div class="ml-2 mt-2">
<h1 class="display-3">#Model.Name</h1>
<!-- Image and pay box -->
<div class="mt-4 container">
<img src="~/Resources/default.jpg" class="" style="height:300px;" />
<div class="d-inline align-top float-right border rounded-lg" style="height:250px;width:250px;">
#if (!Model.OnSale)
{
<h3 class="mt-2 text-nowrap text-center text-warning">#Model.Price</h3>
}
else
{
<div class="row">
<div class="col-2 text-center">
<div class="text-secondary font-italic" style="text-align:center;"><s>#Model.PriceBeforeDiscount</s></div>
<div class="mt-2 text-nowrap text-warning">#Model.Price</div>
</div>
</div>
}
<button class="btn btn-success text-white text-center font-weight-bold w-100 mt-3">
BUY NOW
</button>
given a model, it looks like
I want to center both price texts (the ones on the right), but for some reason, it will refuse to use "text-center", any ideas on how I can solve this? (the # sign is just from Razor syntax, it's the variables it displays)
The text prices are center aligned in your code but they're being constrained by the column width
col-2 should be col-12_ thus:
#if (!Model.OnSale)
{
<h3 class="mt-2 text-nowrap text-center text-warning">#Model.Price</h3>
}
else
{
<div class="row">
<div class="col-12 text-center">
<div class="text-secondary font-italic"><s>#Model.PriceBeforeDiscount</s></div>
<div class="mt-2 text-nowrap text-warning">#Model.Price</div>
</div>
</div>
}
I can't recreate the code here but have tested it locally and col-12 appears to solve the problem
Have you tried <div class="row d-flex justify-content-center"></div>
This should work
I'm trying to create an image grid with that little space between columns equal to the image below:
The problem is that I can not make the right margin(red line), image below shows the problem:
JSfiddle: https://jsfiddle.net/castordida/0zy7qd5m/
<div class="container gridhome mt-5 mb-5 p-0">
<div class="row" style="height:469px;">
<div class="col-sm-8 h-100" style="background-color:#000;">
<span class="categoria">test</span>
<h3>TESTE</h3>
</div>
<div class="col-sm-4 h-100 p-0">
<div class="col-sm-12 h-50 p-0">
<div class="h-100 ml-1" style="background-color:#919191;">
<span class="categoria">test</span>
<h3>TESTE</h3>
</div>
</div>
<div class="col-sm-12 h-50 p-0">
<div class="h-100 ml-1 mt-1" style="background-color:#919191;">
<span class="categoria">test</span>
<h3>TESTE</h3>
</div>
</div>
</div>
</div>
<div class="row mt-1" style="height:234.5px;">
<div class="col-sm-4 h-100 p-0">
<div class="h-100" style="background-color:#919191;">
<span class="categoria">test</span>
<h3>TESTE</h3>
</div>
</div>
<div class="col-sm-4 h-100 p-0">
<div class="h-100 ml-1" style="background-color:#919191;">
<span class="categoria">test</span>
<h3>TESTE</h3>
</div>
</div>
<div class="col-sm-4 h-100 p-0">
<div class="h-100 ml-1" style="background-color:#919191;">
<span class="categoria">test</span>
<h3>TESTE</h3>
</div>
</div>
</div>
</div>
Ok it's due to the fact there is a gab between your picture at right... But the fixed height doesn't mention it...
There are many ways to correct this...
First : https://jsfiddle.net/y0x7kpza/
Add an overflow:hidden to the first .row
Second: https://jsfiddle.net/d0a52xwk/
Reaffect the height of the two div on the right in taking care of the margin-top of these elements.
.h-50-bis{
height:calc(50% - 0.125rem);
}