tijl.dev-core/web/views/about.html
tijl 57c3b5e86d
Some checks failed
build / build (push) Has been cancelled
release-tag / release-image (push) Has been cancelled
fixes
2024-09-07 17:18:20 +02:00

37 lines
1.2 KiB
HTML

<div class="grid grid-cox:wls-1 overflow-hidden rounded-xl grid-cols-2 gap-4">
{{range .About}}
<button onclick="document.getElementById('{{.Id}}').showModal()"
class="card posts-item bg-base-100 border-[2px] border-base-300 hover:bg-base-300 shadow-xl cursor-pointer justify-center items-center py-8">
<span class="w-12 h-12">
{{icon .Icon}}
</span>
{{.Id}}
</button>
<dialog id="{{.Id}}" class="modal">
<div class="modal-box">
{{if (ne .Value "")}}
<div class="join w-full">
<input id="{{.Id}}" tabindex="-1" value="{{.Value}}" class="input input-bordered join-item w-full">
<button onclick="copyToClipBoard('{{.Id}}')" class="btn join-item">Copy</button>
</div>
{{end}}
<a href="{{safeurl .Url}}" class='w-full btn {{if (ne .Value "")}}mt-2{{end}}'>Open</a>
</div>
<form method="dialog" class="modal-backdrop">
<button>close</button>
</form>
</dialog>
{{end}}
</div>
<script>
function copyToClipBoard(id) {
const input = document.querySelector('input#' + id)
input.select();
document.execCommand('copy');
}
</script>