Skip to content

Commit

Permalink
feat(transition): pulsating variant
Browse files Browse the repository at this point in the history
This PR adds a new pulsating transition. Any element getting the looping pulsating transition will have its box border begging for some attention
  • Loading branch information
lubber-de authored Nov 5, 2022
1 parent d459c42 commit edc5e7e
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 2 deletions.
37 changes: 36 additions & 1 deletion src/definitions/modules/transition.less
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,45 @@
/*******************************
Variations
*******************************/
& when (@variationTransitionLoading) {
& when (@variationTransitionLooping) {
.looping.transition {
animation-iteration-count: infinite;
}
}

& when (@variationTransitionPulsating) {
/* Pulsating */
.pulsating.transition {
animation-name: pulsating;
animation-duration: @pulsatingDuration;
box-shadow: 0 0 0 0 fade(@pulsatingColor, @pulsatingOpacity);
}
& when (@variationTransitionInverted) {
.inverted.pulsating.transition {
box-shadow: 0 0 0 0 fade(@pulsatingInvertedColor, @pulsatingInvertedOpacity);
}
}
@keyframes pulsating {
100% {
box-shadow: 0 0 0 @pulsatingDistance rgba(255,255,255,0);
}
}
& when not (@variationTransitionColors = false) {
each(@variationTransitionColors, {
@color: @value;
@c: @colors[@@color][color];
@l: @colors[@@color][light];

.@{color}.pulsating.transition {
box-shadow: 0 0 0 0 fade(@c, @pulsatingOpacity);
}
& when (@variationTransitionInverted) {
.@{color}.inverted.pulsating.transition {
box-shadow: 0 0 0 0 fade(@l, @pulsatingInvertedOpacity);
}
}
})
}
}

.loadUIOverrides();
4 changes: 4 additions & 0 deletions src/themes/default/globals/variation.variables
Original file line number Diff line number Diff line change
Expand Up @@ -716,6 +716,8 @@
/* Transition */
@variationTransitionDisabled: true;
@variationTransitionLoading: true;
@variationTransitionLooping: true;
@variationTransitionInverted: true;
@variationTransitionBrowse: true;
@variationTransitionDrop: true;
@variationTransitionFade: true;
Expand All @@ -732,6 +734,8 @@
@variationTransitionPulse: true;
@variationTransitionJiggle: true;
@variationTransitionGlow: true;
@variationTransitionPulsating: true;
@variationTransitionColors: @variationAllColors;

/* Emojis */
@variationEmojiColons: true;
Expand Down
9 changes: 8 additions & 1 deletion src/themes/default/modules/transition.variables
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,11 @@
@transitionDefaultDuration: 300ms;

@use3DAcceleration: translateZ(0);
@backfaceVisibility: hidden;
@backfaceVisibility: hidden;

@pulsatingColor: #808080;
@pulsatingInvertedColor: #ffffff;
@pulsatingDuration: 2000ms;
@pulsatingDistance: 0.8rem;
@pulsatingOpacity: 50%;
@pulsatingInvertedOpacity: 70%;

0 comments on commit edc5e7e

Please sign in to comment.