Skip to content

Instantly share code, notes, and snippets.

View iamrobert's full-sized avatar

Robert Stark iamrobert

View GitHub Profile
@iamrobert
iamrobert / magnetic.js
Last active April 11, 2025 12:06
A lightweight vanilla JavaScript library for creating magnetic hover effects on web elements. <button class="magnetic" data-strength="30" data-strength-text="15"> <span class="btn-text">Stronger Effect</span> </button>
(function () {
// Default configuration
const defaultConfig = {
selector: '.magnetic',
strength: 24,
textStrength: 18
};
// Public API
window.Magnetic = {
@iamrobert
iamrobert / association.php
Last active March 14, 2025 11:20
FlexiContent Language Switcher - replace flexicontent/helper/association.php
<?php
/**
* @package Joomla.Site
* @subpackage com_content
*
* @copyright Copyright (C) 2005 - 2014 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
@iamrobert
iamrobert / PowerShell-Folder-Sync-Script.ps1
Last active January 17, 2025 12:03
A PowerShell script to monitor and sync changes between source and destination directories.
# Define the project name variable
$projectName = "jy"
# Define source and destination paths
$templateSrc = "D:\2025-laragon\www\$projectName\templates\iamrobert4"
$templateDst = "D:\bitbucket\$projectName"
$mediaSrc = "D:\2025-laragon\www\$projectName\media\templates\site\iamrobert4"
$mediaDst = "D:\bitbucket\$projectName\media\templates\site\iamrobert4"
# Function to compare and sync files
@iamrobert
iamrobert / index.php
Created January 3, 2025 02:04
JOOOMLA J4 DEBUGGER - overwrite administrator/index.php
<?php
/* + JOOOMLA DEBUGGER- will write to /administrator/logs/admin-500.log.
+ Overwrite your /administrator/index.php root file
+ Revert back after debugging!
======================================================================*/
// At the very start of /administrator/index.php
if (!function_exists('debugLog')) {
function debugLog($message, $data = null) {
$logFile = __DIR__ . '/logs/admin-500.log';
$timestamp = date('Y-m-d H:i:s');
@iamrobert
iamrobert / current v2.js
Last active August 27, 2024 18:16
IMAGE TO BASELINE GRID - want image to align with baseline grid
app.imgBaselineHeight = {
init: function () {
function calculateCSSVar(variableName) {
const tempEl = document.createElement('div');
tempEl.style.marginTop = `var(${variableName})`;
tempEl.style.position = 'absolute';
tempEl.style.visibility = 'hidden';
document.body.appendChild(tempEl);
const computedStyle = getComputedStyle(tempEl).marginTop;
@iamrobert
iamrobert / baseline.js
Created July 13, 2024 12:51
Baseline grid Toggle
var urlParams = new URLSearchParams(window.location.search);
if (urlParams.has('grid')) {
document.body.classList.add("bgrid");
}
/* + BGRID
======================================================================*/
// Keyboard event listener for Ctrl + ;
@iamrobert
iamrobert / .htaccess
Created April 23, 2024 07:16 — forked from Darep/.htaccess
PHP CSS&JS auto-versioning function.
# CSS/JS auto-versioning
RewriteEngine On
RewriteRule ^(.*)\.[\d]{10}\.(css|js)$ $1.$2 [L]
@iamrobert
iamrobert / _icons.scss
Last active November 28, 2023 15:49
IAMROBERT ICONS FILE
/*
* =======================================================================
+ ICONS
-----------------------------------------------------------------------
* =======================================================================
*/
/*! purgecss start ignore */
@iamrobert
iamrobert / favi.php
Created November 26, 2023 03:49
Favicon Joomla
<?php
/* iamrobert.com | TAIWAN -------------------------------------------------
_ __ __
(_)__ ___ _ _______ / / ___ ____/ /_
/ / _ `/ ' \/ __/ _ \/ _ \/ -_) __/ __/
/_/\_,_/_/_/_/_/ \___/_.__/\__/_/ \__/
===================================================== DIGITAL DESIGN STUDIO
# author Robert Stark
# copyright Copyright 2023 iamrobert.com All rights reserved.
@iamrobert
iamrobert / video-player.js
Last active November 24, 2023 05:11
JS PLAYER - uses plyr.io and generates Youtube thumbs
/* + VIDEO PLAYER
======================================================================*/
var current_player = null;
app.videoPlayer = {
init: function () {
if (!document.querySelector(".js-player")) {
// console.log('no-plyr');
return;
} else {