Skip to content

Commit

Permalink
add copy function
Browse files Browse the repository at this point in the history
  • Loading branch information
unknown committed Feb 1, 2024
1 parent eded6dc commit d57b13d
Showing 1 changed file with 24 additions and 17 deletions.
41 changes: 24 additions & 17 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -177,27 +177,34 @@ <h2 class="subtitle has-text-justified" style="padding-top: 1rem;" style="width:
<h2 class="title">BibTeX</h2>
<div style="position: relative;">
<button id="copyButton" style="position: absolute; top: 0; right: 0;">Copy</button>
<pre><code id="bibtexCode">@misc{wen2023dilu,
title={DiLu: A Knowledge-Driven Approach to Autonomous Driving with Large Language Models},
author={Licheng Wen and Daocheng Fu and Xin Li and Xinyu Cai and Tao Ma and Pinlong Cai and Min Dou and Botian Shi and Liang He and Yu Qiao},
year={2023},
eprint={2309.16292},
archivePrefix={arXiv},
primaryClass={cs.RO}
}

@misc{fu2023drive,
title={Drive Like a Human: Rethinking Autonomous Driving with Large Language Models},
author={Daocheng Fu and Xin Li and Licheng Wen and Min Dou and Pinlong Cai and Botian Shi and Yu Qiao},
year={2023},
eprint={2307.07162},
archivePrefix={arXiv},
primaryClass={cs.RO}
}
<pre><code id="bibtexCode">
LimSim++
</code></pre>
</div>
</div>
</section>

<script>
var copyButton = document.getElementById("copyButton");

copyButton.addEventListener("click", function () {
var codeElement = document.getElementById("bibtexCode");
var textToCopy = codeElement.textContent;

var textarea = document.createElement("textarea");
textarea.value = textToCopy;
document.body.appendChild(textarea);
textarea.select();
document.execCommand("copy");
document.body.removeChild(textarea);

copyButton.textContent = "✓ Copied!";

setTimeout(function () {
copyButton.textContent = "Copy";
}, 2000); // Reset the button text after 2 seconds (adjust as needed)
});
</script>
<!--End BibTex citation -->


Expand Down

0 comments on commit d57b13d

Please sign in to comment.