mirror of
https://github.com/FrankerFaceZ/FrankerFaceZ.git
synced 2025-08-31 18:31:06 +00:00
Refactored colors. Fixed scrolling on mobile. Added image preview on hover.
This commit is contained in:
parent
2bc2b7003b
commit
02b0a95bd0
22 changed files with 2121 additions and 425 deletions
38
image-proxy.html
Normal file
38
image-proxy.html
Normal file
|
@ -0,0 +1,38 @@
|
|||
<!DOCTYPE html>
|
||||
<style>
|
||||
html,body{overflow:hidden; margin:0; padding:0; background:transparent; height: 100%; position: relative }
|
||||
img {
|
||||
max-width: 186px; max-height: 186px;
|
||||
position: absolute;
|
||||
top: 50%; left: 50%;
|
||||
transform: translateX(-50%) translateY(-50%);
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">window.onload=function(){
|
||||
var IMGUR_REGEX = /(?:https?:\/\/)?(?:i\.)?imgur\.com\/(?:gallery\/)?([A-Za-z0-9]+)(?:\.(.*))?/,
|
||||
GYAZO_REGEX = /(?:https?:\/\/)?(?:i\.)?gyazo\.com\/([a-z0-9]+)/,
|
||||
YOUTUBE_REGEX = /^(?:https?:\/\/)?(?:m\.|www\.)?youtu(?:be\.com|\.be)\/(?:v\/|watch\/|.*?(?:embed|watch).*?v=)?([a-zA-Z0-9\-_]+)$/;
|
||||
|
||||
var url = location.search.substr(1),
|
||||
image_url = url;
|
||||
imgur = url.match(IMGUR_REGEX);
|
||||
|
||||
if ( imgur )
|
||||
image_url = 'http://i.imgur.com/' + imgur[1] + 't.' + (imgur[2] || "png");
|
||||
|
||||
else {
|
||||
var yt = url.match(YOUTUBE_REGEX);
|
||||
if ( yt ) {
|
||||
image_url = 'http://img.youtube.com/vi/' + yt[1] + '/1.jpg'
|
||||
} else {
|
||||
var gyazo = url.match(GYAZO_REGEX);
|
||||
if ( gyazo )
|
||||
image_url = 'http://i.gyazo.com/' + gyazo[1] + '.png';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
var el = document.createElement('img');
|
||||
el.src = image_url;
|
||||
document.body.appendChild(el);
|
||||
}</script>
|
Loading…
Add table
Add a link
Reference in a new issue