Skip to content

Instantly share code, notes, and snippets.

View SaFrMo's full-sized avatar

Sander Moolin SaFrMo

View GitHub Profile
@SaFrMo
SaFrMo / shader-snippets.md
Last active January 24, 2022 20:16
Shader snippets
/**
* Get the host of the this script. The host will be used for posting the data.
*/
var getHost = function () {
var scripts = document.getElementsByTagName("script");
var i;
for (i = 0; i < scripts.length; i++) {
var urlAttribute = scripts[i].attributes.getNamedItem("src");
if (urlAttribute) {
var url = urlAttribute.nodeValue;

Some NPM packages I've written or contributed to:

  1. auto-blur - Blur a button or other element automatically when clicked.
  2. blast-vanilla - Vanilla version of Blast.js. Blast text apart to make it manipulable.
  3. fh-components - Reusable Vue + Vuepress components.
  4. fh-deploy - Deploy files to a server via SFTP.
  5. sketch-outline - Outline a element in Vue on focus or hover using the hand-drawn style of roughjs.
  6. zoomhaus - Medium-like vanilla JS image takeover effect.

Phaser packages

@SaFrMo
SaFrMo / vuepress-snippets.js
Last active March 8, 2018 19:35
Common useful Vuepress functions
// catch newsletter button - any link with `#newsletter` triggers the callback
window.addEventListener('click', evt => {
if( evt.target && event.target.href && typeof evt.target.href == 'string' && event.target.href.indexOf('#newsletter') != -1 ){
evt.preventDefault()
// YOUR ACTION HERE...
}
})
// keys!
<template>
<main class="content home"></main>
</template>
<script>
export default {}
</script>
@SaFrMo
SaFrMo / README.md
Last active February 12, 2018 19:48
Changes for Ambassador

Transition Steps

  1. Front page
    1. Switch Front Page > Rooms to Rooms v2
    2. Remove extra content from children of Rooms
    3. Switch Callouts to Rooms v2 template
    4. Remove extra content from children of Callouts
    5. Switch "Dining & Entertainment" to Landscape Slideshow template
    6. Add content to children of "Dining & Entertainment"
    7. Add custom gallery to front page
  2. Menus

Work Detail

  • On work-detail pages, credits below the video are set up like this:
    <span class="credit">
      <span>Director</span>
      <span>Traktor</span>
    </span>
    
    <span class="credit">
      <span>Production Company</span>
    

Keybase proof

I hereby claim:

  • I am safrmo on github.
  • I am safrmo (https://keybase.io/safrmo) on keybase.
  • I have a public key ASBu-WO-xxfU6n0lkWsmHwlyGp3X2eba7iBHO70mLul_uwo

To claim this, I am signing this object:

@SaFrMo
SaFrMo / README.md
Created September 22, 2017 19:09
Funkhaus Plugins
  1. Vuepress: Vue.js on top of WordPress
  2. fitToParent: Vanilla JS to resize a DOM element to fit its parent container while maintaining original aspect ratio
  3. Zoomhaus: Vanilla JS+CSS smooth image takeover effect
  4. Rest-Easy: WordPress plugin to rest-ify your site with zero effort and powerful customization
  5. FH-Footer: Self-updating slide-to-reveal footer in vanilla JS
  6. FH-Overlap: Simple overlap checker in vanilla JS
  7. funky-colors: WordPress plugin to detect a palette of colors from each image in the media library
  8. Funky-Imgix: WordPress plugin to get Imgix images easily
  9. WP-Shopify: WordPress plugin for easy Shopify integrat

Notes

  • Add a child to a work-detail page to make it a campaign - the campaign's body will be in the child
  • Maria Carretero page has a few special details:
    • "Color" category is structured like this:
      * Color
          * Maria Carretero
              * First Block Title - Second Block Title
              * Other Spots
      
  • ...