I want to style my roundSlider something like this one in the picture:
I've gone through documentation for round slider https://roundsliderui.com/document.html , but I am not able to style it like in the above picture, since my limiting knowledge of CSS.
Here is the code I've got so far:
HTML:
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title></title>
</head>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/jquery.roundslider/1.0/roundslider.min.css">
<body>
<div class="container">
<div id="thermostatSlider"></div>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js" charset="utf-8">
</body>
CSS:
.rs-range-color {
background-color: #33B5E5;
}
.rs-path-color {
background-color: #C2E9F7;
}
.rs-handle {
background-color: #C2E9F7;
padding: 7px;
border: 2px solid #C2E9F7;
}
.rs-handle.rs-focus {
border-color: #33B5E5;
}
.rs-handle:after {
border-color: #33B5E5;
background-color: #33B5E5;
}
.rs-border {
border-color: transparent;
}
.rs-tooltip-text {
font-family: Roboto, sans-serif;
font-size: 30px;
border-radius: 7px;
transition: background 0.02s ease-in-out;
color: #33B5E5;
}
.rs-tooltip-text:before {
position: absolute;
left: 3px;
top: -15px;
content: 'COOLING';
font-size: 12px;
}
.rs-tooltip-text:after {
position: absolute;
left: 19px;
top: 48px;
content: '19';
font-size: 12px;
}
.container{
position: absolute;
z-index: 2;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
font-family: Roboto, sans-serif;
}
JS:
$("#thermostatSlider").roundSlider({
radius: 80,
width: 8,
min: 15,
max: 75,
handleSize: "+16",
circleShape: "pie",
handleShape: "dot",
sliderType: "min-range",
startAngle: 315,
value: 24,
disabled: false
});
Also, my problem is that I cannot set it to behave properly when placed inside a boostrap card. It's down-most part is pointing out, like this: https://ibb.co/26xCBrp.
I have also prepared a small jsfiddle with the above code: JSFiddle.
There are multiple ways to do this in html css, here I have done with a simplest way. Check the below demo for the inner circle shadow behaviour and bottom triangle pointing out issue:
Demo
Suggestion:
In case, if you don't need the tooltip editable functionality then you can simply customize the tooltip with tooltip formatting. This will be useful when the texts are dynamic. Check the below demo based on that:
Demo with tooltip formatting