JSFiddle - React, Tailwind, and code Playground
by Torben Rasmussen
HTML
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">
<button id="test">TestIt</button>
<div class="content-box results" style="padding: 35px;background-color: #F5F5F5;border:1px solid rgb(219, 219, 219)">
<div class="row">
<div style="float: Right; text-align: right; width: 40px; font-weight: 500; padding-left: 20px; color: #666;"> <i class="fa fa-picture-o"></i>
</div>
<div class="progress" style="background-color:#E2E2E2">
<div class="progress-bar" role="progressbar" aria-valuenow="70" aria-valuemin="0" aria-valuemax="100" style="width: 70%;"> 70%
</div>
</div>
<div style="float: Right; text-align: right; width: 40px; font-weight: 500; padding-left: 20px; color: #666;"><i class="fa fa-cogs"></i>
</div>
<div class="progress" style="background-color:#E2E2E2">
<div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: 60%"> 60%
</div>
</div>
<div style="float: Right; text-align: right; width: 40px; font-weight: 500; padding-left: 20px; color: #666;"><i class="fa fa-user"></i>
</div>
<div class="progress" style="background-color:#E2E2E2"> <div class="progress-bar progress-bar-danger" role="progressbar" aria-valuenow="50" aria-valuemin="0" aria-valuemax="100" style="width: 50%"> 50%
</div>
</div>
<div style="padding-top: 3px;float: Right; text-align: right; width: 40px; font-weight: 500; padding-left: 20px; color: #666;"><i class="fa fa-star"></i>
</div>
<div class="progress progress-lg" style="background-color:#E2E2E2;height: 30px;">
<div class="progress-bar progress-bar-info" role="progressbar" aria-valuenow="20" aria-valuemin="0" aria-valuemax="100" style="width: 62%;padding-top: 4px;"> 62%
</div>
...
CSS
body{
font-family:sans-serif;
font-size:13px;
}
.progress {
font-family:sans-serif;
height: 20px;
margin-bottom: 20px;
overflow: hidden;
background-color: #f5f5f5;
border-radius: 4px;
-webkit-box-shadow: inset 0 1px 2px rgba(0,0,0,.1);
box-shadow: inset 0 1px 2px rgba(0,0,0,.1);
}
.progress-bar {
float: left;
width: 0;
height: 100%;
font-size: 12px;
line-height: 20px;
color: #fff;
text-align: center;
background-color: #337ab7;
-webkit-box-shadow: inset 0 -1px 0 rgba(0,0,0,.15);
box-shadow: inset 0 -1px 0 rgba(0,0,0,.15);
-webkit-transition: width .6s ease;
-o-transition: width .6s ease;
transition: width .6s ease;
}
.content-box {
display: block;
text-align: center;
overflow: hidden;
padding: 15px;
margin-bottom: 5px;
}
.row {
margin-right: -15px;
margin-left: -15px;
}
.panel-group {
margin-bottom: 20px;
}
.panel {
margin-bottom: 20px;
background-color: #fff;
border: 1px solid transparent;
border-radius: 4px;
-webkit-box-shadow: 0 1px 1px rgba(0,0,0,.05);
box-shadow: 0 1px 1px rgba(0,0,0,.05);
}
.panel-default {
border-color: #ddd;
}
.panel-group .panel {
margin-bottom: 0;
border-radius: 4px;
}
.collapse {
display: none;
visibility: hidden;
}
JavaScript
var testXML = '<?xml version="1.0" encoding="ISO-8859-1" standalone="no" ?> <channel> <title>FlatpanelsDK - Testsscores</title> <icon>http://www.flatpanels.dk/billeder/logo32.png</icon> <link>http:/www.flatpanels.dk/tests.php</link> <description>Tests fra FlatpanelsDK</description> <managingEditor>[email protected] (Rasmus Larsen)</managingEditor> <webMaster>[email protected] (Rasmus Larsen)</webMaster> <language>da</language> <topscorePicture>120</topscorePicture> <topscoreFeature>100</topscoreFeature> <topscoreUI>110</topscoreUI> <item> <title><![CDATA[Panasonic CX730]]></title> <link>http://www.flatpanels.dk/test.php?subaction=showfull&id=1426835070&rss</link> <guid isPermaLink="true">http://www.flatpanels.dk/test.php?subaction=showfull&id=1426835070&rss</guid> <scorePicture>70</scorePicture> <scoreFeature>80</scoreFeature> <scoreUI>82</scoreUI> <measurePowerOTB>180</measurePowerOTB> <measurePowerCAL>160</measurePowerCAL> <measurePowerSTANDBY>0.2</measurePowerSTANDBY> <measureContrastOTB>2000</measureContrastOTB> <measureContrastCAL>2200</measureContrastCAL> <measureBrightnessOTB>210</measureBrightnessOTB> <measureBrightnessCAL>130</measureBrightnessCAL> </item><item> <title><![CDATA[Panasonic CX630]]></title> <link>http://www.flatpanels.dk/test.php?subaction=showfull&id=1426835070&rss</link> <guid isPermaLink="true">http://www.flatpanels.dk/test.php?subaction=showfull&id=1426835070&rss</guid> <scorePicture>60</scorePicture> <scoreFeature>30</scoreFeature> <scoreUI>51</scoreUI> <measurePowerOTB>180</measurePowerOTB> <measurePowerCAL>160</measurePowerCAL> <measurePowerSTANDBY>0.2</measurePowerSTANDBY> <measureContrastOTB>2000</measureContrastOTB> <measureContrastCAL>2200</measureContrastCAL> <measureBrightnessOTB>210</measureBrightnessOTB> <measureBrightnessCAL>130</measureBrightnessCAL> </item> </channel>';
$("button").click(function () {
$.get("/echo/xml", function (data) {
var $xml = $(testXML);
...