MediaWiki:Common.js

From Psalms: Layer by Layer
Revision as of 17:34, 22 November 2024 by Michael.Roquemore (talk | contribs)
Jump to: navigation, search

Note: After publishing, you may have to bypass your browser's cache to see the changes.

  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
  • Internet Explorer / Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5
  • Opera: Press Ctrl-F5.
/* Any JavaScript here will be loaded for all users on every page load. */

 //console.log("Hello world!");
 
 
 
 // Check if the current page has the specific body class
if (document.body.classList.contains('page-ResourceSite_Welcome-Mike')) {
    // Select the .index container
    const indexContainer = document.querySelector('.index');
    
    // Apply grid styles to the container
    if (indexContainer) {
        indexContainer.style.display = 'grid';
        indexContainer.style.gridTemplateColumns = 'repeat(7, 1fr)'; // Create 7 columns
        indexContainer.style.gap = '10px'; // Add spacing between items
        
        // Optionally center-align each item (if not done in CSS)
        const indexItems = indexContainer.querySelectorAll('.index-item');
        indexItems.forEach(item => {
            item.style.textAlign = 'center';
        });
    }
}