mirror of
https://github.com/seigler/Dash-price-widget
synced 2025-07-25 23:36:09 +00:00
improved appearance
This commit is contained in:
parent
8cf456f7aa
commit
e203d61a7f
6 changed files with 124 additions and 44 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1 +1,2 @@
|
|||
/node_modules/
|
||||
/.brackets.json
|
||||
|
|
9
assets/media/dash.svg
Normal file
9
assets/media/dash.svg
Normal file
|
@ -0,0 +1,9 @@
|
|||
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
width="226.777px" height="226.777px" viewBox="0 0 226.777 226.777" enable-background="new 0 0 226.777 226.777"
|
||||
xml:space="preserve">
|
||||
<path fill="#FFFFFF" d="M113.388,0C50.766,0,0,50.766,0,113.388c0,62.623,50.766,113.389,113.389,113.389
|
||||
c62.623,0,113.389-50.766,113.389-113.389C226.777,50.766,176.011,0,113.388,0z M56.562,104.802h45.266l-5.238,17.024H51.326
|
||||
L56.562,104.802z M173.83,96.773c-1.801,6.506-7.656,26.023-10.059,32.945c-2.4,6.922-6.829,12.734-12.506,16.057
|
||||
c-5.676,3.323-7.797,4.712-15.731,4.712H54.303l5.721-18.542h76.395l11.414-37.109h-75.79l5.722-18.541c0,0,83.698,0,84.577,0
|
||||
c3.875,0,8.996,1.792,11.488,6.639C176.321,87.775,175.629,90.267,173.83,96.773z"/>
|
||||
</svg>
|
After Width: | Height: | Size: 812 B |
|
@ -1,10 +1,6 @@
|
|||
(function () {
|
||||
"use strict";
|
||||
|
||||
/*jshint ignore:start*/
|
||||
window.JSON || document.write('<scr' + 'ipt src="//cdnjs.cloudflare.com/ajax/libs/json3/3.2.4/json3.min.js"><\/scr' + 'ipt>');
|
||||
/*jshint ignore:end*/
|
||||
|
||||
function fetchJSONFile(path, callback) {
|
||||
var httpRequest = (window.XMLHttpRequest) ? new XMLHttpRequest() : new ActiveXObject("Microsoft.XMLHTTP");
|
||||
httpRequest.onreadystatechange = function () {
|
||||
|
|
|
@ -1,54 +1,60 @@
|
|||
/* Micro reset so global styles don't interfere */
|
||||
|
||||
.dash-ticker,
|
||||
.dash-ticker *,
|
||||
.dash-ticker *:before,
|
||||
.dash-ticker *:after {
|
||||
box-sizing: inherit;
|
||||
vertical-align: baseline;
|
||||
font-weight: inherit;
|
||||
font-family: inherit;
|
||||
font-style: inherit;
|
||||
font-size: 100%;
|
||||
border: 0 none;
|
||||
outline: 0;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
box-sizing: inherit;
|
||||
vertical-align: baseline;
|
||||
font-weight: inherit;
|
||||
font-family: inherit;
|
||||
font-style: inherit;
|
||||
font-size: 100%;
|
||||
border: 0 none;
|
||||
outline: 0;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.dash-ticker {
|
||||
display: block;
|
||||
max-width: 20em;
|
||||
margin: 0.5em auto;
|
||||
border-radius: 0.5em;
|
||||
background-color: rgba(0,0,0,0.125);
|
||||
box-sizing: border-box;
|
||||
color: inherit;
|
||||
padding: 0.5em;
|
||||
display: block;
|
||||
max-width: 20em;
|
||||
margin: 0.5em auto;
|
||||
border-radius: 0.5em;
|
||||
background-color: #1D76BC;
|
||||
box-sizing: border-box;
|
||||
color: white;
|
||||
padding: 0.5em;
|
||||
font-family: serif;
|
||||
}
|
||||
|
||||
.dash-ticker .dash-ticker--title {
|
||||
text-align: center;
|
||||
font-size: 1.5em;
|
||||
padding-bottom: 0.125em;
|
||||
border-bottom: 1px solid rgba(0,0,0,0.5);
|
||||
margin-bottom: 0.25em;
|
||||
font-size: 2em;
|
||||
float: left;
|
||||
height: 1em;
|
||||
width: 1em;
|
||||
overflow: hidden;
|
||||
text-indent: -999px;
|
||||
background-image: url(../media/dash.svg);
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
|
||||
#dash-ticker--price-container {
|
||||
font-size: 2em;
|
||||
text-align: center;
|
||||
font-size: 2em;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#dash-ticker--price-container > input {
|
||||
position: fixed;
|
||||
right: -200px;
|
||||
position: fixed;
|
||||
right: -200px;
|
||||
}
|
||||
|
||||
#dash-ticker--price-container > input + label {
|
||||
display: none;
|
||||
cursor: pointer;
|
||||
display: none;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
#dash-ticker--price-container > input:checked + label {
|
||||
display: block;
|
||||
display: block;
|
||||
}
|
||||
|
|
80
dist/index.html
vendored
80
dist/index.html
vendored
|
@ -1,9 +1,76 @@
|
|||
<style type="text/css">.dash-ticker,.dash-ticker *,.dash-ticker :after,.dash-ticker :before{box-sizing:inherit;vertical-align:baseline;font-weight:inherit;font-family:inherit;font-style:inherit;font-size:100%;border:0;outline:0;padding:0;margin:0}.dash-ticker{display:block;max-width:20em;margin:.5em auto;border-radius:.5em;background-color:rgba(0,0,0,.125);box-sizing:border-box;color:inherit;padding:.5em}.dash-ticker .dash-ticker--title{text-align:center;font-size:1.5em;padding-bottom:.125em;border-bottom:1px solid rgba(0,0,0,.5);margin-bottom:.25em}#dash-ticker--price-container{font-size:2em;text-align:center}#dash-ticker--price-container>input{position:fixed;right:-200px}#dash-ticker--price-container>input+label{display:none;cursor:pointer}#dash-ticker--price-container>input:checked+label{display:block}</style><form class="dash-ticker"><div class="dash-ticker--title">Dash Price</div><div id="dash-ticker--price-container" title="Click to change currency"><input type="radio" name="currency" id="USD" checked="checked"><label><span class="dash-ticker--price">Loading...</span> <span class="dash-ticker--currency"></span></label></div></form><script type="application/javascript">(function () {
|
||||
"use strict";
|
||||
<style type="text/css">/* Micro reset so global styles don't interfere */
|
||||
|
||||
/*jshint ignore:start*/
|
||||
window.JSON || document.write('<scr' + 'ipt src="//cdnjs.cloudflare.com/ajax/libs/json3/3.2.4/json3.min.js"><\/scr' + 'ipt>');
|
||||
/*jshint ignore:end*/
|
||||
.dash-ticker,
|
||||
.dash-ticker *,
|
||||
.dash-ticker *:before,
|
||||
.dash-ticker *:after {
|
||||
box-sizing: inherit;
|
||||
vertical-align: baseline;
|
||||
font-weight: inherit;
|
||||
font-family: inherit;
|
||||
font-style: inherit;
|
||||
font-size: 100%;
|
||||
border: 0 none;
|
||||
outline: 0;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.dash-ticker {
|
||||
display: block;
|
||||
max-width: 20em;
|
||||
margin: 0.5em auto;
|
||||
border-radius: 0.5em;
|
||||
background-color: #1D76BC;
|
||||
box-sizing: border-box;
|
||||
color: white;
|
||||
padding: 0.5em;
|
||||
font-family: serif;
|
||||
}
|
||||
|
||||
.dash-ticker .dash-ticker--title {
|
||||
font-size: 2em;
|
||||
float: left;
|
||||
height: 1em;
|
||||
width: 1em;
|
||||
overflow: hidden;
|
||||
text-indent: -999px;
|
||||
background-image: url("data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIGlkPSJMYXllcl8xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4PSIwcHgiIHk9IjBweCIKCSB3aWR0aD0iMjI2Ljc3N3B4IiBoZWlnaHQ9IjIyNi43NzdweCIgdmlld0JveD0iMCAwIDIyNi43NzcgMjI2Ljc3NyIgZW5hYmxlLWJhY2tncm91bmQ9Im5ldyAwIDAgMjI2Ljc3NyAyMjYuNzc3IgoJIHhtbDpzcGFjZT0icHJlc2VydmUiPgo8cGF0aCBmaWxsPSIjRkZGRkZGIiBkPSJNMTEzLjM4OCwwQzUwLjc2NiwwLDAsNTAuNzY2LDAsMTEzLjM4OGMwLDYyLjYyMyw1MC43NjYsMTEzLjM4OSwxMTMuMzg5LDExMy4zODkKCWM2Mi42MjMsMCwxMTMuMzg5LTUwLjc2NiwxMTMuMzg5LTExMy4zODlDMjI2Ljc3Nyw1MC43NjYsMTc2LjAxMSwwLDExMy4zODgsMHogTTU2LjU2MiwxMDQuODAyaDQ1LjI2NmwtNS4yMzgsMTcuMDI0SDUxLjMyNgoJTDU2LjU2MiwxMDQuODAyeiBNMTczLjgzLDk2Ljc3M2MtMS44MDEsNi41MDYtNy42NTYsMjYuMDIzLTEwLjA1OSwzMi45NDVjLTIuNCw2LjkyMi02LjgyOSwxMi43MzQtMTIuNTA2LDE2LjA1NwoJYy01LjY3NiwzLjMyMy03Ljc5Nyw0LjcxMi0xNS43MzEsNC43MTJINTQuMzAzbDUuNzIxLTE4LjU0Mmg3Ni4zOTVsMTEuNDE0LTM3LjEwOWgtNzUuNzlsNS43MjItMTguNTQxYzAsMCw4My42OTgsMCw4NC41NzcsMAoJYzMuODc1LDAsOC45OTYsMS43OTIsMTEuNDg4LDYuNjM5QzE3Ni4zMjEsODcuNzc1LDE3NS42MjksOTAuMjY3LDE3My44Myw5Ni43NzN6Ii8+Cjwvc3ZnPgo=");
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
|
||||
#dash-ticker--price-container {
|
||||
font-size: 2em;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#dash-ticker--price-container > input {
|
||||
position: fixed;
|
||||
right: -200px;
|
||||
}
|
||||
|
||||
#dash-ticker--price-container > input + label {
|
||||
display: none;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
#dash-ticker--price-container > input:checked + label {
|
||||
display: block;
|
||||
}
|
||||
</style>
|
||||
<form class="dash-ticker">
|
||||
<div class="dash-ticker--title">Dash Price</div>
|
||||
<div id="dash-ticker--price-container" title="Click to change currency">
|
||||
<input type="radio" name="currency" id="USD" checked />
|
||||
<label>
|
||||
<span class="dash-ticker--price">Loading...</span>
|
||||
<span class="dash-ticker--currency"></span>
|
||||
</label>
|
||||
</div>
|
||||
</form>
|
||||
<script type="application/javascript">(function () {
|
||||
"use strict";
|
||||
|
||||
function fetchJSONFile(path, callback) {
|
||||
var httpRequest = (window.XMLHttpRequest) ? new XMLHttpRequest() : new ActiveXObject("Microsoft.XMLHTTP");
|
||||
|
@ -32,4 +99,5 @@
|
|||
}
|
||||
document.getElementById('dash-ticker--price-container').innerHTML = currencyListHTML;
|
||||
});
|
||||
})();</script>
|
||||
})();
|
||||
</script>
|
||||
|
|
|
@ -3,10 +3,9 @@
|
|||
"version": "1.0.0",
|
||||
"description": "Embeddable dash price widget",
|
||||
"scripts": {
|
||||
"test": "npm run -s lint",
|
||||
"lint": "echo '=> linting' && jshint assets/scripts/*.js",
|
||||
"inline": "echo '=> inlining' && inline-assets --cssmin --htmlmin assets/index.html dist/index.html",
|
||||
"install": "npm run -s lint && npm run -s inline"
|
||||
"inline": "echo '=> inlining' && inline-assets assets/index.html dist/index.html",
|
||||
"test": "npm run -s lint && npm run -s inline"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
@ -20,6 +19,7 @@
|
|||
"homepage": "https://github.com/seigler/Dash-html-ticker#readme",
|
||||
"devDependencies": {
|
||||
"inline-assets": "^1.0.0",
|
||||
"jshint": "^2.9.2"
|
||||
"jshint": "^2.9.2",
|
||||
"uglify-js": "^2.6.2"
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue