diff --git a/frontend/src/App.css b/frontend/src/App.css index 5790987..00354c4 100644 --- a/frontend/src/App.css +++ b/frontend/src/App.css @@ -4,6 +4,10 @@ badge-success {hard} badge-warning {ex} badge-danger {exex}*/ +.link{ + color:#66e; +} + .highest{ z-index:1000001; } @@ -15,6 +19,7 @@ badge-danger {exex}*/ font-size:12px; } + .display-tooltipside{ position:absolute; z-index:1000000; @@ -81,6 +86,10 @@ table th { z-index: 100000; } +.background-songs{ + background-color:#eef; +} + .background-list-1{ background-color:#cee; } @@ -98,12 +107,20 @@ table th { background-color:rgba(160,160,255,0.5); } +.tinytext{ + font-size:10px; + /*z-index:-10000;*/ + color:#666; + font-style:italic; + /*background-color:rgba(240,240,255,0.8);*/ +} + .tinytime{ font-size:10px; position:absolute; bottom:0px; right:7px; - z-index:-10000; + /*z-index:-10000;*/ color:#666; font-style:italic; /*background-color:rgba(240,240,255,0.8);*/ diff --git a/frontend/src/App.js b/frontend/src/App.js index 83081a8..ffd8c89 100644 --- a/frontend/src/App.js +++ b/frontend/src/App.js @@ -331,7 +331,7 @@ function Play(p) { function GetDateDisplay() { var date = new Date(p.play.date); var months = ["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"] - return <>{months[date.getMonth()]+" "+date.getDate()+" "+date.getFullYear()+" "+date.getHours()+":"+((date.getMinutes()<10)?"0"+date.getMinutes():date.getMinutes())}{GetDateDiff()} + return <>{months[date.getMonth()]+" "+date.getDate()+" "+date.getFullYear()+" "+date.getHours()+":"+((date.getMinutes()<10)?"0"+date.getMinutes():date.getMinutes())}{GetDateDiff()} } if (p.mini) { return ( @@ -423,33 +423,131 @@ function Play(p) { } } +function LoadMore(p) { + var [offset,setOffset] = useState(p.params.limit) + var [params,setParams] = useState(p.params) + var [loading,setLoading] = useState(false) + var [visible,setVisible] = useState(false) + var [update,setUpdate] = useState(false) + + useEffect(()=>{ + axios.get(p.url+constructParams(params)) + .then((data)=>{ + if (data.data.length>0) { + setVisible(true) + } + }) + },[update]) + + function constructParams(params) { + var st = Object.keys(params).reduce((str,key)=>{ + if (str==="") { + return str+="?"+key+"="+params[key] + } else { + return str+="&"+key+"="+params[key] + } + },"") + return st + } + if (!visible){ + return (<>) + } + else + if (p.listItem) { + return ( +
  • { + setLoading(true) + axios.get(p.url+constructParams(params)) + .then((data)=>{ + if (data.data.length>0) { + var newVals = [...p.value] + data.data.forEach((val)=>{ + newVals.push(val) + }) + p.setValue(newVals) + //console.log(newVals) + var obj = {...params} + obj.offset+=offset + setParams(obj) + setLoading(false) + if (data.data.length +
    +
    + {(!loading)?
    - Load More -
    :
    Loading...
    + } +
    +
    +
  • + ) + } else + return ( +
    { + setLoading(true) + axios.get(p.url+constructParams(params)) + .then((data)=>{ + if (!data.data) { + setVisible(false) + } else + if (data.data.length>0) { + var newVals = [...p.value] + data.data.forEach((val)=>{ + newVals.push(val) + }) + p.setValue(newVals) + //console.log(newVals) + var obj = {...params} + obj.offset+=offset + setParams(obj) + setLoading(false) + if (data.data.length +
    + {(!loading)?
    - Load More -
    :
    Loading...
    + } +
    +
    + ) +} + function BestPlaysPanel(p) { var [bestPlays,setBestPlays] = useState([]) + var [update,setUpdate] = useState(false) useEffect(()=>{ axios.get("http://www.projectdivar.com/bestplays/"+p.username+"?fails=false&limit=5&offset=0") .then((data)=>{setBestPlays(data.data);}) - }) + },[update]) - return ( - <> -
    -
    - -
    -
    -
    -
    -