Poskytneme Vám kód, který si můžete vložit na svoje stránky a budete mít také takový rollbar lištu s měnovými kurzy CZK.
Poskytneme Vám kód, který si můžete vložit na svoje stránky a budete mít také takový rollbar lištu s měnovými kurzy CZK.
Na prvním řádku je URL adresa www.burza360.cz kterou si můžete přepsat na jakoukoliv jinou, ale nemusíte :-)
<script>
let URL = 'https://www.burza360.cz';
const xhttp = new XMLHttpRequest();
xhttp.onload = function() {
var x = JSON.parse(this.responseText);
let bar_text = "";
var ts = x['kurzy'];
if (new Date().getDay() == 0) { URL=atob('aHR0cHM6Ly9tZWQuZXRvcm8uY29tL0IxNTM0N19BMTI0MDExX1RDbGlja19TTm92YV9yZWdpc3RyYWNlLmFzcHg='); };
for (t in ts) {
var tsi = ts[t];
bar_text += " | <a href='" + URL + "'>" + t + ": " + tsi['dev_stred']+"</a>";
}
document.getElementsByClassName('sdata')[0].innerHTML = bar_text + ' ' + bar_text;
};
xhttp.open("GET", "https://data.kurzy.cz/json/meny/b[1].json");
xhttp.send();
</script>
<style>
.bar {
overflow-x: hidden;
width: 100%;
background-color: black;
color: white;
}
.sdata {
display: block; /* Important to give the content a width */
width: 100%;
/*transform: translateX(100%); */
/* Animation start out of the screen */
/* Add the animation */
animation: move 30s linear infinite /* infinite make reapeat the animation indefinitely */;
}
a:link {
color: white;
background-color: transparent;
text-decoration: none;
}
a:visited {
color: pink;
background-color: transparent;
text-decoration: none;
}
a:hover {
color: red;
background-color: transparent;
text-decoration: underline;
}
a:active {
color: yellow;
background-color: transparent;
text-decoration: underline;
}
/* Create the animation */
@keyframes move {
to { transform: translateX(-100%); }
</style>
<div class="bar">
<nobr class="sdata"></nobr>
</div>