PageSourceSearch

https://bookriot.com/wp-content/themes/bookriot/assets/js/author-on-hover.js?ver=sep9_1

js bookriot.com collected 2026-10-01 08:32:35 UTC 2,002 bytes, 77 lines download raw bytes

1(function() {
2	'use strict';
3
4	window.addEventListener('load', function () {
5
6		var theAuth = null;
7		const wrapElementSelector = "#author-bio--auth-wrap";
8		var timeout;
9
10		// Find the author link element
11		var entryHeaderAuthor = document.querySelector(".entry-header .entry-meta .author a");
12		if (entryHeaderAuthor) {
13			theAuth = entryHeaderAuthor;
14		} else {
15			theAuth = document.querySelector("a[rel=author]");
16		}
17
18		// If author element found, move the wrap element after it
19		var wrapElement = document.querySelector(wrapElementSelector);
20		if (theAuth && wrapElement && theAuth.parentNode) {
21			theAuth.parentNode.insertBefore(wrapElement, theAuth.nextSibling);
22			
23			// Initialize with Tailwind classes for fade transitions
24			wrapElement.classList.add('opacity-0', 'transition-opacity', 'duration-200');
25		}
26
27		function hide() {
28			timeout = setTimeout(function () {
29				if (wrapElement) {
30					// Fade out: remove opacity-100, add opacity-0
31					wrapElement.classList.remove('opacity-100');
32					wrapElement.classList.add('opacity-0');
33				}
34			}, 200);
35		}
36
37		function show() {
38			if (!wrapElement) return;
39			
40			// Check if wrapElement is a sibling of theAuth
41			if (theAuth) {
42				var parent = theAuth.parentNode;
43				if (parent) {
44					var siblings = Array.from(parent.children);
45					if (siblings.indexOf(wrapElement) === -1) {
46						return; // Not a sibling, don't show
47					}
48				}
49			}
50			
51			// Fade in: remove opacity-0, add opacity-100
52			wrapElement.classList.remove('opacity-0');
53			wrapElement.classList.add('opacity-100');
54		}
55
56		// Add event listeners to author element
57		if (theAuth) {
58			theAuth.addEventListener('mouseenter', function() {
59				clearTimeout(timeout);
60				show();
61			});
62
63			theAuth.addEventListener('mouseleave', hide);
64		}
65
66		// Add event listeners to wrap element
67		if (wrapElement) {
68			wrapElement.addEventListener('mouseenter', function() {
69				clearTimeout(timeout);
70			});
71
72			wrapElement.addEventListener('mouseleave', hide);
73		}
74
75	});
76
77})();

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.