bye bye github
This commit is contained in:
132
public/home/radio/cssRadio.css
Executable file
132
public/home/radio/cssRadio.css
Executable file
@@ -0,0 +1,132 @@
|
||||
section.title{
|
||||
background-color: #C22A39;
|
||||
height:35vh;
|
||||
min-height:360px;
|
||||
padding-top:60px;
|
||||
justify-content:center;
|
||||
-webkit-justify-content:center;
|
||||
}
|
||||
|
||||
article.title p{
|
||||
font-size: 4em;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
color: white;
|
||||
margin: auto;
|
||||
padding-top: 35px;
|
||||
}
|
||||
section.uname{
|
||||
background-color: #C22A39;
|
||||
}
|
||||
article.uname> p{
|
||||
font-size: 2em;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
color: white;
|
||||
margin: auto auto 20px 10px;
|
||||
}
|
||||
|
||||
section.rmod{
|
||||
width:100%;
|
||||
background-color: #C22A39;
|
||||
padding 10px;
|
||||
}
|
||||
article.rmod{
|
||||
flex:1 1 250px;
|
||||
margin:30px;
|
||||
}
|
||||
p#rmod{
|
||||
font-size: 1em;
|
||||
color: white;
|
||||
text-align: left;
|
||||
margin:10px 40px 50px;
|
||||
max-width:440px;
|
||||
}
|
||||
section.logout{
|
||||
width:100%;
|
||||
background-color: #C22A39;
|
||||
}
|
||||
article.logout{
|
||||
flex:1 1 100px;
|
||||
margin:2px;
|
||||
}
|
||||
p#logout{
|
||||
font-size: 1em;
|
||||
color: white;
|
||||
text-align: right;
|
||||
margin:-10px 50px 10px;
|
||||
}
|
||||
section.info,
|
||||
section.radio,
|
||||
section.chat{
|
||||
width:100%;
|
||||
background-color: #333333;
|
||||
padding 10px;
|
||||
justify-content:center;
|
||||
-webkit-justify-content:center;
|
||||
}
|
||||
|
||||
section.info{
|
||||
padding:50px 20px;
|
||||
}
|
||||
article.online,
|
||||
article.offline
|
||||
{
|
||||
flex:5 1 300px;
|
||||
font-size: 1.5em;
|
||||
color: white;
|
||||
max-width:340px;
|
||||
}
|
||||
article.spot{
|
||||
text-align:center;
|
||||
font-size: 1em;
|
||||
color: white;
|
||||
max-width:300px;
|
||||
flex:1 1 280px;
|
||||
}
|
||||
div.spot{
|
||||
display:inline-block;
|
||||
background-color:red;
|
||||
padding:15px;
|
||||
border-radius:15px;
|
||||
}
|
||||
div.chat{
|
||||
background-color: #C22A39;
|
||||
padding:20px 0px;
|
||||
margin:15px 0px;
|
||||
border-radius:5px;
|
||||
min-width:200px;
|
||||
}
|
||||
div.chat:hover{
|
||||
font-size:1.2em;
|
||||
padding:22px 3px;
|
||||
margin:13px -3px;
|
||||
cursor:pointer;
|
||||
|
||||
}
|
||||
|
||||
article.radio{
|
||||
margin:30px;
|
||||
background-color:black;
|
||||
width:80vw;
|
||||
}
|
||||
p#now{
|
||||
color:white;
|
||||
text-align:center;
|
||||
|
||||
}
|
||||
#ra{
|
||||
width:100%;
|
||||
margin:10px 0px;
|
||||
}
|
||||
|
||||
article.online{
|
||||
}
|
||||
article.offline{
|
||||
}
|
||||
.show{
|
||||
display:block;
|
||||
}
|
||||
.hide{
|
||||
display:none;
|
||||
}
|
||||
20
public/home/radio/jsLink.js
Executable file
20
public/home/radio/jsLink.js
Executable file
@@ -0,0 +1,20 @@
|
||||
|
||||
d3.select("#clink").on("click",function(){
|
||||
var newWindow = window.open('ext/candy','_blank');
|
||||
});
|
||||
|
||||
checkChat();
|
||||
|
||||
function checkChat(){
|
||||
d3.json("json/candy/candy_loader/candyInterface.pl&v=isOn",function(d){
|
||||
if(d != undefined){
|
||||
if (d.a==1) { d3.select("#clink").style("visibility","visible");}
|
||||
else if (d.a==0) { d3.select("#clink").style("visibility","hidden");}
|
||||
}
|
||||
else {
|
||||
d3.select("#clink").style("visibility","hidden");
|
||||
console.error("json/candy/candy_loader/candyInterface.pl&v=isOn");}
|
||||
d3.select("#clink").transition().on("end",checkChat).delay(30000);
|
||||
});
|
||||
}
|
||||
|
||||
89
public/home/radio/jsRadio.js
Executable file
89
public/home/radio/jsRadio.js
Executable file
@@ -0,0 +1,89 @@
|
||||
var vid = document.getElementById("ra");
|
||||
//defined by html template
|
||||
// var radio_server=rs;
|
||||
// var listen_url=lis;
|
||||
// var channel=chan;
|
||||
vid.autoplay=true;
|
||||
window.onload = function(){
|
||||
radioUpdate();
|
||||
|
||||
function radioUpdate(){
|
||||
d3.json(radio_server +"/status-json.xsl")
|
||||
.timeout(10000)
|
||||
.get(function(e,d){
|
||||
if(e !=undefined){
|
||||
console.warn("sin conxion");
|
||||
offline();}
|
||||
else{
|
||||
if(d.icestats.source!=undefined){
|
||||
if(d.icestats.source.listenurl == listen_url){
|
||||
console.log("transmitiendo");
|
||||
online(d); }
|
||||
else {
|
||||
console.warn("otro canal");
|
||||
offline(); }}
|
||||
else {
|
||||
console.warn("fuera de línea");
|
||||
offline();
|
||||
}
|
||||
} }); };
|
||||
|
||||
|
||||
function dataUpdate(){
|
||||
d3.json(radio_server+"/status-json.xsl")
|
||||
.timeout(10000)
|
||||
.get(function(e,d){
|
||||
if(e !=undefined){ console.warn("sin datos radio"); }
|
||||
else{
|
||||
if(d.icestats.source!=undefined){
|
||||
if(d.icestats.source.listenurl == listen_url ){
|
||||
d3.select("#now").text(d.icestats.source.title);
|
||||
}}}
|
||||
|
||||
d3.select("#ra").transition().on("end",dataUpdate).delay(60000);
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
function offline(){
|
||||
d3.selectAll("article.offline").style("display","block");
|
||||
d3.selectAll("article.online").style("display","none");
|
||||
d3.select("#spot").style("background-color","red");
|
||||
d3.select("#now").text("");
|
||||
console.log("desconectado");
|
||||
d3.select("#ra").transition().on("end",radioUpdate).delay(90000);
|
||||
};
|
||||
|
||||
function online(d){
|
||||
d3.select("#spot").style("background-color","green");
|
||||
d3.select("#prof").text(d.icestats.source.server_name);
|
||||
d3.select("#now").text(d.icestats.source.title);
|
||||
d3.selectAll("article.online").style("display","block");
|
||||
d3.selectAll("article.offline").style("display","none");
|
||||
vid.src=radio_server+channel;
|
||||
vid.load();
|
||||
console.log("conectado");
|
||||
dataUpdate();
|
||||
}
|
||||
|
||||
function cerr(e){ console.warn("stream "+ e);
|
||||
vid.pause();
|
||||
d3.select("#ra").transition()
|
||||
.on("end",function(){ vid.play(); })
|
||||
.delay(1000);
|
||||
};
|
||||
|
||||
function err(e){
|
||||
console.warn("stream "+e);
|
||||
d3.select("#ra").transition().on("end",radioUpdate).delay(5000);
|
||||
}
|
||||
|
||||
// if error try reloading
|
||||
|
||||
vid.onerror=function(e){ err("error")};
|
||||
vid.onended=function(){ err("end")};
|
||||
//vid.onstalled=function(){ cerr("st")};
|
||||
vid.onemptied=function(){ cerr("empty")};
|
||||
//vid.onsuspend=function(){ cerr("sus")};
|
||||
vid.onabort=function(){ err("abort")};
|
||||
}
|
||||
Reference in New Issue
Block a user