CHROMATIC-SYSTEM v1.03_FOOTNOTE_NUMBERED_LINKS_DISPLAY_ENGINE

INFORMATION & CODE

Footnotes Numbered Links Display

What the Code Does

The code creates a numbered footnote system for a webpage. The numbered buttons such as [1], [2], and [3] appear within the text like traditional footnote references. When the user moves the mouse over one of these numbers, the corresponding footnote appears as a small green pop-up box.

How the Code Works

The HTML provides the structure of the page. The .footnote elements at the beginning contain the actual footnote text, while the .btn buttons placed throughout the paragraphs act as references to those footnotes. The buttons use IDs from 0 to 10, while their visible labels run from [1] to [11]. The stylesheet styles.css and JavaScript file scripts.js are loaded externally.

The CSS controls the appearance and positioning. .page creates a centered, 600-pixel-wide document-like container with a border and shadow. The .btn class makes the footnote references look like small blue links rather than normal buttons. The .footnote class initially hides each footnote using display: none, and the :nth-child() rules give each footnote a specific position on the page. When JavaScript changes display to block, the footnote becomes visible at that predefined position.

The JavaScript connects each numbered button to the footnote with the same position in the two NodeLists. querySelectorAll(".btn") collects all the numbered buttons, while querySelectorAll(".footnote") collects all the footnotes. The forEach() loop goes through the buttons and uses the index to identify the matching footnote. For example, button 0 controls footnote 0, button 1 controls footnote 1, and so on.

When the mouse moves over a button, the mouseover event changes the corresponding footnote's display property from none to block, making it visible. When the mouse leaves the button, the mouseout event changes it back to none, hiding it again. In effect, the user can hover over [1] to see footnote 1, hover over [2] to see footnote 2, and continue in the same way through [11].

How to Use the Code

To use the code, place the HTML in your webpage, put the CSS in a file called styles.css, and put the JavaScript in scripts.js. Both files need to be in the appropriate location specified by the HTML. You can then replace the placeholder footnote text with your own content and adjust the top and left values in the CSS if you want the pop- ups to appear in different locations.

HTML

CSS

JAVASCRIPT

PREVIEW

Footnote: Praesent convallis urna a lacus interdum ut labore et hendrerit no risus congue.

Footnote: Nunc sagittis dictum nisi, sed ullamcorper ipsum dignissim ac.

Footnote: In at libero sed nunc venenatis imperdiet sed ornare turpis.

Footnote: Donec vitae dui eget tellus gravida venenatis.

Footnote: Integer fringilla congue eros non fermentum. Sed dapibus pulvinar nibh tempor porta.

Footnote: Cras ac leo purus. Mauris quis diam velit. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Footnote: Phasellus imperdiet, nulla dictum interdum, nisi lorem egestas odio, vitae ligula venenatis dolor.

Footnote: Maecenas nisl est, ultrices nec congue eget, auctor vitae massa.

Footnote: Fusce luctus vestibulum augue ut aliquet.

Footnote: Mauris ante ligula, facilisis sed ornare eu, lobortis in odio.

Footnote: Praesent convallis urna a lacus interdum ut hendrerit risus congue.

Footnote Numbered Buttons

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

Lorem ipsum dolor sit amet, illum definitiones no quo, maluisset concludaturque et eum, altera fabulas ut quo. Atqui causae gloriatur ius te, id agam omnis evertitur eum. Affert laboramus repudiandae nec et. Inciderint efficiantur his ad. Eum no molestiae voluptatibus.

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus imperdiet, nulla et dictum interdum, nisi lorem egestas odio, vitae scelerisque enim ligula venenatis dolor. Maecenas nisl est, ultrices nec congue eget, auctor vitae massa. Fusce luctus vestibulum augue ut aliquet. Mauris ante ligula, facilisis sed ornare eu, lobortis in odio. Praesent convallis urna a lacus interdum ut hendrerit risus congue. Nunc sagittis dictum nisi, sed ullamcorper ipsum dignissim ac. In at libero sed nunc venenatis imperdiet sed ornare turpis. Donec vitae dui eget tellus gravida venenatis. Integer fringilla congue eros non fermentum. Sed dapibus pulvinar nibh tempor porta. Cras ac leo purus. Mauris quis diam velit. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus imperdiet, nulla et dictum interdum, nisi lorem egestas odio, vitae scelerisque enim ligula venenatis dolor.

Maecenas nisl est, ultrices nec congue eget, auctor vitae massa. Fusce luctus vestibulum augue ut aliquet. Mauris ante ligula, facilisis sed ornare eu, lobortis in odio. Praesent convallis urna a lacus interdum ut hendrerit risus congue. Nunc sagittis dictum nisi, sed ullamcorper ipsum dignissim ac. In at libero sed nunc venenatis imperdiet sed ornare turpis. Donec vitae dui eget tellus gravida venenatis. Integer fringilla congue eros non fermentum. Sed dapibus pulvinar nibh tempor porta. Cras ac leo purus. Mauris quis diam velit. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus imperdiet, nulla et dictum interdum, nisi lorem egestas odio, vitae scelerisque enim ligula venenatis dolor.