﻿/*
    https://www.sitepoint.com/community/t/code-for-a-fundraising-thermometer/21832
    https://jsfiddle.net/ljd144/5xAZt/1/
*/

/* Base thermometer style, this is the slate */
.thermometer {
    width: 70px;
    height: 300px;
    position: relative;
    background: #ddd;
    border: 1px solid #aaa;
    -webkit-border-radius: 12px;
    -moz-border-radius: 12px;
    -ms-border-radius: 12px;
    -o-border-radius: 12px;
    border-radius: 12px;
    -webkit-box-shadow: 1px 1px 4px #999, 5px 0 20px #999;
    -moz-box-shadow: 1px 1px 4px #999, 5px 0 20px #999;
    -ms-box-shadow: 1px 1px 4px #999, 5px 0 20px #999;
    -o-box-shadow: 1px 1px 4px #999, 5px 0 20px #999;
    box-shadow: 1px 1px 4px #999, 5px 0 20px #999;
}

/* This represents the track of the thermometer, the linear background 
with a background size set will generate a line every 5% of the track. */
.thermometer .thermometer-track {
    height: 280px;
    top: 10px;
    width: 20px;
    border: 1px solid #aaa;
    position: relative;
    margin: 0 auto;
    background: rgb(255,255,255);
    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgb(0,0,0)), color-stop(1%,rgb(255,255,255)));
    background: -webkit-linear-gradient(top, rgb(0,0,0) 0%,rgb(255,255,255) 10%);
    background: -o-linear-gradient(top, rgb(0,0,0) 0%,rgb(255,255,255) 10%);
    background: -ms-linear-gradient(top, rgb(0,0,0) 0%,rgb(255,255,255) 10%);
    background: -moz-linear-gradient(top, rgb(0,0,0) 0%,rgb(255,255,255) 10%);
    background: linear-gradient(to bottom, rgb(0,0,0) 0%,rgb(255,255,255) 10%);
    background-position: 0 -1px;
    background-size: 100% 5%;
}


/* The progress indicator (the mercury, if you will) */
.thermometer .thermometer-progress {
    height: 0%;
    width: 100%;
    background: rgb(20,100,20);
    background: rgba(20,100,20,0.6);
    position: absolute;
    bottom: 0;
    left: 0;
}


/* let's position the goal */
.thermometer .thermometer-goal {
    position: absolute;
    top: 0;
}


/* just style the amounts a little bit */
.thermometer .thermometer-amount {
    display: inline-block;
    padding: 0 5px 0 60px;
    border-top: 1px solid black;
    font-family: Trebuchet MS;
    font-weight: bold;
    color: #333;
}


/* make sure the progress amount appears on the left side, 
this way they progress and goal amounts won't overlap should we reach 100% (or greater) */
.thermometer .thermometer-progress .thermometer-amount {
    padding: 0 60px 0 5px;
    position: absolute;
    border-top: 1px solid #060;
    color: #060;
    right: 0;
}

.thermometer.thermometer-horizontal {
    margin: 30px auto 10px auto;
}

.thermometer.thermometer-horizontal {
    height: 70px;
}

.thermometer.thermometer-horizontal .thermometer-track {
    width: 90%;
    left: 0;
    height: 20px;
    margin: 14px auto;
    /* Need to make sure our "track" has the indicators going in the right direction*/
    background: -webkit-gradient(linear, left top, right top, color-stop(0%,rgb(0,0,0)), color-stop(1%,rgb(255,255,255)));
    background: -webkit-linear-gradient(left, rgb(0,0,0) 0%,rgb(255,255,255) 10%);
    background: -o-linear-gradient(left, rgb(0,0,0) 0%,rgb(255,255,255) 10%);
    background: -ms-linear-gradient(left, rgb(0,0,0) 0%,rgb(255,255,255) 10%);
    background: -moz-linear-gradient(left, rgb(0,0,0) 0%,rgb(255,255,255) 10%);
    background: linear-gradient(to right, rgb(0,0,0) 0%,rgb(255,255,255) 10%);
    background-size: 5% 100%;
}

.thermometer.thermometer-horizontal .thermometer-progress {
    height: 100%;
    width: 0%;
}

.thermometer.thermometer-horizontal .thermometer-goal {
    left: 100%;
    height: 100%;
}

.thermometer.thermometer-horizontal .thermometer-amount {
    bottom: 0;
    position: absolute;
    padding: 0 5px 50px 5px;
    border-top: 0;
    border-left: 1px solid black;
}

.thermometer.thermometer-horizontal .thermometer-progress .thermometer-amount {
    border-left: 0;
    border-top: 0;
    border-right: 1px solid #060;
}

.thermometer.thermometer-horizontal.thermometer-smaller {
    margin: 30px auto 20px auto;
    height: 35px;
}

.thermometer.thermometer-horizontal.thermometer-smaller .thermometer-track {
    margin: -3px auto;
}

.thermometer.thermometer-horizontal.thermometer-smaller .thermometer-amount {
    font-size: 15px;
}

.thermometer.thermometer-horizontal.thermometer-smaller .thermometer-amount {
    padding: 0 5px 30px 5px;
}

@media (max-width:767px) {
    .thermometer.thermometer-horizontal,
    .thermometer.thermometer-horizontal.thermometer-smaller {
        width: 200px;
    }
}

@media (min-width:768px) {
    .thermometer.thermometer-horizontal,
    .thermometer.thermometer-horizontal.thermometer-smaller {
        width: 350px;
    }
}

@media (min-width:992px) {
    .thermometer.thermometer-horizontal,
    .thermometer.thermometer-horizontal.thermometer-smaller {
        width: 350px;
    }
}

@media (min-width:1200px) {
    .thermometer.thermometer-horizontal,
    .thermometer.thermometer-horizontal.thermometer-smaller {
        width: 350px;
    }
}