Пульсация
PrimeNG/Ripple (opens in a new tab)
Директива Ripple добавляет эффект пульсации к host элементу.
С чего начать
Подключите модуль
import { RippleModule } from 'primeng/ripple';
Встройте компонент с помощью директивы pRipple.
Ripple
DefaultGreenOrangePurple
Пример настройки стилей:
:host ::ng-deep {
.card-container {
display: flex;
.card {
width: 100px;
height: 100px;
display: flex;
align-items: center;
justify-content: center;
margin-right: 1rem;
user-select: none;
box-shadow: 0 2px 1px -1px rgba(0, 0, 0, 0.2),
0 1px 1px 0 rgba(0, 0, 0, 0.14), 0 1px 3px 0 rgba(0, 0, 0, 0.12);
border-radius: 4px;
margin-bottom: 2rem;
padding: 0;
&.primary-box {
background-color: var(--q-primary-500);
padding: 0;
color: var(--q-primary-500-contrast);
}
&.styled-box-green {
.p-ink {
background: rgba(#4baf50, 0.3);
}
}
&.styled-box-orange {
.p-ink {
background: rgba(#ffc106, 0.3);
}
}
&.styled-box-purple {
.p-ink {
background: rgba(#9c27b0, 0.3);
}
}
&:last-child {
margin-right: 0;
}
}
}
}
Стилизация
Name | Element |
---|---|
p-ripple | Host element. |
p-ink | Ripple element. |
p-ink-active | Ripple element during animating. |