Skip to content

Commit

Permalink
add datasets viewer
Browse files Browse the repository at this point in the history
  • Loading branch information
zaidalyafeai committed Jul 19, 2024
1 parent f396706 commit 8b7695c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions assets/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,13 @@ async function getOGimage(url) {
return "./assets/images/logo.png"
}

function create_hf_viewer(hf_link){
if (hf_link.toString() == 'nan')
return ''
else
return `<iframe src="${hf_link}/embed/viewer" frameborder="0" width="100%" height="560px"></iframe>`
}

async function fomratDetails(data, index) {
// console.log(data, "s")
await getOGimage(data['Link']).then(res => {
Expand Down Expand Up @@ -170,6 +177,8 @@ async function fomratDetails(data, index) {
'<a href="' + `card?id=${index}` + '" class="underline font-normal">Details</a>' +
'<a href="' + data["Paper Link"] + '" target="_blank" class="underline font-normal">Paper</a>' +
'</div>' +
create_hf_viewer(data['HF Link'])+

'</div>'
// })
}
Expand Down

0 comments on commit 8b7695c

Please sign in to comment.