Okay, it's 2018.

• Rework the JavaScript handler.
 • Fix the card generator.
 • Nuke all known XSS attacks.
 • Change the background to white.
 • Change some fonts on index.html to make it look more modern.
 • Remove a few ".old" pages.
 • Improve the mobile-friendliness of index.html.
 • Remove all styling on <select> tags.
 • Other varied bugfixes
master
luk3yx 2018-12-07 17:59:15 +13:00
parent 8f15031b87
commit 828c95d82a
49 changed files with 531 additions and 1135 deletions

View File

@ -4,17 +4,17 @@ GEM
addressable (2.5.2)
public_suffix (>= 2.0.2, < 4.0)
colorator (1.1.0)
concurrent-ruby (1.0.5)
concurrent-ruby (1.1.3)
em-websocket (0.5.1)
eventmachine (>= 0.12.9)
http_parser.rb (~> 0.6.0)
eventmachine (1.2.5)
ffi (1.9.18)
eventmachine (1.2.7)
ffi (1.9.25)
forwardable-extended (2.6.0)
http_parser.rb (0.6.0)
i18n (0.9.1)
i18n (0.9.5)
concurrent-ruby (~> 1.0)
jekyll (3.7.0)
jekyll (3.7.4)
addressable (~> 2.4)
colorator (~> 1.0)
em-websocket (~> 0.5)
@ -27,31 +27,37 @@ GEM
pathutil (~> 0.9)
rouge (>= 1.7, < 4)
safe_yaml (~> 1.0)
jekyll-redirect-from (0.13.0)
jekyll-feed (0.11.0)
jekyll (~> 3.3)
jekyll-sass-converter (1.5.1)
jekyll-redirect-from (0.14.0)
jekyll (~> 3.3)
jekyll-sass-converter (1.5.2)
sass (~> 3.4)
jekyll-watch (2.0.0)
jekyll-seo-tag (2.5.0)
jekyll (~> 3.3)
jekyll-watch (2.1.2)
listen (~> 3.0)
kramdown (1.16.2)
liquid (4.0.0)
kramdown (1.17.0)
liquid (4.0.1)
listen (3.1.5)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
ruby_dep (~> 1.2)
mercenary (0.3.6)
minima (2.1.1)
jekyll (~> 3.3)
pathutil (0.16.1)
minima (2.5.0)
jekyll (~> 3.5)
jekyll-feed (~> 0.9)
jekyll-seo-tag (~> 2.1)
pathutil (0.16.2)
forwardable-extended (~> 2.6)
public_suffix (3.0.1)
rb-fsevent (0.10.2)
public_suffix (3.0.3)
rb-fsevent (0.10.3)
rb-inotify (0.9.10)
ffi (>= 0.5.0, < 2)
rouge (3.1.0)
rouge (3.3.0)
ruby_dep (1.5.0)
safe_yaml (1.0.4)
sass (3.5.5)
sass (3.7.2)
sass-listen (~> 4.0.0)
sass-listen (4.0.0)
rb-fsevent (~> 0.9, >= 0.9.4)
@ -67,4 +73,4 @@ DEPENDENCIES
tzinfo-data
BUNDLED WITH
1.11.2
1.16.4

View File

@ -1,4 +1,4 @@
<meta http-equiv="content-type"
<meta http-equiv="content-type"
content="text/html;charset=utf-8" />
<link rel="stylesheet" type="text/css" href="{{ site.baseurl }}/style.css" />
<link rel="stylesheet" type="text/css" media="only screen and (min-width: 480px)" href="https://fonts.googleapis.com/css?family=Ubuntu:400,300" />
@ -7,4 +7,4 @@
<script src="https://raw.githubusercontent.com/aFarkas/html5shiv/master/dist/html5shiv.min.js" type="text/javascript"></script>
<script src="https://raw.githubusercontent.com/aFarkas/html5shiv/master/dist/html5shiv-printshiv.min.js" type="text/javascript"></script>
<![endif]-->
<meta name="viewport" content="width=350" />
<meta name="viewport" content="width=device-width" />

View File

@ -1,8 +1,7 @@
<div class="title">
<img src="{{ site.baseurl }}/images/icon.svg" alt=" " />
<h1>
<a href="{{ site.baseurl }}/index.html">
Welcome to {{ site.title }}!
{{ site.title }}
</a>
</h1>
</div>

View File

@ -15,10 +15,14 @@ layout: default
line-height: 1;
letter-spacing: -1px;
}
#errordiv h1, #errordiv strong {
font-family: Ubuntu;
}
#errordiv strong {
font-size: 5vmin;
padding-bottom: 5vmin;
display: block;
font-weight: 100;
}
</style>

View File

@ -46,20 +46,25 @@ All rights reserved.
background-size: cover;
background-attachment: fixed;
}
.imgwrapper h1, .imgwrapper h2, #credit {
font-family: Ubuntu;
}
.imgwrapper h1 {
color: white;
font-size: 12.5vh !important;
position: sticky;
top: 56px;
padding-bottom: 48px !important;
font-weight: 100;
}
.imgwrapper h2 {
color: white;
top: 0 !important;
position: sticky;
font-size: 32px;
padding-bottom: 5px !important;
font-family: Ubuntu;
/* padding-bottom: 5px !important; */
padding-bottom: 30vh !important;
font-weight: 100;
}
iframe {
position: fixed;
@ -78,6 +83,9 @@ All rights reserved.
right: 16px;
z-index: 1;
}
#credit i {
font-weight: 100;
}
.title {
transition: ease-in-out 250ms 25ms;
}
@ -102,11 +110,17 @@ All rights reserved.
z-index: 2;
position: relative;
width: 100%;
background: #EFEFEF;
background: #FFFFFF;
}
body {
margin-top: 0 !important;
}
@media only screen and (max-width: 480px) {
.imgwrapper h2 {
position: relative;
}
}
</style>
</head>
<body>
@ -133,11 +147,11 @@ All rights reserved.
</div>
<div id="welcomewrapper">
{% include title.html %}
<div class="content">
{{ content }}
</div>
{% include smallprint.html %}
</div>
</body>

View File

@ -14,7 +14,7 @@ layout: default
</small>
</small>
</h1>
<form action="{{ site.baseurl }}/js/handler" method="get" target="_blank">
<form action="{{ site.baseurl }}/js/handler" method="get">
<p>
<input type="hidden" name="type" value="card" />
Type:
@ -50,7 +50,7 @@ layout: default
<option value="birthday1">Baloons to left, happy birthday up top, and blue -&gt; pink gradient background.</option>
<option value="birthday2">Red background with presents &amp; snowflakes to right.</option>
<option value="birthday3">Randomly coloured/colored circles with happy birthday text up top-left.</option>
</select>
</select>
<br/>
...Alternatively a URL: <input type="text" id="xmasimgurl" name="imgurl" size="15" />
<br/>

BIN
images/back0.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 111 KiB

BIN
images/birthday1.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

BIN
images/birthday2.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

BIN
images/birthday3.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 449 KiB

BIN
images/xmas1.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 81 KiB

BIN
images/xmas2.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

BIN
images/xmas3.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 KiB

BIN
images/xmas4.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

BIN
images/xmas5.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

BIN
images/xmas6.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 101 KiB

View File

@ -6,21 +6,22 @@ redirect_from:
---
<h2>
This website was carefully created by luk3yx.
This website was created by... well... luk3yx.
</h2>
<h3>
The logo (at the top of the page), when clicked, will take you to this page, provided you are on this website.
The title (at the top of the page), when clicked, will take you to this
page, provided you are still on this website.
</h3>
<h4 class="new">
NEW: Welcome to 2015™!
New: Lots of changes, most notably the Chirstmas card generator works again.
</h4>
<hr/>
<h3>
Links
</h3>
<p>
<p class="indent">
<a href="qrgenerator.html">
QR Code generator
</a>
@ -34,7 +35,7 @@ redirect_from:
</a>
<br/>
<a href="cardgenerator.html">
Birthday/Christmas card generator (Requires Javascript, currently broken)
Birthday/Christmas card generator (Requires Javascript)
</a>
<br/>
<a href="selectos.html">
@ -46,14 +47,14 @@ redirect_from:
</a>
<br/>
<a href="youtube-cinema.html">
YouTube&reg; Cinema Mode Button (Requires Javascript)
YouTube Cinema Mode Button (Requires Javascript)
</a>
</p>
<hr/>
<h3>
More links
</h3>
<p>
<p class="indent">
<a href="https://mozilla.org/firefox">
Firefox download
</a>
@ -70,7 +71,7 @@ redirect_from:
<h3>
Google easter eggs
</h3>
<p>
<p class="indent">
<a href="http://google.com/teapot">
Error 418
</a>

View File

@ -1,115 +0,0 @@
---
layout: default
---
<h2>
This website was carefully created by luk3yx.
</h2>
<h3>
The logo (at the top of the page), when clicked, will take you to this page, provided you are on this website.
</h3>
<h4 class="new">
NEW: This site has been changed to a material(-ish) design!
</h4>
<hr/>
<h3>
Here are some links to some free services. Enjoy!
</h3>
<p>
<a href="qrgenerator.html">
QR Code generator
</a>
<br/>
<a href="urlshortener.html">
URL Shortener
</a>
<br/>
<a href="pastebin.html">
Pastebin
</a>
<br/>
<a href="cardgenerator.html">
Birthday/Christmas card generator (Requires Javascript)
</a>
<br/>
<a href="jstranslate.html">
Translate toolbar button (Requires Javascript)
</a>
<br/>
<a href="youtube-cinema.html">
YouTube&reg; Cinema Mode Button (Requires Javascript)
</a>
<br/>
<a href="webpagescreenshot.html">
Webpage Screenshots
</a>
</p>
<hr/>
<h3>
Here are some interesting links that go to other websites.
</h3>
<p>
<a href="https://marketplace.firefox.com/">
Firefox Marketplace<!--
--></a>
|
<a href="https://marketplace.firefox.com/purchases">
Your apps
</a>
<br/>
<a href="https://www.google.com/maps/?force=lite">
Is Google&reg; Maps running slow? Click here to use lite mode.
</a>
<br/>
<a href="http://www.dhmo.org">
Dihydrogen monoxide: The deadly killer.
</a>
</p>
<hr/>
<h3>
Some Google easter eggs
</h3>
<p>
<a href="http://google.com/teapot">
Who's a teapot?
</a>
<br/>
<a href="http://google.com/search?q=zerg%20rush">
Make some o's attack Google&reg; search results
</a>
<br/>
<a href="http://google.com/search?q=tilt">
Tilt the screen!
</a>
<br/>
<a href="http://google.com/search?q=do%20a%20barrel%20roll">
Make the screen do a barrel roll
</a>
</p>
<hr/>
<h3>
Other, not so interesting pages on this website
</h3>
<p>
<a href="/welcome.html" class="new">
Manually go to the new welcome screen (Requires JavaScript and CSS)
</a>
<br/>
<a href="/images">
List of images
</a>
<br/>
<a href="/iso">
ISO Files
</a>
<br/>
<a href="/error.html#gameover">
Game over screen (Requires CSS)
</a>
<br/>
<a href="#" target="_top" onclick="showLoadScreen(); setTimeout(function() {location.reload(); }, 5000);">
Show Loading Screen for 5 seconds (Requires CSS &amp; JavaScript)
</a>
</p>

View File

@ -1,4 +0,0 @@
// Copyright 2016 by luk3yx.
// All rights reserved.
window.stop();
window.location.href = "/403.html";

View File

@ -1,17 +0,0 @@
// Copyright 2016 by luk3yx.
// All rights reserved.
/*
var version = getParam.version;
//checkVar(version);
if (version == "2") {
window.location.href = "/";
}
if (version == "1") {
window.location.href = "/js/handler?type=approve&content=sitev1";
}
if (version == "0") {
window.location.href = "/js/handler?type=approve&content=sitev0";
}
*/
window.stop();
window.location.href = "/error.html?archived sites service#e410";

View File

@ -1 +0,0 @@
loadScript("card");

127
js/card-generator.js Normal file
View File

@ -0,0 +1,127 @@
//
// card-generator.js - Generate a card.
//
// © Copyright 2018 by luk3yx.
//
// Decode the URL (if encoded)
var encoded = helpers.params.get('oldlink');
if (encoded && encoded.startsWith('🎄')) {
helpers.params = new URLSearchParams(atob(encoded.replace('🎄', '')));
}
var card = (helpers.params.get('card') || '').toLowerCase();
var dfmsg = '';
switch (card) {
case "xmas":
case "christmas":
greeting = "Merry Christmas";
dfmsg = 'Jingle bells, jingle bells,' +
'\nJingle all the way.' +
'\nOh what fun it is to ride,' +
'\nIn a one-horse open sleigh!';
break;
case "birthday":
greeting = "Happy Birthday";
break;
default:
greeting = "April Fools";
dfmsg = "I have no idea what card\nI am supposed to make.";
break;
}
if (! dfmsg) {
dfmsg = greeting + ", and\nbest wishes for the future.";
}
// Get all the parameters
var to = helpers.params.get('to');
var from = helpers.params.get('from') || '....................';
var msg = helpers.params.get('msg');
var imgurl = helpers.params.get('imgurl');
var colour = helpers.params.get('colour') || helpers.params.get('color');
var img = helpers.params.get('img');
// Parse them
var title = greeting + "!";
if (img == 'URL') {
img = null;
}
if (to) {
title = greeting + ' ' + to + '!';
}
if (! msg) {
msg = dfmsg;
}
// Escape HTML
title = helpers.escapeHTML(title);
from = helpers.escapeHTML(from);
msg = helpers.escapeHTML(msg, true);
img = helpers.escapeHTML(img);
colour = helpers.escapeHTML(colour);
// Get the image URL
if (img) {
// More code to support legacy options
switch (img) {
case "1": // The older format had '1-6',
case "2": // not xmas[n] and birthday[n].
case "3": // This is because there only
case "4": // used to be a Christmas
case "5": // card generator.
case "6":
imgurl = helpers.url + "/images/xmas" + img + ".jpg";
break;
default:
if (img) {
imgurl = helpers.url + "/images/" + img + ".jpg";
}
break;
}
}
// Get the <img> tag
var imgtag = '';
if (imgurl) {
imgtag = '<img id="backimg" src="' + helpers.escapeHTML(imgurl) +
'" alt=" "></img>';
}
// Set the text colour
var morecss = '';
if (colour) {
morecss = '<style type="text/css" id="txtcolour">* { color: ' +
helpers.escapeHTML(colour) + ' !important; }</style>';
}
var html = `<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type"
content="text/html;charset=utf-8" />
<link rel="stylesheet" type="text/css"
href="${helpers.baseurl}/js/handler/card.css" />
<meta name="viewport" content="width=device-width" />
<title>${title}</title>
${morecss}
</head>
<body>
${imgtag}
<main class="content">
<br/><br/>
<h1>${title}</h1><br/>
<h2>${msg}</h2><br/>
<h1>From ${from}</h1>
</main>
</body>
</html>
`;
// Load the HTML in
helpers.onLoad(function() {
document.open();
document.write(html);
document.close();
})

View File

@ -1,129 +1,29 @@
// Copyright 2017 by luk3yx.
// All rights reserved.
---
# card.js - Generate a card URL that can be sent to card-generator.js.
# © Copyright 2018 by luk3yx.
card = getParam.card;
layout: compress
---
// Function to support legacy options
switch (getParam.type) {
case "card":
break;
case "xmascard":
card = "Christmas";
break;
case "birthdaycard":
card = "birthday";
break;
}
// End of the legacy section
helpers.params.delete('submit');
var data = '🎄' + btoa(helpers.params.toString());
if (typeof card == 'undefined') {
card = '';
}
card = card.toLowerCase();
switch (card) {
case "xmas":
case "christmas":
greeting = "Merry Christmas";
dfmsg = atob("SmluZ2xlIGJlbGxzLCBqaW5nbGUgYmVsbHMsPGJyLz5KaW5nbGUgYWxsIHRoZSB3YXkuPGJyLz5PaCB3aGF0IGZ1biBpdCBpcyB0byByaWRlLDxici8+SW4gYSBvbmUtaG9yc2Ugb3BlbiBzbGVpZ2ghCg==");
break;
case "birthday":
greeting = "Happy Birthday";
break;
case "fathersday":
greeting = "Happy Fathers Day";
break;
case "mothersday":
greeting = "Happy Mothers Day";
break;
default:
greeting = "April Fools";
dfmsg = "I have no idea what card<br/\>I am supposed to make.";
break;
}
helpers.onLoad(function() {
document.getElementById('description').innerHTML = 'Card generator';
document.getElementById('instructions').innerHTML = 'Your generated link:';
to = getParam.to;
if (to == '') {
to = undefined;
}
from = getParam.from;
if (from == '') {
from = undefined;
}
msg = getParam.msg;
if (msg == '') {
msg = undefined;
}
img = getParam.img;
if (img == '') {
img = undefined;
}
if (img == 'URL') {
img = undefined;
}
imgurl = getParam.imgurl;
if (imgurl == '') {
imgurl = undefined;
}
colour = getParam.colour;
if (colour == '') {
colour = undefined;
}
if (typeof dfmsg == 'undefined') {
dfmsg = greeting + ", and <br/\>best wishes for the future.";
}
if (typeof from !== 'undefined') {
from = from.replace(/\+/g, '\ ');
}
title = greeting + "!";
if (typeof to !== 'undefined') {
to = to.replace(/\+/g, '\ ');
title = greeting + " " + to + '!';
}
if (typeof from !== 'undefined') {
from = from.replace(/\+/g, '\ ');
} else {
from = "....................";
}
if (typeof msg !== 'undefined') {
msg = msg.replace(/\r/g, '<br/\>');
msg = msg.replace(/\+/g, ' ');
} else {
msg = dfmsg;
}
if (typeof img !== 'undefined') {
url = "https://" + siteurl;
// More code to support legacy options
switch (img) {
case "1": // The older format had '1-6',
case "2": // not xmas[n] and birthday[n].
case "3": // This is because there only
case "4": // used to be a Christmas
case "5": // card generator.
case "6":
imgurl = url + "/images/xmas" + img + ".jpg";
break;
default:
imgurl = url + "/images/" + img + ".jpg";
break;
}
// End of legacy stuff
}
var url = helpers.baseurl + '/js#' + data;
if (typeof imgurl !== 'undefined') {
imgtag = "<img id='backimg' src='" + imgurl + "' alt=''></img>"
} else {
imgtag = ""
}
morecss = ''
if (typeof colour !== 'undefined') {
morecss = '<style type="text/css" id="txtcolour">* { color: ' + colour + ' !important; }</style>'
}
document.getElementById('loader').innerHTML = `
<input type="text" readonly value="${helpers.url}${url}" />
<br/>
You can <a href="${url}" target="_blank">click here</a> to preview your
card in a new tab.
<br/><br/>
Click <a href="${helpers.baseurl}/cardgenerator.html">here</a> to create
a new card.
`;
br = "<br/\>";
footer = "";
css = '<style type="text/css">' + atob("QGltcG9ydCB1cmwoaHR0cHM6Ly9mb250cy5nb29nbGVhcGlzLmNvbS9jc3M/ZmFtaWx5PU1vdW50YWlucytvZitDaHJpc3RtYXMpOwoqIHsKICAgIGNvbG9yOiBibGFjazsKICAgIHRleHQtc2hhZG93OiAjRkZGRkZGIDAgMCA0cHg7CiAgICBmb250LWZhbWlseTonTW91bnRhaW5zIG9mIENocmlzdG1hcycsJ1VidW50dScsJ1NlZ29lIFVJJywnQXJpYWwnLCdzYW5zLXNlcmlmJyAhaW1wb3J0YW50OwogICAgei1pbmRleDogNTsKfQojYmFja2ltZyB7CiAgICB3aWR0aDogMTAwJTsKICAgIGhlaWdodDogMTAwJTsKICAgIHBvc2l0aW9uOiBmaXhlZDsKICAgIHRvcDogMDsKICAgIGJvdHRvbTogMDsKICAgIGxlZnQ6IDA7CiAgICByaWdodDogMDsKICAgIHotaW5kZXg6IDEgIWltcG9ydGFudDsKfQouY29udGVudCB7CiAgICB3aWR0aDogMTAwJTsKICAgIGhlaWdodDogMTAwJTsKICAgIHBvc2l0aW9uOiBhYnNvbHV0ZTsKICAgIHRvcDogMDsKICAgIGJvdHRvbTogMDsKICAgIGxlZnQ6IDA7CiAgICByaWdodDogMDsKICAgIHotaW5kZXg6IDQgIWltcG9ydGFudDsKfQo=") + "</style>";
docstart = atob("PCFET0NUWVBFIGh0bWwgUFVCTElDICItLy9XM0MvL0RURCBYSFRNTCAxLjAgVHJhbnNpdGlvbmFsLy9FTiIKICAgICAgICAiaHR0cDovL3d3dy53My5vcmcvVFIveGh0bWwxL0RURC94aHRtbDEtdHJhbnNpdGlvbmFsLmR0ZCI+CjxodG1sIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hodG1sIj4KPGhlYWQ+CjxtZXRhIGh0dHAtZXF1aXY9ImNvbnRlbnQtdHlwZSIgCiAgICAgICAgY29udGVudD0idGV4dC9odG1sO2NoYXJzZXQ9dXRmLTgiIC8+Cjx0aXRsZT4K");
content = docstart + title + "</title>" + css + morecss + "</head><body>" + imgtag + "<center class='content'>" + br + br + "<h1>" + title + '</h1>' + br + '<h2>' + msg + '</h2>' + br + '<h1>' + "From " + from + "</h1></center></body></html>";
document.open();
document.write(content);
document.close();
helpers.setTitle('Card generator');
helpers.hideLoadScreen();
});

View File

@ -28,3 +28,5 @@ function deleteContextMenu() {
// document.getElementById("contextMenu").parentElement.removeChild(document.getElementById("contextMenu"));
document.getElementById("contextMenu").style.display = "none";
}
hideLoadScreen();

View File

@ -1,2 +0,0 @@
// An image stored within TinyURL
window.location.href = "http://tinyurl.com/wandathefish";

View File

@ -1,18 +0,0 @@
// The 'getParam' function (stated below) is NOT copyrighted.
var getParam = function () {
var query_string = {};
var query = window.location.search.substring(1);
var vars = query.split("&");
for (var i=0;i<vars.length;i++) {
var pair = vars[i].split("=");
if (typeof query_string[pair[0]] === "undefined") {
query_string[pair[0]] = decodeURIComponent(pair[1]);
} else if (typeof query_string[pair[0]] === "string") {
var arr = [ query_string[pair[0]],decodeURIComponent(pair[1]) ];
query_string[pair[0]] = arr;
} else {
query_string[pair[0]].push(decodeURIComponent(pair[1]));
}
}
return query_string;
}();

View File

@ -1,20 +0,0 @@
// The 'getParam' function (stated below) is NOT copyrighted.
var getParam = function () {
var query_string = {};
var query = window.location.search.substring(1);
var vars = query.split("&");
for (var i=0;i<vars.length;i++) {
var pair = vars[i].split("=");
if (typeof query_string[pair[0]] === "undefined") {
query_string[pair[0]] = decodeURIComponent(pair[1]);
} else if (typeof query_string[pair[0]] === "string") {
var arr = [ query_string[pair[0]],decodeURIComponent(pair[1]) ];
query_string[pair[0]] = arr;
} else {
query_string[pair[0]].push(decodeURIComponent(pair[1]));
}
}
return query_string;
}();
// The 'getParam' function (stated above) is NOT copyrighted.
loadScript(getParam.type);

View File

@ -1,23 +0,0 @@
// Copyright 2016 by luk3yx.
// All rights reserved.
referrer = getParam.referrer;
if (referrer == "HTTP") {
framereferrer = document.referrer.split("=");
referrer = framereferrer[framereferrer.length-1];
}
referrerArray=referrer.split("/")
count=5 // 3 for http:// and 2 for /sites/sitename
redirectURL="/"
while (count < referrerArray.length-1) {
redirectURL = redirectURL + referrerArray[count] + "/";
count=count+1
}
redirectURL = redirectURL + referrerArray[count];
if (redirectURL == "/xhands") {
redirectURL = "/xhands.html";
}
if (redirectURL == "/luk3yx") {
redirectURL = "/";
}
window.location.href = redirectURL;

View File

@ -1,4 +0,0 @@
// This script won't be copyrighted. There is nothing fancy worth stealing.
var url = '/js/handler?type=guess&oldlink=' + encodeURIComponent(window.location.hash.substring(1)) + '&referrer=' + encodeURIComponent(document.referrer);
window.stop();
window.location.href = url;

View File

@ -1,36 +1,25 @@
// Copyright 2016 by luk3yx.
// All rights reserved.
debug("Guess script loaded. Guessing...");
var oldLink = decodeURIComponent(getParam.oldlink);
//
// guess.js - Take a guess at what the user wants
//
// The below function is NOT copyrighted
function getDomainName(link) {
if (link.indexOf("://") > -1) {
// Get rid of the http:// if existent, the pathname, and the port.
return link.split('/')[2].split(':')[0];
} else {
// If the http:// is not existent, just get rid of the pathname and port
return link.split('/')[0].split(':')[0];
}
}
// The above function is NOT copyrighted
(function() {
var oldDomain = getDomainName(oldLink);
type = '';
if (oldDomain == "youtube.com") {
var oldlink = decodeURIComponent(window.location.hash.substr(1));
helpers.params.set('oldlink', oldlink);
helpers.params.set('referrer', document.referrer);
var type = 'jsinfo';
if (helpers.getDomainName(oldlink) == "youtube.com") {
type = 'youtube-cinema';
}
if (oldLink == "cookies-accept") {
} else if (oldlink == "cookies-accept") {
type = 'cookies-accept';
} else if (oldlink.startsWith('🎄')) {
type = 'card-generator';
} else if (oldlink.startsWith('http')) {
type = 'translate';
}
if (type == "") {
if (oldLink == "") {
type = 'jsinfo';
} else {
type = 'translate';
}
}
debug("Type guessed. The type is " + type);
debug("Loading " + type + ".js...");
loadScript(type);
helpers.loadScript(type);
})();

View File

@ -1,27 +1,41 @@
// It isn't really worth copyrighting this script...
---
# JavaScript script dispatcher
// The 'getParam' function (stated below) is NOT copyrighted.
var getParam = function () {
var query_string = {};
var query = urlOpts.substring(1);
var vars = query.split("&");
for (var i=0;i<vars.length;i++) {
var pair = vars[i].split("=");
if (typeof query_string[pair[0]] === "undefined") {
query_string[pair[0]] = decodeURIComponent(pair[1]);
} else if (typeof query_string[pair[0]] === "string") {
var arr = [ query_string[pair[0]],decodeURIComponent(pair[1]) ];
query_string[pair[0]] = arr;
} else {
query_string[pair[0]].push(decodeURIComponent(pair[1]));
}
}
return query_string;
}();
window.history.replaceState({}, "luk3yx's website", "/js");
showLoadScreen();
if (getParam.type == undefined) {
loadScript("jsinfo");
layout: compress
---
helpers.showLoadScreen();
(function() {
var script = helpers.params.get('type');
/* Trivial to implement redirects */
var redirects = {
'approve': '/403.html',
'archive': '/410.html',
'birthdaycard': 'card',
'fish': '/418.html',
'iso': 'http://cdimage.ubuntu.com',
'login': '/403.html',
'redirect': '/418.html',
'teapot': '/418.html',
'xmascard': 'card',
};
if (redirects[script]) {
if (redirects[script].indexOf('/') > -1) {
window.stop();
window.location.href = helpers.baseurl + redirects[script];
} else {
helpers.loadScript(redirects[script]);
}
} else if (script) {
if (! helpers.loadScript(script)) {
window.stop();
window.location.href = helpers.baseurl + '404.html';
};
} else {
loadScript(getParam.type);
helpers.loadScript('jsinfo');
}
})();

35
js/handler/card.css Normal file
View File

@ -0,0 +1,35 @@
---
layout: compress
---
@import url(https://fonts.googleapis.com/css?family=Mountains+of+Christmas);
* {
color: black;
text-shadow: #FFFFFF 0 0 4px;
font-family:'Mountains of Christmas','Ubuntu','Segoe UI','Arial','sans-serif' !important;
z-index: 5;
}
#backimg {
width: 100%;
height: 100%;
position: fixed;
top: 0;
bottom: 0;
left: 0;
right: 0;
z-index: 1 !important;
}
.content {
width: 100%;
height: 100%;
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
text-align: center;
z-index: 4 !important;
}

View File

@ -1,101 +1,20 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
---
layout: default
title: Loading...
---
<!--
Copyright 2016 by luk3yx.
All rights reserved.
-->
<div id="loadscreen">
<h1 style="text-align: center;">
Loading...
</h1>
</div>
<script src="https://unpkg.com/@ungap/url-search-params"></script>
<script src="/js/helpers.js"></script>
<script src="/js/handler.js"></script>
<noscript><h1 style="position: fixed; top: 0; left: 0; z-index: 99999;">
Enable JavaScript or press the back button on your browser.
</h1></noscript>
<head>
<script type="text/javascript" src="/js/security.js"></script>
<title id="title">luk3yx's website</title>
<meta http-equiv="content-type"
content="text/html;charset=utf-8" />
<link rel="stylesheet" type="text/css" href="/style.css" />
<link rel="stylesheet" type="text/css" media="only screen and (min-width: 480px)" href="https://fonts.googleapis.com/css?family=Ubuntu:400,300" />
<link rel="icon" href="/images/favicon.png" type="image/png" />
<!-- Battle For The Net Widget -->
<script src="https://widget.battleforthenet.com/widget.js"></script>
<!-- HTML5Shiv -->
<!--[if lt IE 9]>
<script src="https://raw.githubusercontent.com/aFarkas/html5shiv/master/dist/html5shiv.min.js" type="text/javascript"></script>
<script src="https://raw.githubusercontent.com/aFarkas/html5shiv/master/dist/html5shiv-printshiv.min.js" type="text/javascript"></script>
<![endif]-->
<!-- HTML5Shiv END -->
<meta name="viewport" content="width=350" />
</head>
<body>
<div class="title">
<center>
<h1>
<a href="/index.html">
<img src="/images/logo.png" alt="Welcome to luk3yx's Website!" />
</a>
</h1>
</center>
</div>
<center>
<a href="https://www.mozilla.org/firefox" class="hideinff" target="_blank">
Firefox 57 is here! Download it now for a <b>massive</b> speed improvement!
<br/>
<img alt="Get Mozilla Firefox Now!" src="/images/firefox.png" />
</a>
</center>
<div class="content">
<div id="loadscreen">
<h1>
<center>
<img src="/images/loadscreen.gif" alt="Loading..." />
</center>
</h1>
</div>
<noscript><h1 style="position: fixed; top: 0; left: 0; z-index: 99999;">
Enable JavaScript or press the back button on your browser.
</h1></noscript>
<h1 id="description">Processing your request...</h1>
<img src="/images/load.gif" id="loader" width="100%" alt=" " />
<h2 id="instructions">Please be patient.</h2>
</div>
<center>
<a href="https://www.fairtrade.net/about-fairtrade/what-is-fairtrade.html" class="hideinff" target="_blank">
<img alt="Is your food fair food?" src="/images/fairtrade.svg" />
</a>
</center>
<div class="smallprint">
<center>
<h5>
&copy; Copyright 2017 by luk3yx. All rights reserved.
<br/>
<a href="/privacy.html#terms">
Terms and Conditions</a>
|
<a href="/privacy.html#privacy">
Privacy Policy</a>
|
<a href="https://github.com/luk3yx/luk3yx.github.io/issues">
Report an Issue</a>
|
<a href="/privacy.html#contact">
Contact Me
</a>
</h5>
<p id="w3c">
<a href="https://validator.w3.org/check?uri=referer" target="_blank">
<img src="https://www.w3.org/Icons/valid-xhtml10"
alt="Valid XHTML 1.0 Transitional" height="31"
width="88" />
</a>
</p>
</center>
</div>
</body>
</html>
<h1 id="description">Processing your request...</h1>
<h2 id="instructions">Please be patient.</h2>
<span id="loader"></span>

View File

@ -1,87 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<!--
Copyright 2016 by luk3yx.
All rights reserved.
-->
<head>
<script type="text/javascript" src="/js/security.js"></script>
<title id="title">Processing... - luk3yx's website</title>
<!--<meta http-equiv="content-type"
content="text/html;charset=utf-8" />
-->
<meta http-equiv="content-type"
content="text/html;charset=utf-8" />
<link rel="stylesheet" type="text/css" href="/style.css" />
<script type="text/javascript"><!--
loadScript("handler");
//--></script>
</head>
<!--body--><body>
<div class="title">
<center>
<h1>
<a href="/index.html">
<img src="/title.png" alt="Welcome to luk3yx's Website!" />
</a>
</h1>
</center>
</div>
<center>
<a href="https://www.mozilla.org/firefox" class="hideinff" target="_blank">
<img alt="Get Mozilla Firefox Now!" src="/firefox.png" />
</a>
</center>
<div class="content">
<noscript><h1>
Enable JavaScript or press the back button on your browser.
</h1></noscript>
<h1 id="description">Processing your request...</h1>
<img src="/cookies/load.gif" id="loader" width="100%" alt=" " />
<h2 id="instructions">Please be patient.</h2>
</div>
<center>
<a href="https://www.mozilla.org/thunderbird/" class="hideinff" target="_blank">
<img alt="Get Mozilla Thunderbird Now!" src="/thunderbird.jpg" />
</a>
<!--<a href="https://www.mozilla.org/firefox" class="hideinff" target="_blank">
<img src="/cookies/banner.svg" alt=" " style="bottom: 0; right: 0; width: 20%; position: fixed; " />
</a>-->
</center>
<div class="smallprint">
<center>
<h5>
<!--DATE-->
&copy; Copyright <!--YEAR -->by luk3yx. All rights reserved.
<br/>
<a href="/privacy.html#terms">
Terms and Conditions</a>
|
<a href="/privacy.html#privacy">
Privacy Policy</a>
|
<a href="/contact.html">
Contact Me
</a>
</h5>
<p id="w3c">
<a href="https://validator.w3.org/check?uri=referer" target="_blank">
<img src="https://www.w3.org/Icons/valid-xhtml10"
alt="Valid XHTML 1.0 Transitional" height="31"
width="88" />
</a>
</p>
</center>
</div>
</body>
</html>

View File

@ -1,118 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<!--
Copyright 2016 by luk3yx.
All rights reserved.
-->
<head>
<title id="title">Processing... - luk3yx's website</title>
<!--<meta http-equiv="content-type"
content="text/html;charset=utf-8" />
-->
<meta http-equiv="content-type"
content="text/html;charset=utf-8" />
<script id="loadr" type="text/javascript"></script>
<script type="text/javascript"><!--
// Below text not copyrighted
var getParam = function () {
var query_string = {};
var query = window.location.search.substring(1);
var vars = query.split("&");
for (var i=0;i<vars.length;i++) {
var pair = vars[i].split("=");
if (typeof query_string[pair[0]] === "undefined") {
query_string[pair[0]] = decodeURIComponent(pair[1]);
} else if (typeof query_string[pair[0]] === "string") {
var arr = [ query_string[pair[0]],decodeURIComponent(pair[1]) ];
query_string[pair[0]] = arr;
} else {
query_string[pair[0]].push(decodeURIComponent(pair[1]));
}
}
return query_string;
}();
// Above text not copyrighted
var type=getParam.type
function error() {
window.stop();
window.location.href = "/js/handler/error.html";
}
function loadExternalScript(filename) {
document.getElementById("loadr").setAttribute("src", filename);
}
function loadScript(filename) {
loadExternalScript("/js/" + filename + ".js");
}
loadScript(type);
//-->
</script>
<link rel="stylesheet" type="text/css" href="/style.css" />
</head>
<!--body--><body>
<div class="title">
<center>
<h1>
<a href="/index.html">
<img src="/title.png" alt="Welcome to luk3yx's Website!" />
</a>
</h1>
</center>
</div>
<center>
<a href="https://www.mozilla.org/firefox" class="hideinff" target="_blank">
<img alt="Get Mozilla Firefox Now!" src="/firefox.png" />
</a>
</center>
<div class="content">
<noscript><h1>
Enable JavaScript or press the back button on your browser.
</h1></noscript>
<h1 id="description">Processing your request...</h1>
<img src="/cookies/load.gif" id="loader" width="100%" alt=" " />
<h2 id="instructions">Please be patient.</h2>
</div>
<center>
<a href="https://www.mozilla.org/thunderbird/" class="hideinff" target="_blank">
<img alt="Get Mozilla Thunderbird Now!" src="/thunderbird.jpg" />
</a>
</center>
<div class="smallprint">
<center>
<h5>
<!--DATE-->
&copy; Copyright <!--YEAR -->by luk3yx. All rights reserved.
<br/>
<a href="/privacy.html#terms">
Terms and Conditions</a>
|
<a href="/privacy.html#privacy">
Privacy Policy</a>
|
<a href="/contact.html">
Contact Me
</a>
</h5>
<p id="w3c">
<a href="https://validator.w3.org/check?uri=referer" target="_blank">
<img src="https://www.w3.org/Icons/valid-xhtml10"
alt="Valid XHTML 1.0 Transitional" height="31"
width="88" />
</a>
</p>
</center>
</div>
</body>
</html>

148
js/helpers.js Normal file
View File

@ -0,0 +1,148 @@
---
# JavaScript helper functions
# © 2018 by luk3yx.
layout: compress
---
helpers = {
title: `{{ site.title }}`,
url: `{{ site.url }}`,
baseurl: `{{ site.baseurl }}`,
addLegacyFunctions: function() {
if (window.loadScript) { return; }
for (var i in this) {
window[i] = this[i];
}
window.getParam = this.getParams();
this.setTitle(window.getParam.type);
window.urlOpts = window.location.search;
window.debug = console.log;
console.log('Legacy function names have been loaded in.');
},
loadScript: function(script) {
if (typeof this.versions[script] != 'number') {
console.error('Unknown scripts cannot be loaded.');
return false;
} else if (this.versions[script] < 2) {
this.addLegacyFunctions();
}
var scriptElement = document.createElement('script');
scriptElement.setAttribute("src", "/js/" + this.escapeHTML(script) +
".js");
document.head.appendChild(scriptElement);
return true;
},
loadCSS: function(url) {
var scriptElement = document.createElement('link');
scriptElement.setAttribute("rel", "stylesheet");
scriptElement.setAttribute("type", "text/css");
scriptElement.setAttribute("src", "/css/" + url + ".css");
document.head.appendChild(scriptElement);
},
cacheImage: function(url) {
var cachedImage = document.createElement("img");
cachedImage.style.display = "none";
cachedImage.setAttribute("src", url);
document.getElementsByTagName("HTML")[0].insertBefore(cachedImage, document.head);
},
deleteElement: function(elem) {
if (elem) {
elem.parentElement.removeChild(elem);
} else {
console.warn('helpers.deleteElement() called without an element.');
}
},
hideLoadScreen: function() {
document.body.style.overflow = 'visible';
var loadscreen = document.getElementById('loadscreen');
if (loadscreen) {
loadscreen.style.display = 'none';
this.deleteElement(loadscreen);
}
},
showLoadScreen: function() {
if (! document.getElementById('loadscreen')) {
document.body.style.overflow = 'hidden';
var loadScreen = document.createElement("div");
loadScreen.setAttribute("id", "loadscreen");
document.getElementsByTagName("HTML")[0].insertBefore(loadScreen, document.head);
var loadScreenWrapper = document.createElement("h1");
var loadScreenWrapper2 = document.createElement("center");
var loadScreenImg = document.createElement("img");
loadScreenImg.setAttribute("alt", "Loading...");
loadScreenImg.setAttribute("src", "/images/loadscreen.gif");
loadScreen.appendChild(loadScreenWrapper);
loadScreenWrapper.appendChild(loadScreenWrapper2);
loadScreenWrapper2.appendChild(loadScreenImg);
}
},
escapeHTML: function(html, newlines) {
var escaped = (html || '').replace(/&/g, '&amp;').replace(/</g,
'&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;');
if (newlines) {
escaped = escaped.replace(/\r\n/g, '\n').replace(/[\r\n]/g,
'<br/>');
} else {
escaped = escaped.replace(/[\r\n]/g, '');
}
return escaped;
},
setTitle: function(title) {
document.title = (title || 'Interactive content') + ' - ' + this.title;
},
onLoad: function(func) {
if (document.readyState == 'complete') {
func();
} else {
window.addEventListener('load', func);
}
},
/* Modified from https://stackoverflow.com/a/23945027 */
getDomainName: function(link) {
if (link.indexOf("://") > -1) {
return link.split('/')[2].split(':')[0];
} else {
return link.split('/')[0].split(':')[0];
}
},
params: new URLSearchParams(window.location.search),
getParams: function() {
var obj = {};
for (var i of this.params.keys()) {
obj[i] = this.params.get(i);
}
return obj;
},
/* All scripts callable with loadScript() should be listed here. */
versions: {
'card': 2,
'cardcover': 1,
'card-generator': 2,
'contextmenu': 1,
'cookies-accept': 1,
'guess': 2,
'handler': 2,
'jsinfo': 2,
'load': 1,
'ticker': 1,
'translate': 1,
'youtube-cinema': 2,
},
};
// window.history.replaceState(null, document.title, '/js');

View File

@ -1,101 +1,20 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
---
layout: default
title: Loading...
---
<!--
Copyright 2016 by luk3yx.
All rights reserved.
-->
<script src="https://unpkg.com/@ungap/url-search-params"></script>
<script src="/js/helpers.js"></script>
<script src="/js/guess.js"></script>
<div id="loadscreen">
<h1 style="text-align: center;">
Loading...
</h1>
</div>
<noscript><h1 style="position: fixed; top: 0; left: 0; z-index: 99999;">
Enable JavaScript or press the back button on your browser.
</h1></noscript>
<head>
<script type="text/javascript" src="/js/security.js"></script>
<title id="title">luk3yx's website</title>
<meta http-equiv="content-type"
content="text/html;charset=utf-8" />
<link rel="stylesheet" type="text/css" href="/style.css" />
<link rel="stylesheet" type="text/css" media="only screen and (min-width: 480px)" href="https://fonts.googleapis.com/css?family=Ubuntu:400,300" />
<link rel="icon" href="/images/favicon.png" type="image/png" />
<!-- Battle For The Net Widget -->
<script src="https://widget.battleforthenet.com/widget.js"></script>
<!-- HTML5Shiv -->
<!--[if lt IE 9]>
<script src="https://raw.githubusercontent.com/aFarkas/html5shiv/master/dist/html5shiv.min.js" type="text/javascript"></script>
<script src="https://raw.githubusercontent.com/aFarkas/html5shiv/master/dist/html5shiv-printshiv.min.js" type="text/javascript"></script>
<![endif]-->
<!-- HTML5Shiv END -->
<meta name="viewport" content="width=350" />
</head>
<body>
<div class="title">
<center>
<h1>
<a href="/index.html">
<img src="/images/logo.png" alt="Welcome to luk3yx's Website!" />
</a>
</h1>
</center>
</div>
<center>
<a href="https://www.mozilla.org/firefox" class="hideinff" target="_blank">
Firefox 57 is here! Download it now for a <b>massive</b> speed improvement!
<br/>
<img alt="Get Mozilla Firefox Now!" src="/images/firefox.png" />
</a>
</center>
<div class="content">
<div id="loadscreen">
<h1>
<center>
<img src="/images/loadscreen.gif" alt="Loading..." />
</center>
</h1>
</div>
<noscript><h1 style="position: fixed; top: 0; left: 0; z-index: 99999;">
Enable JavaScript or press the back button on your browser.
</h1></noscript>
<h1 id="description">Processing your request...</h1>
<img src="/images/load.gif" id="loader" width="100%" alt=" " />
<h2 id="instructions">Please be patient.</h2>
</div>
<center>
<a href="https://www.fairtrade.net/about-fairtrade/what-is-fairtrade.html" class="hideinff" target="_blank">
<img alt="Is your food fair food?" src="/images/fairtrade.svg" />
</a>
</center>
<div class="smallprint">
<center>
<h5>
&copy; Copyright 2017 by luk3yx. All rights reserved.
<br/>
<a href="/privacy.html#terms">
Terms and Conditions</a>
|
<a href="/privacy.html#privacy">
Privacy Policy</a>
|
<a href="https://github.com/luk3yx/luk3yx.github.io/issues">
Report an Issue</a>
|
<a href="/privacy.html#contact">
Contact Me
</a>
</h5>
<p id="w3c">
<a href="https://validator.w3.org/check?uri=referer" target="_blank">
<img src="https://www.w3.org/Icons/valid-xhtml10"
alt="Valid XHTML 1.0 Transitional" height="31"
width="88" />
</a>
</p>
</center>
</div>
</body>
</html>
<h1 id="description">Processing your request...</h1>
<h2 id="instructions">Please be patient.</h2>
<span id="loader"></span>

View File

@ -1,32 +0,0 @@
// Copyright 2016 by luk3yx.
// All rights reserved.
var distro = getParam.distro;
var versionall = getParam.version;
var version = versionall.split(",")[0];
var mintversion = versionall.split(",")[1];
if (distro == "mint") {
if (mintversion == "18") {
mintid = "27";
} else if (mintversion == "17.3") {
mintid = "26";
} else if (mintversion == "13") {
mintid = "18";
}
if (typeof mintid !== 'undefined') {
var url = "https://linuxmint.com/release.php?id=" + mintid;
} else {
alert("Sorry. The Linux Mint downloader is not fully functional at the monent.\n\nPlease select '" + mintversion + "' on the following page.");
var url = "https://linuxmint.com/download_all.php";
}
} else {
if (distro == "ubuntu") {
var url = "http://releases.ubuntu.com/" + version;
} else {
var url = "http://cdimage.ubuntu.com/" + distro + "/releases/" + version + "/release/";
}
}
window.stop();
window.location.href = url;

View File

@ -2,11 +2,8 @@
// All rights reserved.
window.onload = function() {
document.getElementById("description").innerHTML = "JavaScript Handler Page.";
loader = document.getElementById("loader");
loader.parentNode.removeChild(loader);
delete loader;
helpers.onLoad(function() {
document.getElementById("description").innerHTML = "JavaScript Handler Page.";
document.getElementById("instructions").innerHTML = "This page processes requests sent to services, and the 'Translate', 'YouTube&reg; Cinema', etc. bookmarklets.<br/\>This page has not been sent any data, so this message was shown instead.";
hideLoadScreen();
}
helpers.hideLoadScreen();
});

View File

@ -1,5 +1,2 @@
// Script to handle legacy requests.
// You think I would copyright this?
// Of course not.
// ...what requests does this script even handle?
loadScript(getParam.file);

View File

@ -1,7 +0,0 @@
// Copyright 2016 by luk3yx.
// All rights reserved.
function loadScript(script) {
scriptElement = document.createElement('script');
scriptElement.setAttribute("src", "/js/" + script + ".js");
document.head.appendChild(scriptElement);
}

View File

@ -1,4 +0,0 @@
// Copyright 2016 by luk3yx.
// All rights reserved.
window.stop();
window.location.href = "/403.html";

View File

@ -1,9 +0,0 @@
// You think I would copyright this?
// Of course not.
url = getParam.url;
// https://stackoverflow.com/a/3480785/1 for the XSS detection.
if (url.indexOf("javascript:") >= 0) {
window.location.href = "/error.html#xss";
} else {
window.location.href = url;
}

View File

@ -1,132 +0,0 @@
// Security script by luk3yx
// Copyright 2016 by luk3yx.
// All rights reserved
function debug(str) {
scriptElements = document.getElementsByTagName('script');
console.log("luk3yx-" + scriptElements[scriptElements.length - 1].getAttribute('src', -1).substring(4).split('.')[0] + " // " + str);
}
var siteurl = "luk3yx.github.io";
var protocol = window.location.protocol;
var redirecturl = "https://" + siteurl + window.location.pathname + window.location.search + window.location.hash
function redirect() {
window.stop();
window.location.href = redirecturl;
}
debug("Security loaded on " + siteurl + ". Scanning...");
if (siteurl !== window.location.hostname && "translate.google.com" !== window.location.hostname && "translate.googleusercontent.com" !== window.location.hostname) {
window.stop();
debug("This site is presumed to be fake, as actual URL is " + window.location.hostname + '.');
redirect();
} else {
if (protocol == "http:") {
debug("Warning! You are not using a secure protocol. You will now be switched to https.")
redirect();
} else {
debug("All clear");
if (window.location.pathname == "" || window.location.pathname == "/") {
debug("The welcome screen is loading.")
window.location.href = "/welcome.html";
}
debug("Loading functions...");
if (window.location.hostname == siteurl) {
window.onload = function() {
translateButton = document.createElement("div");
translateButton.setAttribute("style", "position: fixed; right: 0; top: 0;");
document.getElementsByClassName("title")[0].appendChild(translateButton);
translateButton.innerHTML = "<a href='javascript:translate()'><img src='data:image/svg+xml;base64,PHN2ZyBmaWxsPSIjMDAwMDAwIiBoZWlnaHQ9IjM2IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHdpZHRoPSIzNiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICAgIDxwYXRoIGQ9Ik0wIDBoMjR2MjRIMHoiIGZpbGw9Im5vbmUiLz4KICAgIDxwYXRoIGQ9Ik0xMi44NyAxNS4wN2wtMi41NC0yLjUxLjAzLS4wM2MxLjc0LTEuOTQgMi45OC00LjE3IDMuNzEtNi41M0gxN1Y0aC03VjJIOHYySDF2MS45OWgxMS4xN0MxMS41IDcuOTIgMTAuNDQgOS43NSA5IDExLjM1IDguMDcgMTAuMzIgNy4zIDkuMTkgNi42OSA4aC0yYy43MyAxLjYzIDEuNzMgMy4xNyAyLjk4IDQuNTZsLTUuMDkgNS4wMkw0IDE5bDUtNSAzLjExIDMuMTEuNzYtMi4wNHpNMTguNSAxMGgtMkwxMiAyMmgybDEuMTItM2g0Ljc1TDIxIDIyaDJsLTQuNS0xMnptLTIuNjIgN2wxLjYyLTQuMzNMMTkuMTIgMTdoLTMuMjR6Ii8+Cjwvc3ZnPgo=' alt='Translate this page' /></a>";
delete translateButton;
}
}
function loadScript(script) {
scriptElement = document.createElement('script');
scriptElement.setAttribute("src", "/js/" + script + ".js");
document.head.appendChild(scriptElement);
}
function loadCSS(url) {
scriptElement = document.createElement('link');
scriptElement.setAttribute("rel", "stylesheet");
scriptElement.setAttribute("type", "text/css");
scriptElement.setAttribute("src", "/css/" + url + ".css");
document.head.appendChild(scriptElement);
}
function cacheImage(url) {
cachedImage = document.createElement("img");
cachedImage.style.display = "none";
cachedImage.setAttribute("src", url);
document.getElementsByTagName("HTML")[0].insertBefore(cachedImage, document.head);
delete cachedImage;
}
function hideLoadScreen() {
document.body.style.overflow = 'visible';
document.getElementById("loadscreen").parentNode.removeChild(document.getElementById("loadscreen"));
}
function showLoadScreen() {
if (document.getElementById('loadscreen') === null) {
document.body.style.overflow = 'hidden';
loadScreen = document.createElement("div");
loadScreen.setAttribute("id", "loadscreen");
document.getElementsByTagName("HTML")[0].insertBefore(loadScreen, document.head);
loadScreenWrapper = document.createElement("h1");
loadScreenWrapper2 = document.createElement("center");
loadScreenImg = document.createElement("img");
loadScreenImg.setAttribute("alt", "Loading...");
loadScreenImg.setAttribute("src", "/images/loadscreen.gif");
loadScreen.appendChild(loadScreenWrapper);
loadScreenWrapper.appendChild(loadScreenWrapper2);
loadScreenWrapper2.appendChild(loadScreenImg);
// Remove temp variables
delete loadScreen;
delete loadScreenWrapper;
delete loadScreenWrapper2;
delete loadScreenImg;
}
}
var urlOpts = window.location.search;
if (window.location.pathname.substring(0, 11) == "/js/handler") {
debug("Loading JavaScript Handler...");
loadScript('handler');
} else if (window.location.pathname.substring(0, 12) == "/jstranslate" && window.location.pathname.substring(0, 17) != "/jstranslate.html") {
debug("Redirecting...");
window.stop();
window.location.href = "/js/handler?type=translate&translate=" + encodeURIComponent(window.location.hash.substring(1)) + "&oldlink=" + encodeURIComponent(document.referrer);
} else if (window.location.pathname.substring(0, 3) == "/js" && window.location.pathname.substring(0, 4) != "/jst") {
debug("Loading JavaScript Guess-Handler...");
window.history.replaceState({}, "luk3yx's website", "/js/handler?type=guess&content=" + window.location.hash);
loadScript('guess-landing');
} else if (window.location.pathname.substring(0, 9) == "/mtn.html") {
debug("URL modified for security reasons.");
window.history.replaceState({}, "luk3yx's website", "/");
} else if (window.location.pathname.substring(0, 5) == "/xmas") {
debug("Redirecting...");
window.stop();
window.location.href = "/js/handler?type=xmascard&" + window.location.search.substring(1);
}
function translate() {
window.location.href = "https://translate.google.com/translate?sl=en&u=" + window.location.href;
}
function loadHandler(params) {
showHandlerPage();
window.history.replaceState({}, "luk3yx's website", "/js/handler?" + params);
loadScript("handler");
}
function showHandlerPage() {
showLoadScreen();
document.getElementsByClassName("content")[0].innerHTML = atob("PGgxIGlkPSJkZXNjcmlwdGlvbiI+UHJvY2Vzc2luZyB5b3VyIHJlcXVlc3QuLi48L2gxPgo8aW1nIHNyYz0iL2ltYWdlcy9sb2FkLmdpZiIgaWQ9ImxvYWRlciIgd2lkdGg9IjEwMCUiIGFsdD0iICIgLz4KPGgyIGlkPSJpbnN0cnVjdGlvbnMiPlBsZWFzZSBiZSBwYXRpZW50LjwvaDI+Cg==");
}
function login(page) {
showHandlerPage();
window.history.replaceState({}, "luk3yx's website", "/" + page);
loadScript("login");
}
// Disable Google® Analytics on the BTFN page.
var _btfn_options = {
theme: 'money',
disableGoogleAnalytics: true
}
debug("Done! luk3yx-security is now exiting.");
}
}

View File

@ -1,11 +0,0 @@
// You think I would copyright this?
// Of course not.
// A script to handle HTCPCP requests
var teapot = atob('PGgxPgogICAgRVJST1IgNDE4Ogo8L2gxPgo8aDI+CiAgICBJJ20gYSB0ZWFwb3Q/CjwvaDI+CjxoND4KICAgIFRoZSByZXF1ZXN0ZWQgZW50aXR5IGJvZHkgaXMgc2hvcnQgYW5kIHN0b3V0CjwvaDQ+CjxoNT4KICAgIFRpcCBtZSBvdmVyIGFuZCBwb3VyIG1lIG91dC4KPC9oNT4K');
function teapotRedirect() {
document.getElementById("title").innerHTML = "ERROR 418: I'm a teapot?";
document.getElementsByClassName("content")[0].innerHTML = teapot;
}
window.onload = teapotRedirect;

View File

@ -1 +0,0 @@
loadScript("card");

View File

@ -1,10 +1,6 @@
// Copyright 2016 by luk3yx.
// All rights reserved.
// Possibly the simplest copyrighted script yet!
var beforeLink = decodeURIComponent(getParam.oldlink);
afterLink = beforeLink.replace("/watch?v=", "/embed/");
afterLink = afterLink.replace("/watch", "/embed");
//var afterLink = beforeLink.replace("?", "#");
window.location.href = afterLink;
var raw = helpers.params.get('oldlink');
var link = link.replace("/watch?v=", "/embed/").replace("/watch", "/embed");
window.location.href = link;

View File

@ -6,7 +6,7 @@
// Variables
$font-stack: 'Roboto', 'Ubuntu', 'Segoe UI', 'Arial', 'sans-serif';
$background: #EFEFEF;
$background: #FFFFFF;
$accent-colour: #b0bec5;
$accent-fg: black;
$text-colour: black;
@ -28,13 +28,16 @@ html, body {
background: $background;
padding: 0;
margin: 0;
}
h1, h2, h3, h4, h5, h6, p, body, input, textarea, button, li, a {
color: $text-colour;
font-family: $font-stack;
}
a {
color: #0d47a1;
text-decoration: none;
}
h1 {
font-size: 30px;
font-weight: 100;
}
.smallprint {
@ -68,7 +71,7 @@ h1 {
border-bottom: $border;
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
border-radius: 0 0 2px 2px;
h1 {
font-weight: 300;
font-size: 32px;
@ -76,13 +79,12 @@ h1 {
margin-top: -$padding + 2px;
text-align: center;
}
a {
text-decoration: none;
color: $accent-fg;
font-family: 'Ubuntu';
}
img {
position: fixed;
left: 0;
@ -115,11 +117,11 @@ hr {
min-height: 27px;
height: auto;
padding-bottom: 0;
h1 {
font-size: 6vw;
}
img {
max-height: 35px;
min-height: 20px;
@ -134,79 +136,17 @@ hr {
h1, h2, h3, h4, h5, h6, p, li, body {
text-align: center;
}
//h1, h2, h3, h4, h5, h6, p, body, input, textarea, button, li, a {
// font-family: $mobile-fonts;
//}
li {
list-style-type: none;
}
.indent a {
padding: 5px;
display: inline-block;
}
}
/*
.hamburgerbtn {
position: absolute;
top: 0;
left: 0;
color: black;
font-size: 34px;
}
.hamburger {
position: absolute;
top: -9999px;
left: -9999px;
z-index: -100;
}
.hamburgermenu {
display: none;
position: absolute;
top: 0px;
left: 0px;
width: 400px;
color: black;
border-right: 2px solid #000000 !important;
border-bottom: 2px solid #000000 !important;
z-index: 9;
}
.hamburgermenu .hamburgerbtn {
font-size: 32px;
position: relative;
display: block;
}
.hamburgermenu, .hamburgermenu p {
background-color: $accent-colour;
}
.hamburger:checked ~ .hamburgermenu {
display: block;
}
.hamburger:checked ~ .wrapper {
position: fixed;
display: block;
background-color: black;
top: 0px;
left: 0px;
right: 0px;
bottom: 0px;
opacity: 0.5;
filter: alpha(opacity=50);
z-index: 7;
}
.hamburger:checked ~ .smallprint {
position: fixed;
display: block;
background-color: $accent-colour;
left: 0px;
bottom: 0;
margin: 0px !important;
width: 400px;
z-index: 8;
color: black !important;
border-top: 2px solid #000000 !important;
border-right: 2px solid #000000 !important;
}
.hamburger:checked ~ .smallprint h5 a, .hamburger:checked ~ .smallprint h5 {
color: black;
}
*/
.hashshow {
display: none;
}
@ -215,25 +155,16 @@ hr {
}
.new {
//background: url("/images/glitter.gif");
overflow: hidden;
display: inline-block;
/*clear: both;
float: left;*/
margin: 0px;
padding: $padding;
border: 1px solid $accent-colour;
border-radius: $padding;
font-size: 1.5em;
font-weight: 200;
}
a:hover {
background-color: $accent-colour;
color: $accent-fg;
text-decoration: none;
}
a:hover img {
background-color: $accent-colour;
text-decoration: underline;
}
.centre, .smallprint {
@ -244,11 +175,11 @@ a:hover img {
background-color: transparent;
}
.noselect, #loadscreen, .forceblur, .blur:not(:hover), .button {
user-select: none;
-moz-user-select: -moz-none;
-ms-user-select: none;
-khtml-user-select: none;
-webkit-user-select: none;
-ms-user-select: none;
-moz-user-select: -moz-none;
user-select: none;
}
#loadscreen {
background-color: $accent-colour;
@ -288,7 +219,7 @@ a:hover img {
a, button {
cursor: pointer;
}
.button, button, input[type=submit], select {
.button, button, input[type=submit] {
font-weight: 400 !important;
font-size: 12px !important;
padding: 4px 4px !important;
@ -301,7 +232,7 @@ a, button {
text-align: center;
text-shadow: none;
box-shadow: 1px 1px 0 #000000;
&:hover {
background: #FFFFFF;
color: #111111;
@ -317,9 +248,13 @@ input[type=checkbox] {
background-color: #FFFFFF;
}
@media only screen and (min-width: 480px) {
a, a img:not(:hover), a:not(:hover), .blur, a img, .title, .button, button, select, input {
a, a img:not(:hover), a:not(:hover), .blur, a img, .title, .button, button, input {
@include transition($transition);
}
.indent {
margin-left: 0.5em;
}
}
.forceblur {
cursor: not-allowed;

View File

@ -4,7 +4,7 @@ layout: default
---
<h1>
JavaScript YouTube&reg; Cinema Mode Button
JavaScript YouTube Cinema Mode Button
<small>
<small>
Thanks to
@ -13,9 +13,9 @@ layout: default
--></a>
(for button) and
<a href="/index.html">
YouTube&reg;.<!--
YouTube<!--
--></a>
(For YouTube&reg; videos)
(For YouTube videos).
</small>
</small>
</h1>
@ -24,7 +24,7 @@ layout: default
</h2>
<p>
<a href="javascript:void(window.location.href = 'https://luk3yx.github.io/js/handler?type=youtube-cinema&amp;oldlink=' + encodeURIComponent(window.location.href))">
YouTube&reg; Cinema
YouTube Cinema
</a>
<br/>
In most browsers (including Firefox), you can just drag the link to the bookmarks toolbar.
@ -32,4 +32,3 @@ layout: default
In Firefox, you can also right-click the link, then click "Bookmark This Page".
Select 'Bookmarks Toolbar' (or another place), and you are all set.
</p>