react-swipeable-button
Version:
A component to create swipeable button in react
212 lines (201 loc) • 4.52 kB
CSS
.ReactSwipeButton {
float: left;
/* width: 100%;
height: 100%; */
position: relative;
}
.ReactSwipeButton,
.ReactSwipeButton * {
-webkit-touch-callout: none; /* iOS Safari */
-webkit-user-select: none; /* Chrome/Safari/Opera */
-khtml-user-select: none; /* Konqueror */
-moz-user-select: none; /* Firefox */
-ms-user-select: none; /* Internet Explorer/Edge */
user-select: none; /* Non-prefixed version, currently
not supported by any browser */
}
.rsbContainer {
float: left;
width: 100%;
height: 100%;
/* background: #eee; */
border-radius: 50px;
position: relative;
z-index: 1;
/* box-shadow: inset 1px 1px 4px rgba(0,0,0,0.1); */
overflow: hidden;
}
.rsbContainerDisabled {
cursor: not-allowed;
opacity: 0.6;
}
.rsbContainerUnlocked {
width: 50% ;
margin-left: 25%;
transition: 0.5s;
cursor: default;
}
.rsbContainerUnlocked .rsbcSlider {
/* left: 100% !important; */
cursor: default;
pointer-events: none;
}
.rsbContainerUnlocked .rsbcSliderArrow {
transition: 0.5s;
margin-right: -60px;
}
.rsbContainerUnlocked .rsbcSliderCircle {
transition: 0.5s;
margin-right: -60px;
}
.rsbcSlider {
display: flex; /* Use flexbox */
align-items: center; /* Vertically center the content */
justify-content: center;
float: left;
width: 100%;
position: relative;
height: 100%;
top: 0;
left: 50px;
margin-left: -100%;
background: #333;
/* border-radius: 25px; */
z-index: 50;
/* box-shadow: 1px 1px 5px rgba(0,0,0,0.3); */
cursor: pointer;
/* transition: left 0.5s; */
/* overflow: hidden; */
}
/* .rsbcSliderTransition {
transition: left 0.5s;
} */
.rsbcSliderText {
display: flex; /* Use flexbox */
align-items: center; /* Vertically center the content */
justify-content: center;
position: absolute;
top: 0;
left: 0;
right: 12%;
height: 100%;
text-align: center;
font-family: "Lucida Sans", "Lucida Sans Regular", "Lucida Grande",
"Lucida Sans Unicode", Geneva, Verdana, sans-serif;
letter-spacing: 1px;
font-size: 14px;
z-index: 10;
}
.rsbcSliderArrow {
float: left;
position: absolute;
transform: rotate(45deg);
height: 8px;
width: 8px;
top: 50%;
right: 22px;
margin-top: -6px;
/* border-left-color: transparent;
border-bottom-color: transparent; */
transform-origin: center;
z-index: 60;
}
.rsbcSliderCircle {
position: absolute;
right: 0;
background: #444;
top: 0;
height: 100%;
width: 50px;
border-radius: 100%;
z-index: 50;
}
.rsbcText {
display: flex; /* Use flexbox */
align-items: center; /* Vertically center the content */
justify-content: center;
float: left;
position: absolute;
top: 0;
left: 5%;
right: 0;
height: 100%;
line-height: 50px;
text-align: center;
font-family: "Lucida Sans", "Lucida Sans Regular", "Lucida Grande",
"Lucida Sans Unicode", Geneva, Verdana, sans-serif;
letter-spacing: 1px;
font-size: 14px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
z-index: 10;
/* color: #000; */
}
.rsbContainerUnlocked .rsbcSliderArrow,
.rsbContainerUnlocked .rsbcSliderCircle {
transition: 0.5s;
}
/* @media (min-width: 1313px) {
.ReactSwipeButton {
width: 50%;
}
.rsbContainer{
width: 120%;
}
} */
.textAnimate {
/* position: relative; */
transition: all 0.3s ease;
background: linear-gradient(
90deg,
currentColor 0%,
var(--shimmer-color, rgba(255, 255, 255, 1)) 50%,
currentColor 100%
);
text-shadow: 0 0 1px rgba(0, 0, 0, 0.1);
background-size: 200% 100%;
background-clip: text;
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
animation: shimmer 2s infinite linear;
user-select: none;
}
.sliderShimmer {
/* display: flex;
align-items: center;
justify-content: center; */
/* float: left; */
/* width: 100%; */
position: absolute;
height: 100%;
/* content: ""; */
position: absolute;
top: 0;
left: 10%;
width: 120%;
height: 100%;
background-size: 50% 100%;
z-index: 2;
animation: sliderShimmer 4s infinite ease-in-out;
background-color: rgb(255 255 255 / 20%);
border-bottom-right-radius: 50px;
border-top-right-radius: 50px;
pointer-events: none;
}
@keyframes sliderShimmer {
0% {
transform: translateX(-100%);
}
100% {
transform: translateX(-20%);
}
}
@keyframes shimmer {
0% {
background-position: 100% 0;
}
100% {
background-position: -100% 0;
}
}