Scrollable gradient chat bubble
P粉197639753
2023-09-01 11:52:18
<p>I want a white container with a chat bubble with a gradient that changes when scrolling with the gradient below, as shown in this example: </p>
<p>I tried making the <code>.container</code> part behind any <code>chatBubble</code> transparent so that the background of <code>.root</code> was visible. </p>
<p>
<pre class="brush:css;toolbar:false;">.root {
background-color: linear-gradient(red, yellow);
width: 100vw;
height: 100vh;
}
.container {
width: 100%;
height: 100vh;
background-color: white
}
.chatBubble {
background-color: transparent;
border-radius: 4px;
min-width: 50;
padding: 10px;
}</pre>
<pre class="brush:html;toolbar:false;"><div class="root">
<div class="container">
<chatBubble>This is a chat bubble</chatBubble>
<chatBubble>This is another chat bubble</chatBubble>
</div>
</div></pre>
</p>
This is what I've got so far, trying to mask it so I can have a white background to go with the gradient.
You can "Place Shadow" from
.bubble
: