A button and slider at same digital pin on Adafruit ESP8266

And use the search function in this web page… i.e “button slider led” shows a few threads, including this one…

It is not exactly what you are looking for, examples rarely are… so study it and tweak it to your needs.