├── .gitattributes ├── .gitignore ├── README.md ├── Scratch.swf ├── css ├── scratchx.css └── scratchx.css.map ├── favicon.ico ├── fonts ├── ScratchX.eot ├── ScratchX.svg ├── ScratchX.ttf └── ScratchX.woff ├── images ├── editor.png ├── extensions │ ├── ISSTracker_small.png │ ├── arduino101_large.png │ ├── arduino101_small.png │ ├── arduino_small.png │ ├── clarifai_small.png │ ├── ev3_large.png │ ├── ev3_small.png │ ├── extension.png │ ├── fischertechnik-extension-sm.png │ ├── gomotion_large.jpg │ ├── gomotion_small.jpg │ ├── gotemp_large.jpg │ ├── gotemp_small.jpg │ ├── iRobot_large.png │ ├── iRobot_small.png │ ├── leapmotion_small.png │ ├── littlebits_small.jpg │ ├── makesense_large.png │ ├── makesense_small.png │ ├── mesh-extension-sm.png │ ├── microbit_large.png │ ├── microbit_small.png │ ├── pocketlab_small.png │ ├── poppy_large.png │ ├── poppy_small.png │ ├── rb4s_large.png │ ├── rb4s_small.png │ ├── realsense_small.png │ ├── roamer_large.png │ ├── roamer_small.png │ ├── robotec_small.png │ ├── scratch3d_large.jpg │ ├── scratch3d_small.png │ ├── spotify_large.png │ ├── synth-extension-lg.png │ ├── synth-extension-sm.png │ ├── text-extension-sm.png │ ├── thymio_large.png │ ├── thymio_small.png │ ├── twitter-extension-sm.png │ ├── weather_large.png │ ├── weather_small.png │ └── xi3_small.png ├── scratch-heading.png ├── scratchx-heading.png └── scratchx-logo.png ├── index.html ├── js └── scratchx.js ├── libs ├── ZeroClipboard.min.js ├── ZeroClipboard.min.map ├── ZeroClipboard.swf ├── base64ab.js ├── bowser.min.js ├── expressInstall.swf ├── jquery-1.11.2.min.js ├── socket.io-1.3.7.js ├── swfobject.js ├── underscore-min.js └── underscore-min.map ├── locale ├── ab.po ├── an.po ├── ar.po ├── ast.po ├── az.po ├── bg.po ├── bn-in.po ├── bn.po ├── bn_IN.po ├── br.po ├── ca.po ├── cat.po ├── ccc.po ├── cs.po ├── cy.po ├── da.po ├── de.po ├── el.po ├── eo.po ├── es.po ├── et.po ├── eu.po ├── fa-af.po ├── fa.po ├── fa_AF.po ├── fi.po ├── fil.po ├── fo.po ├── fr-ca.po ├── fr.po ├── fr_CA.po ├── ga.po ├── gd.po ├── gl.po ├── hch.po ├── he.po ├── hi.po ├── hr.po ├── ht.po ├── hu.po ├── hy.po ├── id.po ├── is.po ├── it.po ├── ja-hr.po ├── ja.po ├── ja_HIRA.po ├── kk.po ├── km.po ├── kn.po ├── ko.po ├── ku.po ├── ky.po ├── la.po ├── lang_list.txt ├── lg.po ├── lt.po ├── lv.po ├── maz.po ├── mg.po ├── mk.po ├── ml.po ├── mn.po ├── mr.po ├── ms.po ├── mt.po ├── my.po ├── myn.po ├── nah.po ├── nai.po ├── nb.po ├── ne.po ├── nl.po ├── nn.po ├── no.po ├── or.po ├── os.po ├── ote.po ├── oto.po ├── oz.po ├── pap.po ├── pl.po ├── pt-br.po ├── pt.po ├── pt_BR.po ├── ro.po ├── ru.po ├── rw.po ├── sc.po ├── sk.po ├── sl.po ├── sq.po ├── sr.po ├── sv.po ├── sw.po ├── ta.po ├── te.po ├── th.po ├── tr.po ├── tzm.po ├── ug.po ├── uk.po ├── ur.po ├── vi.po ├── zh-cn.po ├── zh-tw.po ├── zh_CN.po └── zh_TW.po ├── sass ├── _editor.scss ├── _gallery.scss ├── _home.scss ├── base │ ├── _base.scss │ ├── _buttons.scss │ ├── _forms.scss │ ├── _grid-settings.scss │ ├── _icons.scss │ ├── _lists.scss │ ├── _mixins.scss │ ├── _modal.scss │ ├── _normalize.scss │ ├── _tables.scss │ ├── _typography.scss │ └── _variables.scss ├── bourbon │ ├── _bourbon-deprecated-upcoming.scss │ ├── _bourbon.scss │ ├── addons │ │ ├── _border-color.scss │ │ ├── _border-radius.scss │ │ ├── _border-style.scss │ │ ├── _border-width.scss │ │ ├── _buttons.scss │ │ ├── _clearfix.scss │ │ ├── _ellipsis.scss │ │ ├── _font-stacks.scss │ │ ├── _hide-text.scss │ │ ├── _margin.scss │ │ ├── _padding.scss │ │ ├── _position.scss │ │ ├── _prefixer.scss │ │ ├── _retina-image.scss │ │ ├── _size.scss │ │ ├── _text-inputs.scss │ │ ├── _timing-functions.scss │ │ ├── _triangle.scss │ │ └── _word-wrap.scss │ ├── css3 │ │ ├── _animation.scss │ │ ├── _appearance.scss │ │ ├── _backface-visibility.scss │ │ ├── _background-image.scss │ │ ├── _background.scss │ │ ├── _border-image.scss │ │ ├── _calc.scss │ │ ├── _columns.scss │ │ ├── _filter.scss │ │ ├── _flex-box.scss │ │ ├── _font-face.scss │ │ ├── _font-feature-settings.scss │ │ ├── _hidpi-media-query.scss │ │ ├── _hyphens.scss │ │ ├── _image-rendering.scss │ │ ├── _keyframes.scss │ │ ├── _linear-gradient.scss │ │ ├── _perspective.scss │ │ ├── _placeholder.scss │ │ ├── _radial-gradient.scss │ │ ├── _selection.scss │ │ ├── _text-decoration.scss │ │ ├── _transform.scss │ │ ├── _transition.scss │ │ └── _user-select.scss │ ├── functions │ │ ├── _assign-inputs.scss │ │ ├── _contains-falsy.scss │ │ ├── _contains.scss │ │ ├── _is-length.scss │ │ ├── _is-light.scss │ │ ├── _is-number.scss │ │ ├── _is-size.scss │ │ ├── _modular-scale.scss │ │ ├── _px-to-em.scss │ │ ├── _px-to-rem.scss │ │ ├── _shade.scss │ │ ├── _strip-units.scss │ │ ├── _tint.scss │ │ ├── _transition-property-name.scss │ │ └── _unpack.scss │ ├── helpers │ │ ├── _convert-units.scss │ │ ├── _directional-values.scss │ │ ├── _font-source-declaration.scss │ │ ├── _gradient-positions-parser.scss │ │ ├── _linear-angle-parser.scss │ │ ├── _linear-gradient-parser.scss │ │ ├── _linear-positions-parser.scss │ │ ├── _linear-side-corner-parser.scss │ │ ├── _radial-arg-parser.scss │ │ ├── _radial-gradient-parser.scss │ │ ├── _radial-positions-parser.scss │ │ ├── _render-gradients.scss │ │ ├── _shape-size-stripper.scss │ │ └── _str-to-num.scss │ └── settings │ │ ├── _asset-pipeline.scss │ │ ├── _prefixer.scss │ │ └── _px-to-em.scss ├── neat │ ├── _neat-helpers.scss │ ├── _neat.scss │ ├── functions │ │ ├── _new-breakpoint.scss │ │ └── _private.scss │ ├── grid │ │ ├── _box-sizing.scss │ │ ├── _direction-context.scss │ │ ├── _display-context.scss │ │ ├── _fill-parent.scss │ │ ├── _media.scss │ │ ├── _omega.scss │ │ ├── _outer-container.scss │ │ ├── _pad.scss │ │ ├── _private.scss │ │ ├── _row.scss │ │ ├── _shift.scss │ │ ├── _span-columns.scss │ │ ├── _to-deprecate.scss │ │ └── _visual-grid.scss │ └── settings │ │ ├── _disable-warnings.scss │ │ ├── _grid.scss │ │ └── _visual-grid.scss └── scratchx.scss ├── scratch_extensions ├── picoExtension.js ├── scratch_deviceManager.js ├── scratch_ext.js ├── scratch_nmh.js ├── scratch_plugin.js ├── scratch_proxies.js ├── wedo2Extension.js └── wedoExtension.js └── tmp └── TalkingGobo.sbx /.gitattributes: -------------------------------------------------------------------------------- 1 | # Set the default behavior, in case people don't have core.autocrlf set. 2 | * text=auto 3 | 4 | # Explicitly specify line endings for as many files as possible. 5 | # People who (for example) rsync between Windows and Linux need this. 6 | 7 | # File types which we know are binary 8 | *.eot binary 9 | *.ico binary 10 | *.jpg binary 11 | *.png binary 12 | *.sbx binary 13 | *.swf binary 14 | *.ttf binary 15 | *.woff binary 16 | 17 | # Prefer LF for most file types 18 | *.css text eol=lf 19 | *.css.map text eol=lf 20 | *.html text eol=lf 21 | *.js text eol=lf 22 | *.js.map text eol=lf 23 | *.md text eol=lf 24 | *.po text eol=lf 25 | *.scss text eol=lf 26 | *.svg text eol=lf 27 | *.txt text eol=lf 28 | *min.map text eol=lf 29 | 30 | # Prefer LF for these files 31 | .editorconfig text eol=lf 32 | .eslintignore text eol=lf 33 | .gitattributes text eol=lf 34 | .gitignore text eol=lf 35 | CNAME text eol=lf 36 | 37 | # Use CRLF for Windows-specific file types 38 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /.idea 2 | .sass-cache 3 | .DS_Store 4 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ScratchX is no longer supported 2 | #### ScratchX is now archived and no longer supported because Adobe Flash has reached end of life. If you're interested in developing extensions for Scratch, please visit the [Scratch-GUI](https://github.com/scratchfoundation/scratch-gui) repo as a starting point for building a local version of the Scratch editor. It can be linked to your local version of [Scratch-VM](https://github.com/scratchfoundation/scratch-vm), where you can create your own extensions. 3 | 4 | ## ScratchX 5 | #### Website for experimental Scratch extensions 6 | -------------------------------------------------------------------------------- /Scratch.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scratchfoundation/scratchx/c14de2377770ca06a02540926abec934ef815b27/Scratch.swf -------------------------------------------------------------------------------- /favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scratchfoundation/scratchx/c14de2377770ca06a02540926abec934ef815b27/favicon.ico -------------------------------------------------------------------------------- /fonts/ScratchX.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scratchfoundation/scratchx/c14de2377770ca06a02540926abec934ef815b27/fonts/ScratchX.eot -------------------------------------------------------------------------------- /fonts/ScratchX.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scratchfoundation/scratchx/c14de2377770ca06a02540926abec934ef815b27/fonts/ScratchX.ttf -------------------------------------------------------------------------------- /fonts/ScratchX.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scratchfoundation/scratchx/c14de2377770ca06a02540926abec934ef815b27/fonts/ScratchX.woff -------------------------------------------------------------------------------- /images/editor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scratchfoundation/scratchx/c14de2377770ca06a02540926abec934ef815b27/images/editor.png -------------------------------------------------------------------------------- /images/extensions/ISSTracker_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scratchfoundation/scratchx/c14de2377770ca06a02540926abec934ef815b27/images/extensions/ISSTracker_small.png -------------------------------------------------------------------------------- /images/extensions/arduino101_large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scratchfoundation/scratchx/c14de2377770ca06a02540926abec934ef815b27/images/extensions/arduino101_large.png -------------------------------------------------------------------------------- /images/extensions/arduino101_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scratchfoundation/scratchx/c14de2377770ca06a02540926abec934ef815b27/images/extensions/arduino101_small.png -------------------------------------------------------------------------------- /images/extensions/arduino_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scratchfoundation/scratchx/c14de2377770ca06a02540926abec934ef815b27/images/extensions/arduino_small.png -------------------------------------------------------------------------------- /images/extensions/clarifai_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scratchfoundation/scratchx/c14de2377770ca06a02540926abec934ef815b27/images/extensions/clarifai_small.png -------------------------------------------------------------------------------- /images/extensions/ev3_large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scratchfoundation/scratchx/c14de2377770ca06a02540926abec934ef815b27/images/extensions/ev3_large.png -------------------------------------------------------------------------------- /images/extensions/ev3_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scratchfoundation/scratchx/c14de2377770ca06a02540926abec934ef815b27/images/extensions/ev3_small.png -------------------------------------------------------------------------------- /images/extensions/extension.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scratchfoundation/scratchx/c14de2377770ca06a02540926abec934ef815b27/images/extensions/extension.png -------------------------------------------------------------------------------- /images/extensions/fischertechnik-extension-sm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scratchfoundation/scratchx/c14de2377770ca06a02540926abec934ef815b27/images/extensions/fischertechnik-extension-sm.png -------------------------------------------------------------------------------- /images/extensions/gomotion_large.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scratchfoundation/scratchx/c14de2377770ca06a02540926abec934ef815b27/images/extensions/gomotion_large.jpg -------------------------------------------------------------------------------- /images/extensions/gomotion_small.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scratchfoundation/scratchx/c14de2377770ca06a02540926abec934ef815b27/images/extensions/gomotion_small.jpg -------------------------------------------------------------------------------- /images/extensions/gotemp_large.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scratchfoundation/scratchx/c14de2377770ca06a02540926abec934ef815b27/images/extensions/gotemp_large.jpg -------------------------------------------------------------------------------- /images/extensions/gotemp_small.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scratchfoundation/scratchx/c14de2377770ca06a02540926abec934ef815b27/images/extensions/gotemp_small.jpg -------------------------------------------------------------------------------- /images/extensions/iRobot_large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scratchfoundation/scratchx/c14de2377770ca06a02540926abec934ef815b27/images/extensions/iRobot_large.png -------------------------------------------------------------------------------- /images/extensions/iRobot_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scratchfoundation/scratchx/c14de2377770ca06a02540926abec934ef815b27/images/extensions/iRobot_small.png -------------------------------------------------------------------------------- /images/extensions/leapmotion_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scratchfoundation/scratchx/c14de2377770ca06a02540926abec934ef815b27/images/extensions/leapmotion_small.png -------------------------------------------------------------------------------- /images/extensions/littlebits_small.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scratchfoundation/scratchx/c14de2377770ca06a02540926abec934ef815b27/images/extensions/littlebits_small.jpg -------------------------------------------------------------------------------- /images/extensions/makesense_large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scratchfoundation/scratchx/c14de2377770ca06a02540926abec934ef815b27/images/extensions/makesense_large.png -------------------------------------------------------------------------------- /images/extensions/makesense_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scratchfoundation/scratchx/c14de2377770ca06a02540926abec934ef815b27/images/extensions/makesense_small.png -------------------------------------------------------------------------------- /images/extensions/mesh-extension-sm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scratchfoundation/scratchx/c14de2377770ca06a02540926abec934ef815b27/images/extensions/mesh-extension-sm.png -------------------------------------------------------------------------------- /images/extensions/microbit_large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scratchfoundation/scratchx/c14de2377770ca06a02540926abec934ef815b27/images/extensions/microbit_large.png -------------------------------------------------------------------------------- /images/extensions/microbit_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scratchfoundation/scratchx/c14de2377770ca06a02540926abec934ef815b27/images/extensions/microbit_small.png -------------------------------------------------------------------------------- /images/extensions/pocketlab_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scratchfoundation/scratchx/c14de2377770ca06a02540926abec934ef815b27/images/extensions/pocketlab_small.png -------------------------------------------------------------------------------- /images/extensions/poppy_large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scratchfoundation/scratchx/c14de2377770ca06a02540926abec934ef815b27/images/extensions/poppy_large.png -------------------------------------------------------------------------------- /images/extensions/poppy_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scratchfoundation/scratchx/c14de2377770ca06a02540926abec934ef815b27/images/extensions/poppy_small.png -------------------------------------------------------------------------------- /images/extensions/rb4s_large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scratchfoundation/scratchx/c14de2377770ca06a02540926abec934ef815b27/images/extensions/rb4s_large.png -------------------------------------------------------------------------------- /images/extensions/rb4s_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scratchfoundation/scratchx/c14de2377770ca06a02540926abec934ef815b27/images/extensions/rb4s_small.png -------------------------------------------------------------------------------- /images/extensions/realsense_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scratchfoundation/scratchx/c14de2377770ca06a02540926abec934ef815b27/images/extensions/realsense_small.png -------------------------------------------------------------------------------- /images/extensions/roamer_large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scratchfoundation/scratchx/c14de2377770ca06a02540926abec934ef815b27/images/extensions/roamer_large.png -------------------------------------------------------------------------------- /images/extensions/roamer_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scratchfoundation/scratchx/c14de2377770ca06a02540926abec934ef815b27/images/extensions/roamer_small.png -------------------------------------------------------------------------------- /images/extensions/robotec_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scratchfoundation/scratchx/c14de2377770ca06a02540926abec934ef815b27/images/extensions/robotec_small.png -------------------------------------------------------------------------------- /images/extensions/scratch3d_large.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scratchfoundation/scratchx/c14de2377770ca06a02540926abec934ef815b27/images/extensions/scratch3d_large.jpg -------------------------------------------------------------------------------- /images/extensions/scratch3d_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scratchfoundation/scratchx/c14de2377770ca06a02540926abec934ef815b27/images/extensions/scratch3d_small.png -------------------------------------------------------------------------------- /images/extensions/spotify_large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scratchfoundation/scratchx/c14de2377770ca06a02540926abec934ef815b27/images/extensions/spotify_large.png -------------------------------------------------------------------------------- /images/extensions/synth-extension-lg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scratchfoundation/scratchx/c14de2377770ca06a02540926abec934ef815b27/images/extensions/synth-extension-lg.png -------------------------------------------------------------------------------- /images/extensions/synth-extension-sm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scratchfoundation/scratchx/c14de2377770ca06a02540926abec934ef815b27/images/extensions/synth-extension-sm.png -------------------------------------------------------------------------------- /images/extensions/text-extension-sm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scratchfoundation/scratchx/c14de2377770ca06a02540926abec934ef815b27/images/extensions/text-extension-sm.png -------------------------------------------------------------------------------- /images/extensions/thymio_large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scratchfoundation/scratchx/c14de2377770ca06a02540926abec934ef815b27/images/extensions/thymio_large.png -------------------------------------------------------------------------------- /images/extensions/thymio_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scratchfoundation/scratchx/c14de2377770ca06a02540926abec934ef815b27/images/extensions/thymio_small.png -------------------------------------------------------------------------------- /images/extensions/twitter-extension-sm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scratchfoundation/scratchx/c14de2377770ca06a02540926abec934ef815b27/images/extensions/twitter-extension-sm.png -------------------------------------------------------------------------------- /images/extensions/weather_large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scratchfoundation/scratchx/c14de2377770ca06a02540926abec934ef815b27/images/extensions/weather_large.png -------------------------------------------------------------------------------- /images/extensions/weather_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scratchfoundation/scratchx/c14de2377770ca06a02540926abec934ef815b27/images/extensions/weather_small.png -------------------------------------------------------------------------------- /images/extensions/xi3_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scratchfoundation/scratchx/c14de2377770ca06a02540926abec934ef815b27/images/extensions/xi3_small.png -------------------------------------------------------------------------------- /images/scratch-heading.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scratchfoundation/scratchx/c14de2377770ca06a02540926abec934ef815b27/images/scratch-heading.png -------------------------------------------------------------------------------- /images/scratchx-heading.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scratchfoundation/scratchx/c14de2377770ca06a02540926abec934ef815b27/images/scratchx-heading.png -------------------------------------------------------------------------------- /images/scratchx-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scratchfoundation/scratchx/c14de2377770ca06a02540926abec934ef815b27/images/scratchx-logo.png -------------------------------------------------------------------------------- /libs/ZeroClipboard.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scratchfoundation/scratchx/c14de2377770ca06a02540926abec934ef815b27/libs/ZeroClipboard.swf -------------------------------------------------------------------------------- /libs/base64ab.js: -------------------------------------------------------------------------------- 1 | // Convert ArrayBuffers to/from Base64 2 | 3 | (function() { 4 | var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; 5 | 6 | window.ab_to_b64 = function (arraybuffer) { 7 | var bytes = new Uint8Array(arraybuffer), i, len = bytes.length, base64 = ''; 8 | 9 | for (i = 0; i < len; i += 3) { 10 | base64 += chars[bytes[i] >> 2]; 11 | base64 += chars[((bytes[i] & 3) << 4) | (bytes[i + 1] >> 4)]; 12 | base64 += chars[((bytes[i + 1] & 15) << 2) | (bytes[i + 2] >> 6)]; 13 | base64 += chars[bytes[i + 2] & 63]; 14 | } 15 | 16 | if ((len % 3) === 2) { 17 | base64 = base64.substring(0, base64.length - 1) + '='; 18 | } else if (len % 3 === 1) { 19 | base64 = base64.substring(0, base64.length - 2) + '=='; 20 | } 21 | 22 | return base64; 23 | } 24 | 25 | window.b64_to_ab = function (base64) { 26 | var bufferLength = base64.length * 0.75, len = base64.length, i, p = 0, encoded1, encoded2, encoded3, encoded4; 27 | if (base64[base64.length - 1] === '=') { 28 | --bufferLength; 29 | if (base64[base64.length - 2] === '=') { 30 | --bufferLength; 31 | } 32 | } 33 | 34 | var arraybuffer = new ArrayBuffer(bufferLength), bytes = new Uint8Array(arraybuffer); 35 | for (i = 0; i < len; i += 4) { 36 | encoded1 = chars.indexOf(base64[i]); 37 | encoded2 = chars.indexOf(base64[i + 1]); 38 | encoded3 = chars.indexOf(base64[i + 2]); 39 | encoded4 = chars.indexOf(base64[i + 3]); 40 | bytes[p++] = (encoded1 << 2) | (encoded2 >> 4); 41 | bytes[p++] = ((encoded2 & 15) << 4) | (encoded3 >> 2); 42 | bytes[p++] = ((encoded3 & 3) << 6) | (encoded4 & 63); 43 | } 44 | 45 | return arraybuffer; 46 | } 47 | })(); 48 | -------------------------------------------------------------------------------- /libs/bowser.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bowser - a browser detector 3 | * https://github.com/ded/bowser 4 | * MIT License | (c) Dustin Diaz 2014 5 | */ 6 | !function(e,t){typeof module!="undefined"&&module.exports?module.exports.browser=t():typeof define=="function"&&define.amd?define(t):this[e]=t()}("bowser",function(){function t(t){function n(e){var n=t.match(e);return n&&n.length>1&&n[1]||""}var r=n(/(ipod|iphone|ipad)/i).toLowerCase(),i=/like android/i.test(t),s=!i&&/android/i.test(t),o=n(/version\/(\d+(\.\d+)?)/i),u=/tablet/i.test(t),a=!u&&/[^-]mobi/i.test(t),f;/opera|opr/i.test(t)?f={name:"Opera",opera:e,version:o||n(/(?:opera|opr)[\s\/](\d+(\.\d+)?)/i)}:/windows phone/i.test(t)?f={name:"Windows Phone",windowsphone:e,msie:e,version:n(/iemobile\/(\d+(\.\d+)?)/i)}:/msie|trident/i.test(t)?f={name:"Internet Explorer",msie:e,version:n(/(?:msie |rv:)(\d+(\.\d+)?)/i)}:/chrome|crios|crmo/i.test(t)?f={name:"Chrome",chrome:e,version:n(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i)}:r?(f={name:r=="iphone"?"iPhone":r=="ipad"?"iPad":"iPod"},o&&(f.version=o)):/sailfish/i.test(t)?f={name:"Sailfish",sailfish:e,version:n(/sailfish\s?browser\/(\d+(\.\d+)?)/i)}:/seamonkey\//i.test(t)?f={name:"SeaMonkey",seamonkey:e,version:n(/seamonkey\/(\d+(\.\d+)?)/i)}:/firefox|iceweasel/i.test(t)?(f={name:"Firefox",firefox:e,version:n(/(?:firefox|iceweasel)[ \/](\d+(\.\d+)?)/i)},/\((mobile|tablet);[^\)]*rv:[\d\.]+\)/i.test(t)&&(f.firefoxos=e)):/silk/i.test(t)?f={name:"Amazon Silk",silk:e,version:n(/silk\/(\d+(\.\d+)?)/i)}:s?f={name:"Android",version:o}:/phantom/i.test(t)?f={name:"PhantomJS",phantom:e,version:n(/phantomjs\/(\d+(\.\d+)?)/i)}:/blackberry|\bbb\d+/i.test(t)||/rim\stablet/i.test(t)?f={name:"BlackBerry",blackberry:e,version:o||n(/blackberry[\d]+\/(\d+(\.\d+)?)/i)}:/(web|hpw)os/i.test(t)?(f={name:"WebOS",webos:e,version:o||n(/w(?:eb)?osbrowser\/(\d+(\.\d+)?)/i)},/touchpad\//i.test(t)&&(f.touchpad=e)):/bada/i.test(t)?f={name:"Bada",bada:e,version:n(/dolfin\/(\d+(\.\d+)?)/i)}:/tizen/i.test(t)?f={name:"Tizen",tizen:e,version:n(/(?:tizen\s?)?browser\/(\d+(\.\d+)?)/i)||o}:/safari/i.test(t)?f={name:"Safari",safari:e,version:o}:f={},/(apple)?webkit/i.test(t)?(f.name=f.name||"Webkit",f.webkit=e,!f.version&&o&&(f.version=o)):!f.opera&&/gecko\//i.test(t)&&(f.name=f.name||"Gecko",f.gecko=e,f.version=f.version||n(/gecko\/(\d+(\.\d+)?)/i)),s||f.silk?f.android=e:r&&(f[r]=e,f.ios=e);var l="";r?(l=n(/os (\d+([_\s]\d+)*) like mac os x/i),l=l.replace(/[_\s]/g,".")):s?l=n(/android[ \/-](\d+(\.\d+)*)/i):f.windowsphone?l=n(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i):f.webos?l=n(/(?:web|hpw)os\/(\d+(\.\d+)*)/i):f.blackberry?l=n(/rim\stablet\sos\s(\d+(\.\d+)*)/i):f.bada?l=n(/bada\/(\d+(\.\d+)*)/i):f.tizen&&(l=n(/tizen[\/\s](\d+(\.\d+)*)/i)),l&&(f.osversion=l);var c=l.split(".")[0];if(u||r=="ipad"||s&&(c==3||c==4&&!a)||f.silk)f.tablet=e;else if(a||r=="iphone"||r=="ipod"||s||f.blackberry||f.webos||f.bada)f.mobile=e;return f.msie&&f.version>=10||f.chrome&&f.version>=20||f.firefox&&f.version>=20||f.safari&&f.version>=6||f.opera&&f.version>=10||f.ios&&f.osversion&&f.osversion.split(".")[0]>=6||f.blackberry&&f.version>=10.1?f.a=e:f.msie&&f.version<10||f.chrome&&f.version<20||f.firefox&&f.version<20||f.safari&&f.version<6||f.opera&&f.version<10||f.ios&&f.osversion&&f.osversion.split(".")[0]<6?f.c=e:f.x=e,f}var e=!0,n=t(typeof navigator!="undefined"?navigator.userAgent:"");return n._detect=t,n}) -------------------------------------------------------------------------------- /libs/expressInstall.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scratchfoundation/scratchx/c14de2377770ca06a02540926abec934ef815b27/libs/expressInstall.swf -------------------------------------------------------------------------------- /locale/cat.po: -------------------------------------------------------------------------------- 1 | # The language name as it will appear in the language menu 2 | msgid "Language-Name" 3 | msgstr "" 4 | 5 | msgid "%b and %b" 6 | msgstr "%b meow %b" 7 | 8 | msgid "%b or %b" 9 | msgstr "%b meow %b" 10 | 11 | msgid "%m.attribute of %m.spriteOrStage" 12 | msgstr "" 13 | 14 | msgid "%m.list contains %s" 15 | msgstr "%m.list meows %s" 16 | 17 | msgid "%m.mathOp of %n" 18 | msgstr "%m.mathOp meow %n" 19 | 20 | msgid "%m.sensor sensor value" 21 | msgstr "" 22 | 23 | msgid "%n mod %n" 24 | msgstr "" 25 | 26 | msgid "add %s to %m.list" 27 | msgstr "meow %s to %m.list" 28 | 29 | msgid "answer" 30 | msgstr "meow" 31 | 32 | msgid "ask %s and wait" 33 | msgstr "meow %s and meow" 34 | 35 | # "backdrop" in Scratch 2.0 is similar to "background" in Scratch 1.4 36 | msgid "backdrop #" 37 | msgstr "meow #" 38 | 39 | # "backdrop" in Scratch 2.0 is similar to "background" in Scratch 1.4 40 | msgid "backdrop name" 41 | msgstr "backdrop meow" 42 | 43 | msgid "broadcast %m.broadcast" 44 | msgstr "meow %m.broadcast" 45 | 46 | msgid "broadcast %m.broadcast and wait" 47 | msgstr "meow %m.broadcast and wait" 48 | 49 | msgid "change %m.effect effect by %n" 50 | msgstr "meow %m.effect effect by %n" 51 | 52 | msgid "change %m.var by %n" 53 | msgstr "meow %m.var by %n" 54 | 55 | msgid "change pen color by %n" 56 | msgstr "change meow color by %n" 57 | 58 | msgid "change pen shade by %n" 59 | msgstr "change meow shade by %n" 60 | 61 | msgid "change pen size by %n" 62 | msgstr "change meow size by %n" 63 | 64 | msgid "change size by %n" 65 | msgstr "change meow by %n" 66 | 67 | msgid "change tempo by %n" 68 | msgstr "change meow by %n" 69 | 70 | msgid "change volume by %n" 71 | msgstr "change meow by %n" 72 | 73 | msgid "change x by %n" 74 | msgstr "meow x by %n" 75 | 76 | msgid "change y by %n" 77 | msgstr "meow y by %n" 78 | 79 | msgid "clear" 80 | msgstr "meow" 81 | 82 | msgid "clear graphic effects" 83 | msgstr "clear meow effects" 84 | 85 | msgid "color %c is touching %c?" 86 | msgstr "meow %c is touching %c?" 87 | 88 | msgid "Control" 89 | msgstr "Meow" 90 | 91 | msgid "costume #" 92 | msgstr "meow #" 93 | 94 | msgid "create clone of %m.spriteOnly" 95 | msgstr "create meow of %m.spriteOnly" 96 | 97 | msgid "current %m.timeAndDate" 98 | msgstr "meow %m.timeAndDate" 99 | 100 | msgid "Data" 101 | msgstr "Meow" 102 | 103 | msgid "days since 2000" 104 | msgstr "Meows since 200" 105 | 106 | msgid "define" 107 | msgstr "meow" 108 | 109 | msgid "delete %d.listDeleteItem of %m.list" 110 | msgstr "meow %d.listDeleteItem of %m.list" 111 | 112 | msgid "delete this clone" 113 | msgstr "delete this meow" 114 | 115 | msgid "direction" 116 | msgstr "meow" 117 | 118 | msgid "distance" 119 | msgstr "meow" 120 | 121 | msgid "distance to %m.spriteOrMouse" 122 | msgstr "meow to %m.spriteOrMouse" 123 | 124 | msgid "else" 125 | msgstr "meow" 126 | 127 | msgid "Events" 128 | msgstr "Meow" 129 | 130 | msgid "forever" 131 | msgstr "meow" 132 | 133 | msgid "glide %n secs to x:%n y:%n" 134 | msgstr "meow %n secs to x:%n y:%n" 135 | 136 | msgid "go back %n layers" 137 | msgstr "go meow %n layers" 138 | 139 | msgid "go to %m.spriteOrMouse" 140 | msgstr "meow to %m.spriteOrMouse" 141 | 142 | msgid "go to front" 143 | msgstr "meow to front" 144 | 145 | msgid "go to x:%n y:%n" 146 | msgstr "meow to x:%n y:%n" 147 | 148 | msgid "hide" 149 | msgstr "meow" 150 | 151 | msgid "hide list %m.list" 152 | msgstr "hide meow %m.list" 153 | 154 | msgid "hide variable %m.var" 155 | msgstr "hide meow %m.var" 156 | 157 | msgid "if %b then" 158 | msgstr "meow %b then" 159 | 160 | msgid "if on edge, bounce" 161 | msgstr "f on edge, meow" 162 | 163 | msgid "insert %s at %d.listItem of %m.list" 164 | msgstr "meow %s at %d.listItem of %m.list" 165 | 166 | msgid "item %d.listItem of %m.list" 167 | msgstr "meow %d.listItem of %m.list" 168 | 169 | msgid "join %s %s" 170 | msgstr "meow %s %s" 171 | 172 | msgid "key %m.key pressed?" 173 | msgstr "meow %m.key pressed?" 174 | 175 | msgid "length of %m.list" 176 | msgstr "meow of %m.list" 177 | 178 | msgid "length of %s" 179 | msgstr "meow of %s" 180 | 181 | msgid "letter %n of %s" 182 | msgstr "meow %n of %s" 183 | 184 | msgid "Looks" 185 | msgstr "Meow" 186 | 187 | msgid "loudness" 188 | msgstr "meow" 189 | 190 | msgid "More Blocks" 191 | msgstr "Meow Meow" 192 | 193 | msgid "Motion" 194 | msgstr "Meow" 195 | 196 | msgid "mouse down?" 197 | msgstr "" 198 | 199 | msgid "mouse x" 200 | msgstr "" 201 | 202 | msgid "mouse y" 203 | msgstr "" 204 | 205 | msgid "move %n steps" 206 | msgstr "meow %n steps" 207 | 208 | # "backdrop" in Scratch 2.0 is similar to "background" in Scratch 1.4 209 | msgid "next backdrop" 210 | msgstr "meow backdrop" 211 | 212 | msgid "next costume" 213 | msgstr "meow costume" 214 | 215 | msgid "not %b" 216 | msgstr "meow %b" 217 | 218 | msgid "Operators" 219 | msgstr "Meow" 220 | 221 | msgid "Pen" 222 | msgstr "Meow" 223 | 224 | msgid "pen down" 225 | msgstr "meow down" 226 | 227 | msgid "pen up" 228 | msgstr "meow up" 229 | 230 | msgid "pick random %n to %n" 231 | msgstr "pick meow %n to %n" 232 | 233 | msgid "play drum %d.drum for %n beats" 234 | msgstr "play meow %d.drum for %n beats" 235 | 236 | msgid "play note %d.note for %n beats" 237 | msgstr "play meow %d.note for %n beats" 238 | 239 | msgid "play sound %m.sound" 240 | msgstr "play meow %d.note for %n beats" 241 | 242 | msgid "play sound %m.sound until done" 243 | msgstr "play meow %m.sound until meow" 244 | 245 | msgid "point in direction %d.direction" 246 | msgstr "meow in direction %d.direction" 247 | 248 | msgid "point towards %m.spriteOrMouse" 249 | msgstr "meow towards %m.spriteOrMouse" 250 | 251 | msgid "repeat %n" 252 | msgstr "meow %n" 253 | 254 | msgid "repeat until %b" 255 | msgstr "repeat meow %b" 256 | 257 | msgid "replace item %d.listItem of %m.list with %s" 258 | msgstr "replace meow %d.listItem of %m.list with %s" 259 | 260 | msgid "reset timer" 261 | msgstr "reset meow" 262 | 263 | msgid "rest for %n beats" 264 | msgstr "meow for %n beats" 265 | 266 | msgid "round %n" 267 | msgstr "meow %n" 268 | 269 | msgid "say %s" 270 | msgstr "meow %s" 271 | 272 | msgid "say %s for %n secs" 273 | msgstr "meow %s for %n secs" 274 | 275 | msgid "Sensing" 276 | msgstr "Meow" 277 | 278 | msgid "sensor %m.booleanSensor?" 279 | msgstr "" 280 | 281 | msgid "set %m.effect effect to %n" 282 | msgstr "" 283 | 284 | msgid "set %m.var to %s" 285 | msgstr "" 286 | 287 | msgid "set instrument to %d.instrument" 288 | msgstr "" 289 | 290 | msgid "set motor direction %m.motorDirection" 291 | msgstr "" 292 | 293 | msgid "set motor power %n" 294 | msgstr "" 295 | 296 | msgid "set pen color to %c" 297 | msgstr "set meow meow to %c" 298 | 299 | msgid "set pen color to %n" 300 | msgstr "set meow meow to %n" 301 | 302 | msgid "set pen shade to %n" 303 | msgstr "set meow meow to %n" 304 | 305 | msgid "set pen size to %n" 306 | msgstr "set meow meow to %n" 307 | 308 | msgid "set rotation style %m.rotationStyle" 309 | msgstr "set meow style %m.rotationStyle" 310 | 311 | msgid "set size to %n%" 312 | msgstr "set meow to %n%" 313 | 314 | msgid "set tempo to %n bpm" 315 | msgstr "set tempo to %n meowpm" 316 | 317 | msgid "set video transparency to %n%" 318 | msgstr "set meow transparency to %n%" 319 | 320 | msgid "set volume to %n%" 321 | msgstr "meow volume to %n%" 322 | 323 | msgid "set x to %n" 324 | msgstr "meow x to %n" 325 | 326 | msgid "set y to %n" 327 | msgstr "meow y to %n" 328 | 329 | msgid "show" 330 | msgstr "meow" 331 | 332 | msgid "show list %m.list" 333 | msgstr "meow list %m.list" 334 | 335 | msgid "show variable %m.var" 336 | msgstr "meow variable %m.var" 337 | 338 | msgid "size" 339 | msgstr "meow" 340 | 341 | msgid "Sound" 342 | msgstr "Meow" 343 | 344 | msgid "stamp" 345 | msgstr "meow" 346 | 347 | msgid "stop %m.stop" 348 | msgstr "meow %m.stop" 349 | 350 | msgid "stop all sounds" 351 | msgstr "stop all meows" 352 | 353 | # "backdrop" in Scratch 2.0 is similar to "background" in Scratch 1.4 354 | msgid "switch backdrop to %m.backdrop" 355 | msgstr "switch meow to %m.backdrop" 356 | 357 | # "backdrop" in Scratch 2.0 is similar to "background" in Scratch 1.4 358 | msgid "switch backdrop to %m.backdrop and wait" 359 | msgstr "switch meow to %m.backdrop and meow" 360 | 361 | msgid "switch costume to %m.costume" 362 | msgstr "switch meow to %m.costume" 363 | 364 | msgid "tempo" 365 | msgstr "moew" 366 | 367 | msgid "think %s" 368 | msgstr "meow %s" 369 | 370 | msgid "think %s for %n secs" 371 | msgstr "meow %s for %n secs" 372 | 373 | msgid "tilt" 374 | msgstr "meow" 375 | 376 | msgid "timer" 377 | msgstr "meow" 378 | 379 | msgid "touching %m.touching?" 380 | msgstr "moew %m.touching?" 381 | 382 | msgid "touching color %c?" 383 | msgstr "meow color %c?" 384 | 385 | msgid "turn @turnLeft %n degrees" 386 | msgstr "meow @turnLeft %n degrees" 387 | 388 | msgid "turn @turnRight %n degrees" 389 | msgstr "meow @turnRight %n degrees" 390 | 391 | msgid "turn motor off" 392 | msgstr "" 393 | 394 | msgid "turn motor on" 395 | msgstr "" 396 | 397 | msgid "turn motor on for %n secs" 398 | msgstr "" 399 | 400 | msgid "turn video %m.videoState" 401 | msgstr "" 402 | 403 | msgid "username" 404 | msgstr "" 405 | 406 | msgid "video %m.videoMotionType on %m.stageOrThis" 407 | msgstr "meow %m.videoMotionType on %m.stageOrThis" 408 | 409 | msgid "volume" 410 | msgstr "meow" 411 | 412 | msgid "wait %n secs" 413 | msgstr "meow %n secs" 414 | 415 | msgid "wait until %b" 416 | msgstr "meow until %b" 417 | 418 | msgid "when %m.booleanSensor" 419 | msgstr "" 420 | 421 | msgid "when %m.key key pressed" 422 | msgstr "when %m.key key meowed" 423 | 424 | msgid "when %m.triggerSensor > %n" 425 | msgstr "" 426 | 427 | msgid "when @greenFlag clicked" 428 | msgstr "when @greenFlag meowed" 429 | 430 | # "backdrop" in Scratch 2.0 is similar to "background" in Scratch 1.4 431 | msgid "when backdrop switches to %m.backdrop" 432 | msgstr "when meow meows to %m.backdrop" 433 | 434 | msgid "when distance < %n" 435 | msgstr "when meow < %n" 436 | 437 | msgid "when I receive %m.broadcast" 438 | msgstr "when I meow %m.broadcast" 439 | 440 | msgid "when I start as a clone" 441 | msgstr "when I meow as a meow" 442 | 443 | msgid "when this sprite clicked" 444 | msgstr "when this sprite meowed" 445 | 446 | msgid "when tilt = %n" 447 | msgstr "when meow = %n" 448 | 449 | msgid "x position" 450 | msgstr "x meow" 451 | 452 | msgid "y position" 453 | msgstr "y moew" 454 | -------------------------------------------------------------------------------- /locale/lang_list.txt: -------------------------------------------------------------------------------- 1 | an,Aragonés 2 | ast,Asturianu 3 | id,Bahasa Indonesia 4 | ms,Bahasa Melayu 5 | ca,Català 6 | cs,Česky 7 | cy,Cymraeg 8 | da,Dansk 9 | fa-af,Dari 10 | de,Deutsch 11 | et,Eesti 12 | eo,Esperanto 13 | es,Español 14 | eu,Euskara 15 | fr,Français 16 | fr-ca,Français (Canada) 17 | ga,Gaeilge 18 | gd,Gàidhlig 19 | gl,Galego 20 | hr,Hrvatski 21 | is,Íslenska 22 | it,Italiano 23 | rw,Kinyarwanda 24 | ku,Kurdî 25 | la,Latina 26 | lv,Latviešu 27 | lt,Lietuvių 28 | hu,Magyar 29 | mt,Malti 30 | cat,Meow 31 | nl,Nederlands 32 | nb,Norsk Bokmål 33 | pl,Polski 34 | pt,Português 35 | pt-br,Português Brasileiro 36 | ro,Română 37 | sc,Sardu 38 | sk,Slovenčina 39 | sl,Slovenščina 40 | fi,suomi 41 | sv,Svenska 42 | nai,Tepehuan 43 | vi,Tiếng Việt 44 | tr,Türkçe 45 | ab,Аҧсшәа 46 | ar,العربية 47 | bg,Български 48 | el,Ελληνικά 49 | fa,فارسی 50 | he,עִבְרִית 51 | hi,हिन्दी 52 | hy,Հայերեն 53 | ja,日本語 54 | ja-hr,にほんご 55 | km,សំលៀកបំពាក 56 | kn,ಭಾಷೆ-ಹೆಸರು 57 | ko,한국어 58 | mk,Македонски 59 | ml,മലയാളം 60 | mn,Монгол хэл 61 | mr,मराठी 62 | my,မြန်မာဘာသာ 63 | ru,Русский 64 | sr,Српски 65 | th,ไทย 66 | uk,Українська 67 | zh-cn,简体中文 68 | zh-tw,正體中文 69 | -------------------------------------------------------------------------------- /sass/_editor.scss: -------------------------------------------------------------------------------- 1 | #scratch { 2 | position: absolute; 3 | width: 100%; 4 | height: 100%; 5 | top: -9999px; 6 | } 7 | 8 | .scratch_unsupported p { 9 | color: #aaa; 10 | font-size: 22px; 11 | margin-top: 14px; 12 | line-height: 28px; 13 | } 14 | 15 | -------------------------------------------------------------------------------- /sass/_gallery.scss: -------------------------------------------------------------------------------- 1 | article .intro { 2 | padding-top: $vertical-base * 5; 3 | } 4 | 5 | .gallery { 6 | background: $gallery-background-color; 7 | 8 | > div { 9 | padding: $vertical-base * 10 0; 10 | } 11 | 12 | ul { 13 | @include outer-container; 14 | @include reset-display; 15 | padding-left: 0; 16 | } 17 | 18 | li { 19 | /* Grid of 3 wide */ 20 | @include span-columns(4); 21 | @include omega(3n); 22 | margin-bottom: $gutter; 23 | 24 | overflow: hidden; 25 | border-radius: $base-border-radius; 26 | 27 | section, header { 28 | padding: $gutter; 29 | background-color: $base-background-color; 30 | font-size: $small-font-size; 31 | 32 | p { 33 | margin-bottom: 0; 34 | text-align: left; 35 | } 36 | } 37 | 38 | header { 39 | background-color: $bright-blue; 40 | color: $white; 41 | position: relative; 42 | 43 | @include icon(before, right-arrow) { 44 | position: absolute; 45 | font-size: 1.5em; 46 | line-height: 1.5; 47 | right: $gutter; 48 | } 49 | 50 | h2 { 51 | font-size: $h3-font-size; 52 | margin-bottom: 0; 53 | line-height: 1; 54 | } 55 | } 56 | 57 | img { 58 | display: block; 59 | height: 150px; 60 | } 61 | 62 | .description { 63 | overflow: hidden; 64 | 65 | a { 66 | width: 50%; 67 | float: left; 68 | display: block; 69 | } 70 | 71 | } 72 | 73 | .tags { 74 | border-top: $base-border; 75 | } 76 | } 77 | 78 | 79 | } 80 | 81 | aside + .gallery { 82 | margin-top: $vertical-base * -4; 83 | } 84 | 85 | .tag { 86 | 87 | &:before { 88 | padding-right: $vertical-base; 89 | } 90 | 91 | &.web { 92 | @include icon(before, wifi) { 93 | font-size: 1.25em; 94 | display: inline-block; 95 | vertical-align: baseline; 96 | } 97 | } 98 | 99 | &.hardware { 100 | @include icon(before, gear) { 101 | font-size: 1.5em; 102 | display: inline-block; 103 | vertical-align: middle; 104 | } 105 | } 106 | } -------------------------------------------------------------------------------- /sass/_home.scss: -------------------------------------------------------------------------------- 1 | /* Homepage */ 2 | 3 | body.page-home > main > header { 4 | background-color: transparent; 5 | 6 | > div { 7 | border-bottom: $base-border; 8 | } 9 | 10 | a { 11 | color: $white; 12 | } 13 | } 14 | 15 | #home { 16 | padding-top: 0; 17 | 18 | > header { 19 | background-image: linear-gradient(to bottom, rgba(117, 161, 202, 0.5) 67%, rgba($dark-blue, 1) 33%), url(../images/editor.png); 20 | background-size: cover, cover; 21 | padding-top: $vertical-base * 10; 22 | 23 | h1 { 24 | font-weight: normal; 25 | } 26 | 27 | > section { 28 | @include outer-container; 29 | padding-top: $vertical-base * 8; 30 | 31 | div { 32 | @include span-columns(10); 33 | @include shift(1); 34 | } 35 | 36 | .open-extension, .open-url { 37 | @include span-columns(3); 38 | text-align: center; 39 | 40 | a { 41 | color: $white 42 | } 43 | } 44 | 45 | .open-extension { 46 | @include shift(3); 47 | 48 | a { 49 | @include icon(before, upload){ 50 | padding-right: $vertical-base; 51 | }; 52 | } 53 | } 54 | 55 | .open-url { 56 | @include shift(0); 57 | 58 | a { 59 | @include icon(before, link){ 60 | padding-right: $vertical-base; 61 | }; 62 | } 63 | } 64 | } 65 | 66 | > ul { 67 | @include outer-container; 68 | 69 | padding-top: $vertical-base * 8; 70 | 71 | li { 72 | @include span-columns(3); 73 | @include omega(4n); 74 | } 75 | } 76 | 77 | .bottom-row { 78 | @include outer-container; 79 | 80 | 81 | > div { 82 | @include row; 83 | margin-top: 3 * $vertical-base; 84 | margin-bottom: 4 * $vertical-base; 85 | 86 | > aside{ 87 | @include span-columns(9); 88 | vertical-align: middle; 89 | line-height: 2.5em; 90 | 91 | @include icon(before, gears) { 92 | font-size: 1.5 * $base-font-size; 93 | padding-right: $vertical-base; 94 | } 95 | 96 | a { 97 | color: $bright-blue-dark-bg; 98 | 99 | &:hover { 100 | color: $white; 101 | } 102 | } 103 | } 104 | 105 | > a { 106 | @include span-columns(3); 107 | 108 | button { 109 | @include fill-parent; 110 | } 111 | } 112 | } 113 | } 114 | } 115 | 116 | header + aside { 117 | margin: 0; 118 | } 119 | 120 | > section { 121 | 122 | padding: 6 * $vertical-base 0; 123 | 124 | > div { 125 | @include outer-container; 126 | 127 | > div { 128 | @include row(); 129 | margin-bottom: 0; 130 | } 131 | } 132 | 133 | &.scratch-vs-scratchx { 134 | 135 | background-color: $light-gray; 136 | 137 | > div > div { 138 | 139 | @include row(table); 140 | 141 | > div { 142 | @include span-columns(6); 143 | vertical-align: top; 144 | 145 | &:first-child { 146 | border-right: $base-border; 147 | } 148 | 149 | > div { 150 | @include reset-display; 151 | @include span-columns(5 of 6); 152 | 153 | } 154 | 155 | &:last-child > div { 156 | @include shift(1); 157 | } 158 | } 159 | } 160 | } 161 | 162 | &.who-uses-scratchx { 163 | > div > div > div { 164 | @include span-columns(10); 165 | @include shift(1); 166 | } 167 | 168 | text-align: center; 169 | 170 | h2 { 171 | font-weight: normal; 172 | } 173 | } 174 | } 175 | 176 | nav { 177 | @include outer-container; 178 | 179 | ul { 180 | @include row(table); 181 | padding: 6 * $vertical-base 0; 182 | vertical-align: top; 183 | border-top: $base-border; 184 | 185 | li { 186 | @include span-columns(4); 187 | text-align: center; 188 | 189 | a { 190 | display: block; 191 | position: relative; 192 | padding-top: 76px * 1.25; 193 | @include icon(before) { 194 | color: $white; 195 | background-color: $bright-blue; 196 | font-size: 3.5em; 197 | border-radius: 38px; 198 | width: 76px; 199 | height: 76px; 200 | line-height: 76px; 201 | text-align: center; 202 | position: absolute; 203 | top: 0; 204 | right: 50%; 205 | margin-right: -38px; 206 | box-shadow: 0 7px 0 0 $light-gray; 207 | } 208 | } 209 | 210 | &.documentation a:before { 211 | content: $icon-doc; 212 | } 213 | 214 | &.extensions a:before { 215 | content: $icon-blocks; 216 | } 217 | 218 | &.faq a:before { 219 | content: $icon-faq; 220 | } 221 | } 222 | } 223 | } 224 | } 225 | 226 | .logo-scratch { 227 | @include hide-text; 228 | background: url(../images/scratch-heading.png) no-repeat; 229 | height: 49px; 230 | } 231 | 232 | .logo-scratchx { 233 | @include hide-text; 234 | background: url(../images/scratchx-heading.png) no-repeat; 235 | height: 49px; 236 | } 237 | 238 | .featured-extension { 239 | border-radius: $base-border-radius; 240 | overflow: hidden; 241 | 242 | > a { 243 | position: relative; 244 | display: block; 245 | font-weight: normal; 246 | } 247 | 248 | img { 249 | display: block; 250 | height: 107px; 251 | } 252 | 253 | .tryit { 254 | display: inline-block; 255 | position: absolute; 256 | background-color: $bright-blue; 257 | color: $white; 258 | padding: 0 1em; 259 | border-radius: 1em; 260 | top: $vertical-base; 261 | right: $vertical-base; 262 | } 263 | 264 | section { 265 | background-color: $white; 266 | color: $base-font-color; 267 | padding: 2 * $vertical-base; 268 | 269 | line-height: 1; 270 | 271 | h2 { 272 | color: $bright-blue; 273 | margin-bottom: 0; 274 | font-size: 1.1 * $base-font-size; 275 | font-weight: 600; 276 | } 277 | 278 | p { 279 | text-align: left; 280 | font-size: $small-font-size; 281 | margin-bottom: 0; 282 | } 283 | } 284 | } 285 | -------------------------------------------------------------------------------- /sass/base/_base.scss: -------------------------------------------------------------------------------- 1 | // Bitters 1.0.0 2 | // http://bitters.bourbon.io 3 | // Copyright 2013-2015 thoughtbot, inc. 4 | // MIT License 5 | 6 | @import "normalize"; 7 | @import "mixins"; 8 | @import "icons"; 9 | @import "variables"; 10 | @import "buttons"; 11 | @import "forms"; 12 | @import "lists"; 13 | @import "tables"; 14 | @import "typography"; 15 | @import "modal"; 16 | -------------------------------------------------------------------------------- /sass/base/_buttons.scss: -------------------------------------------------------------------------------- 1 | #{$all-button-inputs}, 2 | button { 3 | @include appearance(none); 4 | -webkit-font-smoothing: antialiased; 5 | background-color: $action-color; 6 | border-radius: $base-border-radius; 7 | border: none; 8 | color: #fff; 9 | cursor: pointer; 10 | display: inline-block; 11 | font-family: $base-font-family; 12 | font-size: $base-font-size; 13 | font-weight: 600; 14 | line-height: 1; 15 | padding: 0.75em 1em; 16 | text-decoration: none; 17 | user-select: none; 18 | vertical-align: middle; 19 | white-space: nowrap; 20 | 21 | &.success { 22 | &:hover, 23 | &:focus { 24 | background-color: darken($green, 15%); 25 | color: $white; 26 | } 27 | } 28 | 29 | &:hover, 30 | &:focus { 31 | background-color: darken($action-color, 15%); 32 | color: #fff; 33 | } 34 | 35 | &:disabled { 36 | cursor: not-allowed; 37 | opacity: 0.5; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /sass/base/_forms.scss: -------------------------------------------------------------------------------- 1 | fieldset { 2 | background-color: lighten($base-border-color, 10%); 3 | border: $base-border; 4 | margin: 0 0 $small-spacing; 5 | padding: $base-spacing; 6 | } 7 | 8 | input, 9 | label, 10 | select { 11 | display: block; 12 | font-family: $base-font-family; 13 | font-size: $base-font-size; 14 | } 15 | 16 | label { 17 | font-weight: 600; 18 | margin-bottom: $small-spacing / 2; 19 | 20 | &.required::after { 21 | content: "*"; 22 | } 23 | 24 | abbr { 25 | display: none; 26 | } 27 | } 28 | 29 | #{$all-text-inputs}, 30 | select[multiple=multiple], 31 | textarea { 32 | background-color: $base-background-color; 33 | border: $base-border; 34 | border-radius: $base-border-radius; 35 | box-shadow: $form-box-shadow; 36 | box-sizing: border-box; 37 | font-family: $base-font-family; 38 | font-size: $base-font-size; 39 | margin-bottom: $base-spacing / 2; 40 | padding: $base-spacing / 3; 41 | transition: border-color; 42 | width: 100%; 43 | 44 | &:hover { 45 | border-color: darken($base-border-color, 10%); 46 | } 47 | 48 | &:focus { 49 | border-color: $action-color; 50 | box-shadow: $form-box-shadow-focus; 51 | outline: none; 52 | } 53 | } 54 | 55 | textarea { 56 | resize: vertical; 57 | } 58 | 59 | input[type="search"] { 60 | @include appearance(none); 61 | } 62 | 63 | input[type="checkbox"], 64 | input[type="radio"] { 65 | display: inline; 66 | margin-right: $small-spacing / 2; 67 | } 68 | 69 | input[type="file"] { 70 | padding-bottom: $small-spacing; 71 | width: 100%; 72 | } 73 | 74 | select { 75 | margin-bottom: $base-spacing; 76 | max-width: 100%; 77 | width: auto; 78 | } 79 | 80 | .input-plus-button { 81 | overflow: hidden; 82 | 83 | input, input:focus, input:hover, button { 84 | @include reset-box; 85 | display: block; 86 | float: left; 87 | border-radius: $base-border-radius; 88 | padding: $vertical-base; 89 | @include placeholder{ 90 | @include reset-box; 91 | } 92 | } 93 | 94 | input, input:focus, input:hover { 95 | width: 75%; 96 | text-align: center; 97 | @include border-right-radius(0); 98 | border: 1px solid $light-gray; 99 | border-right: 0px; 100 | } 101 | 102 | button { 103 | width: 25%; 104 | @include border-left-radius(0); 105 | border: 1px solid $blue; 106 | } 107 | 108 | } -------------------------------------------------------------------------------- /sass/base/_grid-settings.scss: -------------------------------------------------------------------------------- 1 | @import "../neat/neat-helpers"; 2 | 3 | // Neat Overrides 4 | $column: 69px; 5 | $gutter: 12px; 6 | $grid-columns: 12; 7 | $max-width: em(960); 8 | 9 | // Neat Breakpoints 10 | $medium-screen: em(640); 11 | $large-screen: em(960); 12 | 13 | $medium-screen-up: new-breakpoint(min-width $medium-screen 4); 14 | $large-screen-up: new-breakpoint(min-width $large-screen 8); 15 | 16 | // Vertical rhythm 17 | 18 | $vertical-base: em(6); 19 | -------------------------------------------------------------------------------- /sass/base/_icons.scss: -------------------------------------------------------------------------------- 1 | $font-icon: "ScratchX"; 2 | @font-face { 3 | font-family: '#{$font-icon}'; 4 | src:url('../fonts/ScratchX.eot?-omdesu'); 5 | src:url('../fonts/ScratchX.eot?#iefix-omdesu') format('embedded-opentype'), 6 | url('../fonts/ScratchX.woff?-omdesu') format('woff'), 7 | url('../fonts/ScratchX.ttf?-omdesu') format('truetype'), 8 | url('../fonts/ScratchX.svg?-omdesu#ScratchX') format('svg'); 9 | font-weight: normal; 10 | font-style: normal; 11 | } 12 | 13 | 14 | $icon-documentation: "\e600"; 15 | $icon-download: "\e601"; 16 | $icon-github: "\e602"; 17 | $icon-link: "\e603"; 18 | $icon-right-arrow: "\e604"; 19 | $icon-twitter: "\e605"; 20 | $icon-upload: "\e606"; 21 | $icon-warning: "\e607"; 22 | $icon-new-link: "\e608"; 23 | $icon-wifi: "\e609"; 24 | $icon-faq: "\e60a"; 25 | $icon-doc: "\e60b"; 26 | $icon-blocks: "\e60c"; 27 | $icon-gears: "\e60d"; 28 | $icon-gear: "\e60e"; 29 | 30 | $icons: ( 31 | "documentation": "#{$icon-documentation}", 32 | "download": "#{$icon-download}", 33 | "github": "#{$icon-github}", 34 | "link": "#{$icon-link}", 35 | "right-arrow": "#{$icon-right-arrow}", 36 | "twitter": "#{$icon-twitter}", 37 | "upload": "#{$icon-upload}", 38 | "warning": "#{$icon-warning}", 39 | "new-link": "#{$icon-new-link}", 40 | "wifi": "#{$icon-wifi}", 41 | "faq": "#{$icon-faq}", 42 | "doc": "#{$icon-doc}", 43 | "blocks": "#{$icon-blocks}", 44 | "gears": "#{$icon-gears}", 45 | "gear": "#{$icon-gear}", 46 | ); 47 | 48 | @mixin icon($position: before, $icon: false, $style: plain, $centered: false, $font-size: 1em) { 49 | @if $position == both { 50 | $position: 'before, &:after'; 51 | } 52 | // Either a :before or :after pseudo-element, or both, defaulting to :before 53 | &:#{$position} { 54 | @if $icon { 55 | // A particular icon has been specified 56 | content: "#{map-get($icons, $icon)}"; 57 | } 58 | 59 | font-family: $font-icon; 60 | speak: none; 61 | font-style: normal; 62 | font-weight: normal; 63 | font-variant: normal; 64 | font-size: $font-size; 65 | text-transform: none; 66 | line-height: 1; 67 | 68 | /* Better Font Rendering =========== */ 69 | -webkit-font-smoothing: antialiased; 70 | -moz-osx-font-smoothing: grayscale; 71 | 72 | @if $style == circular { 73 | border-radius: $font-size/4; 74 | width: $font-size/2; 75 | height: $font-size/2; 76 | text-align: center; 77 | } 78 | 79 | 80 | @if $centered { 81 | line-height: 1.5; 82 | position: absolute; 83 | left: 50%; 84 | margin-left: -$font-size/4; 85 | } 86 | 87 | // Include any extra rules supplied for the pseudo-element 88 | @content; 89 | } 90 | } -------------------------------------------------------------------------------- /sass/base/_lists.scss: -------------------------------------------------------------------------------- 1 | ul, 2 | ol { 3 | list-style-type: none; 4 | margin: 0; 5 | padding: 0; 6 | 7 | &%default-ul { 8 | list-style-type: disc; 9 | margin-bottom: $small-spacing; 10 | padding-left: $base-spacing; 11 | } 12 | 13 | &%default-ol { 14 | list-style-type: decimal; 15 | margin-bottom: $small-spacing; 16 | padding-left: $base-spacing; 17 | } 18 | } 19 | 20 | dl { 21 | margin-bottom: $small-spacing; 22 | 23 | dt { 24 | font-weight: bold; 25 | margin-top: $small-spacing; 26 | } 27 | 28 | dd { 29 | margin: 0; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /sass/base/_mixins.scss: -------------------------------------------------------------------------------- 1 | 2 | @mixin box-shadow($shadows...) { 3 | -moz-box-shadow: $shadows; 4 | -webkit-box-shadow: $shadows; 5 | box-shadow: $shadows; 6 | } 7 | 8 | @mixin reset-box { 9 | border: 0; 10 | margin: 0; 11 | padding: 0; 12 | @include box-shadow(none); 13 | } 14 | -------------------------------------------------------------------------------- /sass/base/_modal.scss: -------------------------------------------------------------------------------- 1 | .modal { 2 | $base-border-color: gainsboro !default; 3 | $base-border-radius: 3px !default; 4 | $base-background-color: white !default; 5 | $base-font-size: 1em !default; 6 | $base-line-height: 1.5em !default; 7 | $action-color: #477DCA !default; 8 | $dark-gray: #333 !default; 9 | $light-gray: #DDD !default; 10 | $medium-screen: em(640) !default; 11 | $large-screen: em(860) !default; 12 | $base-font-color: $dark-gray !default; 13 | $modal-padding: 3em; 14 | $modal-background: transparent; 15 | $modal-close-color: $light-gray; 16 | $modal-image-height: 135px; 17 | $modal-image-width: $modal-image-height; 18 | $modal-trigger-image-width: 300px; 19 | 20 | label { 21 | cursor: pointer; 22 | margin-bottom: 0; 23 | } 24 | 25 | label img { 26 | border-radius: $modal-trigger-image-width / 2; 27 | display: block; 28 | max-width: $modal-trigger-image-width; 29 | } 30 | 31 | .modal-state { 32 | display: none; 33 | } 34 | 35 | .modal-trigger { 36 | @include button(flat, $action-color); 37 | padding: 0.8em 1em; 38 | } 39 | 40 | .modal-fade-screen { // overlay 41 | @include transition(opacity 0.25s ease); 42 | @include position(fixed, 0px 0px 0px 0px); 43 | background: rgba(0,0,0, 0.85); 44 | opacity: 0; 45 | padding-top: 0.6em; 46 | text-align: left; 47 | visibility: hidden; 48 | z-index: 99999; 49 | 50 | @include media($large-screen) { 51 | padding-top: 10em; 52 | } 53 | 54 | .modal-bg { 55 | @include position(absolute, 0px 0px 0px 0px); 56 | cursor: pointer; 57 | } 58 | } 59 | 60 | .modal-close { 61 | @include position(absolute, ($modal-padding /4) ($modal-padding /4) null null); 62 | @include size(1.5em); 63 | background: $modal-background; 64 | cursor: pointer; 65 | 66 | &:after, 67 | &:before { 68 | @include position(absolute, 3px 3px 0 50%); 69 | @include transform(rotate(45deg)); 70 | @include size(0.15em 1.5em); 71 | background: $modal-close-color; 72 | content: ''; 73 | display: block; 74 | margin: -3px 0 0 -1px; 75 | } 76 | 77 | &:hover:after, 78 | &:hover:before { 79 | background: darken($modal-close-color, 10%); 80 | } 81 | 82 | &:before { 83 | @include transform(rotate(-45deg)); 84 | } 85 | } 86 | 87 | .modal-inner { 88 | @include transition(opacity 0.25s ease); 89 | border-radius: $base-border-radius; 90 | padding: $modal-padding / 2; 91 | position: relative; 92 | display: table; 93 | margin: auto; 94 | 95 | a.cta { 96 | color: white; 97 | display: inline-block; 98 | margin-right: 0.5em; 99 | margin-top: 1em; 100 | 101 | &:last-child { 102 | padding: 0 2em; 103 | } 104 | } 105 | } 106 | 107 | .modal-state:checked + .modal-fade-screen, 108 | .modal-fade-screen.visible { 109 | opacity: 1; 110 | visibility: visible; 111 | } 112 | 113 | .modal-state:checked + .modal-fade-screen .modal-inner, 114 | .modal-fade-screen.visible .modal-inner { 115 | top: 0.5em; 116 | } 117 | } 118 | 119 | .modal-open { 120 | overflow: hidden; 121 | } 122 | 123 | // Based on code by Kasper Mikiewicz 124 | -------------------------------------------------------------------------------- /sass/base/_tables.scss: -------------------------------------------------------------------------------- 1 | table { 2 | @include font-feature-settings("kern", "liga", "tnum"); 3 | border-collapse: collapse; 4 | margin: $small-spacing 0; 5 | table-layout: fixed; 6 | width: 100%; 7 | } 8 | 9 | th { 10 | border-bottom: 1px solid darken($base-border-color, 15%); 11 | font-weight: 600; 12 | padding: $small-spacing 0; 13 | text-align: left; 14 | } 15 | 16 | td { 17 | border-bottom: $base-border; 18 | padding: $small-spacing 0; 19 | } 20 | 21 | tr, 22 | td, 23 | th { 24 | vertical-align: middle; 25 | } 26 | -------------------------------------------------------------------------------- /sass/base/_typography.scss: -------------------------------------------------------------------------------- 1 | @import url(https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,600,700); 2 | 3 | body { 4 | @include font-feature-settings("kern", "liga", "pnum"); 5 | -webkit-font-smoothing: antialiased; 6 | color: $base-font-color; 7 | font-family: $base-font-family; 8 | font-size: $base-font-size; 9 | line-height: $base-line-height; 10 | } 11 | 12 | h1, 13 | h2, 14 | h3, 15 | h4, 16 | h5, 17 | h6 { 18 | font-family: $heading-font-family; 19 | font-size: $base-font-size; 20 | line-height: $heading-line-height; 21 | margin: 0 0 $small-spacing; 22 | font-weight: 700; 23 | } 24 | 25 | article h1 { 26 | font-size: $h1-font-size; 27 | } 28 | 29 | article h2, dialog h2 { 30 | font-size: $h2-font-size; 31 | } 32 | 33 | p { 34 | margin: 0 0 $small-spacing; 35 | } 36 | 37 | a { 38 | color: $action-color; 39 | text-decoration: none; 40 | transition: color 0.1s linear; 41 | 42 | &:active, 43 | &:focus, 44 | &:hover { 45 | color: darken($action-color, 15%); 46 | } 47 | 48 | &:active, 49 | &:focus { 50 | outline: none; 51 | } 52 | font-weight: 600; 53 | } 54 | 55 | hr { 56 | border-bottom: $base-border; 57 | border-left: none; 58 | border-right: none; 59 | border-top: none; 60 | margin: $base-spacing 0; 61 | } 62 | 63 | img, 64 | picture { 65 | margin: 0; 66 | max-width: 100%; 67 | } 68 | -------------------------------------------------------------------------------- /sass/base/_variables.scss: -------------------------------------------------------------------------------- 1 | // Typography 2 | $base-font-family: "Source Sans Pro", "Lucida Grande", "Tahoma", "Verdana", "Arial", sans-serif; 3 | $heading-font-family: $base-font-family; 4 | 5 | // Font Sizes 6 | $base-font-size: 1em; 7 | 8 | $h1-font-size: 1.5 * $base-font-size; 9 | $h2-font-size: $h1-font-size; 10 | $h3-font-size: 1.1 * $base-font-size; 11 | $small-font-size: .9 * $base-font-size; 12 | 13 | // Line height 14 | $base-line-height: 1.5; 15 | $heading-line-height: 1.2; 16 | 17 | // Other Sizes 18 | $base-border-radius: 5px; 19 | $base-spacing: $base-line-height * 1em; 20 | $small-spacing: $base-spacing / 2; 21 | $base-z-index: 0; 22 | 23 | // Colors 24 | $white: #fff; 25 | $blue: #21b4f0; 26 | $bright-blue: #24a3ec; 27 | $bright-blue-dark-bg: #4ABFF9; 28 | $light-blue: #d7e5f3; 29 | $dark-blue: #3f5975; 30 | $dark-gray: #58595b; 31 | $medium-gray: #c5c5c5; 32 | $light-gray: #dfe3e7; 33 | $green: #18ba37; 34 | $yellow: #fff447; 35 | 36 | 37 | // Font Colors 38 | $base-background-color: #fff; 39 | $alt-background-color: $dark-blue; 40 | $gallery-background-color: $light-blue; 41 | $base-font-color: $dark-gray; 42 | $alt-font-color: $white; 43 | $action-color: $blue; 44 | $warning-color: $yellow; 45 | $alt-action-color: $green; 46 | 47 | // Border 48 | $base-border-color: $medium-gray; 49 | $base-border: 1px solid $base-border-color; 50 | 51 | // Forms 52 | $form-box-shadow: inset 0 1px 3px rgba(#000, 0.06); 53 | $form-box-shadow-focus: $form-box-shadow, 0 0 5px adjust-color($action-color, $lightness: -5%, $alpha: -0.3); 54 | -------------------------------------------------------------------------------- /sass/bourbon/_bourbon.scss: -------------------------------------------------------------------------------- 1 | // Bourbon 4.2.2 2 | // http://bourbon.io 3 | // Copyright 2011-2015 thoughtbot, inc. 4 | // MIT License 5 | 6 | @import "settings/prefixer"; 7 | @import "settings/px-to-em"; 8 | @import "settings/asset-pipeline"; 9 | 10 | @import "functions/assign-inputs"; 11 | @import "functions/contains"; 12 | @import "functions/contains-falsy"; 13 | @import "functions/is-length"; 14 | @import "functions/is-light"; 15 | @import "functions/is-number"; 16 | @import "functions/is-size"; 17 | @import "functions/px-to-em"; 18 | @import "functions/px-to-rem"; 19 | @import "functions/shade"; 20 | @import "functions/strip-units"; 21 | @import "functions/tint"; 22 | @import "functions/transition-property-name"; 23 | @import "functions/unpack"; 24 | @import "functions/modular-scale"; 25 | 26 | @import "helpers/convert-units"; 27 | @import "helpers/directional-values"; 28 | @import "helpers/font-source-declaration"; 29 | @import "helpers/gradient-positions-parser"; 30 | @import "helpers/linear-angle-parser"; 31 | @import "helpers/linear-gradient-parser"; 32 | @import "helpers/linear-positions-parser"; 33 | @import "helpers/linear-side-corner-parser"; 34 | @import "helpers/radial-arg-parser"; 35 | @import "helpers/radial-positions-parser"; 36 | @import "helpers/radial-gradient-parser"; 37 | @import "helpers/render-gradients"; 38 | @import "helpers/shape-size-stripper"; 39 | @import "helpers/str-to-num"; 40 | 41 | @import "css3/animation"; 42 | @import "css3/appearance"; 43 | @import "css3/backface-visibility"; 44 | @import "css3/background"; 45 | @import "css3/background-image"; 46 | @import "css3/border-image"; 47 | @import "css3/calc"; 48 | @import "css3/columns"; 49 | @import "css3/filter"; 50 | @import "css3/flex-box"; 51 | @import "css3/font-face"; 52 | @import "css3/font-feature-settings"; 53 | @import "css3/hidpi-media-query"; 54 | @import "css3/hyphens"; 55 | @import "css3/image-rendering"; 56 | @import "css3/keyframes"; 57 | @import "css3/linear-gradient"; 58 | @import "css3/perspective"; 59 | @import "css3/placeholder"; 60 | @import "css3/radial-gradient"; 61 | @import "css3/selection"; 62 | @import "css3/text-decoration"; 63 | @import "css3/transform"; 64 | @import "css3/transition"; 65 | @import "css3/user-select"; 66 | 67 | @import "addons/border-color"; 68 | @import "addons/border-radius"; 69 | @import "addons/border-style"; 70 | @import "addons/border-width"; 71 | @import "addons/buttons"; 72 | @import "addons/clearfix"; 73 | @import "addons/ellipsis"; 74 | @import "addons/font-stacks"; 75 | @import "addons/hide-text"; 76 | @import "addons/margin"; 77 | @import "addons/padding"; 78 | @import "addons/position"; 79 | @import "addons/prefixer"; 80 | @import "addons/retina-image"; 81 | @import "addons/size"; 82 | @import "addons/text-inputs"; 83 | @import "addons/timing-functions"; 84 | @import "addons/triangle"; 85 | @import "addons/word-wrap"; 86 | 87 | @import "bourbon-deprecated-upcoming"; 88 | -------------------------------------------------------------------------------- /sass/bourbon/addons/_border-color.scss: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | 3 | /// Provides a quick method for targeting `border-color` on specific sides of a box. Use a `null` value to “skip” a side. 4 | /// 5 | /// @param {Arglist} $vals 6 | /// List of arguments 7 | /// 8 | /// @example scss - Usage 9 | /// .element { 10 | /// @include border-color(#a60b55 #76cd9c null #e8ae1a); 11 | /// } 12 | /// 13 | /// @example css - CSS Output 14 | /// .element { 15 | /// border-left-color: #e8ae1a; 16 | /// border-right-color: #76cd9c; 17 | /// border-top-color: #a60b55; 18 | /// } 19 | /// 20 | /// @require {mixin} directional-property 21 | /// 22 | /// @output `border-color` 23 | 24 | @mixin border-color($vals...) { 25 | @include directional-property(border, color, $vals...); 26 | } 27 | -------------------------------------------------------------------------------- /sass/bourbon/addons/_border-radius.scss: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | 3 | /// Provides a quick method for targeting `border-radius` on both corners on the side of a box. 4 | /// 5 | /// @param {Number} $radii 6 | /// List of arguments 7 | /// 8 | /// @example scss - Usage 9 | /// .element-one { 10 | /// @include border-top-radius(5px); 11 | /// } 12 | /// 13 | /// .element-two { 14 | /// @include border-left-radius(3px); 15 | /// } 16 | /// 17 | /// @example css - CSS Output 18 | /// .element-one { 19 | /// border-top-left-radius: 5px; 20 | /// border-top-right-radius: 5px; 21 | /// } 22 | /// 23 | /// .element-two { 24 | /// border-bottom-left-radius: 3px; 25 | /// border-top-left-radius: 3px; 26 | /// } 27 | /// 28 | /// @output `border-radius` 29 | 30 | @mixin border-top-radius($radii) { 31 | border-top-left-radius: $radii; 32 | border-top-right-radius: $radii; 33 | } 34 | 35 | @mixin border-right-radius($radii) { 36 | border-bottom-right-radius: $radii; 37 | border-top-right-radius: $radii; 38 | } 39 | 40 | @mixin border-bottom-radius($radii) { 41 | border-bottom-left-radius: $radii; 42 | border-bottom-right-radius: $radii; 43 | } 44 | 45 | @mixin border-left-radius($radii) { 46 | border-bottom-left-radius: $radii; 47 | border-top-left-radius: $radii; 48 | } 49 | -------------------------------------------------------------------------------- /sass/bourbon/addons/_border-style.scss: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | 3 | /// Provides a quick method for targeting `border-style` on specific sides of a box. Use a `null` value to “skip” a side. 4 | /// 5 | /// @param {Arglist} $vals 6 | /// List of arguments 7 | /// 8 | /// @example scss - Usage 9 | /// .element { 10 | /// @include border-style(dashed null solid); 11 | /// } 12 | /// 13 | /// @example css - CSS Output 14 | /// .element { 15 | /// border-bottom-style: solid; 16 | /// border-top-style: dashed; 17 | /// } 18 | /// 19 | /// @require {mixin} directional-property 20 | /// 21 | /// @output `border-style` 22 | 23 | @mixin border-style($vals...) { 24 | @include directional-property(border, style, $vals...); 25 | } 26 | -------------------------------------------------------------------------------- /sass/bourbon/addons/_border-width.scss: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | 3 | /// Provides a quick method for targeting `border-width` on specific sides of a box. Use a `null` value to “skip” a side. 4 | /// 5 | /// @param {Arglist} $vals 6 | /// List of arguments 7 | /// 8 | /// @example scss - Usage 9 | /// .element { 10 | /// @include border-width(1em null 20px); 11 | /// } 12 | /// 13 | /// @example css - CSS Output 14 | /// .element { 15 | /// border-bottom-width: 20px; 16 | /// border-top-width: 1em; 17 | /// } 18 | /// 19 | /// @require {mixin} directional-property 20 | /// 21 | /// @output `border-width` 22 | 23 | @mixin border-width($vals...) { 24 | @include directional-property(border, width, $vals...); 25 | } 26 | -------------------------------------------------------------------------------- /sass/bourbon/addons/_buttons.scss: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | 3 | /// Generates variables for all buttons. Please note that you must use interpolation on the variable: `#{$all-buttons}`. 4 | /// 5 | /// @example scss - Usage 6 | /// #{$all-buttons} { 7 | /// background-color: #f00; 8 | /// } 9 | /// 10 | /// #{$all-buttons-focus}, 11 | /// #{$all-buttons-hover} { 12 | /// background-color: #0f0; 13 | /// } 14 | /// 15 | /// #{$all-buttons-active} { 16 | /// background-color: #00f; 17 | /// } 18 | /// 19 | /// @example css - CSS Output 20 | /// button, 21 | /// input[type="button"], 22 | /// input[type="reset"], 23 | /// input[type="submit"] { 24 | /// background-color: #f00; 25 | /// } 26 | /// 27 | /// button:focus, 28 | /// input[type="button"]:focus, 29 | /// input[type="reset"]:focus, 30 | /// input[type="submit"]:focus, 31 | /// button:hover, 32 | /// input[type="button"]:hover, 33 | /// input[type="reset"]:hover, 34 | /// input[type="submit"]:hover { 35 | /// background-color: #0f0; 36 | /// } 37 | /// 38 | /// button:active, 39 | /// input[type="button"]:active, 40 | /// input[type="reset"]:active, 41 | /// input[type="submit"]:active { 42 | /// background-color: #00f; 43 | /// } 44 | /// 45 | /// @require assign-inputs 46 | /// 47 | /// @type List 48 | /// 49 | /// @todo Remove double assigned variables (Lines 59–62) in v5.0.0 50 | 51 | $buttons-list: 'button', 52 | 'input[type="button"]', 53 | 'input[type="reset"]', 54 | 'input[type="submit"]'; 55 | 56 | $all-buttons: assign-inputs($buttons-list); 57 | $all-buttons-active: assign-inputs($buttons-list, active); 58 | $all-buttons-focus: assign-inputs($buttons-list, focus); 59 | $all-buttons-hover: assign-inputs($buttons-list, hover); 60 | 61 | $all-button-inputs: $all-buttons; 62 | $all-button-inputs-active: $all-buttons-active; 63 | $all-button-inputs-focus: $all-buttons-focus; 64 | $all-button-inputs-hover: $all-buttons-hover; 65 | -------------------------------------------------------------------------------- /sass/bourbon/addons/_clearfix.scss: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | 3 | /// Provides an easy way to include a clearfix for containing floats. 4 | /// 5 | /// @link http://cssmojo.com/latest_new_clearfix_so_far/ 6 | /// 7 | /// @example scss - Usage 8 | /// .element { 9 | /// @include clearfix; 10 | /// } 11 | /// 12 | /// @example css - CSS Output 13 | /// .element::after { 14 | /// clear: both; 15 | /// content: ""; 16 | /// display: table; 17 | /// } 18 | 19 | @mixin clearfix { 20 | &::after { 21 | clear: both; 22 | content: ""; 23 | display: table; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /sass/bourbon/addons/_ellipsis.scss: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | 3 | /// Truncates text and adds an ellipsis to represent overflow. 4 | /// 5 | /// @param {Number} $width [100%] 6 | /// Max-width for the string to respect before being truncated 7 | /// 8 | /// @example scss - Usage 9 | /// .element { 10 | /// @include ellipsis; 11 | /// } 12 | /// 13 | /// @example css - CSS Output 14 | /// .element { 15 | /// display: inline-block; 16 | /// max-width: 100%; 17 | /// overflow: hidden; 18 | /// text-overflow: ellipsis; 19 | /// white-space: nowrap; 20 | /// word-wrap: normal; 21 | /// } 22 | 23 | @mixin ellipsis($width: 100%) { 24 | display: inline-block; 25 | max-width: $width; 26 | overflow: hidden; 27 | text-overflow: ellipsis; 28 | white-space: nowrap; 29 | word-wrap: normal; 30 | } 31 | -------------------------------------------------------------------------------- /sass/bourbon/addons/_font-stacks.scss: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | 3 | /// Georgia font stack. 4 | /// 5 | /// @type List 6 | 7 | $georgia: "Georgia", "Cambria", "Times New Roman", "Times", serif; 8 | 9 | /// Helvetica font stack. 10 | /// 11 | /// @type List 12 | 13 | $helvetica: "Helvetica Neue", "Helvetica", "Roboto", "Arial", sans-serif; 14 | 15 | /// Lucida Grande font stack. 16 | /// 17 | /// @type List 18 | 19 | $lucida-grande: "Lucida Grande", "Tahoma", "Verdana", "Arial", sans-serif; 20 | 21 | /// Monospace font stack. 22 | /// 23 | /// @type List 24 | 25 | $monospace: "Bitstream Vera Sans Mono", "Consolas", "Courier", monospace; 26 | 27 | /// Verdana font stack. 28 | /// 29 | /// @type List 30 | 31 | $verdana: "Verdana", "Geneva", sans-serif; 32 | -------------------------------------------------------------------------------- /sass/bourbon/addons/_hide-text.scss: -------------------------------------------------------------------------------- 1 | /// Hides the text in an element, commonly used to show an image. Some elements will need block-level styles applied. 2 | /// 3 | /// @link http://zeldman.com/2012/03/01/replacing-the-9999px-hack-new-image-replacement 4 | /// 5 | /// @example scss - Usage 6 | /// .element { 7 | /// @include hide-text; 8 | /// } 9 | /// 10 | /// @example css - CSS Output 11 | /// .element { 12 | /// overflow: hidden; 13 | /// text-indent: 101%; 14 | /// white-space: nowrap; 15 | /// } 16 | /// 17 | /// @todo Remove height argument in v5.0.0 18 | 19 | @mixin hide-text($height: null) { 20 | overflow: hidden; 21 | text-indent: 101%; 22 | white-space: nowrap; 23 | 24 | @if $height { 25 | @warn "The `hide-text` mixin has changed and no longer requires a height. The height argument will no longer be accepted in v5.0.0"; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /sass/bourbon/addons/_margin.scss: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | 3 | /// Provides a quick method for targeting `margin` on specific sides of a box. Use a `null` value to “skip” a side. 4 | /// 5 | /// @param {Arglist} $vals 6 | /// List of arguments 7 | /// 8 | /// @example scss - Usage 9 | /// .element { 10 | /// @include margin(null 10px 3em 20vh); 11 | /// } 12 | /// 13 | /// @example css - CSS Output 14 | /// .element { 15 | /// margin-bottom: 3em; 16 | /// margin-left: 20vh; 17 | /// margin-right: 10px; 18 | /// } 19 | /// 20 | /// @require {mixin} directional-property 21 | /// 22 | /// @output `margin` 23 | 24 | @mixin margin($vals...) { 25 | @include directional-property(margin, false, $vals...); 26 | } 27 | -------------------------------------------------------------------------------- /sass/bourbon/addons/_padding.scss: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | 3 | /// Provides a quick method for targeting `padding` on specific sides of a box. Use a `null` value to “skip” a side. 4 | /// 5 | /// @param {Arglist} $vals 6 | /// List of arguments 7 | /// 8 | /// @example scss - Usage 9 | /// .element { 10 | /// @include padding(12vh null 10px 5%); 11 | /// } 12 | /// 13 | /// @example css - CSS Output 14 | /// .element { 15 | /// padding-bottom: 10px; 16 | /// padding-left: 5%; 17 | /// padding-top: 12vh; 18 | /// } 19 | /// 20 | /// @require {mixin} directional-property 21 | /// 22 | /// @output `padding` 23 | 24 | @mixin padding($vals...) { 25 | @include directional-property(padding, false, $vals...); 26 | } 27 | -------------------------------------------------------------------------------- /sass/bourbon/addons/_position.scss: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | 3 | /// Provides a quick method for setting an element’s position. Use a `null` value to “skip” a side. 4 | /// 5 | /// @param {Position} $position [relative] 6 | /// A CSS position value 7 | /// 8 | /// @param {Arglist} $coordinates [null null null null] 9 | /// List of values that correspond to the 4-value syntax for the edges of a box 10 | /// 11 | /// @example scss - Usage 12 | /// .element { 13 | /// @include position(absolute, 0 null null 10em); 14 | /// } 15 | /// 16 | /// @example css - CSS Output 17 | /// .element { 18 | /// left: 10em; 19 | /// position: absolute; 20 | /// top: 0; 21 | /// } 22 | /// 23 | /// @require {function} is-length 24 | /// @require {function} unpack 25 | 26 | @mixin position($position: relative, $coordinates: null null null null) { 27 | @if type-of($position) == list { 28 | $coordinates: $position; 29 | $position: relative; 30 | } 31 | 32 | $coordinates: unpack($coordinates); 33 | 34 | $offsets: ( 35 | top: nth($coordinates, 1), 36 | right: nth($coordinates, 2), 37 | bottom: nth($coordinates, 3), 38 | left: nth($coordinates, 4) 39 | ); 40 | 41 | position: $position; 42 | 43 | @each $offset, $value in $offsets { 44 | @if is-length($value) { 45 | #{$offset}: $value; 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /sass/bourbon/addons/_prefixer.scss: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | 3 | /// A mixin for generating vendor prefixes on non-standardized properties. 4 | /// 5 | /// @param {String} $property 6 | /// Property to prefix 7 | /// 8 | /// @param {*} $value 9 | /// Value to use 10 | /// 11 | /// @param {List} $prefixes 12 | /// Prefixes to define 13 | /// 14 | /// @example scss - Usage 15 | /// .element { 16 | /// @include prefixer(border-radius, 10px, webkit ms spec); 17 | /// } 18 | /// 19 | /// @example css - CSS Output 20 | /// .element { 21 | /// -webkit-border-radius: 10px; 22 | /// -moz-border-radius: 10px; 23 | /// border-radius: 10px; 24 | /// } 25 | /// 26 | /// @require {variable} $prefix-for-webkit 27 | /// @require {variable} $prefix-for-mozilla 28 | /// @require {variable} $prefix-for-microsoft 29 | /// @require {variable} $prefix-for-opera 30 | /// @require {variable} $prefix-for-spec 31 | 32 | @mixin prefixer($property, $value, $prefixes) { 33 | @each $prefix in $prefixes { 34 | @if $prefix == webkit { 35 | @if $prefix-for-webkit { 36 | -webkit-#{$property}: $value; 37 | } 38 | } @else if $prefix == moz { 39 | @if $prefix-for-mozilla { 40 | -moz-#{$property}: $value; 41 | } 42 | } @else if $prefix == ms { 43 | @if $prefix-for-microsoft { 44 | -ms-#{$property}: $value; 45 | } 46 | } @else if $prefix == o { 47 | @if $prefix-for-opera { 48 | -o-#{$property}: $value; 49 | } 50 | } @else if $prefix == spec { 51 | @if $prefix-for-spec { 52 | #{$property}: $value; 53 | } 54 | } @else { 55 | @warn "Unrecognized prefix: #{$prefix}"; 56 | } 57 | } 58 | } 59 | 60 | @mixin disable-prefix-for-all() { 61 | $prefix-for-webkit: false !global; 62 | $prefix-for-mozilla: false !global; 63 | $prefix-for-microsoft: false !global; 64 | $prefix-for-opera: false !global; 65 | $prefix-for-spec: false !global; 66 | } 67 | -------------------------------------------------------------------------------- /sass/bourbon/addons/_retina-image.scss: -------------------------------------------------------------------------------- 1 | @mixin retina-image($filename, $background-size, $extension: png, $retina-filename: null, $retina-suffix: _2x, $asset-pipeline: $asset-pipeline) { 2 | @if $asset-pipeline { 3 | background-image: image-url("#{$filename}.#{$extension}"); 4 | } @else { 5 | background-image: url("#{$filename}.#{$extension}"); 6 | } 7 | 8 | @include hidpi { 9 | @if $asset-pipeline { 10 | @if $retina-filename { 11 | background-image: image-url("#{$retina-filename}.#{$extension}"); 12 | } @else { 13 | background-image: image-url("#{$filename}#{$retina-suffix}.#{$extension}"); 14 | } 15 | } @else { 16 | @if $retina-filename { 17 | background-image: url("#{$retina-filename}.#{$extension}"); 18 | } @else { 19 | background-image: url("#{$filename}#{$retina-suffix}.#{$extension}"); 20 | } 21 | } 22 | 23 | background-size: $background-size; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /sass/bourbon/addons/_size.scss: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | 3 | /// Sets the `width` and `height` of the element. 4 | /// 5 | /// @param {List} $size 6 | /// A list of at most 2 size values. 7 | /// 8 | /// If there is only a single value in `$size` it is used for both width and height. All units are supported. 9 | /// 10 | /// @example scss - Usage 11 | /// .first-element { 12 | /// @include size(2em); 13 | /// } 14 | /// 15 | /// .second-element { 16 | /// @include size(auto 10em); 17 | /// } 18 | /// 19 | /// @example css - CSS Output 20 | /// .first-element { 21 | /// width: 2em; 22 | /// height: 2em; 23 | /// } 24 | /// 25 | /// .second-element { 26 | /// width: auto; 27 | /// height: 10em; 28 | /// } 29 | /// 30 | /// @todo Refactor in 5.0.0 to use a comma-separated argument 31 | 32 | @mixin size($value) { 33 | $width: nth($value, 1); 34 | $height: $width; 35 | 36 | @if length($value) > 1 { 37 | $height: nth($value, 2); 38 | } 39 | 40 | @if is-size($height) { 41 | height: $height; 42 | } @else { 43 | @warn "`#{$height}` is not a valid length for the `$height` parameter in the `size` mixin."; 44 | } 45 | 46 | @if is-size($width) { 47 | width: $width; 48 | } @else { 49 | @warn "`#{$width}` is not a valid length for the `$width` parameter in the `size` mixin."; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /sass/bourbon/addons/_text-inputs.scss: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | 3 | /// Generates variables for all text-based inputs. Please note that you must use interpolation on the variable: `#{$all-text-inputs}`. 4 | /// 5 | /// @example scss - Usage 6 | /// #{$all-text-inputs} { 7 | /// border: 1px solid #f00; 8 | /// } 9 | /// 10 | /// #{$all-text-inputs-focus}, 11 | /// #{$all-text-inputs-hover} { 12 | /// border: 1px solid #0f0; 13 | /// } 14 | /// 15 | /// #{$all-text-inputs-active} { 16 | /// border: 1px solid #00f; 17 | /// } 18 | /// 19 | /// @example css - CSS Output 20 | /// input[type="color"], 21 | /// input[type="date"], 22 | /// input[type="datetime"], 23 | /// input[type="datetime-local"], 24 | /// input[type="email"], 25 | /// input[type="month"], 26 | /// input[type="number"], 27 | /// input[type="password"], 28 | /// input[type="search"], 29 | /// input[type="tel"], 30 | /// input[type="text"], 31 | /// input[type="time"], 32 | /// input[type="url"], 33 | /// input[type="week"], 34 | /// textarea { 35 | /// border: 1px solid #f00; 36 | /// } 37 | /// 38 | /// input[type="color"]:focus, 39 | /// input[type="date"]:focus, 40 | /// input[type="datetime"]:focus, 41 | /// input[type="datetime-local"]:focus, 42 | /// input[type="email"]:focus, 43 | /// input[type="month"]:focus, 44 | /// input[type="number"]:focus, 45 | /// input[type="password"]:focus, 46 | /// input[type="search"]:focus, 47 | /// input[type="tel"]:focus, 48 | /// input[type="text"]:focus, 49 | /// input[type="time"]:focus, 50 | /// input[type="url"]:focus, 51 | /// input[type="week"]:focus, 52 | /// textarea:focus, 53 | /// input[type="color"]:hover, 54 | /// input[type="date"]:hover, 55 | /// input[type="datetime"]:hover, 56 | /// input[type="datetime-local"]:hover, 57 | /// input[type="email"]:hover, 58 | /// input[type="month"]:hover, 59 | /// input[type="number"]:hover, 60 | /// input[type="password"]:hover, 61 | /// input[type="search"]:hover, 62 | /// input[type="tel"]:hover, 63 | /// input[type="text"]:hover, 64 | /// input[type="time"]:hover, 65 | /// input[type="url"]:hover, 66 | /// input[type="week"]:hover, 67 | /// textarea:hover { 68 | /// border: 1px solid #0f0; 69 | /// } 70 | /// 71 | /// input[type="color"]:active, 72 | /// input[type="date"]:active, 73 | /// input[type="datetime"]:active, 74 | /// input[type="datetime-local"]:active, 75 | /// input[type="email"]:active, 76 | /// input[type="month"]:active, 77 | /// input[type="number"]:active, 78 | /// input[type="password"]:active, 79 | /// input[type="search"]:active, 80 | /// input[type="tel"]:active, 81 | /// input[type="text"]:active, 82 | /// input[type="time"]:active, 83 | /// input[type="url"]:active, 84 | /// input[type="week"]:active, 85 | /// textarea:active { 86 | /// border: 1px solid #00f; 87 | /// } 88 | /// 89 | /// @require assign-inputs 90 | /// 91 | /// @type List 92 | 93 | $text-inputs-list: 'input[type="color"]', 94 | 'input[type="date"]', 95 | 'input[type="datetime"]', 96 | 'input[type="datetime-local"]', 97 | 'input[type="email"]', 98 | 'input[type="month"]', 99 | 'input[type="number"]', 100 | 'input[type="password"]', 101 | 'input[type="search"]', 102 | 'input[type="tel"]', 103 | 'input[type="text"]', 104 | 'input[type="time"]', 105 | 'input[type="url"]', 106 | 'input[type="week"]', 107 | 'textarea'; 108 | 109 | $all-text-inputs: assign-inputs($text-inputs-list); 110 | $all-text-inputs-active: assign-inputs($text-inputs-list, active); 111 | $all-text-inputs-focus: assign-inputs($text-inputs-list, focus); 112 | $all-text-inputs-hover: assign-inputs($text-inputs-list, hover); 113 | -------------------------------------------------------------------------------- /sass/bourbon/addons/_timing-functions.scss: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | 3 | /// CSS cubic-bezier timing functions. Timing functions courtesy of jquery.easie (github.com/jaukia/easie) 4 | /// 5 | /// Timing functions are the same as demoed here: http://jqueryui.com/resources/demos/effect/easing.html 6 | /// 7 | /// @type cubic-bezier 8 | 9 | $ease-in-quad: cubic-bezier(0.550, 0.085, 0.680, 0.530); 10 | $ease-in-cubic: cubic-bezier(0.550, 0.055, 0.675, 0.190); 11 | $ease-in-quart: cubic-bezier(0.895, 0.030, 0.685, 0.220); 12 | $ease-in-quint: cubic-bezier(0.755, 0.050, 0.855, 0.060); 13 | $ease-in-sine: cubic-bezier(0.470, 0.000, 0.745, 0.715); 14 | $ease-in-expo: cubic-bezier(0.950, 0.050, 0.795, 0.035); 15 | $ease-in-circ: cubic-bezier(0.600, 0.040, 0.980, 0.335); 16 | $ease-in-back: cubic-bezier(0.600, -0.280, 0.735, 0.045); 17 | 18 | $ease-out-quad: cubic-bezier(0.250, 0.460, 0.450, 0.940); 19 | $ease-out-cubic: cubic-bezier(0.215, 0.610, 0.355, 1.000); 20 | $ease-out-quart: cubic-bezier(0.165, 0.840, 0.440, 1.000); 21 | $ease-out-quint: cubic-bezier(0.230, 1.000, 0.320, 1.000); 22 | $ease-out-sine: cubic-bezier(0.390, 0.575, 0.565, 1.000); 23 | $ease-out-expo: cubic-bezier(0.190, 1.000, 0.220, 1.000); 24 | $ease-out-circ: cubic-bezier(0.075, 0.820, 0.165, 1.000); 25 | $ease-out-back: cubic-bezier(0.175, 0.885, 0.320, 1.275); 26 | 27 | $ease-in-out-quad: cubic-bezier(0.455, 0.030, 0.515, 0.955); 28 | $ease-in-out-cubic: cubic-bezier(0.645, 0.045, 0.355, 1.000); 29 | $ease-in-out-quart: cubic-bezier(0.770, 0.000, 0.175, 1.000); 30 | $ease-in-out-quint: cubic-bezier(0.860, 0.000, 0.070, 1.000); 31 | $ease-in-out-sine: cubic-bezier(0.445, 0.050, 0.550, 0.950); 32 | $ease-in-out-expo: cubic-bezier(1.000, 0.000, 0.000, 1.000); 33 | $ease-in-out-circ: cubic-bezier(0.785, 0.135, 0.150, 0.860); 34 | $ease-in-out-back: cubic-bezier(0.680, -0.550, 0.265, 1.550); 35 | -------------------------------------------------------------------------------- /sass/bourbon/addons/_triangle.scss: -------------------------------------------------------------------------------- 1 | @mixin triangle($size, $color, $direction) { 2 | $width: nth($size, 1); 3 | $height: nth($size, length($size)); 4 | $foreground-color: nth($color, 1); 5 | $background-color: if(length($color) == 2, nth($color, 2), transparent); 6 | height: 0; 7 | width: 0; 8 | 9 | @if ($direction == up) or ($direction == down) or ($direction == right) or ($direction == left) { 10 | $width: $width / 2; 11 | $height: if(length($size) > 1, $height, $height/2); 12 | 13 | @if $direction == up { 14 | border-bottom: $height solid $foreground-color; 15 | border-left: $width solid $background-color; 16 | border-right: $width solid $background-color; 17 | } @else if $direction == right { 18 | border-bottom: $width solid $background-color; 19 | border-left: $height solid $foreground-color; 20 | border-top: $width solid $background-color; 21 | } @else if $direction == down { 22 | border-left: $width solid $background-color; 23 | border-right: $width solid $background-color; 24 | border-top: $height solid $foreground-color; 25 | } @else if $direction == left { 26 | border-bottom: $width solid $background-color; 27 | border-right: $height solid $foreground-color; 28 | border-top: $width solid $background-color; 29 | } 30 | } @else if ($direction == up-right) or ($direction == up-left) { 31 | border-top: $height solid $foreground-color; 32 | 33 | @if $direction == up-right { 34 | border-left: $width solid $background-color; 35 | } @else if $direction == up-left { 36 | border-right: $width solid $background-color; 37 | } 38 | } @else if ($direction == down-right) or ($direction == down-left) { 39 | border-bottom: $height solid $foreground-color; 40 | 41 | @if $direction == down-right { 42 | border-left: $width solid $background-color; 43 | } @else if $direction == down-left { 44 | border-right: $width solid $background-color; 45 | } 46 | } @else if ($direction == inset-up) { 47 | border-color: $background-color $background-color $foreground-color; 48 | border-style: solid; 49 | border-width: $height $width; 50 | } @else if ($direction == inset-down) { 51 | border-color: $foreground-color $background-color $background-color; 52 | border-style: solid; 53 | border-width: $height $width; 54 | } @else if ($direction == inset-right) { 55 | border-color: $background-color $background-color $background-color $foreground-color; 56 | border-style: solid; 57 | border-width: $width $height; 58 | } @else if ($direction == inset-left) { 59 | border-color: $background-color $foreground-color $background-color $background-color; 60 | border-style: solid; 61 | border-width: $width $height; 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /sass/bourbon/addons/_word-wrap.scss: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | 3 | /// Provides an easy way to change the `word-wrap` property. 4 | /// 5 | /// @param {String} $wrap [break-word] 6 | /// Value for the `word-break` property. 7 | /// 8 | /// @example scss - Usage 9 | /// .wrapper { 10 | /// @include word-wrap(break-word); 11 | /// } 12 | /// 13 | /// @example css - CSS Output 14 | /// .wrapper { 15 | /// overflow-wrap: break-word; 16 | /// word-break: break-all; 17 | /// word-wrap: break-word; 18 | /// } 19 | 20 | @mixin word-wrap($wrap: break-word) { 21 | overflow-wrap: $wrap; 22 | word-wrap: $wrap; 23 | 24 | @if $wrap == break-word { 25 | word-break: break-all; 26 | } @else { 27 | word-break: $wrap; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /sass/bourbon/css3/_animation.scss: -------------------------------------------------------------------------------- 1 | // http://www.w3.org/TR/css3-animations/#the-animation-name-property- 2 | // Each of these mixins support comma separated lists of values, which allows different transitions for individual properties to be described in a single style rule. Each value in the list corresponds to the value at that same position in the other properties. 3 | 4 | @mixin animation($animations...) { 5 | @include prefixer(animation, $animations, webkit moz spec); 6 | } 7 | 8 | @mixin animation-name($names...) { 9 | @include prefixer(animation-name, $names, webkit moz spec); 10 | } 11 | 12 | @mixin animation-duration($times...) { 13 | @include prefixer(animation-duration, $times, webkit moz spec); 14 | } 15 | 16 | @mixin animation-timing-function($motions...) { 17 | // ease | linear | ease-in | ease-out | ease-in-out 18 | @include prefixer(animation-timing-function, $motions, webkit moz spec); 19 | } 20 | 21 | @mixin animation-iteration-count($values...) { 22 | // infinite | 23 | @include prefixer(animation-iteration-count, $values, webkit moz spec); 24 | } 25 | 26 | @mixin animation-direction($directions...) { 27 | // normal | alternate 28 | @include prefixer(animation-direction, $directions, webkit moz spec); 29 | } 30 | 31 | @mixin animation-play-state($states...) { 32 | // running | paused 33 | @include prefixer(animation-play-state, $states, webkit moz spec); 34 | } 35 | 36 | @mixin animation-delay($times...) { 37 | @include prefixer(animation-delay, $times, webkit moz spec); 38 | } 39 | 40 | @mixin animation-fill-mode($modes...) { 41 | // none | forwards | backwards | both 42 | @include prefixer(animation-fill-mode, $modes, webkit moz spec); 43 | } 44 | -------------------------------------------------------------------------------- /sass/bourbon/css3/_appearance.scss: -------------------------------------------------------------------------------- 1 | @mixin appearance($value) { 2 | @include prefixer(appearance, $value, webkit moz ms o spec); 3 | } 4 | -------------------------------------------------------------------------------- /sass/bourbon/css3/_backface-visibility.scss: -------------------------------------------------------------------------------- 1 | @mixin backface-visibility($visibility) { 2 | @include prefixer(backface-visibility, $visibility, webkit spec); 3 | } 4 | -------------------------------------------------------------------------------- /sass/bourbon/css3/_background-image.scss: -------------------------------------------------------------------------------- 1 | //************************************************************************// 2 | // Background-image property for adding multiple background images with 3 | // gradients, or for stringing multiple gradients together. 4 | //************************************************************************// 5 | 6 | @mixin background-image($images...) { 7 | $webkit-images: (); 8 | $spec-images: (); 9 | 10 | @each $image in $images { 11 | $webkit-image: (); 12 | $spec-image: (); 13 | 14 | @if (type-of($image) == string) { 15 | $url-str: str-slice($image, 0, 3); 16 | $gradient-type: str-slice($image, 0, 6); 17 | 18 | @if $url-str == "url" { 19 | $webkit-image: $image; 20 | $spec-image: $image; 21 | } 22 | 23 | @else if $gradient-type == "linear" { 24 | $gradients: _linear-gradient-parser($image); 25 | $webkit-image: map-get($gradients, webkit-image); 26 | $spec-image: map-get($gradients, spec-image); 27 | } 28 | 29 | @else if $gradient-type == "radial" { 30 | $gradients: _radial-gradient-parser($image); 31 | $webkit-image: map-get($gradients, webkit-image); 32 | $spec-image: map-get($gradients, spec-image); 33 | } 34 | } 35 | 36 | $webkit-images: append($webkit-images, $webkit-image, comma); 37 | $spec-images: append($spec-images, $spec-image, comma); 38 | } 39 | 40 | background-image: $webkit-images; 41 | background-image: $spec-images; 42 | } 43 | -------------------------------------------------------------------------------- /sass/bourbon/css3/_background.scss: -------------------------------------------------------------------------------- 1 | //************************************************************************// 2 | // Background property for adding multiple backgrounds using shorthand 3 | // notation. 4 | //************************************************************************// 5 | 6 | @mixin background($backgrounds...) { 7 | $webkit-backgrounds: (); 8 | $spec-backgrounds: (); 9 | 10 | @each $background in $backgrounds { 11 | $webkit-background: (); 12 | $spec-background: (); 13 | $background-type: type-of($background); 14 | 15 | @if $background-type == string or $background-type == list { 16 | $background-str: if($background-type == list, nth($background, 1), $background); 17 | 18 | $url-str: str-slice($background-str, 0, 3); 19 | $gradient-type: str-slice($background-str, 0, 6); 20 | 21 | @if $url-str == "url" { 22 | $webkit-background: $background; 23 | $spec-background: $background; 24 | } 25 | 26 | @else if $gradient-type == "linear" { 27 | $gradients: _linear-gradient-parser("#{$background}"); 28 | $webkit-background: map-get($gradients, webkit-image); 29 | $spec-background: map-get($gradients, spec-image); 30 | } 31 | 32 | @else if $gradient-type == "radial" { 33 | $gradients: _radial-gradient-parser("#{$background}"); 34 | $webkit-background: map-get($gradients, webkit-image); 35 | $spec-background: map-get($gradients, spec-image); 36 | } 37 | 38 | @else { 39 | $webkit-background: $background; 40 | $spec-background: $background; 41 | } 42 | } 43 | 44 | @else { 45 | $webkit-background: $background; 46 | $spec-background: $background; 47 | } 48 | 49 | $webkit-backgrounds: append($webkit-backgrounds, $webkit-background, comma); 50 | $spec-backgrounds: append($spec-backgrounds, $spec-background, comma); 51 | } 52 | 53 | background: $webkit-backgrounds; 54 | background: $spec-backgrounds; 55 | } 56 | -------------------------------------------------------------------------------- /sass/bourbon/css3/_border-image.scss: -------------------------------------------------------------------------------- 1 | @mixin border-image($borders...) { 2 | $webkit-borders: (); 3 | $spec-borders: (); 4 | 5 | @each $border in $borders { 6 | $webkit-border: (); 7 | $spec-border: (); 8 | $border-type: type-of($border); 9 | 10 | @if $border-type == string or list { 11 | $border-str: if($border-type == list, nth($border, 1), $border); 12 | 13 | $url-str: str-slice($border-str, 0, 3); 14 | $gradient-type: str-slice($border-str, 0, 6); 15 | 16 | @if $url-str == "url" { 17 | $webkit-border: $border; 18 | $spec-border: $border; 19 | } 20 | 21 | @else if $gradient-type == "linear" { 22 | $gradients: _linear-gradient-parser("#{$border}"); 23 | $webkit-border: map-get($gradients, webkit-image); 24 | $spec-border: map-get($gradients, spec-image); 25 | } 26 | 27 | @else if $gradient-type == "radial" { 28 | $gradients: _radial-gradient-parser("#{$border}"); 29 | $webkit-border: map-get($gradients, webkit-image); 30 | $spec-border: map-get($gradients, spec-image); 31 | } 32 | 33 | @else { 34 | $webkit-border: $border; 35 | $spec-border: $border; 36 | } 37 | } 38 | 39 | @else { 40 | $webkit-border: $border; 41 | $spec-border: $border; 42 | } 43 | 44 | $webkit-borders: append($webkit-borders, $webkit-border, comma); 45 | $spec-borders: append($spec-borders, $spec-border, comma); 46 | } 47 | 48 | -webkit-border-image: $webkit-borders; 49 | border-image: $spec-borders; 50 | border-style: solid; 51 | } 52 | 53 | //Examples: 54 | // @include border-image(url("image.png")); 55 | // @include border-image(url("image.png") 20 stretch); 56 | // @include border-image(linear-gradient(45deg, orange, yellow)); 57 | // @include border-image(linear-gradient(45deg, orange, yellow) stretch); 58 | // @include border-image(linear-gradient(45deg, orange, yellow) 20 30 40 50 stretch round); 59 | // @include border-image(radial-gradient(top, cover, orange, yellow, orange)); 60 | -------------------------------------------------------------------------------- /sass/bourbon/css3/_calc.scss: -------------------------------------------------------------------------------- 1 | @mixin calc($property, $value) { 2 | #{$property}: -webkit-calc(#{$value}); 3 | #{$property}: calc(#{$value}); 4 | } 5 | -------------------------------------------------------------------------------- /sass/bourbon/css3/_columns.scss: -------------------------------------------------------------------------------- 1 | @mixin columns($arg: auto) { 2 | // || 3 | @include prefixer(columns, $arg, webkit moz spec); 4 | } 5 | 6 | @mixin column-count($int: auto) { 7 | // auto || integer 8 | @include prefixer(column-count, $int, webkit moz spec); 9 | } 10 | 11 | @mixin column-gap($length: normal) { 12 | // normal || length 13 | @include prefixer(column-gap, $length, webkit moz spec); 14 | } 15 | 16 | @mixin column-fill($arg: auto) { 17 | // auto || length 18 | @include prefixer(column-fill, $arg, webkit moz spec); 19 | } 20 | 21 | @mixin column-rule($arg) { 22 | // || || 23 | @include prefixer(column-rule, $arg, webkit moz spec); 24 | } 25 | 26 | @mixin column-rule-color($color) { 27 | @include prefixer(column-rule-color, $color, webkit moz spec); 28 | } 29 | 30 | @mixin column-rule-style($style: none) { 31 | // none | hidden | dashed | dotted | double | groove | inset | inset | outset | ridge | solid 32 | @include prefixer(column-rule-style, $style, webkit moz spec); 33 | } 34 | 35 | @mixin column-rule-width ($width: none) { 36 | @include prefixer(column-rule-width, $width, webkit moz spec); 37 | } 38 | 39 | @mixin column-span($arg: none) { 40 | // none || all 41 | @include prefixer(column-span, $arg, webkit moz spec); 42 | } 43 | 44 | @mixin column-width($length: auto) { 45 | // auto || length 46 | @include prefixer(column-width, $length, webkit moz spec); 47 | } 48 | -------------------------------------------------------------------------------- /sass/bourbon/css3/_filter.scss: -------------------------------------------------------------------------------- 1 | @mixin filter($function: none) { 2 | // [ 3 | @include prefixer(perspective, $depth, webkit moz spec); 4 | } 5 | 6 | @mixin perspective-origin($value: 50% 50%) { 7 | @include prefixer(perspective-origin, $value, webkit moz spec); 8 | } 9 | -------------------------------------------------------------------------------- /sass/bourbon/css3/_placeholder.scss: -------------------------------------------------------------------------------- 1 | @mixin placeholder { 2 | $placeholders: ":-webkit-input" ":-moz" "-moz" "-ms-input"; 3 | @each $placeholder in $placeholders { 4 | &:#{$placeholder}-placeholder { 5 | @content; 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /sass/bourbon/css3/_radial-gradient.scss: -------------------------------------------------------------------------------- 1 | // Requires Sass 3.1+ 2 | @mixin radial-gradient($g1, $g2, 3 | $g3: null, $g4: null, 4 | $g5: null, $g6: null, 5 | $g7: null, $g8: null, 6 | $g9: null, $g10: null, 7 | $pos: null, 8 | $shape-size: null, 9 | $fallback: null) { 10 | 11 | $data: _radial-arg-parser($g1, $g2, $pos, $shape-size); 12 | $g1: nth($data, 1); 13 | $g2: nth($data, 2); 14 | $pos: nth($data, 3); 15 | $shape-size: nth($data, 4); 16 | 17 | $full: $g1, $g2, $g3, $g4, $g5, $g6, $g7, $g8, $g9, $g10; 18 | 19 | // Strip deprecated cover/contain for spec 20 | $shape-size-spec: _shape-size-stripper($shape-size); 21 | 22 | // Set $g1 as the default fallback color 23 | $first-color: nth($full, 1); 24 | $fallback-color: nth($first-color, 1); 25 | 26 | @if (type-of($fallback) == color) or ($fallback == "transparent") { 27 | $fallback-color: $fallback; 28 | } 29 | 30 | // Add Commas and spaces 31 | $shape-size: if($shape-size, "#{$shape-size}, ", null); 32 | $pos: if($pos, "#{$pos}, ", null); 33 | $pos-spec: if($pos, "at #{$pos}", null); 34 | $shape-size-spec: if(($shape-size-spec != " ") and ($pos == null), "#{$shape-size-spec}, ", "#{$shape-size-spec} "); 35 | 36 | background-color: $fallback-color; 37 | background-image: -webkit-radial-gradient(unquote(#{$pos}#{$shape-size}#{$full})); 38 | background-image: unquote("radial-gradient(#{$shape-size-spec}#{$pos-spec}#{$full})"); 39 | } 40 | -------------------------------------------------------------------------------- /sass/bourbon/css3/_selection.scss: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | 3 | /// Outputs the spec and prefixed versions of the `::selection` pseudo-element. 4 | /// 5 | /// @param {Bool} $current-selector [false] 6 | /// If set to `true`, it takes the current element into consideration. 7 | /// 8 | /// @example scss - Usage 9 | /// .element { 10 | /// @include selection(true) { 11 | /// background-color: #ffbb52; 12 | /// } 13 | /// } 14 | /// 15 | /// @example css - CSS Output 16 | /// .element::-moz-selection { 17 | /// background-color: #ffbb52; 18 | /// } 19 | /// 20 | /// .element::selection { 21 | /// background-color: #ffbb52; 22 | /// } 23 | 24 | @mixin selection($current-selector: false) { 25 | @if $current-selector { 26 | &::-moz-selection { 27 | @content; 28 | } 29 | 30 | &::selection { 31 | @content; 32 | } 33 | } @else { 34 | ::-moz-selection { 35 | @content; 36 | } 37 | 38 | ::selection { 39 | @content; 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /sass/bourbon/css3/_text-decoration.scss: -------------------------------------------------------------------------------- 1 | @mixin text-decoration($value) { 2 | // || || 3 | @include prefixer(text-decoration, $value, moz); 4 | } 5 | 6 | @mixin text-decoration-line($line: none) { 7 | // none || underline || overline || line-through 8 | @include prefixer(text-decoration-line, $line, moz); 9 | } 10 | 11 | @mixin text-decoration-style($style: solid) { 12 | // solid || double || dotted || dashed || wavy 13 | @include prefixer(text-decoration-style, $style, moz webkit); 14 | } 15 | 16 | @mixin text-decoration-color($color: currentColor) { 17 | // currentColor || 18 | @include prefixer(text-decoration-color, $color, moz); 19 | } 20 | -------------------------------------------------------------------------------- /sass/bourbon/css3/_transform.scss: -------------------------------------------------------------------------------- 1 | @mixin transform($property: none) { 2 | // none | 3 | @include prefixer(transform, $property, webkit moz ms o spec); 4 | } 5 | 6 | @mixin transform-origin($axes: 50%) { 7 | // x-axis - left | center | right | length | % 8 | // y-axis - top | center | bottom | length | % 9 | // z-axis - length 10 | @include prefixer(transform-origin, $axes, webkit moz ms o spec); 11 | } 12 | 13 | @mixin transform-style($style: flat) { 14 | @include prefixer(transform-style, $style, webkit moz ms o spec); 15 | } 16 | -------------------------------------------------------------------------------- /sass/bourbon/css3/_transition.scss: -------------------------------------------------------------------------------- 1 | // Shorthand mixin. Supports multiple parentheses-deliminated values for each variable. 2 | // Example: @include transition (all 2s ease-in-out); 3 | // @include transition (opacity 1s ease-in 2s, width 2s ease-out); 4 | // @include transition-property (transform, opacity); 5 | 6 | @mixin transition($properties...) { 7 | // Fix for vendor-prefix transform property 8 | $needs-prefixes: false; 9 | $webkit: (); 10 | $moz: (); 11 | $spec: (); 12 | 13 | // Create lists for vendor-prefixed transform 14 | @each $list in $properties { 15 | @if nth($list, 1) == "transform" { 16 | $needs-prefixes: true; 17 | $list1: -webkit-transform; 18 | $list2: -moz-transform; 19 | $list3: (); 20 | 21 | @each $var in $list { 22 | $list3: join($list3, $var); 23 | 24 | @if $var != "transform" { 25 | $list1: join($list1, $var); 26 | $list2: join($list2, $var); 27 | } 28 | } 29 | 30 | $webkit: append($webkit, $list1); 31 | $moz: append($moz, $list2); 32 | $spec: append($spec, $list3); 33 | } @else { 34 | $webkit: append($webkit, $list, comma); 35 | $moz: append($moz, $list, comma); 36 | $spec: append($spec, $list, comma); 37 | } 38 | } 39 | 40 | @if $needs-prefixes { 41 | -webkit-transition: $webkit; 42 | -moz-transition: $moz; 43 | transition: $spec; 44 | } @else { 45 | @if length($properties) >= 1 { 46 | @include prefixer(transition, $properties, webkit moz spec); 47 | } @else { 48 | $properties: all 0.15s ease-out 0s; 49 | @include prefixer(transition, $properties, webkit moz spec); 50 | } 51 | } 52 | } 53 | 54 | @mixin transition-property($properties...) { 55 | -webkit-transition-property: transition-property-names($properties, "webkit"); 56 | -moz-transition-property: transition-property-names($properties, "moz"); 57 | transition-property: transition-property-names($properties, false); 58 | } 59 | 60 | @mixin transition-duration($times...) { 61 | @include prefixer(transition-duration, $times, webkit moz spec); 62 | } 63 | 64 | @mixin transition-timing-function($motions...) { 65 | // ease | linear | ease-in | ease-out | ease-in-out | cubic-bezier() 66 | @include prefixer(transition-timing-function, $motions, webkit moz spec); 67 | } 68 | 69 | @mixin transition-delay($times...) { 70 | @include prefixer(transition-delay, $times, webkit moz spec); 71 | } 72 | -------------------------------------------------------------------------------- /sass/bourbon/css3/_user-select.scss: -------------------------------------------------------------------------------- 1 | @mixin user-select($value: none) { 2 | @include prefixer(user-select, $value, webkit moz ms spec); 3 | } 4 | -------------------------------------------------------------------------------- /sass/bourbon/functions/_assign-inputs.scss: -------------------------------------------------------------------------------- 1 | @function assign-inputs($inputs, $pseudo: null) { 2 | $list: (); 3 | 4 | @each $input in $inputs { 5 | $input: unquote($input); 6 | $input: if($pseudo, $input + ":" + $pseudo, $input); 7 | $list: append($list, $input, comma); 8 | } 9 | 10 | @return $list; 11 | } 12 | -------------------------------------------------------------------------------- /sass/bourbon/functions/_contains-falsy.scss: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | 3 | /// Checks if a list does not contains a value. 4 | /// 5 | /// @access private 6 | /// 7 | /// @param {List} $list 8 | /// The list to check against. 9 | /// 10 | /// @return {Bool} 11 | 12 | @function contains-falsy($list) { 13 | @each $item in $list { 14 | @if not $item { 15 | @return true; 16 | } 17 | } 18 | 19 | @return false; 20 | } 21 | -------------------------------------------------------------------------------- /sass/bourbon/functions/_contains.scss: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | 3 | /// Checks if a list contains a value(s). 4 | /// 5 | /// @access private 6 | /// 7 | /// @param {List} $list 8 | /// The list to check against. 9 | /// 10 | /// @param {List} $values 11 | /// A single value or list of values to check for. 12 | /// 13 | /// @example scss - Usage 14 | /// contains($list, $value) 15 | /// 16 | /// @return {Bool} 17 | 18 | @function contains($list, $values...) { 19 | @each $value in $values { 20 | @if type-of(index($list, $value)) != "number" { 21 | @return false; 22 | } 23 | } 24 | 25 | @return true; 26 | } 27 | -------------------------------------------------------------------------------- /sass/bourbon/functions/_is-length.scss: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | 3 | /// Checks for a valid CSS length. 4 | /// 5 | /// @param {String} $value 6 | 7 | @function is-length($value) { 8 | @return type-of($value) != "null" and (str-slice($value + "", 1, 4) == "calc" 9 | or index(auto inherit initial 0, $value) 10 | or (type-of($value) == "number" and not(unitless($value)))); 11 | } 12 | -------------------------------------------------------------------------------- /sass/bourbon/functions/_is-light.scss: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | 3 | /// Programatically determines whether a color is light or dark. 4 | /// 5 | /// @link http://robots.thoughtbot.com/closer-look-color-lightness 6 | /// 7 | /// @param {Color (Hex)} $color 8 | /// 9 | /// @example scss - Usage 10 | /// is-light($color) 11 | /// 12 | /// @return {Bool} 13 | 14 | @function is-light($hex-color) { 15 | $-local-red: red(rgba($hex-color, 1)); 16 | $-local-green: green(rgba($hex-color, 1)); 17 | $-local-blue: blue(rgba($hex-color, 1)); 18 | $-local-lightness: ($-local-red * 0.2126 + $-local-green * 0.7152 + $-local-blue * 0.0722) / 255; 19 | 20 | @return $-local-lightness > 0.6; 21 | } 22 | -------------------------------------------------------------------------------- /sass/bourbon/functions/_is-number.scss: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | 3 | /// Checks for a valid number. 4 | /// 5 | /// @param {Number} $value 6 | /// 7 | /// @require {function} contains 8 | 9 | @function is-number($value) { 10 | @return contains("0" "1" "2" "3" "4" "5" "6" "7" "8" "9" 0 1 2 3 4 5 6 7 8 9, $value); 11 | } 12 | -------------------------------------------------------------------------------- /sass/bourbon/functions/_is-size.scss: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | 3 | /// Checks for a valid CSS size. 4 | /// 5 | /// @param {String} $value 6 | /// 7 | /// @require {function} contains 8 | /// @require {function} is-length 9 | 10 | @function is-size($value) { 11 | @return is-length($value) 12 | or contains("fill" "fit-content" "min-content" "max-content", $value); 13 | } 14 | -------------------------------------------------------------------------------- /sass/bourbon/functions/_modular-scale.scss: -------------------------------------------------------------------------------- 1 | // Scaling Variables 2 | $golden: 1.618; 3 | $minor-second: 1.067; 4 | $major-second: 1.125; 5 | $minor-third: 1.2; 6 | $major-third: 1.25; 7 | $perfect-fourth: 1.333; 8 | $augmented-fourth: 1.414; 9 | $perfect-fifth: 1.5; 10 | $minor-sixth: 1.6; 11 | $major-sixth: 1.667; 12 | $minor-seventh: 1.778; 13 | $major-seventh: 1.875; 14 | $octave: 2; 15 | $major-tenth: 2.5; 16 | $major-eleventh: 2.667; 17 | $major-twelfth: 3; 18 | $double-octave: 4; 19 | 20 | $modular-scale-ratio: $perfect-fourth !default; 21 | $modular-scale-base: em($em-base) !default; 22 | 23 | @function modular-scale($increment, $value: $modular-scale-base, $ratio: $modular-scale-ratio) { 24 | $v1: nth($value, 1); 25 | $v2: nth($value, length($value)); 26 | $value: $v1; 27 | 28 | // scale $v2 to just above $v1 29 | @while $v2 > $v1 { 30 | $v2: ($v2 / $ratio); // will be off-by-1 31 | } 32 | @while $v2 < $v1 { 33 | $v2: ($v2 * $ratio); // will fix off-by-1 34 | } 35 | 36 | // check AFTER scaling $v2 to prevent double-counting corner-case 37 | $double-stranded: $v2 > $v1; 38 | 39 | @if $increment > 0 { 40 | @for $i from 1 through $increment { 41 | @if $double-stranded and ($v1 * $ratio) > $v2 { 42 | $value: $v2; 43 | $v2: ($v2 * $ratio); 44 | } @else { 45 | $v1: ($v1 * $ratio); 46 | $value: $v1; 47 | } 48 | } 49 | } 50 | 51 | @if $increment < 0 { 52 | // adjust $v2 to just below $v1 53 | @if $double-stranded { 54 | $v2: ($v2 / $ratio); 55 | } 56 | 57 | @for $i from $increment through -1 { 58 | @if $double-stranded and ($v1 / $ratio) < $v2 { 59 | $value: $v2; 60 | $v2: ($v2 / $ratio); 61 | } @else { 62 | $v1: ($v1 / $ratio); 63 | $value: $v1; 64 | } 65 | } 66 | } 67 | 68 | @return $value; 69 | } 70 | -------------------------------------------------------------------------------- /sass/bourbon/functions/_px-to-em.scss: -------------------------------------------------------------------------------- 1 | // Convert pixels to ems 2 | // eg. for a relational value of 12px write em(12) when the parent is 16px 3 | // if the parent is another value say 24px write em(12, 24) 4 | 5 | @function em($pxval, $base: $em-base) { 6 | @if not unitless($pxval) { 7 | $pxval: strip-units($pxval); 8 | } 9 | @if not unitless($base) { 10 | $base: strip-units($base); 11 | } 12 | @return ($pxval / $base) * 1em; 13 | } 14 | -------------------------------------------------------------------------------- /sass/bourbon/functions/_px-to-rem.scss: -------------------------------------------------------------------------------- 1 | // Convert pixels to rems 2 | // eg. for a relational value of 12px write rem(12) 3 | // Assumes $em-base is the font-size of 4 | 5 | @function rem($pxval) { 6 | @if not unitless($pxval) { 7 | $pxval: strip-units($pxval); 8 | } 9 | 10 | $base: $em-base; 11 | @if not unitless($base) { 12 | $base: strip-units($base); 13 | } 14 | @return ($pxval / $base) * 1rem; 15 | } 16 | -------------------------------------------------------------------------------- /sass/bourbon/functions/_shade.scss: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | 3 | /// Mixes a color with black. 4 | /// 5 | /// @param {Color} $color 6 | /// 7 | /// @param {Number (Percentage)} $percent 8 | /// The amount of black to be mixed in. 9 | /// 10 | /// @example scss - Usage 11 | /// .element { 12 | /// background-color: shade(#ffbb52, 60%); 13 | /// } 14 | /// 15 | /// @example css - CSS Output 16 | /// .element { 17 | /// background-color: #664a20; 18 | /// } 19 | /// 20 | /// @return {Color} 21 | 22 | @function shade($color, $percent) { 23 | @return mix(#000, $color, $percent); 24 | } 25 | -------------------------------------------------------------------------------- /sass/bourbon/functions/_strip-units.scss: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | 3 | /// Strips the unit from a number. 4 | /// 5 | /// @param {Number (With Unit)} $value 6 | /// 7 | /// @example scss - Usage 8 | /// $dimension: strip-units(10em); 9 | /// 10 | /// @example css - CSS Output 11 | /// $dimension: 10; 12 | /// 13 | /// @return {Number (Unitless)} 14 | 15 | @function strip-units($value) { 16 | @return ($value / ($value * 0 + 1)); 17 | } 18 | -------------------------------------------------------------------------------- /sass/bourbon/functions/_tint.scss: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | 3 | /// Mixes a color with white. 4 | /// 5 | /// @param {Color} $color 6 | /// 7 | /// @param {Number (Percentage)} $percent 8 | /// The amount of white to be mixed in. 9 | /// 10 | /// @example scss - Usage 11 | /// .element { 12 | /// background-color: tint(#6ecaa6, 40%); 13 | /// } 14 | /// 15 | /// @example css - CSS Output 16 | /// .element { 17 | /// background-color: #a8dfc9; 18 | /// } 19 | /// 20 | /// @return {Color} 21 | 22 | @function tint($color, $percent) { 23 | @return mix(#fff, $color, $percent); 24 | } 25 | -------------------------------------------------------------------------------- /sass/bourbon/functions/_transition-property-name.scss: -------------------------------------------------------------------------------- 1 | // Return vendor-prefixed property names if appropriate 2 | // Example: transition-property-names((transform, color, background), moz) -> -moz-transform, color, background 3 | //************************************************************************// 4 | @function transition-property-names($props, $vendor: false) { 5 | $new-props: (); 6 | 7 | @each $prop in $props { 8 | $new-props: append($new-props, transition-property-name($prop, $vendor), comma); 9 | } 10 | 11 | @return $new-props; 12 | } 13 | 14 | @function transition-property-name($prop, $vendor: false) { 15 | // put other properties that need to be prefixed here aswell 16 | @if $vendor and $prop == transform { 17 | @return unquote('-'+$vendor+'-'+$prop); 18 | } 19 | @else { 20 | @return $prop; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /sass/bourbon/functions/_unpack.scss: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | 3 | /// Converts shorthand to the 4-value syntax. 4 | /// 5 | /// @param {List} $shorthand 6 | /// 7 | /// @example scss - Usage 8 | /// .element { 9 | /// margin: unpack(1em 2em); 10 | /// } 11 | /// 12 | /// @example css - CSS Output 13 | /// .element { 14 | /// margin: 1em 2em 1em 2em; 15 | /// } 16 | 17 | @function unpack($shorthand) { 18 | @if length($shorthand) == 1 { 19 | @return nth($shorthand, 1) nth($shorthand, 1) nth($shorthand, 1) nth($shorthand, 1); 20 | } @else if length($shorthand) == 2 { 21 | @return nth($shorthand, 1) nth($shorthand, 2) nth($shorthand, 1) nth($shorthand, 2); 22 | } @else if length($shorthand) == 3 { 23 | @return nth($shorthand, 1) nth($shorthand, 2) nth($shorthand, 3) nth($shorthand, 2); 24 | } @else { 25 | @return $shorthand; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /sass/bourbon/helpers/_convert-units.scss: -------------------------------------------------------------------------------- 1 | //************************************************************************// 2 | // Helper function for str-to-num fn. 3 | // Source: http://sassmeister.com/gist/9647408 4 | //************************************************************************// 5 | @function _convert-units($number, $unit) { 6 | $strings: "px", "cm", "mm", "%", "ch", "pica", "in", "em", "rem", "pt", "pc", "ex", "vw", "vh", "vmin", "vmax", "deg", "rad", "grad", "turn"; 7 | $units: 1px, 1cm, 1mm, 1%, 1ch, 1pica, 1in, 1em, 1rem, 1pt, 1pc, 1ex, 1vw, 1vh, 1vmin, 1vmax, 1deg, 1rad, 1grad, 1turn; 8 | $index: index($strings, $unit); 9 | 10 | @if not $index { 11 | @warn "Unknown unit `#{$unit}`."; 12 | @return false; 13 | } 14 | 15 | @if type-of($number) != "number" { 16 | @warn "`#{$number} is not a number`"; 17 | @return false; 18 | } 19 | 20 | @return $number * nth($units, $index); 21 | } 22 | -------------------------------------------------------------------------------- /sass/bourbon/helpers/_directional-values.scss: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | 3 | /// Directional-property mixins are shorthands for writing properties like the following 4 | /// 5 | /// @ignore You can also use `false` instead of `null`. 6 | /// 7 | /// @param {List} $vals 8 | /// List of directional values 9 | /// 10 | /// @example scss - Usage 11 | /// .element { 12 | /// @include border-style(dotted null); 13 | /// @include margin(null 0 10px); 14 | /// } 15 | /// 16 | /// @example css - CSS Output 17 | /// .element { 18 | /// border-bottom-style: dotted; 19 | /// border-top-style: dotted; 20 | /// margin-bottom: 10px; 21 | /// margin-left: 0; 22 | /// margin-right: 0; 23 | /// } 24 | /// 25 | /// @require {function} contains-falsy 26 | /// 27 | /// @return {List} 28 | 29 | @function collapse-directionals($vals) { 30 | $output: null; 31 | 32 | $a: nth($vals, 1); 33 | $b: if(length($vals) < 2, $a, nth($vals, 2)); 34 | $c: if(length($vals) < 3, $a, nth($vals, 3)); 35 | $d: if(length($vals) < 2, $a, nth($vals, if(length($vals) < 4, 2, 4))); 36 | 37 | @if $a == 0 { $a: 0; } 38 | @if $b == 0 { $b: 0; } 39 | @if $c == 0 { $c: 0; } 40 | @if $d == 0 { $d: 0; } 41 | 42 | @if $a == $b and $a == $c and $a == $d { $output: $a; } 43 | @else if $a == $c and $b == $d { $output: $a $b; } 44 | @else if $b == $d { $output: $a $b $c; } 45 | @else { $output: $a $b $c $d; } 46 | 47 | @return $output; 48 | } 49 | 50 | /// Output directional properties, for instance `margin`. 51 | /// 52 | /// @access private 53 | /// 54 | /// @param {String} $pre 55 | /// Prefix to use 56 | /// @param {String} $suf 57 | /// Suffix to use 58 | /// @param {List} $vals 59 | /// List of values 60 | /// 61 | /// @require {function} collapse-directionals 62 | /// @require {function} contains-falsy 63 | 64 | @mixin directional-property($pre, $suf, $vals) { 65 | // Property Names 66 | $top: $pre + "-top" + if($suf, "-#{$suf}", ""); 67 | $bottom: $pre + "-bottom" + if($suf, "-#{$suf}", ""); 68 | $left: $pre + "-left" + if($suf, "-#{$suf}", ""); 69 | $right: $pre + "-right" + if($suf, "-#{$suf}", ""); 70 | $all: $pre + if($suf, "-#{$suf}", ""); 71 | 72 | $vals: collapse-directionals($vals); 73 | 74 | @if contains-falsy($vals) { 75 | @if nth($vals, 1) { #{$top}: nth($vals, 1); } 76 | 77 | @if length($vals) == 1 { 78 | @if nth($vals, 1) { #{$right}: nth($vals, 1); } 79 | } @else { 80 | @if nth($vals, 2) { #{$right}: nth($vals, 2); } 81 | } 82 | 83 | @if length($vals) == 2 { 84 | @if nth($vals, 1) { #{$bottom}: nth($vals, 1); } 85 | @if nth($vals, 2) { #{$left}: nth($vals, 2); } 86 | } @else if length($vals) == 3 { 87 | @if nth($vals, 3) { #{$bottom}: nth($vals, 3); } 88 | @if nth($vals, 2) { #{$left}: nth($vals, 2); } 89 | } @else if length($vals) == 4 { 90 | @if nth($vals, 3) { #{$bottom}: nth($vals, 3); } 91 | @if nth($vals, 4) { #{$left}: nth($vals, 4); } 92 | } 93 | } @else { 94 | #{$all}: $vals; 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /sass/bourbon/helpers/_font-source-declaration.scss: -------------------------------------------------------------------------------- 1 | // Used for creating the source string for fonts using @font-face 2 | // Reference: http://goo.gl/Ru1bKP 3 | 4 | @function font-url-prefixer($asset-pipeline) { 5 | @if $asset-pipeline == true { 6 | @return font-url; 7 | } @else { 8 | @return url; 9 | } 10 | } 11 | 12 | @function font-source-declaration( 13 | $font-family, 14 | $file-path, 15 | $asset-pipeline, 16 | $file-formats, 17 | $font-url) { 18 | 19 | $src: null; 20 | 21 | $formats-map: ( 22 | eot: "#{$file-path}.eot?#iefix" format("embedded-opentype"), 23 | woff2: "#{$file-path}.woff2" format("woff2"), 24 | woff: "#{$file-path}.woff" format("woff"), 25 | ttf: "#{$file-path}.ttf" format("truetype"), 26 | svg: "#{$file-path}.svg##{$font-family}" format("svg") 27 | ); 28 | 29 | @each $key, $values in $formats-map { 30 | @if contains($file-formats, $key) { 31 | $file-path: nth($values, 1); 32 | $font-format: nth($values, 2); 33 | 34 | @if $asset-pipeline == true { 35 | $src: append($src, font-url($file-path) $font-format, comma); 36 | } @else { 37 | $src: append($src, url($file-path) $font-format, comma); 38 | } 39 | } 40 | } 41 | 42 | @return $src; 43 | } 44 | -------------------------------------------------------------------------------- /sass/bourbon/helpers/_gradient-positions-parser.scss: -------------------------------------------------------------------------------- 1 | @function _gradient-positions-parser($gradient-type, $gradient-positions) { 2 | @if $gradient-positions 3 | and ($gradient-type == linear) 4 | and (type-of($gradient-positions) != color) { 5 | $gradient-positions: _linear-positions-parser($gradient-positions); 6 | } 7 | @else if $gradient-positions 8 | and ($gradient-type == radial) 9 | and (type-of($gradient-positions) != color) { 10 | $gradient-positions: _radial-positions-parser($gradient-positions); 11 | } 12 | @return $gradient-positions; 13 | } 14 | -------------------------------------------------------------------------------- /sass/bourbon/helpers/_linear-angle-parser.scss: -------------------------------------------------------------------------------- 1 | // Private function for linear-gradient-parser 2 | @function _linear-angle-parser($image, $first-val, $prefix, $suffix) { 3 | $offset: null; 4 | $unit-short: str-slice($first-val, str-length($first-val) - 2, str-length($first-val)); 5 | $unit-long: str-slice($first-val, str-length($first-val) - 3, str-length($first-val)); 6 | 7 | @if ($unit-long == "grad") or 8 | ($unit-long == "turn") { 9 | $offset: if($unit-long == "grad", -100grad * 3, -0.75turn); 10 | } 11 | 12 | @else if ($unit-short == "deg") or 13 | ($unit-short == "rad") { 14 | $offset: if($unit-short == "deg", -90 * 3, 1.6rad); 15 | } 16 | 17 | @if $offset { 18 | $num: _str-to-num($first-val); 19 | 20 | @return ( 21 | webkit-image: -webkit- + $prefix + ($offset - $num) + $suffix, 22 | spec-image: $image 23 | ); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /sass/bourbon/helpers/_linear-gradient-parser.scss: -------------------------------------------------------------------------------- 1 | @function _linear-gradient-parser($image) { 2 | $image: unquote($image); 3 | $gradients: (); 4 | $start: str-index($image, "("); 5 | $end: str-index($image, ","); 6 | $first-val: str-slice($image, $start + 1, $end - 1); 7 | 8 | $prefix: str-slice($image, 0, $start); 9 | $suffix: str-slice($image, $end, str-length($image)); 10 | 11 | $has-multiple-vals: str-index($first-val, " "); 12 | $has-single-position: unquote(_position-flipper($first-val) + ""); 13 | $has-angle: is-number(str-slice($first-val, 0, 0)); 14 | 15 | @if $has-multiple-vals { 16 | $gradients: _linear-side-corner-parser($image, $first-val, $prefix, $suffix, $has-multiple-vals); 17 | } 18 | 19 | @else if $has-single-position != "" { 20 | $pos: unquote($has-single-position + ""); 21 | 22 | $gradients: ( 23 | webkit-image: -webkit- + $image, 24 | spec-image: $prefix + "to " + $pos + $suffix 25 | ); 26 | } 27 | 28 | @else if $has-angle { 29 | // Rotate degree for webkit 30 | $gradients: _linear-angle-parser($image, $first-val, $prefix, $suffix); 31 | } 32 | 33 | @else { 34 | $gradients: ( 35 | webkit-image: -webkit- + $image, 36 | spec-image: $image 37 | ); 38 | } 39 | 40 | @return $gradients; 41 | } 42 | -------------------------------------------------------------------------------- /sass/bourbon/helpers/_linear-positions-parser.scss: -------------------------------------------------------------------------------- 1 | @function _linear-positions-parser($pos) { 2 | $type: type-of(nth($pos, 1)); 3 | $spec: null; 4 | $degree: null; 5 | $side: null; 6 | $corner: null; 7 | $length: length($pos); 8 | // Parse Side and corner positions 9 | @if ($length > 1) { 10 | @if nth($pos, 1) == "to" { // Newer syntax 11 | $side: nth($pos, 2); 12 | 13 | @if $length == 2 { // eg. to top 14 | // Swap for backwards compatability 15 | $degree: _position-flipper(nth($pos, 2)); 16 | } 17 | @else if $length == 3 { // eg. to top left 18 | $corner: nth($pos, 3); 19 | } 20 | } 21 | @else if $length == 2 { // Older syntax ("top left") 22 | $side: _position-flipper(nth($pos, 1)); 23 | $corner: _position-flipper(nth($pos, 2)); 24 | } 25 | 26 | @if ("#{$side} #{$corner}" == "left top") or ("#{$side} #{$corner}" == "top left") { 27 | $degree: _position-flipper(#{$side}) _position-flipper(#{$corner}); 28 | } 29 | @else if ("#{$side} #{$corner}" == "right top") or ("#{$side} #{$corner}" == "top right") { 30 | $degree: _position-flipper(#{$side}) _position-flipper(#{$corner}); 31 | } 32 | @else if ("#{$side} #{$corner}" == "right bottom") or ("#{$side} #{$corner}" == "bottom right") { 33 | $degree: _position-flipper(#{$side}) _position-flipper(#{$corner}); 34 | } 35 | @else if ("#{$side} #{$corner}" == "left bottom") or ("#{$side} #{$corner}" == "bottom left") { 36 | $degree: _position-flipper(#{$side}) _position-flipper(#{$corner}); 37 | } 38 | $spec: to $side $corner; 39 | } 40 | @else if $length == 1 { 41 | // Swap for backwards compatability 42 | @if $type == string { 43 | $degree: $pos; 44 | $spec: to _position-flipper($pos); 45 | } 46 | @else { 47 | $degree: -270 - $pos; //rotate the gradient opposite from spec 48 | $spec: $pos; 49 | } 50 | } 51 | $degree: unquote($degree + ","); 52 | $spec: unquote($spec + ","); 53 | @return $degree $spec; 54 | } 55 | 56 | @function _position-flipper($pos) { 57 | @return if($pos == left, right, null) 58 | if($pos == right, left, null) 59 | if($pos == top, bottom, null) 60 | if($pos == bottom, top, null); 61 | } 62 | -------------------------------------------------------------------------------- /sass/bourbon/helpers/_linear-side-corner-parser.scss: -------------------------------------------------------------------------------- 1 | // Private function for linear-gradient-parser 2 | @function _linear-side-corner-parser($image, $first-val, $prefix, $suffix, $has-multiple-vals) { 3 | $val-1: str-slice($first-val, 0, $has-multiple-vals - 1 ); 4 | $val-2: str-slice($first-val, $has-multiple-vals + 1, str-length($first-val)); 5 | $val-3: null; 6 | $has-val-3: str-index($val-2, " "); 7 | 8 | @if $has-val-3 { 9 | $val-3: str-slice($val-2, $has-val-3 + 1, str-length($val-2)); 10 | $val-2: str-slice($val-2, 0, $has-val-3 - 1); 11 | } 12 | 13 | $pos: _position-flipper($val-1) _position-flipper($val-2) _position-flipper($val-3); 14 | $pos: unquote($pos + ""); 15 | 16 | // Use old spec for webkit 17 | @if $val-1 == "to" { 18 | @return ( 19 | webkit-image: -webkit- + $prefix + $pos + $suffix, 20 | spec-image: $image 21 | ); 22 | } 23 | 24 | // Bring the code up to spec 25 | @else { 26 | @return ( 27 | webkit-image: -webkit- + $image, 28 | spec-image: $prefix + "to " + $pos + $suffix 29 | ); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /sass/bourbon/helpers/_radial-arg-parser.scss: -------------------------------------------------------------------------------- 1 | @function _radial-arg-parser($g1, $g2, $pos, $shape-size) { 2 | @each $value in $g1, $g2 { 3 | $first-val: nth($value, 1); 4 | $pos-type: type-of($first-val); 5 | $spec-at-index: null; 6 | 7 | // Determine if spec was passed to mixin 8 | @if type-of($value) == list { 9 | $spec-at-index: if(index($value, at), index($value, at), false); 10 | } 11 | @if $spec-at-index { 12 | @if $spec-at-index > 1 { 13 | @for $i from 1 through ($spec-at-index - 1) { 14 | $shape-size: $shape-size nth($value, $i); 15 | } 16 | @for $i from ($spec-at-index + 1) through length($value) { 17 | $pos: $pos nth($value, $i); 18 | } 19 | } 20 | @else if $spec-at-index == 1 { 21 | @for $i from ($spec-at-index + 1) through length($value) { 22 | $pos: $pos nth($value, $i); 23 | } 24 | } 25 | $g1: null; 26 | } 27 | 28 | // If not spec calculate correct values 29 | @else { 30 | @if ($pos-type != color) or ($first-val != "transparent") { 31 | @if ($pos-type == number) 32 | or ($first-val == "center") 33 | or ($first-val == "top") 34 | or ($first-val == "right") 35 | or ($first-val == "bottom") 36 | or ($first-val == "left") { 37 | 38 | $pos: $value; 39 | 40 | @if $pos == $g1 { 41 | $g1: null; 42 | } 43 | } 44 | 45 | @else if 46 | ($first-val == "ellipse") 47 | or ($first-val == "circle") 48 | or ($first-val == "closest-side") 49 | or ($first-val == "closest-corner") 50 | or ($first-val == "farthest-side") 51 | or ($first-val == "farthest-corner") 52 | or ($first-val == "contain") 53 | or ($first-val == "cover") { 54 | 55 | $shape-size: $value; 56 | 57 | @if $value == $g1 { 58 | $g1: null; 59 | } 60 | 61 | @else if $value == $g2 { 62 | $g2: null; 63 | } 64 | } 65 | } 66 | } 67 | } 68 | @return $g1, $g2, $pos, $shape-size; 69 | } 70 | -------------------------------------------------------------------------------- /sass/bourbon/helpers/_radial-gradient-parser.scss: -------------------------------------------------------------------------------- 1 | @function _radial-gradient-parser($image) { 2 | $image: unquote($image); 3 | $gradients: (); 4 | $start: str-index($image, "("); 5 | $end: str-index($image, ","); 6 | $first-val: str-slice($image, $start + 1, $end - 1); 7 | 8 | $prefix: str-slice($image, 0, $start); 9 | $suffix: str-slice($image, $end, str-length($image)); 10 | 11 | $is-spec-syntax: str-index($first-val, "at"); 12 | 13 | @if $is-spec-syntax and $is-spec-syntax > 1 { 14 | $keyword: str-slice($first-val, 1, $is-spec-syntax - 2); 15 | $pos: str-slice($first-val, $is-spec-syntax + 3, str-length($first-val)); 16 | $pos: append($pos, $keyword, comma); 17 | 18 | $gradients: ( 19 | webkit-image: -webkit- + $prefix + $pos + $suffix, 20 | spec-image: $image 21 | ); 22 | } 23 | 24 | @else if $is-spec-syntax == 1 { 25 | $pos: str-slice($first-val, $is-spec-syntax + 3, str-length($first-val)); 26 | 27 | $gradients: ( 28 | webkit-image: -webkit- + $prefix + $pos + $suffix, 29 | spec-image: $image 30 | ); 31 | } 32 | 33 | @else if str-index($image, "cover") or str-index($image, "contain") { 34 | @warn "Radial-gradient needs to be updated to conform to latest spec."; 35 | 36 | $gradients: ( 37 | webkit-image: null, 38 | spec-image: $image 39 | ); 40 | } 41 | 42 | @else { 43 | $gradients: ( 44 | webkit-image: -webkit- + $image, 45 | spec-image: $image 46 | ); 47 | } 48 | 49 | @return $gradients; 50 | } 51 | -------------------------------------------------------------------------------- /sass/bourbon/helpers/_radial-positions-parser.scss: -------------------------------------------------------------------------------- 1 | @function _radial-positions-parser($gradient-pos) { 2 | $shape-size: nth($gradient-pos, 1); 3 | $pos: nth($gradient-pos, 2); 4 | $shape-size-spec: _shape-size-stripper($shape-size); 5 | 6 | $pre-spec: unquote(if($pos, "#{$pos}, ", null)) 7 | unquote(if($shape-size, "#{$shape-size},", null)); 8 | $pos-spec: if($pos, "at #{$pos}", null); 9 | 10 | $spec: "#{$shape-size-spec} #{$pos-spec}"; 11 | 12 | // Add comma 13 | @if ($spec != " ") { 14 | $spec: "#{$spec},"; 15 | } 16 | 17 | @return $pre-spec $spec; 18 | } 19 | -------------------------------------------------------------------------------- /sass/bourbon/helpers/_render-gradients.scss: -------------------------------------------------------------------------------- 1 | // User for linear and radial gradients within background-image or border-image properties 2 | 3 | @function _render-gradients($gradient-positions, $gradients, $gradient-type, $vendor: false) { 4 | $pre-spec: null; 5 | $spec: null; 6 | $vendor-gradients: null; 7 | @if $gradient-type == linear { 8 | @if $gradient-positions { 9 | $pre-spec: nth($gradient-positions, 1); 10 | $spec: nth($gradient-positions, 2); 11 | } 12 | } 13 | @else if $gradient-type == radial { 14 | $pre-spec: nth($gradient-positions, 1); 15 | $spec: nth($gradient-positions, 2); 16 | } 17 | 18 | @if $vendor { 19 | $vendor-gradients: -#{$vendor}-#{$gradient-type}-gradient(#{$pre-spec} $gradients); 20 | } 21 | @else if $vendor == false { 22 | $vendor-gradients: "#{$gradient-type}-gradient(#{$spec} #{$gradients})"; 23 | $vendor-gradients: unquote($vendor-gradients); 24 | } 25 | @return $vendor-gradients; 26 | } 27 | -------------------------------------------------------------------------------- /sass/bourbon/helpers/_shape-size-stripper.scss: -------------------------------------------------------------------------------- 1 | @function _shape-size-stripper($shape-size) { 2 | $shape-size-spec: null; 3 | @each $value in $shape-size { 4 | @if ($value == "cover") or ($value == "contain") { 5 | $value: null; 6 | } 7 | $shape-size-spec: "#{$shape-size-spec} #{$value}"; 8 | } 9 | @return $shape-size-spec; 10 | } 11 | -------------------------------------------------------------------------------- /sass/bourbon/helpers/_str-to-num.scss: -------------------------------------------------------------------------------- 1 | //************************************************************************// 2 | // Helper function for linear/radial-gradient-parsers. 3 | // Source: http://sassmeister.com/gist/9647408 4 | //************************************************************************// 5 | @function _str-to-num($string) { 6 | // Matrices 7 | $strings: "0" "1" "2" "3" "4" "5" "6" "7" "8" "9"; 8 | $numbers: 0 1 2 3 4 5 6 7 8 9; 9 | 10 | // Result 11 | $result: 0; 12 | $divider: 0; 13 | $minus: false; 14 | 15 | // Looping through all characters 16 | @for $i from 1 through str-length($string) { 17 | $character: str-slice($string, $i, $i); 18 | $index: index($strings, $character); 19 | 20 | @if $character == "-" { 21 | $minus: true; 22 | } 23 | 24 | @else if $character == "." { 25 | $divider: 1; 26 | } 27 | 28 | @else { 29 | @if not $index { 30 | $result: if($minus, $result * -1, $result); 31 | @return _convert-units($result, str-slice($string, $i)); 32 | } 33 | 34 | $number: nth($numbers, $index); 35 | 36 | @if $divider == 0 { 37 | $result: $result * 10; 38 | } 39 | 40 | @else { 41 | // Move the decimal dot to the left 42 | $divider: $divider * 10; 43 | $number: $number / $divider; 44 | } 45 | 46 | $result: $result + $number; 47 | } 48 | } 49 | @return if($minus, $result * -1, $result); 50 | } 51 | -------------------------------------------------------------------------------- /sass/bourbon/settings/_asset-pipeline.scss: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | 3 | /// A global setting to enable or disable the `$asset-pipeline` variable for all functions that accept it. 4 | /// 5 | /// @type Bool 6 | 7 | $asset-pipeline: false !default; 8 | -------------------------------------------------------------------------------- /sass/bourbon/settings/_prefixer.scss: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | 3 | /// Global variables to enable or disable vendor prefixes 4 | 5 | $prefix-for-webkit: true !default; 6 | $prefix-for-mozilla: true !default; 7 | $prefix-for-microsoft: true !default; 8 | $prefix-for-opera: true !default; 9 | $prefix-for-spec: true !default; 10 | -------------------------------------------------------------------------------- /sass/bourbon/settings/_px-to-em.scss: -------------------------------------------------------------------------------- 1 | $em-base: 16px !default; 2 | -------------------------------------------------------------------------------- /sass/neat/_neat-helpers.scss: -------------------------------------------------------------------------------- 1 | // Functions 2 | @import "functions/private"; 3 | @import "functions/new-breakpoint"; 4 | 5 | // Settings 6 | @import "settings/grid"; 7 | @import "settings/visual-grid"; 8 | @import "settings/disable-warnings"; 9 | -------------------------------------------------------------------------------- /sass/neat/_neat.scss: -------------------------------------------------------------------------------- 1 | // Neat 1.7.2 2 | // http://neat.bourbon.io 3 | // Copyright 2012-2015 thoughtbot, inc. 4 | // MIT License 5 | 6 | // Helpers 7 | @import "neat-helpers"; 8 | 9 | // Grid 10 | @import "grid/private"; 11 | @import "grid/box-sizing"; 12 | @import "grid/omega"; 13 | @import "grid/outer-container"; 14 | @import "grid/span-columns"; 15 | @import "grid/row"; 16 | @import "grid/shift"; 17 | @import "grid/pad"; 18 | @import "grid/fill-parent"; 19 | @import "grid/media"; 20 | @import "grid/to-deprecate"; 21 | @import "grid/visual-grid"; 22 | @import "grid/display-context"; 23 | @import "grid/direction-context"; 24 | -------------------------------------------------------------------------------- /sass/neat/functions/_new-breakpoint.scss: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | 3 | /// Returns a media context (media query / grid context) that can be stored in a variable and passed to `media()` as a single-keyword argument. Media contexts defined using `new-breakpoint` are used by the visual grid, as long as they are defined before importing Neat. 4 | /// 5 | /// @param {List} $query 6 | /// A list of media query features and values. Each `$feature` should have a corresponding `$value`. 7 | /// 8 | /// If there is only a single `$value` in `$query`, `$default-feature` is going to be used. 9 | /// 10 | /// The number of total columns in the grid can be set by passing `$columns` at the end of the list (overrides `$total-columns`). For a list of valid values for `$feature`, click [here](http://www.w3.org/TR/css3-mediaqueries/#media1). 11 | /// 12 | /// @param {Number (unitless)} $total-columns [$grid-columns] 13 | /// - Number of columns to use in the new grid context. Can be set as a shorthand in the first parameter. 14 | /// 15 | /// @example scss - Usage 16 | /// $mobile: new-breakpoint(max-width 480px 4); 17 | /// 18 | /// .element { 19 | /// @include media($mobile) { 20 | /// @include span-columns(4); 21 | /// } 22 | /// } 23 | /// 24 | /// @example css - CSS Output 25 | /// @media screen and (max-width: 480px) { 26 | /// .element { 27 | /// display: block; 28 | /// float: left; 29 | /// margin-right: 7.42297%; 30 | /// width: 100%; 31 | /// } 32 | /// .element:last-child { 33 | /// margin-right: 0; 34 | /// } 35 | /// } 36 | 37 | @function new-breakpoint($query: $feature $value $columns, $total-columns: $grid-columns) { 38 | @if length($query) == 1 { 39 | $query: $default-feature nth($query, 1) $total-columns; 40 | } @else if is-even(length($query)) { 41 | $query: append($query, $total-columns); 42 | } 43 | 44 | @if is-not(belongs-to($query, $visual-grid-breakpoints)) { 45 | $visual-grid-breakpoints: append($visual-grid-breakpoints, $query, comma) !global; 46 | } 47 | 48 | @return $query; 49 | } 50 | -------------------------------------------------------------------------------- /sass/neat/functions/_private.scss: -------------------------------------------------------------------------------- 1 | // Not function for Libsass compatibility 2 | // https://github.com/sass/libsass/issues/368 3 | @function is-not($value) { 4 | @return if($value, false, true); 5 | } 6 | 7 | // Checks if a number is even 8 | @function is-even($int) { 9 | @return $int % 2 == 0; 10 | } 11 | 12 | // Checks if an element belongs to a list or not 13 | @function belongs-to($tested-item, $list) { 14 | @return is-not(not-belongs-to($tested-item, $list)); 15 | } 16 | 17 | @function not-belongs-to($tested-item, $list) { 18 | @return is-not(index($list, $tested-item)); 19 | } 20 | 21 | // Contains display value 22 | @function contains-display-value($query) { 23 | @return belongs-to(table, $query) 24 | or belongs-to(block, $query) 25 | or belongs-to(inline-block, $query) 26 | or belongs-to(inline, $query); 27 | } 28 | 29 | // Parses the first argument of span-columns() 30 | @function container-span($span: $span) { 31 | @if length($span) == 3 { 32 | $container-columns: nth($span, 3); 33 | @return $container-columns; 34 | } @else if length($span) == 2 { 35 | $container-columns: nth($span, 2); 36 | @return $container-columns; 37 | } 38 | 39 | @return $grid-columns; 40 | } 41 | 42 | @function container-shift($shift: $shift) { 43 | $parent-columns: $grid-columns !default !global; 44 | 45 | @if length($shift) == 3 { 46 | $container-columns: nth($shift, 3); 47 | @return $container-columns; 48 | } @else if length($shift) == 2 { 49 | $container-columns: nth($shift, 2); 50 | @return $container-columns; 51 | } 52 | 53 | @return $parent-columns; 54 | } 55 | 56 | // Generates a striped background 57 | @function gradient-stops($grid-columns, $color: $visual-grid-color) { 58 | $transparent: transparent; 59 | 60 | $column-width: flex-grid(1, $grid-columns); 61 | $gutter-width: flex-gutter($grid-columns); 62 | $column-offset: $column-width; 63 | 64 | $values: ($transparent 0, $color 0); 65 | 66 | @for $i from 1 to $grid-columns*2 { 67 | @if is-even($i) { 68 | $values: append($values, $transparent $column-offset, comma); 69 | $values: append($values, $color $column-offset, comma); 70 | $column-offset: $column-offset + $column-width; 71 | } @else { 72 | $values: append($values, $color $column-offset, comma); 73 | $values: append($values, $transparent $column-offset, comma); 74 | $column-offset: $column-offset + $gutter-width; 75 | } 76 | } 77 | 78 | @return $values; 79 | } 80 | 81 | // Layout direction 82 | @function get-direction($layout, $default) { 83 | $direction: null; 84 | 85 | @if to-upper-case($layout) == "LTR" or to-upper-case($layout) == "RTL" { 86 | $direction: direction-from-layout($layout); 87 | } @else { 88 | $direction: direction-from-layout($default); 89 | } 90 | 91 | @return $direction; 92 | } 93 | 94 | @function direction-from-layout($layout) { 95 | $direction: null; 96 | 97 | @if to-upper-case($layout) == "LTR" { 98 | $direction: right; 99 | } @else { 100 | $direction: left; 101 | } 102 | 103 | @return $direction; 104 | } 105 | 106 | @function get-opposite-direction($direction) { 107 | $opposite-direction: left; 108 | 109 | @if $direction == "left" { 110 | $opposite-direction: right; 111 | } 112 | 113 | @return $opposite-direction; 114 | } 115 | -------------------------------------------------------------------------------- /sass/neat/grid/_box-sizing.scss: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | 3 | @if $border-box-sizing == true { 4 | html { // http://bit.ly/1qk2tVR 5 | box-sizing: border-box; 6 | } 7 | 8 | * { 9 | &, 10 | &::after, 11 | &::before { 12 | box-sizing: inherit; 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /sass/neat/grid/_direction-context.scss: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | 3 | /// Changes the direction property used by other mixins called in the code block argument. 4 | /// 5 | /// @param {String} $direction [left-to-right] 6 | /// Layout direction to be used within the block. Can be `left-to-right` or `right-to-left`. 7 | /// 8 | /// @example scss - Usage 9 | /// @include direction-context(right-to-left) { 10 | /// .right-to-left-block { 11 | /// @include span-columns(6); 12 | /// } 13 | /// } 14 | /// 15 | /// @example css - CSS Output 16 | /// .right-to-left-block { 17 | /// float: right; 18 | /// ... 19 | /// } 20 | 21 | @mixin direction-context($direction: left-to-right) { 22 | $scope-direction: $layout-direction; 23 | 24 | @if to-lower-case($direction) == "left-to-right" { 25 | $layout-direction: LTR !global; 26 | } @else if to-lower-case($direction) == "right-to-left" { 27 | $layout-direction: RTL !global; 28 | } 29 | 30 | @content; 31 | 32 | $layout-direction: $scope-direction !global; 33 | } 34 | -------------------------------------------------------------------------------- /sass/neat/grid/_display-context.scss: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | 3 | /// Changes the display property used by other mixins called in the code block argument. 4 | /// 5 | /// @param {String} $display [block] 6 | /// Display value to be used within the block. Can be `table` or `block`. 7 | /// 8 | /// @example scss 9 | /// @include display-context(table) { 10 | /// .display-table { 11 | /// @include span-columns(6); 12 | /// } 13 | /// } 14 | /// 15 | /// @example css 16 | /// .display-table { 17 | /// display: table-cell; 18 | /// ... 19 | /// } 20 | 21 | @mixin display-context($display: block) { 22 | $scope-display: $container-display-table; 23 | $container-display-table: $display == table !global; 24 | 25 | @content; 26 | 27 | $container-display-table: $scope-display !global; 28 | } 29 | -------------------------------------------------------------------------------- /sass/neat/grid/_fill-parent.scss: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | 3 | /// Forces the element to fill its parent container. 4 | /// 5 | /// @example scss - Usage 6 | /// .element { 7 | /// @include fill-parent; 8 | /// } 9 | /// 10 | /// @example css - CSS Output 11 | /// .element { 12 | /// width: 100%; 13 | /// box-sizing: border-box; 14 | /// } 15 | 16 | @mixin fill-parent() { 17 | width: 100%; 18 | 19 | @if $border-box-sizing == false { 20 | box-sizing: border-box; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /sass/neat/grid/_media.scss: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | 3 | /// Outputs a media-query block with an optional grid context (the total number of columns used in the grid). 4 | /// 5 | /// @param {List} $query 6 | /// A list of media query features and values, where each `$feature` should have a corresponding `$value`. 7 | /// For a list of valid values for `$feature`, click [here](http://www.w3.org/TR/css3-mediaqueries/#media1). 8 | /// 9 | /// If there is only a single `$value` in `$query`, `$default-feature` is going to be used. 10 | /// 11 | /// The number of total columns in the grid can be set by passing `$columns` at the end of the list (overrides `$total-columns`). 12 | /// 13 | /// 14 | /// @param {Number (unitless)} $total-columns [$grid-columns] 15 | /// - Number of columns to use in the new grid context. Can be set as a shorthand in the first parameter. 16 | /// 17 | /// @example scss - Usage 18 | /// .responsive-element { 19 | /// @include media(769px) { 20 | /// @include span-columns(6); 21 | /// } 22 | /// } 23 | /// 24 | /// .new-context-element { 25 | /// @include media(min-width 320px max-width 480px, 6) { 26 | /// @include span-columns(6); 27 | /// } 28 | /// } 29 | /// 30 | /// @example css - CSS Output 31 | /// @media screen and (min-width: 769px) { 32 | /// .responsive-element { 33 | /// display: block; 34 | /// float: left; 35 | /// margin-right: 2.35765%; 36 | /// width: 48.82117%; 37 | /// } 38 | /// 39 | /// .responsive-element:last-child { 40 | /// margin-right: 0; 41 | /// } 42 | /// } 43 | /// 44 | /// @media screen and (min-width: 320px) and (max-width: 480px) { 45 | /// .new-context-element { 46 | /// display: block; 47 | /// float: left; 48 | /// margin-right: 4.82916%; 49 | /// width: 100%; 50 | /// } 51 | /// 52 | /// .new-context-element:last-child { 53 | /// margin-right: 0; 54 | /// } 55 | /// } 56 | 57 | @mixin media($query: $feature $value $columns, $total-columns: $grid-columns) { 58 | @if length($query) == 1 { 59 | @media screen and ($default-feature: nth($query, 1)) { 60 | $default-grid-columns: $grid-columns; 61 | $grid-columns: $total-columns !global; 62 | @content; 63 | $grid-columns: $default-grid-columns !global; 64 | } 65 | } @else { 66 | $loop-to: length($query); 67 | $media-query: "screen and "; 68 | $default-grid-columns: $grid-columns; 69 | $grid-columns: $total-columns !global; 70 | 71 | @if is-not(is-even(length($query))) { 72 | $grid-columns: nth($query, $loop-to) !global; 73 | $loop-to: $loop-to - 1; 74 | } 75 | 76 | $i: 1; 77 | @while $i <= $loop-to { 78 | $media-query: $media-query + "(" + nth($query, $i) + ": " + nth($query, $i + 1) + ") "; 79 | 80 | @if ($i + 1) != $loop-to { 81 | $media-query: $media-query + "and "; 82 | } 83 | 84 | $i: $i + 2; 85 | } 86 | 87 | @media #{$media-query} { 88 | @content; 89 | $grid-columns: $default-grid-columns !global; 90 | } 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /sass/neat/grid/_omega.scss: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | 3 | /// Removes the element's gutter margin, regardless of its position in the grid hierarchy or display property. It can target a specific element, or every `nth-child` occurrence. Works only with `block` layouts. 4 | /// 5 | /// @param {List} $query [block] 6 | /// List of arguments. Supported arguments are `nth-child` selectors (targets a specific pseudo element) and `auto` (targets `last-child`). 7 | /// 8 | /// When passed an `nth-child` argument of type `*n` with `block` display, the omega mixin automatically adds a clear to the `*n+1` th element. Note that composite arguments such as `2n+1` do not support this feature. 9 | /// 10 | /// **Deprecation warning**: The omega mixin will no longer take a `$direction` argument. To change the layout direction, use `row($direction)` or set `$default-layout-direction` instead. 11 | /// 12 | /// @example scss - Usage 13 | /// .element { 14 | /// @include omega; 15 | /// } 16 | /// 17 | /// .nth-element { 18 | /// @include omega(4n); 19 | /// } 20 | /// 21 | /// @example css - CSS Output 22 | /// .element { 23 | /// margin-right: 0; 24 | /// } 25 | /// 26 | /// .nth-element:nth-child(4n) { 27 | /// margin-right: 0; 28 | /// } 29 | /// 30 | /// .nth-element:nth-child(4n+1) { 31 | /// clear: left; 32 | /// } 33 | 34 | @mixin omega($query: block, $direction: default) { 35 | $table: belongs-to(table, $query); 36 | $auto: belongs-to(auto, $query); 37 | 38 | @if $direction != default { 39 | @include -neat-warn("The omega mixin will no longer take a $direction argument. To change the layout direction, use the direction(){...} mixin."); 40 | } @else { 41 | $direction: get-direction($layout-direction, $default-layout-direction); 42 | } 43 | 44 | @if $table { 45 | @include -neat-warn("The omega mixin no longer removes padding in table layouts."); 46 | } 47 | 48 | @if length($query) == 1 { 49 | @if $auto { 50 | &:last-child { 51 | margin-#{$direction}: 0; 52 | } 53 | } 54 | 55 | @else if contains-display-value($query) and $table == false { 56 | margin-#{$direction}: 0; 57 | } 58 | 59 | @else { 60 | @include nth-child($query, $direction); 61 | } 62 | } @else if length($query) == 2 { 63 | @if $auto { 64 | &:last-child { 65 | margin-#{$direction}: 0; 66 | } 67 | } @else { 68 | @include nth-child(nth($query, 1), $direction); 69 | } 70 | } @else { 71 | @include -neat-warn("Too many arguments passed to the omega() mixin."); 72 | } 73 | } 74 | 75 | @mixin nth-child($query, $direction) { 76 | $opposite-direction: get-opposite-direction($direction); 77 | 78 | &:nth-child(#{$query}) { 79 | margin-#{$direction}: 0; 80 | } 81 | 82 | @if type-of($query) == number and unit($query) == "n" { 83 | &:nth-child(#{$query}+1) { 84 | clear: $opposite-direction; 85 | } 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /sass/neat/grid/_outer-container.scss: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | 3 | /// Makes an element a outer container by centring it in the viewport, clearing its floats, and setting its `max-width`. 4 | /// Although optional, using `outer-container` is recommended. The mixin can be called on more than one element per page, as long as they are not nested. 5 | /// 6 | /// @param {Number [unit]} $local-max-width [$max-width] 7 | /// Max width to be applied to the element. Can be a percentage or a measure. 8 | /// 9 | /// @example scss - Usage 10 | /// .element { 11 | /// @include outer-container(100%); 12 | /// } 13 | /// 14 | /// @example css - CSS Output 15 | /// .element { 16 | /// *zoom: 1; 17 | /// max-width: 100%; 18 | /// margin-left: auto; 19 | /// margin-right: auto; 20 | /// } 21 | /// 22 | /// .element:before, .element:after { 23 | /// content: " "; 24 | /// display: table; 25 | /// } 26 | /// 27 | /// .element:after { 28 | /// clear: both; 29 | /// } 30 | 31 | @mixin outer-container($local-max-width: $max-width) { 32 | @include clearfix; 33 | max-width: $local-max-width; 34 | margin: { 35 | left: auto; 36 | right: auto; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /sass/neat/grid/_pad.scss: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | 3 | /// Adds padding to the element. 4 | /// 5 | /// @param {List} $padding [flex-gutter()] 6 | /// A list of padding value(s) to use. Passing `default` in the list will result in using the gutter width as a padding value. 7 | /// 8 | /// @example scss - Usage 9 | /// .element { 10 | /// @include pad(30px -20px 10px default); 11 | /// } 12 | /// 13 | /// @example css - CSS Output 14 | /// .element { 15 | /// padding: 30px -20px 10px 2.35765%; 16 | /// } 17 | 18 | @mixin pad($padding: flex-gutter()) { 19 | $padding-list: null; 20 | @each $value in $padding { 21 | $value: if($value == 'default', flex-gutter(), $value); 22 | $padding-list: join($padding-list, $value); 23 | } 24 | padding: $padding-list; 25 | } 26 | -------------------------------------------------------------------------------- /sass/neat/grid/_private.scss: -------------------------------------------------------------------------------- 1 | $parent-columns: $grid-columns !default; 2 | $fg-column: $column; 3 | $fg-gutter: $gutter; 4 | $fg-max-columns: $grid-columns; 5 | $container-display-table: false !default; 6 | $layout-direction: LTR !default; 7 | 8 | @function flex-grid($columns, $container-columns: $fg-max-columns) { 9 | $width: $columns * $fg-column + ($columns - 1) * $fg-gutter; 10 | $container-width: $container-columns * $fg-column + ($container-columns - 1) * $fg-gutter; 11 | @return percentage($width / $container-width); 12 | } 13 | 14 | @function flex-gutter($container-columns: $fg-max-columns, $gutter: $fg-gutter) { 15 | $container-width: $container-columns * $fg-column + ($container-columns - 1) * $fg-gutter; 16 | @return percentage($gutter / $container-width); 17 | } 18 | 19 | @function grid-width($n) { 20 | @return $n * $gw-column + ($n - 1) * $gw-gutter; 21 | } 22 | 23 | @function get-parent-columns($columns) { 24 | @if $columns != $grid-columns { 25 | $parent-columns: $columns !global; 26 | } @else { 27 | $parent-columns: $grid-columns !global; 28 | } 29 | 30 | @return $parent-columns; 31 | } 32 | 33 | @function is-display-table($container-is-display-table, $display) { 34 | @return $container-is-display-table == true or $display == table; 35 | } 36 | -------------------------------------------------------------------------------- /sass/neat/grid/_row.scss: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | 3 | /// Designates the element as a row of columns in the grid layout. It clears the floats on the element and sets its display property. Rows can't be nested, but there can be more than one row element—with different display properties—per layout. 4 | /// 5 | /// @param {String} $display [default] 6 | /// Sets the display property of the element and the display context that will be used by its children. Can be `block` or `table`. 7 | /// 8 | /// @param {String} $direction [$default-layout-direction] 9 | /// Sets the layout direction. Can be `LTR` (left-to-right) or `RTL` (right-to-left). 10 | /// 11 | /// @example scss - Usage 12 | /// .element { 13 | /// @include row(); 14 | /// } 15 | /// 16 | /// @example css - CSS Output 17 | /// .element { 18 | /// *zoom: 1; 19 | /// display: block; 20 | /// } 21 | /// 22 | /// .element:before, .element:after { 23 | /// content: " "; 24 | /// display: table; 25 | /// } 26 | /// 27 | /// .element:after { 28 | /// clear: both; 29 | /// } 30 | 31 | @mixin row($display: default, $direction: $default-layout-direction) { 32 | @if $direction != $default-layout-direction { 33 | @include -neat-warn("The $direction argument will be deprecated in future versions in favor of the direction(){...} mixin."); 34 | } 35 | 36 | $layout-direction: $direction !global; 37 | 38 | @if $display != default { 39 | @include -neat-warn("The $display argument will be deprecated in future versions in favor of the display(){...} mixin."); 40 | } 41 | 42 | @if $display == table { 43 | display: table; 44 | @include fill-parent; 45 | table-layout: fixed; 46 | $container-display-table: true !global; 47 | } @else { 48 | @include clearfix; 49 | display: block; 50 | $container-display-table: false !global; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /sass/neat/grid/_shift.scss: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | 3 | /// Translates an element horizontally by a number of columns. Positive arguments shift the element to the active layout direction, while negative ones shift it to the opposite direction. 4 | /// 5 | /// @param {Number (unitless)} $n-columns [1] 6 | /// Number of columns by which the element shifts. 7 | /// 8 | /// @example scss - Usage 9 | /// .element { 10 | /// @include shift(-3); 11 | /// } 12 | /// 13 | /// @example css - CSS output 14 | /// .element { 15 | /// margin-left: -25.58941%; 16 | /// } 17 | 18 | @mixin shift($n-columns: 1) { 19 | @include shift-in-context($n-columns); 20 | } 21 | 22 | /// Translates an element horizontally by a number of columns, in a specific nesting context. 23 | /// 24 | /// @param {List} $shift 25 | /// A list containing the number of columns to shift (`$columns`) and the number of columns of the parent element (`$container-columns`). 26 | /// 27 | /// The two values can be separated with any string such as `of`, `/`, etc. 28 | /// 29 | /// @example scss - Usage 30 | /// .element { 31 | /// @include shift(-3 of 6); 32 | /// } 33 | /// 34 | /// @example css - CSS output 35 | /// .element { 36 | /// margin-left: -52.41458%; 37 | /// } 38 | 39 | @mixin shift-in-context($shift: $columns of $container-columns) { 40 | $n-columns: nth($shift, 1); 41 | $parent-columns: container-shift($shift) !global; 42 | 43 | $direction: get-direction($layout-direction, $default-layout-direction); 44 | $opposite-direction: get-opposite-direction($direction); 45 | 46 | margin-#{$opposite-direction}: $n-columns * flex-grid(1, $parent-columns) + $n-columns * flex-gutter($parent-columns); 47 | 48 | // Reset nesting context 49 | $parent-columns: $grid-columns !global; 50 | } 51 | -------------------------------------------------------------------------------- /sass/neat/grid/_span-columns.scss: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | 3 | /// Specifies the number of columns an element should span. If the selector is nested the number of columns of its parent element should be passed as an argument as well. 4 | /// 5 | /// @param {List} $span 6 | /// A list containing `$columns`, the unitless number of columns the element spans (required), and `$container-columns`, the number of columns the parent element spans (optional). 7 | /// 8 | /// If only one value is passed, it is assumed that it's `$columns` and that that `$container-columns` is equal to `$grid-columns`, the total number of columns in the grid. 9 | /// 10 | /// The values can be separated with any string such as `of`, `/`, etc. 11 | /// 12 | /// `$columns` also accepts decimals for when it's necessary to break out of the standard grid. E.g. Passing `2.4` in a standard 12 column grid will divide the row into 5 columns. 13 | /// 14 | /// @param {String} $display [block] 15 | /// Sets the display property of the element. By default it sets the display propert of the element to `block`. 16 | /// 17 | /// If passed `block-collapse`, it also removes the margin gutter by adding it to the element width. 18 | /// 19 | /// If passed `table`, it sets the display property to `table-cell` and calculates the width of the element without taking gutters into consideration. The result does not align with the block-based grid. 20 | /// 21 | /// @example scss - Usage 22 | /// .element { 23 | /// @include span-columns(6); 24 | /// 25 | /// .nested-element { 26 | /// @include span-columns(2 of 6); 27 | /// } 28 | /// } 29 | /// 30 | /// @example css - CSS Output 31 | /// .element { 32 | /// display: block; 33 | /// float: left; 34 | /// margin-right: 2.35765%; 35 | /// width: 48.82117%; 36 | /// } 37 | /// 38 | /// .element:last-child { 39 | /// margin-right: 0; 40 | /// } 41 | /// 42 | /// .element .nested-element { 43 | /// display: block; 44 | /// float: left; 45 | /// margin-right: 4.82916%; 46 | /// width: 30.11389%; 47 | /// } 48 | /// 49 | /// .element .nested-element:last-child { 50 | /// margin-right: 0; 51 | /// } 52 | 53 | @mixin span-columns($span: $columns of $container-columns, $display: block) { 54 | $columns: nth($span, 1); 55 | $container-columns: container-span($span); 56 | 57 | $parent-columns: get-parent-columns($container-columns) !global; 58 | 59 | $direction: get-direction($layout-direction, $default-layout-direction); 60 | $opposite-direction: get-opposite-direction($direction); 61 | 62 | $display-table: is-display-table($container-display-table, $display); 63 | 64 | @if $display-table { 65 | display: table-cell; 66 | width: percentage($columns / $container-columns); 67 | } @else { 68 | float: #{$opposite-direction}; 69 | 70 | @if $display != no-display { 71 | display: block; 72 | } 73 | 74 | @if $display == collapse { 75 | @include -neat-warn("The 'collapse' argument will be deprecated. Use 'block-collapse' instead."); 76 | } 77 | 78 | @if $display == collapse or $display == block-collapse { 79 | width: flex-grid($columns, $container-columns) + flex-gutter($container-columns); 80 | 81 | &:last-child { 82 | width: flex-grid($columns, $container-columns); 83 | } 84 | 85 | } @else { 86 | margin-#{$direction}: flex-gutter($container-columns); 87 | width: flex-grid($columns, $container-columns); 88 | 89 | &:last-child { 90 | margin-#{$direction}: 0; 91 | } 92 | } 93 | } 94 | } 95 | -------------------------------------------------------------------------------- /sass/neat/grid/_to-deprecate.scss: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | 3 | @mixin breakpoint($query:$feature $value $columns, $total-columns: $grid-columns) { 4 | @include -neat-warn("The breakpoint() mixin was renamed to media() in Neat 1.0. Please update your project with the new syntax before the next version bump."); 5 | 6 | @if length($query) == 1 { 7 | @media screen and ($default-feature: nth($query, 1)) { 8 | $default-grid-columns: $grid-columns; 9 | $grid-columns: $total-columns; 10 | @content; 11 | $grid-columns: $default-grid-columns; 12 | } 13 | } @else if length($query) == 2 { 14 | @media screen and (nth($query, 1): nth($query, 2)) { 15 | $default-grid-columns: $grid-columns; 16 | $grid-columns: $total-columns; 17 | @content; 18 | $grid-columns: $default-grid-columns; 19 | } 20 | } @else if length($query) == 3 { 21 | @media screen and (nth($query, 1): nth($query, 2)) { 22 | $default-grid-columns: $grid-columns; 23 | $grid-columns: nth($query, 3); 24 | @content; 25 | $grid-columns: $default-grid-columns; 26 | } 27 | } @else if length($query) == 4 { 28 | @media screen and (nth($query, 1): nth($query, 2)) and (nth($query, 3): nth($query, 4)) { 29 | $default-grid-columns: $grid-columns; 30 | $grid-columns: $total-columns; 31 | @content; 32 | $grid-columns: $default-grid-columns; 33 | } 34 | } @else if length($query) == 5 { 35 | @media screen and (nth($query, 1): nth($query, 2)) and (nth($query, 3): nth($query, 4)) { 36 | $default-grid-columns: $grid-columns; 37 | $grid-columns: nth($query, 5); 38 | @content; 39 | $grid-columns: $default-grid-columns; 40 | } 41 | } @else { 42 | @include -neat-warn("Wrong number of arguments for breakpoint(). Read the documentation for more details."); 43 | } 44 | } 45 | 46 | @mixin nth-omega($nth, $display: block, $direction: default) { 47 | @include -neat-warn("The nth-omega() mixin is deprecated. Please use omega() instead."); 48 | @include omega($nth $display, $direction); 49 | } 50 | 51 | /// Resets the active display property to `block`. Particularly useful when changing the display property in a single row. 52 | /// 53 | /// @example scss - Usage 54 | /// .element { 55 | /// @include row(table); 56 | /// // Context changed to table display 57 | /// } 58 | /// 59 | /// @include reset-display; 60 | /// // Context is reset to block display 61 | 62 | @mixin reset-display { 63 | $container-display-table: false !global; 64 | @include -neat-warn("Resetting $display will be deprecated in future versions in favor of the display(){...} mixin."); 65 | } 66 | 67 | /// Resets the active layout direction to the default value set in `$default-layout-direction`. Particularly useful when changing the layout direction in a single row. 68 | /// 69 | /// @example scss - Usage 70 | /// .element { 71 | /// @include row($direction: RTL); 72 | /// // Context changed to right-to-left 73 | /// } 74 | /// 75 | /// @include reset-layout-direction; 76 | /// // Context is reset to left-to-right 77 | 78 | @mixin reset-layout-direction { 79 | $layout-direction: $default-layout-direction !global; 80 | @include -neat-warn("Resetting $direction will be deprecated in future versions in favor of the direction(){...} mixin."); 81 | } 82 | 83 | /// Resets both the active layout direction and the active display property. 84 | /// 85 | /// @example scss - Usage 86 | /// .element { 87 | /// @include row(table, RTL); 88 | /// // Context changed to table table and right-to-left 89 | /// } 90 | /// 91 | /// @include reset-all; 92 | /// // Context is reset to block display and left-to-right 93 | 94 | @mixin reset-all { 95 | @include reset-display; 96 | @include reset-layout-direction; 97 | } 98 | -------------------------------------------------------------------------------- /sass/neat/grid/_visual-grid.scss: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | 3 | @mixin grid-column-gradient($values...) { 4 | background-image: -webkit-linear-gradient(left, $values); 5 | background-image: -moz-linear-gradient(left, $values); 6 | background-image: -ms-linear-gradient(left, $values); 7 | background-image: -o-linear-gradient(left, $values); 8 | background-image: unquote("linear-gradient(to left, #{$values})"); 9 | } 10 | 11 | @if $visual-grid == true or $visual-grid == yes { 12 | body:before { 13 | @include grid-column-gradient(gradient-stops($grid-columns)); 14 | content: ""; 15 | display: inline-block; 16 | height: 100%; 17 | left: 0; 18 | margin: 0 auto; 19 | max-width: $max-width; 20 | opacity: $visual-grid-opacity; 21 | pointer-events: none; 22 | position: fixed; 23 | right: 0; 24 | width: 100%; 25 | 26 | @if $visual-grid-index == back { 27 | z-index: -1; 28 | } 29 | 30 | @else if $visual-grid-index == front { 31 | z-index: 9999; 32 | } 33 | 34 | @each $breakpoint in $visual-grid-breakpoints { 35 | @if $breakpoint { 36 | @include media($breakpoint) { 37 | @include grid-column-gradient(gradient-stops($grid-columns)); 38 | } 39 | } 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /sass/neat/settings/_disable-warnings.scss: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | 3 | /// Disable all deprecation warnings. Defaults to `false`. Set with a `!global` flag. 4 | /// 5 | /// @type Bool 6 | 7 | $disable-warnings: false !default; 8 | 9 | @mixin -neat-warn($message) { 10 | @if $disable-warnings == false { 11 | @warn "#{$message}"; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /sass/neat/settings/_grid.scss: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | 3 | /// Sets the relative width of a single grid column. The unit used should be the same one used to define `$gutter`. To learn more about modular-scale() see [Bourbon docs](http://bourbon.io/docs/#modular-scale). Set with a `!global` flag. 4 | /// 5 | /// @type Number (Unit) 6 | 7 | $column: modular-scale(3, 1em, $golden) !default; 8 | 9 | /// Sets the relative width of a single grid gutter. The unit used should be the same one used to define `$column`. To learn more about modular-scale() see [Bourbon docs](http://bourbon.io/docs/#modular-scale). Set with the `!global` flag. 10 | /// 11 | /// @type Number (Unit) 12 | 13 | $gutter: modular-scale(1, 1em, $golden) !default; 14 | 15 | /// Sets the total number of columns in the grid. Its value can be overridden inside a media query using the `media()` mixin. Set with the `!global` flag. 16 | /// 17 | /// @type Number (Unitless) 18 | 19 | $grid-columns: 12 !default; 20 | 21 | /// Sets the max-width property of the element that includes `outer-container()`. To learn more about `em()` see [Bourbon docs](http://bourbon.io/docs/#px-to-em). Set with the `!global` flag. 22 | /// 23 | /// @type Number (Unit) 24 | /// 25 | $max-width: em(1088) !default; 26 | 27 | /// When set to true, it sets the box-sizing property of all elements to `border-box`. Set with a `!global` flag. 28 | /// 29 | /// @type Bool 30 | /// 31 | /// @example css - CSS Output 32 | /// html { 33 | /// box-sizing: border-box; } 34 | /// 35 | /// *, *::after, *::before { 36 | /// box-sizing: inherit; 37 | /// } 38 | 39 | $border-box-sizing: true !default; 40 | 41 | /// Sets the default [media feature](http://www.w3.org/TR/css3-mediaqueries/#media) that `media()` and `new-breakpoint()` revert to when only a breakpoint value is passed. Set with a `!global` flag. 42 | /// 43 | /// @type String 44 | 45 | $default-feature: min-width; // Default @media feature for the breakpoint() mixin 46 | 47 | ///Sets the default layout direction of the grid. Can be `LTR` or `RTL`. Set with a `!global` flag. 48 | /// 49 | ///@type String 50 | 51 | $default-layout-direction: LTR !default; 52 | -------------------------------------------------------------------------------- /sass/neat/settings/_visual-grid.scss: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | 3 | /// Displays the visual grid when set to true. The overlaid grid may be few pixels off depending on the browser's rendering engine and pixel rounding algorithm. Set with the `!global` flag. 4 | /// 5 | /// @type Bool 6 | 7 | $visual-grid: false !default; 8 | 9 | /// Sets the visual grid color. Set with `!global` flag. 10 | /// 11 | /// @type Color 12 | 13 | $visual-grid-color: #eee !default; 14 | 15 | /// Sets the `z-index` property of the visual grid. Can be `back` (behind content) or `front` (in front of content). Set with `!global` flag. 16 | /// 17 | /// @type String 18 | 19 | $visual-grid-index: back !default; 20 | 21 | /// Sets the opacity property of the visual grid. Set with `!global` flag. 22 | /// 23 | /// @type Number (unitless) 24 | 25 | $visual-grid-opacity: 0.4 !default; 26 | 27 | $visual-grid-breakpoints: () !default; 28 | -------------------------------------------------------------------------------- /sass/scratchx.scss: -------------------------------------------------------------------------------- 1 | @import "bourbon/bourbon"; 2 | @import "base/grid-settings"; 3 | @import "neat/neat"; 4 | @import "base/base"; 5 | 6 | 7 | a[href=""] { 8 | outline: 1px solid red; 9 | } 10 | 11 | article header h1 { 12 | text-align: center; 13 | } 14 | 15 | article header p { 16 | text-align: center; 17 | } 18 | 19 | article header h1 + p { 20 | font-size: 1.125em; 21 | margin-bottom: 1.5em; 22 | @include span-columns(10); 23 | @include shift(1); 24 | } 25 | 26 | body > main > article > section { 27 | ul { 28 | @extend %default-ul; 29 | } 30 | 31 | } 32 | 33 | body > main { 34 | > header, 35 | > article > header, 36 | > article > section, 37 | > footer { 38 | > div { 39 | @include outer-container; 40 | > div { 41 | @include row(); 42 | margin-bottom: 3em; 43 | .main { 44 | @include span-columns(8); 45 | h1 { 46 | font-size: 2em 47 | } 48 | h2, h3, h4, h5, h6 { 49 | margin: 1em 0 0.25em 0; 50 | } 51 | } 52 | nav { 53 | border-left: 1px solid $base-border-color; 54 | @include span-columns(4); 55 | @include pad(0 0 0 2 * $gutter) 56 | } 57 | } 58 | } 59 | } 60 | } 61 | 62 | section.intro { 63 | @include outer-container; 64 | > div { 65 | @include row(); 66 | 67 | > div { 68 | text-align: center; 69 | @include span-columns(10); 70 | @include shift(1); 71 | margin-bottom: 0; 72 | } 73 | } 74 | } 75 | 76 | body { 77 | > main > article, 78 | > section { 79 | display: none; 80 | } 81 | #home { 82 | display: block; 83 | } 84 | } 85 | 86 | .modal dialog { 87 | width: 25em; 88 | float: left; 89 | margin-right: $gutter; 90 | 91 | &:last-child { 92 | margin-right: auto; 93 | } 94 | } 95 | 96 | 97 | dialog { 98 | display: block; 99 | position: static; 100 | overflow: hidden; 101 | border-radius: $base-border-radius; 102 | text-align: center; 103 | 104 | h2 { 105 | text-align: center; 106 | margin: 4 * $vertical-base 0 $vertical-base 0; 107 | } 108 | 109 | section { 110 | background-color: $alt-background-color; 111 | color: $alt-font-color; 112 | padding: 4 * $vertical-base; 113 | } 114 | 115 | section:last-child { 116 | background-color: $base-background-color; 117 | padding: 4 * $vertical-base; 118 | color: $base-font-color; 119 | } 120 | 121 | button { 122 | display: inline-block; 123 | line-height: normal; 124 | width: 100%; 125 | padding: $vertical-base; 126 | /* 127 | Needed so that all buttons are the same height 128 | as text inputs 129 | */ 130 | border: 1px solid; 131 | } 132 | 133 | } 134 | 135 | 136 | dialog.with-icon { 137 | section:first-child { 138 | /* Add a border equal to the number of featured extensions - 1 */ 139 | border-top: 2px solid $alt-background-color; 140 | position: relative; 141 | padding-top: 18 * $vertical-base; 142 | 143 | &:before { 144 | background-color: $blue; 145 | color: $white; 146 | top: 2 * $vertical-base 147 | } 148 | 149 | } 150 | } 151 | 152 | .extension-file { 153 | &.with-icon section:first-child { 154 | @include icon(before, upload, circular, true, 8*$vertical-base) { 155 | background-color: $green; 156 | } 157 | } 158 | 159 | button { 160 | background-color: $green; 161 | color: $alt-font-color; 162 | } 163 | } 164 | 165 | .extension-url { 166 | &.with-icon section:first-child { 167 | @include icon(before, link, circular, true, 8*$vertical-base); 168 | } 169 | } 170 | 171 | .extension-warning { 172 | &.with-icon section:first-child { 173 | @include icon(before, warning, circular, true, 8*$vertical-base) { 174 | background-color: $yellow; 175 | color: $dark-gray; 176 | } 177 | } 178 | 179 | button { 180 | width: 49%; 181 | display: inline-block; 182 | margin-top: 2 * $vertical-base; 183 | } 184 | } 185 | 186 | .extension-feature { 187 | section:first-child { 188 | h2 { 189 | margin-top: $vertical-base; 190 | } 191 | } 192 | 193 | section:last-child { 194 | padding: 0px; 195 | } 196 | 197 | ul { 198 | li { 199 | border-bottom: 1px solid $light-gray; 200 | padding: 2 * $vertical-base; 201 | 202 | a { 203 | position: relative; 204 | display: block; 205 | padding-right: 25px; 206 | @include icon(before, right-arrow) { 207 | color: $blue; 208 | position: absolute; 209 | right: 0; 210 | top: 50%; 211 | margin-top: -.5em; 212 | font-size: 1.5em; 213 | } 214 | } 215 | 216 | h3 { 217 | font-size: 1.125 * $base-font-size; 218 | font-weight: 600; 219 | margin-bottom: $vertical-base; 220 | } 221 | 222 | p { 223 | text-align: left; 224 | margin: 0; 225 | color: $base-font-color; 226 | font-weight: normal; 227 | } 228 | } 229 | } 230 | } 231 | 232 | footer { 233 | @include pad(5 * $vertical-base 0); 234 | section { 235 | @include span-columns(4); 236 | @include shift(1); 237 | } 238 | 239 | nav { 240 | @include span-columns(2); 241 | &:first-of-type { 242 | @include shift(1); 243 | } 244 | h2 { 245 | line-height: 1.5; 246 | margin-bottom: 0; 247 | } 248 | } 249 | } 250 | 251 | footer, main header { 252 | background-color: $alt-background-color; 253 | color: $alt-font-color; 254 | } 255 | 256 | 257 | body > main > header { 258 | @include row(); 259 | height: $vertical-base * 10; 260 | line-height: $vertical-base * 10; 261 | position: relative; 262 | } 263 | 264 | body > main > article { 265 | padding-top: $vertical-base * 10; 266 | margin-top: -$vertical-base * 10; 267 | } 268 | 269 | .scratchx-logo { 270 | float: left; 271 | margin-bottom: 0; 272 | 273 | span { 274 | @include hide-text; 275 | display: inline-block; 276 | background: url(../images/scratchx-logo.png) left center no-repeat; 277 | width: 192px; 278 | height: $vertical-base * 10; 279 | } 280 | } 281 | 282 | .main-nav { 283 | float: right; 284 | 285 | ul, li { 286 | display: inline-block; 287 | } 288 | li { 289 | margin-left: 50px; 290 | } 291 | } 292 | 293 | .message { 294 | border-radius: $base-border-radius; 295 | text-align: center; 296 | margin: $vertical-base * 4 0; 297 | padding: $vertical-base * 2; 298 | } 299 | 300 | .warning { 301 | background-color: $yellow; 302 | color: $dark-gray; 303 | } 304 | 305 | .info { 306 | background-color: $light-gray; 307 | color: $dark-gray; 308 | } 309 | 310 | .success { 311 | background-color: $green; 312 | color: $white; 313 | } 314 | 315 | .twitter, .github { 316 | display: block; 317 | float: left; 318 | margin-right: 2 * $gutter; 319 | span { 320 | display: none; 321 | } 322 | } 323 | 324 | .twitter { 325 | @include icon(before, twitter, circular, false, 4 * $vertical-base){ 326 | display: inline-block; 327 | line-height: 5 * $vertical-base; 328 | width: 5 * $vertical-base; 329 | height: 5 * $vertical-base; 330 | border-radius: 2.5 * $vertical-base; 331 | background-color: $blue; 332 | color: $white; 333 | } 334 | } 335 | 336 | .github { 337 | @include icon(before, github, circular, false, 4 * $vertical-base){ 338 | display: inline-block; 339 | line-height: 5 * $vertical-base; 340 | width: 5 * $vertical-base; 341 | height: 5 * $vertical-base; 342 | border-radius: 2.5 * $vertical-base; 343 | background-color: $blue; 344 | color: $white; 345 | } 346 | } 347 | 348 | 349 | @import "home"; 350 | @import "editor"; 351 | @import "gallery"; 352 | -------------------------------------------------------------------------------- /scratch_extensions/picoExtension.js: -------------------------------------------------------------------------------- 1 | // picoExtension.js 2 | // Shane M. Clements, February 2014 3 | // PicoBoard Scratch Extension 4 | // 5 | // This is an extension for development and testing of the Scratch Javascript Extension API. 6 | 7 | (function (ext) { 8 | var device = null; 9 | var rawData = null; 10 | 11 | // Sensor states: 12 | var channels = { 13 | slider: 7, 14 | light: 5, 15 | sound: 6, 16 | button: 3, 17 | 'resistance-A': 4, 18 | 'resistance-B': 2, 19 | 'resistance-C': 1, 20 | 'resistance-D': 0 21 | }; 22 | var inputs = { 23 | slider: 0, 24 | light: 0, 25 | sound: 0, 26 | button: 0, 27 | 'resistance-A': 0, 28 | 'resistance-B': 0, 29 | 'resistance-C': 0, 30 | 'resistance-D': 0 31 | }; 32 | 33 | // Hats / triggers 34 | ext.whenSensorConnected = function (which) { 35 | return getSensorPressed(which); 36 | }; 37 | 38 | ext.whenSensorPass = function (which, sign, level) { 39 | if (sign == '<') return getSensor(which) < level; 40 | return getSensor(which) > level; 41 | }; 42 | 43 | // Reporters 44 | ext.sensorPressed = function (which) { 45 | return getSensorPressed(which); 46 | }; 47 | 48 | ext.sensor = function (which) { 49 | return getSensor(which); 50 | }; 51 | 52 | // Private logic 53 | function getSensorPressed(which) { 54 | if (device == null) return false; 55 | if (which == 'button pressed' && getSensor('button') < 1) return true; 56 | if (which == 'A connected' && getSensor('resistance-A') < 10) return true; 57 | if (which == 'B connected' && getSensor('resistance-B') < 10) return true; 58 | if (which == 'C connected' && getSensor('resistance-C') < 10) return true; 59 | if (which == 'D connected' && getSensor('resistance-D') < 10) return true; 60 | return false; 61 | } 62 | 63 | function getSensor(which) { 64 | return inputs[which]; 65 | } 66 | 67 | var inputArray = []; 68 | 69 | function processData() { 70 | var bytes = new Uint8Array(rawData); 71 | 72 | inputArray[15] = 0; 73 | 74 | // TODO: make this robust against misaligned packets. 75 | // Right now there's no guarantee that our 18 bytes start at the beginning of a message. 76 | // Maybe we should treat the data as a stream of 2-byte packets instead of 18-byte packets. 77 | // That way we could just check the high bit of each byte to verify that we're aligned. 78 | for (var i = 0; i < 9; ++i) { 79 | var hb = bytes[i * 2] & 127; 80 | var channel = hb >> 3; 81 | var lb = bytes[i * 2 + 1] & 127; 82 | inputArray[channel] = ((hb & 7) << 7) + lb; 83 | } 84 | 85 | if (watchdog && (inputArray[15] == 0x04)) { 86 | // Seems to be a valid PicoBoard. 87 | clearTimeout(watchdog); 88 | watchdog = null; 89 | } 90 | 91 | for (var name in inputs) { 92 | var v = inputArray[channels[name]]; 93 | if (name == 'light') { 94 | v = (v < 25) ? 100 - v : Math.round((1023 - v) * (75 / 998)); 95 | } 96 | else if (name == 'sound') { 97 | //empirically tested noise sensor floor 98 | v = Math.max(0, v - 18); 99 | v = (v < 50) ? v / 2 : 100 | //noise ceiling 101 | 25 + Math.min(75, Math.round((v - 50) * (75 / 580))); 102 | } 103 | else { 104 | v = (100 * v) / 1023; 105 | } 106 | 107 | inputs[name] = v; 108 | } 109 | 110 | //console.log(inputs); 111 | rawData = null; 112 | } 113 | 114 | function appendBuffer(buffer1, buffer2) { 115 | var tmp = new Uint8Array(buffer1.byteLength + buffer2.byteLength); 116 | tmp.set(new Uint8Array(buffer1), 0); 117 | tmp.set(new Uint8Array(buffer2), buffer1.byteLength); 118 | return tmp.buffer; 119 | } 120 | 121 | // Extension API interactions 122 | var potentialDevices = []; 123 | ext._deviceConnected = function (dev) { 124 | potentialDevices.push(dev); 125 | 126 | if (!device) { 127 | tryNextDevice(); 128 | } 129 | }; 130 | 131 | function tryNextDevice() { 132 | // If potentialDevices is empty, device will be undefined. 133 | // That will get us back here next time a device is connected. 134 | device = potentialDevices.shift(); 135 | 136 | if (device) { 137 | device.open({stopBits: 0, bitRate: 38400, ctsFlowControl: 0}, deviceOpened); 138 | } 139 | } 140 | 141 | var poller = null; 142 | var watchdog = null; 143 | 144 | function deviceOpened(dev) { 145 | if (!dev) { 146 | // Opening the port failed. 147 | tryNextDevice(); 148 | return; 149 | } 150 | device.set_receive_handler(function (data) { 151 | //console.log('Received: ' + data.byteLength); 152 | if (!rawData || rawData.byteLength == 18) { 153 | rawData = new Uint8Array(data); 154 | } else { 155 | rawData = appendBuffer(rawData, data); 156 | } 157 | 158 | if (rawData.byteLength >= 18) { 159 | //console.log(rawData); 160 | processData(); 161 | //device.send(pingCmd.buffer); 162 | } 163 | }); 164 | 165 | // Tell the PicoBoard to send a input data every 50ms 166 | var pingCmd = new Uint8Array(1); 167 | pingCmd[0] = 1; 168 | poller = setInterval(function () { 169 | device.send(pingCmd.buffer); 170 | }, 50); 171 | watchdog = setTimeout(function () { 172 | // This device didn't get good data in time, so give up on it. Clean up and then move on. 173 | // If we get good data then we'll terminate this watchdog. 174 | clearInterval(poller); 175 | poller = null; 176 | device.set_receive_handler(null); 177 | device.close(); 178 | device = null; 179 | tryNextDevice(); 180 | }, 250); 181 | } 182 | 183 | ext._deviceRemoved = function (dev) { 184 | if (device != dev) return; 185 | if (poller) poller = clearInterval(poller); 186 | device = null; 187 | }; 188 | 189 | ext._shutdown = function () { 190 | if (device) device.close(); 191 | if (poller) poller = clearInterval(poller); 192 | device = null; 193 | }; 194 | 195 | ext._getStatus = function () { 196 | if (!device) return {status: 1, msg: 'PicoBoard disconnected'}; 197 | if (watchdog) return {status: 1, msg: 'Probing for PicoBoard'}; 198 | return {status: 2, msg: 'PicoBoard connected'}; 199 | }; 200 | 201 | var descriptor = { 202 | blocks: [ 203 | ['h', 'when %m.booleanSensor', 'whenSensorConnected', 'button pressed'], 204 | ['h', 'when %m.sensor %m.lessMore %n', 'whenSensorPass', 'slider', '>', 50], 205 | ['b', 'sensor %m.booleanSensor?', 'sensorPressed', 'button pressed'], 206 | ['r', '%m.sensor sensor value', 'sensor', 'slider'] 207 | ], 208 | menus: { 209 | booleanSensor: ['button pressed', 'A connected', 'B connected', 'C connected', 'D connected'], 210 | sensor: ['slider', 'light', 'sound', 'resistance-A', 'resistance-B', 'resistance-C', 'resistance-D'], 211 | lessMore: ['>', '<'] 212 | }, 213 | url: '/info/help/studio/tips/ext/PicoBoard/' 214 | }; 215 | ScratchExtensions.register('PicoBoard', descriptor, ext, {type: 'serial'}); 216 | })({}); 217 | -------------------------------------------------------------------------------- /scratch_extensions/scratch_deviceManager.js: -------------------------------------------------------------------------------- 1 | // Communicate with the Scratch Device Manager through Socket.IO 2 | window.ScratchDeviceManager = new (function () { 3 | var instance = this; 4 | var sockets = []; 5 | 6 | // Assume it's OK until we find out otherwise 7 | var isConnected = true; 8 | 9 | // device-manager.scratch.mit.edu = 127.0.0.1 10 | instance.deviceManagerHost = 'https://device-manager.scratch.mit.edu:3030'; 11 | 12 | // work around https://github.com/socketio/socket.io-client/issues/812 13 | function connectNamespace(namespace) { 14 | return io(instance.deviceManagerHost + namespace, {forceNew: true}); 15 | } 16 | 17 | function onClose(){ 18 | for(var i=0; i= 0) { 60 | sockets.splice(socketIndex, 1); 61 | } 62 | // If this is the first event on this socket then respond with failure. 63 | if (clearOpenTimeout()) { 64 | callback(null); 65 | } 66 | } 67 | 68 | function onTimeout () { 69 | // This will trigger `onDisconnect()` 70 | socket.disconnect(); 71 | } 72 | 73 | // If the timeout is still pending, clear it and return true. Otherwise, return false. 74 | // Callers can use the return value to determine whether they are the first to respond on this socket. 75 | function clearOpenTimeout () { 76 | if (openTimeout !== null) { 77 | clearTimeout(openTimeout); 78 | openTimeout = null; 79 | return true; 80 | } 81 | else { 82 | return false; 83 | } 84 | } 85 | 86 | var socket = connectNamespace('/' + deviceType); 87 | sockets.push(socket); 88 | 89 | socket.on('deviceWasOpened', onDeviceWasOpened); 90 | socket.on('disconnect', onDisconnect); 91 | var openTimeout = setTimeout(onTimeout, 10 * 1000); 92 | 93 | socket.emit('open', {deviceId: deviceId, name: ext_name}); 94 | }; 95 | 96 | instance.isConnected = function () { 97 | return isConnected; 98 | }; 99 | })(); 100 | -------------------------------------------------------------------------------- /scratch_extensions/scratch_nmh.js: -------------------------------------------------------------------------------- 1 | // Communicate with the Scratch Native Messaging Host through an extension. 2 | window.ScratchDeviceHost = new (function () { 3 | var self = this; 4 | var isConnected = false; 5 | 6 | self.isAvailable = function () { 7 | return isConnected; 8 | }; 9 | 10 | if (!(window.chrome && window.chrome.runtime && window.chrome.runtime.connect)) { 11 | return; 12 | } 13 | 14 | var extensionID = 'clmabinlolakdafkoajkfjjengcdmnpm'; 15 | var callNumber = 0; 16 | var port = chrome.runtime.connect(extensionID); 17 | console.assert(port, "Failed to create port"); 18 | 19 | var messageHandlers = {}; 20 | port.onMessage.addListener(function (message) { 21 | var messageName = message[0]; 22 | if (messageName == "@") { 23 | var callbackToken = message[1]; 24 | var returnValue = message[2]; 25 | var callback = pendingCallbacks[callbackToken]; 26 | delete pendingCallbacks[callbackToken]; 27 | if (callback) callback(returnValue); 28 | } else { 29 | var handler = messageHandlers[messageName]; 30 | if (handler) { 31 | handler(message); 32 | } else { 33 | console.log("SDH-Page: Unrecognized message " + message); 34 | } 35 | } 36 | }); 37 | 38 | messageHandlers["serialRecv"] = function (message) { 39 | var path = message[1]; 40 | var data = message[2]; 41 | 42 | var device = serialDevices[path]; 43 | if (device && device.receiveHandler) { 44 | device.receiveHandler(data); 45 | } 46 | }; 47 | 48 | messageHandlers["serialError"] = function (message) { 49 | var path = message[1]; 50 | var errorMessage = message[2]; 51 | 52 | var device = serialDevices[path]; 53 | if (device && device.errorHandler) { 54 | device.errorHandler(errorMessage); 55 | } 56 | }; 57 | 58 | var pendingCallbacks = {}; 59 | 60 | function sendMessage(message, callback) { 61 | var callbackToken = (callNumber++).toString(); 62 | pendingCallbacks[callbackToken] = callback; 63 | port.postMessage([callbackToken, message]); 64 | } 65 | 66 | sendMessage(["version"], function (version) { 67 | isConnected = true; 68 | }); 69 | 70 | self.hid_list = function (callback, opt_vendorID, opt_productID) { 71 | var message = ["hid_list", opt_vendorID || 0, opt_productID || 0]; 72 | sendMessage(message, function (deviceList) { 73 | if (callback) callback(deviceList); 74 | }); 75 | }; 76 | self.hid_open = function (path, callback) { 77 | var message = ["hid_open_raw", path]; 78 | sendMessage(message, function (result) { 79 | var device; 80 | if (result) { 81 | device = new HidDevice(path); 82 | ScratchProxies.AddHidProxies(device); 83 | var claimMessage = ["claim", path]; 84 | sendMessage(claimMessage); 85 | } 86 | if (callback) callback(device); 87 | }); 88 | }; 89 | self.serial_list = function (callback) { 90 | sendMessage(["serial_list"], function (deviceList) { 91 | if (callback) callback(deviceList); 92 | }); 93 | }; 94 | self.serial_open = function (path, opts, callback) { 95 | var message = ["serial_open_raw", path]; 96 | if (opts) message.push(opts); 97 | sendMessage(message, function (result) { 98 | var device; 99 | if (result) { 100 | device = new SerialDevice(path); 101 | ScratchProxies.AddSerialProxies(device); 102 | var claimMessage = ["claim", path]; 103 | sendMessage(claimMessage); 104 | } 105 | if (callback) callback(device); 106 | }); 107 | }; 108 | self.reset = function () { 109 | sendMessage(["reset"]); 110 | }; 111 | self.version = function (callback) { 112 | sendMessage(["version"], function (result) { 113 | if (callback) callback(result); 114 | }); 115 | }; 116 | 117 | function HidDevice(path) { 118 | var self = this; 119 | 120 | self.write_raw = function (arrayBuffer, callback) { 121 | var message = ["write_raw", path, arrayBuffer]; 122 | sendMessage(message, function (result) { 123 | if (callback) callback(result); 124 | }); 125 | }; 126 | self.send_feature_report_raw = function (arrayBuffer, callback) { 127 | var message = ["send_feature_report_raw", path, arrayBuffer]; 128 | sendMessage(message, function (result) { 129 | if (callback) callback(result); 130 | }); 131 | }; 132 | self.read_raw = function (size, callback) { 133 | var message = ["read_raw", path, size]; 134 | sendMessage(message, function (data) { 135 | if (callback) callback(data); 136 | }); 137 | }; 138 | self.get_feature_report_raw = function (size, callback) { 139 | var message = ["get_feature_report_raw", path, size]; 140 | sendMessage(message, function (data) { 141 | if (callback) callback(data); 142 | }); 143 | }; 144 | self.set_nonblocking = function (flag, callback) { 145 | var message = ["set_nonblocking", path, flag]; 146 | sendMessage(message, function (result) { 147 | if (callback) callback(result); 148 | }); 149 | }; 150 | self.close = function () { 151 | sendMessage(["close", path]); 152 | }; 153 | } 154 | 155 | var serialDevices = {}; // path -> SerialDevice 156 | function SerialDevice(path) { 157 | var self = this; 158 | 159 | self.receiveHandler = undefined; 160 | self.errorHandler = undefined; 161 | 162 | serialDevices[path] = self; 163 | 164 | self.send_raw = function (data) { 165 | var message = ["serial_send_raw", path, data]; 166 | sendMessage(message); 167 | }; 168 | self.close = function () { 169 | var message = ["serial_close", path]; 170 | sendMessage(message); 171 | }; 172 | self.is_open = function (callback) { 173 | var message = ["serial_is_open", path]; 174 | sendMessage(message, function (result) { 175 | if (callback) callback(result); 176 | }); 177 | }; 178 | self.set_receive_handler_raw = function (callback) { 179 | self.receiveHandler = callback; 180 | var message = ["serial_recv_start", path]; 181 | sendMessage(message); 182 | }; 183 | self.set_error_handler = function (callback) { 184 | self.errorHandler = callback; 185 | }; 186 | } 187 | })(); 188 | -------------------------------------------------------------------------------- /scratch_extensions/scratch_plugin.js: -------------------------------------------------------------------------------- 1 | window.ScratchPlugin = new (function () { 2 | var self = this; 3 | 4 | var pluginName = 'Scratch Device Plugin'; // will be 'Scratch Plugin for Devices' 5 | self.useActiveX = window.hasOwnProperty('ActiveXObject'); 6 | self.axObjectName = 'MITMediaLab.ScratchDevicePlugin'; // name of ActiveX object 7 | self.isAvailable = function () { 8 | return !!(self.useActiveX || navigator.plugins[pluginName]); 9 | }; 10 | 11 | // These wrappers make the plugin act asynchronous, matching the API found in AIR and NMH. 12 | // The one difference is that callbacks are triggered before the initiating call returns. 13 | self.PluginWrapper = function (plugin) { 14 | var self = this; 15 | self.hid_list = function (callback, opt_vendorID, opt_productID) { 16 | var deviceList = plugin.hid_list(opt_vendorID, opt_productID); 17 | if (callback) callback(deviceList); 18 | }; 19 | self.hid_open = function (path, callback) { 20 | var device = plugin.hid_open_raw(path); 21 | if (device) { 22 | device = new HidWrapper(device); 23 | ScratchProxies.AddHidProxies(device); 24 | } 25 | if (callback) callback(device); 26 | }; 27 | self.serial_list = function (callback) { 28 | var deviceList = plugin.serial_list(); 29 | if (callback) callback(deviceList); 30 | }; 31 | self.serial_open = function (path, opts, callback) { 32 | var device = plugin.serial_open_raw(path, opts); 33 | if (device) { 34 | device = new SerialWrapper(device); 35 | ScratchProxies.AddSerialProxies(device); 36 | } 37 | if (callback) callback(device); 38 | }; 39 | self.reset = function () { 40 | plugin.reset(); 41 | }; 42 | self.version = function (callback) { 43 | var result = plugin.version(); 44 | if (callback) callback(result); 45 | }; 46 | }; 47 | 48 | function HidWrapper(device) { 49 | var self = this; 50 | 51 | self.write_raw = function (arrayBuffer, callback) { 52 | var result = device.write_raw(arrayBuffer); 53 | if (callback) callback(result); 54 | }; 55 | self.send_feature_report_raw = function (arrayBuffer, callback) { 56 | var result = device.send_feature_report_raw(arrayBuffer); 57 | if (callback) callback(result); 58 | }; 59 | self.read_raw = function (size, callback) { 60 | var data = device.read_raw(size); 61 | if (callback) callback(data); 62 | }; 63 | self.get_feature_report_raw = function (size, callback) { 64 | var data = device.get_feature_report_raw(size); 65 | if (callback) callback(data); 66 | }; 67 | self.set_nonblocking = function (flag, callback) { 68 | var result = device.set_nonblocking(flag); 69 | if (callback) callback(result); 70 | }; 71 | self.close = function () { 72 | device.close(); 73 | }; 74 | } 75 | 76 | function SerialWrapper(device) { 77 | var self = this; 78 | 79 | self.send_raw = function (data) { 80 | device.send_raw(data); 81 | }; 82 | self.close = function () { 83 | device.close(); 84 | }; 85 | self.is_open = function (callback) { 86 | var result = device.is_open(); 87 | if (callback) callback(result); 88 | }; 89 | self.set_receive_handler_raw = function (callback) { 90 | device.set_receive_handler_raw(callback); 91 | }; 92 | self.set_error_handler = function (callback) { 93 | device.set_error_handler(callback); 94 | }; 95 | } 96 | })(); 97 | -------------------------------------------------------------------------------- /scratch_extensions/scratch_proxies.js: -------------------------------------------------------------------------------- 1 | // Extend hardware devices with some hardware-API-agnostic data conversion wrappers 2 | window.ScratchProxies = new (function () { 3 | var self = this; 4 | var charsBase64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; 5 | 6 | function ab_to_b64(arraybuffer) { 7 | var bytes = new Uint8Array(arraybuffer), i, len = bytes.length, base64 = ''; 8 | 9 | for (i = 0; i < len; i += 3) { 10 | base64 += charsBase64[bytes[i] >> 2]; 11 | base64 += charsBase64[((bytes[i] & 3) << 4) | (bytes[i + 1] >> 4)]; 12 | base64 += charsBase64[((bytes[i + 1] & 15) << 2) | (bytes[i + 2] >> 6)]; 13 | base64 += charsBase64[bytes[i + 2] & 63]; 14 | } 15 | 16 | if ((len % 3) === 2) { 17 | base64 = base64.substring(0, base64.length - 1) + '='; 18 | } else if (len % 3 === 1) { 19 | base64 = base64.substring(0, base64.length - 2) + '=='; 20 | } 21 | 22 | return base64; 23 | } 24 | 25 | function b64_to_ab(base64) { 26 | var bufferLength = base64.length * 0.75, len = base64.length, i, p = 0, encoded1, encoded2, encoded3, encoded4; 27 | if (base64[base64.length - 1] === '=') { 28 | --bufferLength; 29 | if (base64[base64.length - 2] === '=') { 30 | --bufferLength; 31 | } 32 | } 33 | 34 | var arraybuffer = new ArrayBuffer(bufferLength), bytes = new Uint8Array(arraybuffer); 35 | for (i = 0; i < len; i += 4) { 36 | encoded1 = charsBase64.indexOf(base64[i]); 37 | encoded2 = charsBase64.indexOf(base64[i + 1]); 38 | encoded3 = charsBase64.indexOf(base64[i + 2]); 39 | encoded4 = charsBase64.indexOf(base64[i + 3]); 40 | bytes[p++] = (encoded1 << 2) | (encoded2 >> 4); 41 | bytes[p++] = ((encoded2 & 15) << 4) | (encoded3 >> 2); 42 | bytes[p++] = ((encoded3 & 3) << 6) | (encoded4 & 63); 43 | } 44 | 45 | return arraybuffer; 46 | } 47 | 48 | self.AddHidProxies = function (device) { 49 | device.write = function (arrayBuffer, callback) { 50 | var bufferBase64 = ab_to_b64(arrayBuffer); 51 | device.write_raw(bufferBase64, callback); 52 | }; 53 | device.send_feature_report = function (arrayBuffer, callback) { 54 | var bufferBase64 = ab_to_b64(arrayBuffer); 55 | device.send_feature_report_raw(bufferBase64, callback); 56 | }; 57 | device.read = function (size, callback) { 58 | device.read_raw(size, function (data) { 59 | if (callback) { 60 | data = b64_to_ab(data); 61 | callback(data); 62 | } 63 | }); 64 | }; 65 | device.get_feature_report = function (size, callback) { 66 | device.get_feature_report_raw(size, function (data) { 67 | if (callback) { 68 | data = b64_to_ab(data); 69 | callback(data); 70 | } 71 | }); 72 | }; 73 | }; 74 | 75 | self.AddSerialProxies = function (device) { 76 | device.send = function (arrayBuffer, callback) { 77 | var bufferBase64 = ab_to_b64(arrayBuffer); 78 | device.send_raw(bufferBase64, function (result) { 79 | if (callback) callback(result); 80 | }); 81 | }; 82 | device.set_receive_handler = function (callback) { 83 | device.set_receive_handler_raw(function (data) { 84 | if (callback) { 85 | data = b64_to_ab(data); 86 | callback(data); 87 | } 88 | }); 89 | }; 90 | }; 91 | })(); 92 | -------------------------------------------------------------------------------- /tmp/TalkingGobo.sbx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scratchfoundation/scratchx/c14de2377770ca06a02540926abec934ef815b27/tmp/TalkingGobo.sbx --------------------------------------------------------------------------------