Install FFmpeg with homebrew. You'll need to install it with a couple flags for webm and the AAC audio codec.
brew install ffmpeg --with-libvpx --with-libvorbis --with-fdk-aac --with-opus| magick convert T_Ceramic_M.png T_Ceramic_R.png T_Ceramic_M.png -channel RGB -combine T_Ceramic_MR.png |
| export const isAutoplaySupported = () => { | |
| // Detect if user can autoplay inline video | |
| // Works when user is on low-battery mode on IOS | |
| // Return promise from video.play | |
| const video = document.createElement('video') | |
| video.src = 'data:video/mp4;base64,AAAAIGZ0eXBtcDQyAAAAAG1wNDJtcDQxaXNvbWF2YzEAAATKbW9vdgAAAGxtdmhkAAAAANLEP5XSxD+VAAB1MAAAdU4AAQAAAQAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAACFpb2RzAAAAABCAgIAQAE////9//w6AgIAEAAAAAQAABDV0cmFrAAAAXHRraGQAAAAH0sQ/ldLEP5UAAAABAAAAAAAAdU4AAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAAoAAAAFoAAAAAAAkZWR0cwAAABxlbHN0AAAAAAAAAAEAAHVOAAAH0gABAAAAAAOtbWRpYQAAACBtZGhkAAAAANLEP5XSxD+VAAB1MAAAdU5VxAAAAAAANmhkbHIAAAAAAAAAAHZpZGUAAAAAAAAAAAAAAABMLVNNQVNIIFZpZGVvIEhhbmRsZXIAAAADT21pbmYAAAAUdm1oZAAAAAEAAAAAAAAAAAAAACRkaW5mAAAAHGRyZWYAAAAAAAAAAQAAAAx1cmwgAAAAAQAAAw9zdGJsAAAAwXN0c2QAAAAAAAAAAQAAALFhdmMxAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAoABaABIAAAASAAAAAAAAAABCkFWQyBDb2RpbmcAAAAAAAAAAAAAAAA |
| /* | |
| The MIT License (MIT) | |
| Copyright (c) 2018 Eric Arnebäck | |
| Permission is hereby granted, free of charge, to any person obtaining a copy | |
| of this software and associated documentation files (the "Software"), to deal | |
| in the Software without restriction, including without limitation the rights | |
| to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| copies of the Software, and to permit persons to whom the Software is |
| /** | |
| * Generate web videos mp4 + webm from given folder | |
| * You can pass options by file in videos.json | |
| * Options are crop size | |
| * NODE and FFMEPG is required. On mac brew install node && brew install ffmpeg | |
| * FFMPEG command are inspired by https://gist.github.com/Vestride/278e13915894821e1d6f | |
| * eg: node videos.js --input=../inputDir --output=../dir/outputDir --prefix=compressed --r-audio | |
| * if missing outputDir, inputDir will be use | |
| */ |
| // http://ericholsinger.com/install-ffmpeg-on-a-mac | |
| ffmpeg -i input.mp4 -vcodec h264 -acodec mp3 output.mp4 |
| current -= ( target + current ) * friction | |
| current += ( target - current ) * friction |
| "The common wisdom of "don't use conditionals in shaders" is one of my biggest frustrations with how shaders are taught. | |
| step(y, x) _is_ a conditional! It compiles to identical code as: | |
| float val = (x >= y ? 1.0 : 0.0) | |
| or | |
| float val = 0.0; | |
| if (x >= y) val = 1.0;" | |
| https://twitter.com/bgolus/status/1235254923819802626 | |
| // Performing shader divisions without diving *rcp = approximation of 1/x | |
| float myDividedVal = myValToDivide * rcp(myDivider); |
| /* | |
| ** Copyright (c) 2012, Romain Dura romain@shazbits.com | |
| ** | |
| ** Permission to use, copy, modify, and/or distribute this software for any | |
| ** purpose with or without fee is hereby granted, provided that the above | |
| ** copyright notice and this permission notice appear in all copies. | |
| ** | |
| ** THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | |
| ** WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | |
| ** MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY |
| @mixin box-shadow($top, $left, $blur, $color, $inset: false) { | |
| @if $inset { | |
| -webkit-box-shadow:inset $top $left $blur $color; | |
| -moz-box-shadow:inset $top $left $blur $color; | |
| box-shadow:inset $top $left $blur $color; | |
| } @else { | |
| -webkit-box-shadow: $top $left $blur $color; | |
| -moz-box-shadow: $top $left $blur $color; | |
| box-shadow: $top $left $blur $color; | |
| } |