Skip to content

Instantly share code, notes, and snippets.

View themorgantown's full-sized avatar

Daniel themorgantown

View GitHub Profile
// Wait for the SDK to become ready:
if (mraid.getState() === 'loading') {
// If the SDK is still loading, add a listener for the 'ready' event:
mraid.addEventListener('ready', onSdkReady);
} else {
// Otherwise, if the SDK is ready, execute your function:
onSdkReady();
}
// Implement a function that shows the ad when it first renders:
@themorgantown
themorgantown / hypedocument.html
Last active December 2, 2020 04:25
tiniest Hype document possible...
<!DOCTYPE html><html> <head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/><meta http-equiv="X-UA-Compatible" content="chrome=1,IE=edge"/><title>My Title</title><style>html{height:100%;}body{background-color:#FFF;margin:0;height:100%;}</style> <meta name="viewport" content="user-scalable=yes, width=600"/> </head> <body> <div id="default_hype_container" class="HYPE_document" style="margin:auto;position:relative;width:600px;height:400px;overflow:hidden;"></div><script type="text/javascript" charset="utf-8">(function(){var g=void 0,j=!0,k=null,m=!1,ca=parseFloat,p=Math,y=window,da=parseInt,ea=encodeURIComponent,fa=navigator,A=document;function ga(Q,J){return Q.width=J}function ja(Q,J){return Q.display=J}function ka(Q,J){return Q.height=J}function na(Q,J){return Q.length=J}function pa(Q,J){return Q.innerHTML=J}function qa(Q,J){return Q.className=J}function ra(Q,J){return Q.zIndex=J}var sa="lastPosition",ta="userAgent",C="push",za="type",Aa="location",Ca="detachEvent",Da="clearTimeout",Ea="add
<!-- add just before </body> in footer.php -->
<script>
/*! instant.page v5.1.0 - (C) 2019-2020 Alexandre Dieulot - https://instant.page/license */
let t,e;const n=new Set,o=document.createElement("link"),i=o.relList&&o.relList.supports&&o.relList.supports("prefetch")&&window.IntersectionObserver&&"isIntersecting"in IntersectionObserverEntry.prototype,s="instantAllowQueryString"in document.body.dataset,a="instantAllowExternalLinks"in document.body.dataset,r="instantWhitelist"in document.body.dataset,c="instantMousedownShortcut"in document.body.dataset,d=1111;let l=65,u=!1,f=!1,m=!1;if("instantIntensity"in document.body.dataset){const t=document.body.dataset.instantIntensity;if("mousedown"==t.substr(0,"mousedown".length))u=!0,"mousedown-only"==t&&(f=!0);else if("viewport"==t.substr(0,"viewport".length))navigator.connection&&(navigator.connection.saveData||navigator.connection.effectiveType&&navigator.connection.effectiveType.includes("2g"))||("viewport"==t?document.documentElement.clientWidth*document.documen
.fw100 {
font-weight:100 !important;
}
.fw200 {
font-weight:200 !important;
}
.fw300 {
font-weight:300 !important;
}
.fw400 {
<script>
// place this in the head of your Hype document
// to play audio file:
// this plays p1texte1.mp3
//var snd = hypeDocument.loadSound('p1texte1');
//snd.play();
// this stops all playing audio
amp = .09; // The larger the value, the greater the amplitude
freq = 2; // The higher the value, the higher the frequency
decay = 5; // The larger the value, the less the decay
n = 0;
if (numKeys > 0){
n = nearestKey(time).index;
if (key(n).time > time){
n--;
}
<script type="text/javascript">
function myCallback(hypeDocument, element, event) {
// optional:
// document.getElementById(hypeDocument.documentId()).style["max-width"] = "1100px";
var hypeContainer = document.getElementById(hypeDocument.documentId());
var layoutsOfScene =
# BEGIN WpFastestCache
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{HTTPS} =on
RewriteCond %{HTTP_HOST} ^loupiots-design.com
# Start WPFC Exclude
# End WPFC Exclude
# Start_WPFC_Exclude_Admin_Cookie
RewriteCond %{HTTP:Cookie} !wordpress_logged_in_[^\=]+\=sophie
@themorgantown
themorgantown / text.html
Created August 29, 2019 19:20
copied from word
<!--[if gte mso 9]><xml>
<o:OfficeDocumentSettings>
<o:AllowPNG/>
</o:OfficeDocumentSettings>
</xml><![endif]-->
@themorgantown
themorgantown / hype3.0email.html
Created May 24, 2019 19:15
This is a slightly tweaked version with larger fonts and images that reference https://static.tumult.com urls. It also has the unsubscribe link in the footer for Sendy support.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><meta name="viewport" content="width=device-width"/>
<title>Introducing Tumult Hype 3 and Hype Professional</title>
<link href="http://fonts.googleapis.com/css?family=Source+Sans+Pro:200,300" rel="stylesheet" type="text/css" />
<style type="text/css">/* RESET ALL THE THINGS */ /* Based on The MailChimp Reset INLINE: Yes. */ /* Client-specific Styles */ #outlook a {padding:0;} /* Force Outlook to provide a "view in browser" menu link. */ body{ width:100% !important; -webkit-text-size-adjust:100%; -ms-text-size-adjust:100%; margin:0; padding:0;} /* Prevent Webkit and Windows Mobile platforms from changing default font sizes.*/ .ExternalClass {width:100%;} /* Force Hotmail to display emails at full width */ .ExternalClass, .ExternalClass p, .ExternalClass span, .ExternalClass fon