From d53fd180ed5fffb4779732dc1efbe81deb1699ec Mon Sep 17 00:00:00 2001 From: Sommerregen Date: Sun, 26 Apr 2015 20:55:47 +0200 Subject: [PATCH] :package: Initial commit of new "MediaEmbed" plugin --- CHANGELOG.md | 5 + LICENSE | 21 + README.md | 114 + assets/css/mediaembed.css | 330 ++ assets/js/mediaembed.js | 18 + assets/screenshot.png | Bin 0 -> 648316 bytes blueprints.yaml | 48 + classes/Autoloader.php | 100 + classes/MediaEmbed.php | 458 +++ classes/OEmbed/OEmbed.php | 489 +++ classes/OEmbed/OEmbedInterface.php | 153 + classes/OEmbed/OEmbedLink.php | 22 + classes/OEmbed/OEmbedPhoto.php | 45 + classes/OEmbed/OEmbedRich.php | 59 + classes/OEmbed/OEmbedVideo.php | 58 + classes/ProviderInterface.php | 112 + classes/Service.php | 315 ++ classes/ServiceProvider.php | 231 ++ classes/Services/Github.php | 51 + docs/CONTRIBUTING.md | 125 + docs/INSTALL.md | 47 + hebe.json | 15 + mediaembed.php | 214 + mediaembed.yaml | 204 + templates/partials/mediaembed.html.twig | 124 + vendor/Requests/.coveralls.yml | 4 + vendor/Requests/.travis.yml | 27 + vendor/Requests/CHANGELOG.md | 48 + vendor/Requests/LICENSE | 49 + vendor/Requests/README.md | 145 + vendor/Requests/bin/create_pear_package.php | 55 + vendor/Requests/composer.json | 24 + vendor/Requests/docs/README.md | 28 + vendor/Requests/docs/authentication-custom.md | 44 + vendor/Requests/docs/authentication.md | 31 + vendor/Requests/docs/goals.md | 29 + vendor/Requests/docs/hooks.md | 92 + vendor/Requests/docs/proxy.md | 23 + vendor/Requests/docs/usage-advanced.md | 74 + vendor/Requests/docs/usage.md | 154 + vendor/Requests/docs/why-requests.md | 192 + vendor/Requests/examples/basic-auth.php | 16 + vendor/Requests/examples/get.php | 13 + vendor/Requests/examples/multiple.php | 45 + vendor/Requests/examples/post.php | 13 + vendor/Requests/examples/proxy.php | 18 + vendor/Requests/examples/session.php | 24 + vendor/Requests/examples/timeout.php | 17 + vendor/Requests/library/Requests.php | 869 ++++ vendor/Requests/library/Requests/Auth.php | 33 + .../Requests/library/Requests/Auth/Basic.php | 88 + vendor/Requests/library/Requests/Cookie.php | 374 ++ .../Requests/library/Requests/Cookie/Jar.php | 158 + .../Requests/library/Requests/Exception.php | 62 + .../library/Requests/Exception/HTTP.php | 67 + .../library/Requests/Exception/HTTP/400.php | 27 + .../library/Requests/Exception/HTTP/401.php | 27 + .../library/Requests/Exception/HTTP/402.php | 27 + .../library/Requests/Exception/HTTP/403.php | 27 + .../library/Requests/Exception/HTTP/404.php | 27 + .../library/Requests/Exception/HTTP/405.php | 27 + .../library/Requests/Exception/HTTP/406.php | 27 + .../library/Requests/Exception/HTTP/407.php | 27 + .../library/Requests/Exception/HTTP/408.php | 27 + .../library/Requests/Exception/HTTP/409.php | 27 + .../library/Requests/Exception/HTTP/410.php | 27 + .../library/Requests/Exception/HTTP/411.php | 27 + .../library/Requests/Exception/HTTP/412.php | 27 + .../library/Requests/Exception/HTTP/413.php | 27 + .../library/Requests/Exception/HTTP/414.php | 27 + .../library/Requests/Exception/HTTP/415.php | 27 + .../library/Requests/Exception/HTTP/416.php | 27 + .../library/Requests/Exception/HTTP/417.php | 27 + .../library/Requests/Exception/HTTP/418.php | 29 + .../library/Requests/Exception/HTTP/428.php | 29 + .../library/Requests/Exception/HTTP/429.php | 29 + .../library/Requests/Exception/HTTP/431.php | 29 + .../library/Requests/Exception/HTTP/500.php | 27 + .../library/Requests/Exception/HTTP/501.php | 27 + .../library/Requests/Exception/HTTP/502.php | 27 + .../library/Requests/Exception/HTTP/503.php | 27 + .../library/Requests/Exception/HTTP/504.php | 27 + .../library/Requests/Exception/HTTP/505.php | 27 + .../library/Requests/Exception/HTTP/511.php | 29 + .../Requests/Exception/HTTP/Unknown.php | 44 + vendor/Requests/library/Requests/Hooker.php | 33 + vendor/Requests/library/Requests/Hooks.php | 61 + .../Requests/library/Requests/IDNAEncoder.php | 390 ++ vendor/Requests/library/Requests/IPv6.php | 221 + vendor/Requests/library/Requests/IRI.php | 1221 ++++++ vendor/Requests/library/Requests/Proxy.php | 35 + .../Requests/library/Requests/Proxy/HTTP.php | 150 + vendor/Requests/library/Requests/Response.php | 95 + .../library/Requests/Response/Headers.php | 95 + vendor/Requests/library/Requests/SSL.php | 151 + vendor/Requests/library/Requests/Session.php | 258 ++ .../Requests/library/Requests/Transport.php | 41 + .../library/Requests/Transport/cURL.php | 372 ++ .../library/Requests/Transport/cacert.pem | 3554 +++++++++++++++++ .../library/Requests/Transport/fsockopen.php | 404 ++ .../Utility/CaseInsensitiveDictionary.php | 91 + .../Requests/Utility/FilteredIterator.php | 38 + vendor/Requests/package.xml.tpl | 60 + vendor/Requests/tests/Auth/Basic.php | 87 + vendor/Requests/tests/ChunkedEncoding.php | 68 + vendor/Requests/tests/Cookies.php | 349 ++ vendor/Requests/tests/Encoding.php | 94 + vendor/Requests/tests/IDNAEncoder.php | 102 + vendor/Requests/tests/IRI.php | 418 ++ vendor/Requests/tests/Requests.php | 148 + vendor/Requests/tests/Response/Headers.php | 55 + vendor/Requests/tests/SSL.php | 108 + vendor/Requests/tests/Session.php | 86 + vendor/Requests/tests/Transport/Base.php | 683 ++++ vendor/Requests/tests/Transport/cURL.php | 5 + vendor/Requests/tests/Transport/fsockopen.php | 5 + vendor/Requests/tests/bootstrap.php | 139 + vendor/Requests/tests/phpunit.xml.dist | 35 + 118 files changed, 16663 insertions(+) create mode 100644 CHANGELOG.md create mode 100644 LICENSE create mode 100644 README.md create mode 100644 assets/css/mediaembed.css create mode 100644 assets/js/mediaembed.js create mode 100644 assets/screenshot.png create mode 100644 blueprints.yaml create mode 100644 classes/Autoloader.php create mode 100644 classes/MediaEmbed.php create mode 100644 classes/OEmbed/OEmbed.php create mode 100644 classes/OEmbed/OEmbedInterface.php create mode 100644 classes/OEmbed/OEmbedLink.php create mode 100644 classes/OEmbed/OEmbedPhoto.php create mode 100644 classes/OEmbed/OEmbedRich.php create mode 100644 classes/OEmbed/OEmbedVideo.php create mode 100644 classes/ProviderInterface.php create mode 100644 classes/Service.php create mode 100644 classes/ServiceProvider.php create mode 100644 classes/Services/Github.php create mode 100644 docs/CONTRIBUTING.md create mode 100644 docs/INSTALL.md create mode 100644 hebe.json create mode 100644 mediaembed.php create mode 100644 mediaembed.yaml create mode 100644 templates/partials/mediaembed.html.twig create mode 100644 vendor/Requests/.coveralls.yml create mode 100644 vendor/Requests/.travis.yml create mode 100644 vendor/Requests/CHANGELOG.md create mode 100644 vendor/Requests/LICENSE create mode 100644 vendor/Requests/README.md create mode 100644 vendor/Requests/bin/create_pear_package.php create mode 100644 vendor/Requests/composer.json create mode 100644 vendor/Requests/docs/README.md create mode 100644 vendor/Requests/docs/authentication-custom.md create mode 100644 vendor/Requests/docs/authentication.md create mode 100644 vendor/Requests/docs/goals.md create mode 100644 vendor/Requests/docs/hooks.md create mode 100644 vendor/Requests/docs/proxy.md create mode 100644 vendor/Requests/docs/usage-advanced.md create mode 100644 vendor/Requests/docs/usage.md create mode 100644 vendor/Requests/docs/why-requests.md create mode 100644 vendor/Requests/examples/basic-auth.php create mode 100644 vendor/Requests/examples/get.php create mode 100644 vendor/Requests/examples/multiple.php create mode 100644 vendor/Requests/examples/post.php create mode 100644 vendor/Requests/examples/proxy.php create mode 100644 vendor/Requests/examples/session.php create mode 100644 vendor/Requests/examples/timeout.php create mode 100644 vendor/Requests/library/Requests.php create mode 100644 vendor/Requests/library/Requests/Auth.php create mode 100644 vendor/Requests/library/Requests/Auth/Basic.php create mode 100644 vendor/Requests/library/Requests/Cookie.php create mode 100644 vendor/Requests/library/Requests/Cookie/Jar.php create mode 100644 vendor/Requests/library/Requests/Exception.php create mode 100644 vendor/Requests/library/Requests/Exception/HTTP.php create mode 100644 vendor/Requests/library/Requests/Exception/HTTP/400.php create mode 100644 vendor/Requests/library/Requests/Exception/HTTP/401.php create mode 100644 vendor/Requests/library/Requests/Exception/HTTP/402.php create mode 100644 vendor/Requests/library/Requests/Exception/HTTP/403.php create mode 100644 vendor/Requests/library/Requests/Exception/HTTP/404.php create mode 100644 vendor/Requests/library/Requests/Exception/HTTP/405.php create mode 100644 vendor/Requests/library/Requests/Exception/HTTP/406.php create mode 100644 vendor/Requests/library/Requests/Exception/HTTP/407.php create mode 100644 vendor/Requests/library/Requests/Exception/HTTP/408.php create mode 100644 vendor/Requests/library/Requests/Exception/HTTP/409.php create mode 100644 vendor/Requests/library/Requests/Exception/HTTP/410.php create mode 100644 vendor/Requests/library/Requests/Exception/HTTP/411.php create mode 100644 vendor/Requests/library/Requests/Exception/HTTP/412.php create mode 100644 vendor/Requests/library/Requests/Exception/HTTP/413.php create mode 100644 vendor/Requests/library/Requests/Exception/HTTP/414.php create mode 100644 vendor/Requests/library/Requests/Exception/HTTP/415.php create mode 100644 vendor/Requests/library/Requests/Exception/HTTP/416.php create mode 100644 vendor/Requests/library/Requests/Exception/HTTP/417.php create mode 100644 vendor/Requests/library/Requests/Exception/HTTP/418.php create mode 100644 vendor/Requests/library/Requests/Exception/HTTP/428.php create mode 100644 vendor/Requests/library/Requests/Exception/HTTP/429.php create mode 100644 vendor/Requests/library/Requests/Exception/HTTP/431.php create mode 100644 vendor/Requests/library/Requests/Exception/HTTP/500.php create mode 100644 vendor/Requests/library/Requests/Exception/HTTP/501.php create mode 100644 vendor/Requests/library/Requests/Exception/HTTP/502.php create mode 100644 vendor/Requests/library/Requests/Exception/HTTP/503.php create mode 100644 vendor/Requests/library/Requests/Exception/HTTP/504.php create mode 100644 vendor/Requests/library/Requests/Exception/HTTP/505.php create mode 100644 vendor/Requests/library/Requests/Exception/HTTP/511.php create mode 100644 vendor/Requests/library/Requests/Exception/HTTP/Unknown.php create mode 100644 vendor/Requests/library/Requests/Hooker.php create mode 100644 vendor/Requests/library/Requests/Hooks.php create mode 100644 vendor/Requests/library/Requests/IDNAEncoder.php create mode 100644 vendor/Requests/library/Requests/IPv6.php create mode 100644 vendor/Requests/library/Requests/IRI.php create mode 100644 vendor/Requests/library/Requests/Proxy.php create mode 100644 vendor/Requests/library/Requests/Proxy/HTTP.php create mode 100644 vendor/Requests/library/Requests/Response.php create mode 100644 vendor/Requests/library/Requests/Response/Headers.php create mode 100644 vendor/Requests/library/Requests/SSL.php create mode 100644 vendor/Requests/library/Requests/Session.php create mode 100644 vendor/Requests/library/Requests/Transport.php create mode 100644 vendor/Requests/library/Requests/Transport/cURL.php create mode 100644 vendor/Requests/library/Requests/Transport/cacert.pem create mode 100644 vendor/Requests/library/Requests/Transport/fsockopen.php create mode 100644 vendor/Requests/library/Requests/Utility/CaseInsensitiveDictionary.php create mode 100644 vendor/Requests/library/Requests/Utility/FilteredIterator.php create mode 100644 vendor/Requests/package.xml.tpl create mode 100644 vendor/Requests/tests/Auth/Basic.php create mode 100644 vendor/Requests/tests/ChunkedEncoding.php create mode 100644 vendor/Requests/tests/Cookies.php create mode 100644 vendor/Requests/tests/Encoding.php create mode 100644 vendor/Requests/tests/IDNAEncoder.php create mode 100644 vendor/Requests/tests/IRI.php create mode 100644 vendor/Requests/tests/Requests.php create mode 100644 vendor/Requests/tests/Response/Headers.php create mode 100644 vendor/Requests/tests/SSL.php create mode 100644 vendor/Requests/tests/Session.php create mode 100644 vendor/Requests/tests/Transport/Base.php create mode 100644 vendor/Requests/tests/Transport/cURL.php create mode 100644 vendor/Requests/tests/Transport/fsockopen.php create mode 100644 vendor/Requests/tests/bootstrap.php create mode 100644 vendor/Requests/tests/phpunit.xml.dist diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..f3e23c6 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,5 @@ +# v1.0.0 +## 04/26/2015 + +1. [](#new) + * ChangeLog started... diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..abf0a59 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015 Benjamin Regler + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..ef3ad75 --- /dev/null +++ b/README.md @@ -0,0 +1,114 @@ +# [Grav MediaEmbed Plugin][project] + +> This plugin embeds several media sites (e.g. YouTube, Vimeo, Soundcloud) by only providing the URL to the medium. + +## About + +Grav MediaEmbed plugin is the official successor of [Grav VideoEmbed plugin](https://github.com/sommerregen/grav-plugin-mediaembed/), allows to embed several media sites by only providing the URL to the medium and supports lazy loading techniques for videos and other media. Currently it supports + +- YouTube +- Vimeo +- DailyMotion +- SoundCloud +- Spotify +- Flickr +- Imgur +- Instagram +- GitHub + +but more services are coming soon! In principle it supports any service, which provides the [oEmbed format](http://www.oembed.com/). Media are embedded using the Markdown syntax for images (`![Alt](URL "Title")`), e.g. the below screenshot was created with the following code: + +``` +![](https://www.flickr.com/photos/chris_gin/6585842063) +``` + +![Screenshot MediaEmbed Plugin](assets/screenshot.png "MediaEmbed Preview") + +## Installation and Updates + +Installing or updating the `MediaEmbed` plugin can be done in one of two ways. Using the GPM (Grav Package Manager) installation method (i.e. `bin/gpm install mediaembed`) or manual install or update method by downloading [this plugin](https://github.com/sommerregen/grav-plugin-mediaembed) and extracting all plugin files to + + /your/site/grav/user/plugins/mediaembed + +For more informations, please check the [Installation and update guide](docs/INSTALL.md). + +## Usage + +The `MediaEmbed` plugin comes with some sensible default configuration, that are pretty self explanatory: + +### Config Defaults + +``` +# Global plugin configurations + +enabled: true # Set to false to disable this plugin completely +built_in_css: true # Use built-in CSS of the plugin +built_in_js: true # Use built-in JS of the plugin + +# Default options for MediaEmbed configuration. + +# -- Media -- +media: + width: 640 # Default media width + height: 390 # Default media height including controls + adjust: true # Adjust media or keep default dimensions? + + preview: true # Show or hide media preview + responsive: false # Allow media to be responsive + protocol: "http://" # Default protocol for remote media resources + +services: + : + enabled: true # Set to false to disable this service completely + type: # Type of the media service + + # URL of media service used for embedding + url: "www.domain.com/embed/{:id}" + + # Canonical URL of media service (used in endpoint calls) + canonical: "http://www.domain.com/{:id}" + + # Endpoint to grab media informations + endpoint: "http://www.domain.com/oembed?url={:canonical}&format=json" + + # Regex filters ("~REGEX~i") to grab media id + schemes: + - "domain.com/*" + + # Custom service-related media option overrides + params: + : +``` + +If you need to change any value, then the best process is to copy the [mediaembed.yaml](mediaembed.yaml) file into your `users/config/plugins/` folder (create it if it doesn't exist), and then modify there. This will override the default settings. + +## Contributing + +You can contribute at any time! Before opening any issue, please search for existing issues and review the [guidelines for contributing](docs/CONTRIBUTING.md). + +After that please note: + +* If you find a bug or would like to make a feature request or suggest an improvement, [please open a new issue][issues]. If you have any interesting ideas for additions to the syntax please do suggest them as well! +* Feature requests are more likely to get attention if you include a clearly described use case. +* If you wish to submit a pull request, please make again sure that your request match the [guidelines for contributing](docs/CONTRIBUTING.md) and that you keep track of adding unit tests for any new or changed functionality. + +### Support and donations + +If you like my project, feel free to support me via [![Flattr](https://api.flattr.com/button/flattr-badge-large.png)][flattr] or by sending me some bitcoins to **1HQdy5aBzNKNvqspiLvcmzigCq7doGfLM4**. + +Thanks! + +## License + +Copyright (c) 2015 [Benjamin Regler][github]. See also the list of [contributors] who participated in this project. + +[Licensed](LICENSE) for use under the terms of the [MIT license][mit-license]. + +[github]: https://github.com/sommerregen/ "GitHub account from Benjamin Regler" +[mit-license]: http://www.opensource.org/licenses/mit-license.php "MIT license" + +[flattr]: https://flattr.com/submit/auto?user_id=Sommerregen&url=https://github.com/sommerregen/grav-plugin-mediaembed "Flatter my GitHub project" + +[project]: https://github.com/sommerregen/grav-plugin-mediaembed +[issues]: https://github.com/sommerregen/grav-plugin-mediaembed/issues "GitHub Issues for Grav MediaEmbed Plugin" +[contributors]: https://github.com/sommerregen/grav-plugin-mediaembed/graphs/contributors "List of contributors of the project" diff --git a/assets/css/mediaembed.css b/assets/css/mediaembed.css new file mode 100644 index 0000000..7951909 --- /dev/null +++ b/assets/css/mediaembed.css @@ -0,0 +1,330 @@ +/* MediaEmbed */ +.mediaembed, +.mediaembed-responsive { + margin: 0 auto; + overflow: hidden; + + -webkit-box-sizing: content-box; + -moz-box-sizing: content-box; + box-sizing: content-box; +} + +.mediaembed-media .mediaembed-media, +.mediaembed-media embed, +.mediaembed-media iframe, +.mediaembed-media object, +.mediaembed-media video, +.mediaembed-embed img { + top: 0; + left: 0; + width: 100%; + height: 100%; + position: absolute; + z-index: 1; +} + +/* Media screen of death */ +.mediaembed-msod { + background-color: #000; + color: white; + display: block; + font-size: 80%; + overflow: hidden; + padding: 1em; + position: relative; + text-align: center; + vertical-align: middle; + z-index: 1; +} +.mediaembed-msod:before { + content: ""; + display: block; + + position: absolute; + z-index: -1; + + /* We make the element extra-large so we can shuffle it around without exposing the edges */ + height: 300%; + left: -100%; + top: -100%; + width: 300%; + + -webkit-animation: grain 5s steps(10) infinite; + -moz-animation: grain 5s steps(10) infinite; + -ms-animation: grain 5s steps(10) infinite; + animation: grain 5s steps(10) infinite; + + background-image: url(data:image/png;base64,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); +} +.mediaembed-msod .mediaembed-icon { + font-size: 7em; + line-height: 1em; + margin: 0.25em auto 0; +} +.mediaembed-msod p b { + display: block; + font-weight: bold; + text-align: center; +} +.mediaembed-msod .mediaembed-error-message { + margin: 0 3em 1em; + text-align: justify; +} +.mediaembed-msod .mediaembed-error-message b { + color: #f00; + text-transform: uppercase; +} + +/* MediaEmbed media */ + +.mediaembed-container { + position: relative; +} + +/* MediaEmbed Play button */ +.mediaembed-play { + margin: auto; + position: absolute; + + top: 0; + right: 0; + bottom: 0; + left: 10px; + + width: 1em; + height: 1em; + + color: #fff; + display: block; + font-size: 6em; + line-height: 1; + text-align: center; + text-shadow: 0 0 2px #ccc; + + visibility: visible; + opacity: 1; + z-index: 2; +} +.mediaembed-play:before { + box-shadow: 0 0 2px 0 #ccc inset, 0 0 2px 0 #ccc; + border: medium solid; + border-radius: 100%; + content: ""; + display: block; + height: 120%; + left: calc(-10% - 10px); + position: absolute; + top: calc(-5% - 5px); + width: 120%; +} +.mediaembed-play::after { + bottom: -1000%; + content: ""; + display: block; + left: -1000%; + position: absolute; + right: -1000%; + top: -1000%; +} +.mediaembed-play:hover { + color: #ccc; +} +.mediaembed-media iframe ~ .mediaembed-play, +.mediaembed-media input:checked ~ .mediaembed-play { + visibility: hidden; + opacity: 0; + z-index: 1; + + -webkit-transition: opacity 1.5s ease-in-out 0s, visibility 1.5s linear 0s, z-index 1.5s linear 0s; + -moz-transition: opacity 1.5s ease-in-out 0s, visibility 1.5s linear 0s, z-index 1.5s linear 0s; + -ms-transition: opacity 1.5s ease-in-out 0s, visibility 1.5s linear 0s, z-index 1.5s linear 0s; + -o-transition: opacity 1.5s ease-in-out 0s, visibility 1.5s linear 0s, z-index 1.5s linear 0s; + transition: opacity 1.5s ease-in-out 0s, visibility 1.5s linear 0s, z-index 1.5s linear 0s; +} +.mediaembed-media iframe ~ .mediaembed-play, +.mediaembed-media input:checked ~ .mediaembed-play:before { + -webkit-animation: ring 1.5s ease-in-out 1; + -moz-animation: ring 1.5s ease-in-out 1; + -ms-animation: ring 1.5s ease-in-out 1; + -o-animation: ring 1.5s ease-in-out 1; + animation: ring 1.5s ease-in-out 1; +} + +.mediaembed-media input:checked ~ noscript iframe { + display: block !important; +} +.mediaembed-media .mediaembed-input { + display: none; +} +.mediaembed-thumbnail { + margin: auto; + position: absolute; + + top: -50%; + right: 0; + bottom: -50%; + left: 0; + + width: 100%; + z-index: 0; +} + +/* GitHub adjustments */ +.mediaembed-github { + overflow: auto; +} +.mediaembed-github .gist .line-numbers { + width: 4em; +} +.mediaembed-github .gist-file { + padding: 1em; +} + +/* + * Animations + */ + +/* -- Grain -- */ +@-webkit-keyframes grain { + 0%, 100% { + -webkit-transform: translate(0, 0); + } + 10% { + -webkit-transform: translate(-5%, -10%); + } + 20% { + -webkit-transform: translate(-15%, 5%); + } + 30% { + -webkit-transform: translate(7%, -25%); + } + 40% { + -webkit-transform: translate(-5%, 25%); + } + 50% { + -webkit-transform: translate(-15%, 10%); + } + 60% { + -webkit-transform: translate(15%, 0%); + } + 70% { + -webkit-transform: translate(0%, 15%); + } + 80% { + -webkit-transform: translate(3%, 20%); + } + 90% { + -webkit-transform: translate(-10%, 10%); + } +} +@-moz-keyframes grain { + 0%, 100% { + -moz-transform: translate(0, 0); + } + 10% { + -moz-transform: translate(-5%, -10%); + } + 20% { + -moz-transform: translate(-15%, 5%); + } + 30% { + -moz-transform: translate(7%, -25%); + } + 40% { + -moz-transform: translate(-5%, 25%); + } + 50% { + -moz-transform: translate(-15%, 10%); + } + 60% { + -moz-transform: translate(15%, 0%); + } + 70% { + -moz-transform: translate(0%, 15%); + } + 80% { + -moz-transform: translate(3%, 20%); + } + 90% { + -moz-transform: translate(-10%, 10%); + } +} +@-ms-keyframes grain { + 0%, 100% { + -ms-transform: translate(0, 0); + } + 10% { + -ms-transform: translate(-5%, -10%); + } + 20% { + -ms-transform: translate(-15%, 5%); + } + 30% { + -ms-transform: translate(7%, -25%); + } + 40% { + -ms-transform: translate(-5%, 25%); + } + 50% { + -ms-transform: translate(-15%, 10%); + } + 60% { + -ms-transform: translate(15%, 0%); + } + 70% { + -ms-transform: translate(0%, 15%); + } + 80% { + -ms-transform: translate(3%, 20%); + } + 90% { + -ms-transform: translate(-10%, 10%); + } +} +@keyframes grain { + 0%, 100% { + transform: translate(0, 0); + } + 10% { + transform: translate(-5%, -10%); + } + 20% { + transform: translate(-15%, 5%); + } + 30% { + transform: translate(7%, -25%); + } + 40% { + transform: translate(-5%, 25%); + } + 50% { + transform: translate(-15%, 10%); + } + 60% { + transform: translate(15%, 0%); + } + 70% { + transform: translate(0%, 15%); + } + 80% { + transform: translate(3%, 20%); + } + 90% { + transform: translate(-10%, 10%); + } +} + +/* -- Ring -- */ +@keyframes ring { + 0% { + transform: scale(1); + opacity: 1; + border-width: medium; + } + /* hidden */ + 100% { + transform: scale(3); + opacity: 0; + border-width: thin; + } +} diff --git a/assets/js/mediaembed.js b/assets/js/mediaembed.js new file mode 100644 index 0000000..aba16ef --- /dev/null +++ b/assets/js/mediaembed.js @@ -0,0 +1,18 @@ +function lazyload(anchor) { + setTimeout(function () { + // Strip comment tags around innerHTML + anchor.innerHTML = anchor.innerHTML.replace('', ''); + }, 1000); + + // Remove