Skip to content

Instantly share code, notes, and snippets.

View fongreecss's full-sized avatar
:octocat:
working

Fon Greecss fongreecss

:octocat:
working
  • Slovenia
View GitHub Profile
var $video = $('#sbranding_hero_video video');
var $image_1 = $('.sbranding-hero_shadow-1');
var $image_2 = $('.sbranding-hero_shadow-2');
var currentSrc1 = 'https://uploads-ssl.webflow.com/5f996b22b00afe35a55e6f79/6619145cb252ec488c91b348_Ellipse%20495.svg';
var currentSrc2 = 'https://uploads-ssl.webflow.com/5f996b22b00afe35a55e6f79/6619145ca350727bae3f0e30_Ellipse%20496.svg';
function preloadImage(src) {
var img = new Image();
img.src = src;
}
@fongreecss
fongreecss / video-on-scroll.js
Created July 5, 2023 17:56
Video play on scroll
var video = document.getElementById('hero_video');
var video_wrapper = document.getElementById('mc-hero');
var videoStart = video_wrapper.offsetTop;
var target = 0,
current = 0,
easeAmount = 0.05;
function scrollVideo() {
var videoLength = video.duration,
(function() {
let fontData = new Map();
// Recursive function to walk the DOM tree
function processNode(node) {
if (node.nodeType === Node.ELEMENT_NODE) {
const style = window.getComputedStyle(node);
const fontFamily = style.getPropertyValue("font-family");
const fontWeight = style.getPropertyValue("font-weight");
function delay(fn, ms){
let timer = 0
return function(...args){
clearTimeout(timer)
timer = setTimeout(fn.bind(this, ...args), ms || 0)
}
}
@fongreecss
fongreecss / redirect-cities.js
Created May 22, 2023 07:36
Redirect cities in Philadelphia to another landing page (using geojs.io)
<!-- The GeoJS script is loaded asynchronously. -->
<script async src="https://get.geojs.io/v1/ip/geo.js"></script>
<!-- A function is defined to handle the JSON response from the GeoJS API. -->
<script type="application/javascript">
function geoip(json) {
// The JSON data returned from GeoJS is parsed and the relevant fields are extracted and assigned to variables.
const cities = [
sudo apt update && sudo apt upgrade -y
sudo apt install -y build-essential gpp g++ wget curl oathtool youtube-dl
sudo apt install -y unace rar unrar unzip p7zip-rar p7zip sharutils uudeview mpack arj cabextract lzip lunzip file-roller
sudo apt install -y tidy ubuntu-make build-essential zlib1g-dev libssl-dev libreadline-dev libyaml-dev
sudo apt install -y libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev libffi-dev
#INSTALL RUBY
sudo apt install ruby-full -y
sudo gem update --system
sudo su -c "gem install sass"
sudo gem install compass
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
/**
* Vsakemu switcherju oz boxu, ki spreminja pač kamero se doda tag, ki mora biti ime kamere na katero želi preklopit
* Vsak switcher mora imet to skripto not. Skripts-> CameraSwitcher
*
* */
public class CameraSwitcher : MonoBehaviour
@fongreecss
fongreecss / area.js
Last active February 7, 2020 21:28
Calc distance between 2d points and poly area
class Polygon {
static calcArea (...points) {
var area = 0;
var X = points.map((v) => { return v[0] });
var Y = points.map((v) => { return v[1] });
var numPoints = points.length;
var j = numPoints - 1;
var i = 0;
@fongreecss
fongreecss / slider.js
Last active February 7, 2020 17:19
Slider
export default class Slider {
constructor(sliderWrapper) {
// wrapper, so it can handle multiple on the same page
this.sliderWrapper = document.querySelector(sliderWrapper);
if (! this.sliderWrapper) return;
// prev next buttons
this.prev = this.sliderWrapper.querySelector('.x-slider__prev');
this.next = this.sliderWrapper.querySelector('.x-slider__next');
$post_id = wp_insert_post([
'post_type' => 'contact-form',
'post_title' => $_POST['name']
]);
$data = [
'email' => sanitize_email($_POST['email']),
'first' => sanitize_text_field($_POST['name']),
'last' => sanitize_text_field($_POST['surname']),
'message' => sanitize_textarea_field()($_POST['message']),