Skip to content

Instantly share code, notes, and snippets.

@annelyse
annelyse / gradientOverflow
Last active August 13, 2024 09:34
use it for slider side content hidden for exemple
@mixin linear-gradient($side, $color) {
/* Chrome10-25,Safari5.1-6 */
background: -webkit-linear-gradient(
$side,
rgba($color, 0) 0%,
rgba($color, 1) 100%
);
/* FF3.6-15 */
background: -moz-linear-gradient(
const expandableItem = () => {
let expandableItem = document.querySelectorAll(".expandableItemJs");
let i;
function getHeightVisible(element) {
const mobileBreakpoint = 480;
const tabletBreakpoint = 768;
if (window.innerWidth <= mobileBreakpoint) {
return element.getAttribute("data-expand-mobile");
// display title
if (!function_exists('display_title_acf')) {
function display_title_acf($title = '', $tag = "h2", $class = '')
{
if (!empty($title)) {
echo '<' . $tag . ' class="title ' . $class . '">' . $title . '</' . $tag . '>';
}
}
}
if (!function_exists('storefront_site_title_or_logo')) {
/**
* Display the site title or logo
*
* @since 2.1.0
* @param bool $echo Echo the string or return it.
* @return string
*/
function storefront_site_title_or_logo($echo = true)
{
export class stickyScrollElement {
/**
* Constructs a new sticky instance.
*
* @param stickyItem Element parent contenant le sticky
* @param limiteWrapper container dans lequel le sticky doit se déplacer
* @param stickyNav Navigation sticky qui faudrait enlever des calculs
*/
constructor(
const menuSticky = () => {
const body = document.body;
const stickyMenu = document.querySelector(".wrapper-sticky-header"); // wrap your header with that
const menuHeight = stickyMenu.offsetHeight;
stickyMenu.style.height = menuHeight + 'px';
// const nav = document.querySelector(".page-header nav");
<!doctype html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<?php wp_head(); ?>
</head>
import $ from "jquery";
/******************************************/
/*************** PUBLICATIONS *************/
/******************************************/
$(function() {
var $publications = $('#container_loadResult_js');
var $seeMore = $("#load_more_js");
var $filterCategories = $('#filter_category_js');
var $filterTag = $('#filter_tag_js');
/**
* External dependencies
*/
import { isEmpty } from "lodash";
/**
* WordPress dependencies
*/
const { isBlobURL } = wp.blob;
function gutenberg_examples_dynamic() {
// automatically load dependencies and version
register_block_type( 'custom-e2s/bloc-left', array(
'api_version' => 2,
'render_callback' => function($attributes, $content ) {
$path = locate_template( 'templates/blocks/bloc-left.php' );
if ( file_exists( $path ) ) {
ob_start();