PDA

View Full Version : Mini Mods - Nicer poll bars - css


billstelling
12-04-2013, 11:00 PM
I miss adding the images for the poll bars we had before. Even then it was a pain to code in and you had to up graphics to get the job done.

I put together a little coding to make it really simple to do and only takes about a minute to do.


To use this mod, add this code to additional css.
.pollbar1, .pollbar2, .pollbar3, .pollbar4, .pollbar5, .pollbar6 {
top: 4px;
border-radius: 3px 3px 3px 3px !important;
border-width: 1px !important;
border-style: solid !important;
border-color: transparent !important;
background: -moz-linear-gradient(center top , rgb(218, 107, 19) 0%, rgb(253, 125, 22) 20px) repeat scroll 0% 0% transparent !important;
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, rgb(218, 107, 19)), color-stop(20px, rgb(253, 125, 22))) !important;
background: -webkit-linear-gradient(top, rgb(218, 107, 19) 0%, rgb(253, 125, 22) 20px) !important;
background: -o-linear-gradient(top, rgb(218, 107, 19) 0%, rgb(253, 125, 22) 20px) !important;
background: -ms-linear-gradient(top, rgb(218, 107, 19) 0%, rgb(253, 125, 22) 20px) !important;
background: linear-gradient(top, rgb(218, 107, 19) 0%, rgb(253, 125, 22) 20px) !important;
filter: progid:dximagetransform.microsoft.gradient(startCo lorstr='#da6b13', endColorstr='#fd7d16', GradientType=0) !important;
position: relative;
-webkit-box-shadow: 0px 3px 6px 0px rgba(0, 0, 0, 0.25);
-moz-box-shadow: 0px 3px 6px 0px rgba(0, 0, 0, 0.25);
box-shadow: 0px 3px 6px 0px rgba(0, 0, 0, 0.25);
}

Go to the stylvars for the theme, click the go button on the right and then check the box that says "Hide Variables". Pick "polls' in the list and set the "Poll Bar Height" to what you want, I used 6px and set "Poll Bar Margin" to 0.4em. Set the colors for the poll bars to the start color you set for the gradient if you changed it. I used #fd7d16.

You can set the colors for the gradient by adjusting the red code.

You can set the level of shadow by adjusting the dark orange code.

The blue is to bring them down and centered with the text for the poll item.

If you want a different one for each bar, use the same code, change to the colors you want, and remove the extra descriptors.
.pollbar1, .pollbar2, .pollbar3, .pollbar4, .pollbar5, .pollbar6 {

With each one just change pollbar1 to the number for that bar.

https://vborg.vbsupport.ru/external/2013/12/34.png
full size (http://i.imgur.com/LTml3Ih.png)
Enjoy. ;)


Update:

Colored poll bars.

https://vborg.vbsupport.ru/external/2013/12/35.png

.pollbar1 {
top: 4px;
border-radius: 3px 3px 3px 3px !important;
border-width: 1px !important;
border-style: solid !important;
border-color: transparent !important;
background: -moz-linear-gradient(center top , #d3d3d3 0%, #eaeaea 20px) repeat scroll 0% 0% transparent !important;
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #d3d3d3), color-stop(20px, #eaeaea)) !important;
background: -webkit-linear-gradient(top, #d3d3d3 0%, #eaeaea 20px) !important;
background: -o-linear-gradient(top, #d3d3d3 0%, #eaeaea 20px) !important;
background: -ms-linear-gradient(top, #d3d3d3 0%, #eaeaea 20px) !important;
background: linear-gradient(top, #d3d3d3 0%, #eaeaea 20px) !important;
filter: progid:dximagetransform.microsoft.gradient(startCo lorstr='#d3d3d3', endColorstr='#eaeaea', GradientType=0) !important;
position: relative;
-webkit-box-shadow: 0px 3px 6px 0px rgba(0, 0, 0, 0.25);
-moz-box-shadow: 0px 3px 6px 0px rgba(0, 0, 0, 0.25);
box-shadow: 0px 3px 6px 0px rgba(0, 0, 0, 0.25);
}
.pollbar2 {
top: 4px;
border-radius: 3px 3px 3px 3px !important;
border-width: 1px !important;
border-style: solid !important;
border-color: transparent !important;
background: -moz-linear-gradient(center top , #0e0eff 0%, #3535ff 20px) repeat scroll 0% 0% transparent !important;
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #0e0eff), color-stop(20px, #3535ff)) !important;
background: -webkit-linear-gradient(top, #0e0eff 0%, #3535ff 20px) !important;
background: -o-linear-gradient(top, #0e0eff 0%, #3535ff 20px) !important;
background: -ms-linear-gradient(top, #0e0eff 0%, #3535ff 20px) !important;
background: linear-gradient(top, #0e0eff 0%, #3535ff 20px) !important;
filter: progid:dximagetransform.microsoft.gradient(startCo lorstr='#0e0eff', endColorstr='#3535ff', GradientType=0) !important;
position: relative;
-webkit-box-shadow: 0px 3px 6px 0px rgba(0, 0, 0, 0.25);
-moz-box-shadow: 0px 3px 6px 0px rgba(0, 0, 0, 0.25);
box-shadow: 0px 3px 6px 0px rgba(0, 0, 0, 0.25);
}
.pollbar3 {
top: 4px;
border-radius: 3px 3px 3px 3px !important;
border-width: 1px !important;
border-style: solid !important;
border-color: transparent !important;
background: -moz-linear-gradient(center top , #318000 0%, #40a600 20px) repeat scroll 0% 0% transparent !important;
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #318000), color-stop(20px, #40a600)) !important;
background: -webkit-linear-gradient(top, #318000 0%, #40a600 20px) !important;
background: -o-linear-gradient(top, #318000 0%, #40a600 20px) !important;
background: -ms-linear-gradient(top, #0e0eff 0%, #40a600 20px) !important;
background: linear-gradient(top, #318000 0%, #40a600 20px) !important;
filter: progid:dximagetransform.microsoft.gradient(startCo lorstr='#318000', endColorstr='#40a600', GradientType=0) !important;
position: relative;
-webkit-box-shadow: 0px 3px 6px 0px rgba(0, 0, 0, 0.25);
-moz-box-shadow: 0px 3px 6px 0px rgba(0, 0, 0, 0.25);
box-shadow: 0px 3px 6px 0px rgba(0, 0, 0, 0.25);
}
.pollbar4 {
top: 4px;
border-radius: 3px 3px 3px 3px !important;
border-width: 1px !important;
border-style: solid !important;
border-color: transparent !important;
background: -moz-linear-gradient(center top , #d80030 0%, #ff0039 20px) repeat scroll 0% 0% transparent !important;
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #d80030), color-stop(20px, #ff0039)) !important;
background: -webkit-linear-gradient(top, #d80030 0%, #ff0039 20px) !important;
background: -o-linear-gradient(top, #d80030 0%, #ff0039 20px) !important;
background: -ms-linear-gradient(top, #d80030 0%, #ff0039 20px) !important;
background: linear-gradient(top, #d80030 0%, #ff0039 20px) !important;
filter: progid:dximagetransform.microsoft.gradient(startCo lorstr='#d80030', endColorstr='#ff0039', GradientType=0) !important;
position: relative;
-webkit-box-shadow: 0px 3px 6px 0px rgba(0, 0, 0, 0.25);
-moz-box-shadow: 0px 3px 6px 0px rgba(0, 0, 0, 0.25);
box-shadow: 0px 3px 6px 0px rgba(0, 0, 0, 0.25);
}
.pollbar5 {
top: 4px;
border-radius: 3px 3px 3px 3px !important;
border-width: 1px !important;
border-style: solid !important;
border-color: transparent !important;
background: -moz-linear-gradient(center top , rgb(17, 119, 209) 0%, rgb(9, 88, 156) 20px) repeat scroll 0% 0% transparent !important;
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, rgb(17, 119, 209)), color-stop(20px, rgb(9, 88, 156))) !important;
background: -webkit-linear-gradient(top, rgb(17, 119, 209) 0%, rgb(9, 88, 156) 20px) !important;
background: -o-linear-gradient(top, rgb(17, 119, 209) 0%, rgb(9, 88, 156) 20px) !important;
background: -ms-linear-gradient(top, rgb(17, 119, 209) 0%, rgb(9, 88, 156) 20px) !important;
background: linear-gradient(top, rgb(17, 119, 209) 0%, rgb(9, 88, 156) 20px) !important;
filter: progid:dximagetransform.microsoft.gradient(startCo lorstr='#da6b13', endColorstr='#09589c', GradientType=0) !important;
position: relative;
-webkit-box-shadow: 0px 3px 6px 0px rgba(0, 0, 0, 0.25);
-moz-box-shadow: 0px 3px 6px 0px rgba(0, 0, 0, 0.25);
box-shadow: 0px 3px 6px 0px rgba(0, 0, 0, 0.25);
}
.pollbar6 {
top: 4px;
border-radius: 3px 3px 3px 3px !important;
border-width: 1px !important;
border-style: solid !important;
border-color: transparent !important;
background: -moz-linear-gradient(center top , #970880 0%, #bd26a4 20px) repeat scroll 0% 0% transparent !important;
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #970880), color-stop(20px, #bd26a4)) !important;
background: -webkit-linear-gradient(top, #970880 0%, #bd26a4 20px) !important;
background: -o-linear-gradient(top, #970880 0%, #bd26a4 20px) !important;
background: -ms-linear-gradient(top, #970880 0%, #bd26a4 20px) !important;
background: linear-gradient(top, #970880 0%, #bd26a4 20px) !important;
filter: progid:dximagetransform.microsoft.gradient(startCo lorstr='#970880', endColorstr='#bd26a4', GradientType=0) !important;
position: relative;
-webkit-box-shadow: 0px 3px 6px 0px rgba(0, 0, 0, 0.25);
-moz-box-shadow: 0px 3px 6px 0px rgba(0, 0, 0, 0.25);
box-shadow: 0px 3px 6px 0px rgba(0, 0, 0, 0.25);
}

Davey-UK
12-05-2013, 03:50 PM
Do you have a screen shot of what to expect with this edit?
Ta

billstelling
12-05-2013, 04:00 PM
added.. I missed it when I wrote it up. I added it while you were posting.. :D

ckgb
12-14-2013, 09:11 AM
How did you get the number of votes to display in the same orange?

Thanks

billstelling
12-15-2013, 10:12 PM
poll #'s
#pollresults li .votes .numvotes {
font-size: 11px;
color: #fd7d16;
}

poll %
#pollresults li .votes {
font-size: 11px;
color: #0d0d0d;
}

ckgb
12-15-2013, 11:24 PM
Thank you very much

billstelling
12-19-2013, 05:43 AM
:)your welcome..

ckgb
02-11-2014, 07:29 AM
Polls having 0 votes display semitransparent looking tiny bars. Where is the option to change color of he "zero vote" bars?

Thank you.

billstelling
04-16-2014, 01:09 AM
in this part of the code..

-webkit-box-shadow: 0px 3px 6px 0px rgba(0, 0, 0, 0.25);
-moz-box-shadow: 0px 3px 6px 0px rgba(0, 0, 0, 0.25);
box-shadow: 0px 3px 6px 0px rgba(0, 0, 0, 0.25);
}

ku-med
01-09-2015, 01:54 PM
Looks cool! Thanks.