diff --git a/packet/static/js/pfp-zoom.js b/packet/static/js/pfp-zoom.js new file mode 100644 index 0000000..3e80b5f --- /dev/null +++ b/packet/static/js/pfp-zoom.js @@ -0,0 +1,36 @@ +$(document).ready(function () { + let photos = Array.from(document.querySelectorAll('.eval-user-img')) + + top.onclick = function (e) { + let tsib = e.target.previousElementSibling + if (tsib != null) { + if (tsib.classList.contains('eval-user-img')) { + return; + } + } + if (e.target.classList.contains('eval-user-img')) { + return; + } + document.querySelector('#zoom-photo').remove() + } + + photos.forEach((photo) => { + photo.addEventListener('click', (e) => { + let other = document.querySelector('#zoom-photo') + if (other != null) { + other.remove() + } + photo.insertAdjacentHTML('afterend', ` +
+ ${photo.alt} +
+ `) + e.preventDefault(); + }) + }) + +}) \ No newline at end of file diff --git a/packet/templates/active_packets.html b/packet/templates/active_packets.html index 3fa6564..d2c95e2 100644 --- a/packet/templates/active_packets.html +++ b/packet/templates/active_packets.html @@ -111,6 +111,7 @@

Active Packets

{% block scripts %} {{ super() }} + {% if info.realm == "csh" %} {% endif %} diff --git a/packet/templates/packet.html b/packet/templates/packet.html index 5445f10..2d5a7a4 100644 --- a/packet/templates/packet.html +++ b/packet/templates/packet.html @@ -192,3 +192,7 @@
Upperclassmen Score - {{ '%0.2f' % upper_score }}%
{% endblock %} +{% block scripts %} + {{ super() }} + +{% endblock %} \ No newline at end of file