Skip to content

Instantly share code, notes, and snippets.

View marco-van-zomeren's full-sized avatar
:octocat:
Hello world!

marco-van-zomeren

:octocat:
Hello world!
View GitHub Profile
// SHARE PAGE
$(document).ready(function () {
$('.js__share-page a.share-page__on-facebook').click(function () {
var link = $(location).attr('href');
var facebookUrl = "https://www.facebook.com/sharer/sharer.php?u=" + link;
window.open(facebookUrl);
});
$('.js__share-page a.share-page__on-twitter').click(function () {
var link = $(location).attr('href');
var twitterUrl = "https://twitter.com/intent/tweet?url=" + link + '&text=' + "Hey, bekijk eens:" + link;
// FADEIN
var animateHTML = function() {
var elems;
var windowHeight;
function init() {
elems = document.querySelectorAll('.fx_fadeInUp');
windowHeight = window.innerHeight;
addEventHandlers();
checkPosition();
}
// ARROW
$arrow-size: 31px;
$arrow-border: 1.2px;
.read-more,
a[rel~="next"],
a[rel~="prev"] {
position: relative;
i {
@marco-van-zomeren
marco-van-zomeren / safari_border-radius_overflow-hidden_hover-fix.css
Last active February 2, 2019 12:17
Safari border-radius + overflow: hidden + hover fix
.block__image-container {
background-image: ... ;
border-radius: 5px;
overflow:hidden;
-webkit-mask-image: -webkit-radial-gradient(white, black);
}
@marco-van-zomeren
marco-van-zomeren / grid.scss
Last active September 3, 2019 17:18
Automate CSS grid utility classes
.container.grid {
max-width: 1600px;
margin: auto;
grid-row-gap: var(--gutter)
}
[class*="grid"] {
display: grid;
grid-gap: var(--gutter);
grid-template-columns: repeat(12, 1fr);
@marco-van-zomeren
marco-van-zomeren / WordPress_multisite.php
Created January 4, 2020 13:11
Create a WordPress multisite
define( 'WP_ALLOW_MULTISITE', true );
@marco-van-zomeren
marco-van-zomeren / wordpress-contact-form.php
Last active January 5, 2020 09:10
Wordpress contact form without a plugin
<?php include("header.php"); ?>
<div class="page-container span_12 xs-md:p-0 pg">
<section class="span_12 container grid">
<main class="span_12 relative pg">
<?php
//response generation function
$response = "";
@marco-van-zomeren
marco-van-zomeren / audio-url-wordpress-post.php
Created February 14, 2020 20:29
Get audio url from post attachment WordPress
<div class="audio">
<?php $audio = get_children( array('post_parent' => $post->ID, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'audio' ) ); ?>
<?php if ( empty( $audio ) ) : ?>
<?php else : ?>
<?php foreach ( $audio as $attachment_id => $attachment ) : ?>
<div class="player">
<audio controls>
<source src="<?php echo wp_get_attachment_url( $attachment_id, 'full' ); ?>" type="audio/mpeg">
@marco-van-zomeren
marco-van-zomeren / support-color-schemes.css
Created March 31, 2020 20:34
Support dark color scheme
:root {
color-scheme: light dark;
supported-color-schemes: light dark;
}
@media (prefers-color-scheme: dark) {
...
}