Is there a way in jQuery to select specific parts and apply a "border radius"?
I've been struggling to use a jQuery selector to achieve this. Is there another method using CSS?
I don't want to manually add a "CLASS" to the HTML code to solve this issue. I want to automate the detection of these parts with a concise code.
Desired output: https://i.sstatic.net/oomDW.png
My Code: https://jsfiddle.net/gL3dwyu4/
body{
margin: 0;
padding: 15px 0px;
font-family: sans-serif;
font-size: 15px;
}
#chat-messages-list .message-row{
display: flex;
word-wrap: break-word;
margin-bottom: 2px;
padding-left: 20px;
padding-right: 20px;
position: relative;
}
#chat-messages-list .message-row:hover .message-time{
opacity: 1;
}
#chat-messages-list .message-row .chat-avatar{
display: block;
border-radius: 50%;
width: 28px;
height: 28px;
flex-direction: column;
background-repeat: no-repeat;
background-position: center center;
background-color: #eff0f1;
background-size: cover;
}
#chat-messages-list .message-row .message-container{
position: relative;
padding: 6px 12px;
box-sizing: border-box;
word-break: break-word;
border-bottom-left-radius: 1.25rem;
border-bottom-right-radius: 1.25rem;
border-top-left-radius: 1.25rem;
border-top-right-radius: 1.25rem;
}
#chat-messages-list .message-row .message-time{
display: flex;
align-items: center;
margin: 0 10px;
font-size: 12px;
color: var(--black-400);
text-align: left;
opacity: 0;
transition: opacity 275ms;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
#chat-messages-list .message-row.arrow {
margin-top: 10px;
}
#chat-messages-list .message-row:not(.arrow) .message-sender,
#chat-messages-list .message-row.me .message-sender,
#chat-messages-list .message-row:not(.arrow) .chat-username,
#chat-messages-list .message-row.me .chat-username {
display: none;
}
#chat-messages-list .message-row.me{
flex-direction: row-reverse;
}
#chat-messages-list .message-row.me .message-container {
border-bottom-right-radius: 0;
border-top-right-radius: 0;
background-color: #f2720c;
color: #fff;
}
#chat-messages-list .message-row.me.arrow .message-container {
border-top-right-radius: 1.25rem;
}
#chat-messages-list .message-row.you{
justify-content: flex-start;
}
#chat-messages-list .message-row.you .message-sender{
cursor: pointer;
}
#chat-messages-list .message-row.you .message-container {
background-color: #eff0f1;
color: #0c0d0e;
border-bottom-left-radius: 0;
border-top-left-radius: 0;
margin-left: 38px;
}
#chat-messages-list .message-row.you.arrow .message-container {
border-top-left-radius: 1.25rem;
margin-left: 10px;
}
#chat-messages-list .message-row.you.arrow .message-container .chat-username {
cursor: pointer;
font-size: 16px;
margin-bottom: 5px;
font-weight: 600;
color: #0c0d0e;
}
#chat-messages-list .message-row.you .message-time{
text-align: right;
}
<div id="chat-messages-list">
<div class="message-row me arrow" data-messageid="1" data-senderid="1001">
<div class="message-sender" onclick="_chatUserDetails(1001)"><div class="chat-avatar" style="background-image: url(https://i.pinimg.com/originals/11/54/5b/11545b03970ce036070c48944c1aa66e.jpg);"></div></div>
<div class="message-container">
<div class="chat-username">seyit55</div>
<div class="chat-message">Hello!</div>
</div>
<div class="message-time">17:00</div>
</div>
// Remaining HTML code snippets...
</div>