Skip to content

Instantly share code, notes, and snippets.

View full-sized avatar

Michael Schönrock flymke

View GitHub Profile
@flymke
flymke / custom.css
Created November 17, 2022 08:55
SantaPress - Change Background, Fonts in Modal through CSS
View custom.css
// Change Background
.santapress-post.modal {
background:red !important; border:0 !important
}
// Change Font for <h1> Title
.santapress-post.modal h1.santapress-title {
font-family: arial, sans-serif !important;
}
@flymke
flymke / iframe.html
Last active August 9, 2022 20:57
Booklyn iFrame Intergration
View iframe.html
<div class="iframe-holder">
<iframe id="booklynFrame" src="https://<IHRE_SUBDOMAIN>.booklyn.io/embed" width="100%" height="100" scrolling="no" style="border:0"></iframe>
<script src="https://booklyn.io/js/iframeResizer.min.js"></script>
<script>
iFrameResize({ log: false, heightCalculationMethod: 'lowestElement' }, '#booklynFrame');
</script>
</div>
@flymke
flymke / functions.php
Created November 30, 2021 15:35
make future doors clickable, e.g. for custom popups
View functions.php
add_action( 'wp_head', function () { ?>
<script>
jQuery(document).ready(function($){
$('.santapress-door.status-future:not(.preview)').css('pointer-events', 'auto').find('a').removeClass('santapress-modal');
});
</script>
<?php } );
@flymke
flymke / functions.php
Created November 29, 2021 11:18
Add 'opened' class to all doors that were previously clicked by the user - SantaPress
View functions.php
add_action( 'wp_head', function () { ?>
<script>
jQuery(document).ready(function($){
// click on door and save open status to local storage
$('.santapress-door.status-publish:not(.preview)').click(function() {
var postid = $(this).data('postid');
var opendoors = JSON.parse( window.localStorage.getItem('opendoors') );
if(!opendoors) {
var opendoors = [];
@flymke
flymke / functions.php
Created November 26, 2021 08:45
SantaPress - leave past doors visually open
View functions.php
add_action( 'wp_head', function () { ?>
<script>
jQuery(document).ready(function($){
$('.santapress-door.status-publish:not(:last)').find('img').css('transform', 'perspective(1200px) translateZ(0px) translateX(0px) translateY(0px) rotateY(-45deg)');
});
</script>
<?php } );
@flymke
flymke / custom.css
Created November 19, 2021 10:27
SantaPress - Prevent flickering on iPhone
View custom.css
body.santapress-snow-modal.modal-open .blocker:after {
-webkit-backface-visibility: hidden;
}
@flymke
flymke / functions.php
Last active November 19, 2021 08:20
SantaPress - play audio file when opening a door
View functions.php
add_action( 'wp_head', function () { ?>
<script>
/* Audio file attribution
Merry Christmas sound effects from Air Media
www.airmedia.co
https://freesound.org/s/349855/
This work is licensed under the Creative Commons 0 License.
*/
@flymke
flymke / custom.css
Last active November 25, 2022 20:08
SantaPress - make more doors in a row on mobile devices
View custom.css
/* make 4 doors in a row */
@media only screen and (max-width: 767px) {
.santapress-container .santapress-door {
width: 25% !important;
flex: 1 0 25% !important;
}
}
/* make 4 doors in a row without stretching the last element */
@media only screen and (max-width: 767px) {
@flymke
flymke / functions.php
Created October 5, 2021 10:19
santapress - allow comments on single door pages
View functions.php
function santapress_allow_comments() {
add_post_type_support( 'door', 'comments' );
}
add_action('init', 'santapress_allow_comments');
@flymke
flymke / input.scss
Created April 12, 2021 23:03
Generated by SassMeister.com.
View input.scss
$primary: '#555';
$grey: '#eee';
$grid-breakpoints: (
xs: 0,
sm: 576px,
md: 768px,
lg: 992px,
xl: 1200px
);