Simple function example
Compares two numbers, returns the larger one
by rowntreerob
HTML
<p>what paywall to get around: <input type="text" id="f" size="64"></p>
<button id="b" class="myButton">Paywall</button>
CSS
input[type=text] {
font-family: 'Consolas', monospace;
font-size: 0.9em;
padding: 0.03em;
text-align: left;
}
/* insane button CSS from http://www.bestcssbuttongenerator.com/ */
.myButton {
-moz-box-shadow: 0px 1px 0px 0px #f0f7fa;
-webkit-box-shadow: 0px 1px 0px 0px #f0f7fa;
box-shadow: 0px 1px 0px 0px #f0f7fa;
background:-webkit-gradient(linear, left top, left bottom, color-stop(0.05, #33bdef), color-stop(1, #019ad2));
background:-moz-linear-gradient(top, #33bdef 5%, #019ad2 100%);
background:-webkit-linear-gradient(top, #33bdef 5%, #019ad2 100%);
background:-o-linear-gradient(top, #33bdef 5%, #019ad2 100%);
background:-ms-linear-gradient(top, #33bdef 5%, #019ad2 100%);
background:linear-gradient(to bottom, #33bdef 5%, #019ad2 100%);
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#33bdef', endColorstr='#019ad2',GradientType=0);
background-color:#33bdef;
-moz-border-radius:6px;
-webkit-border-radius:6px;
border-radius:6px;
border:1px solid #057fd0;
display:inline-block;
cursor:pointer;
color:#ffffff;
font-family:Arial;
font-size:15px;
font-weight:bold;
padding:6px 24px;
text-decoration:none;
text-shadow:0px -1px 0px #5b6178;
}
.myButton:hover {
background:-webkit-gradient(linear, left top, left bottom, color-stop(0.05, #019ad2), color-stop(1, #33bdef));
background:-moz-linear-gradient(top, #019ad2 5%, #33bdef 100%);
background:-webkit-linear-gradient(top, #019ad2 5%, #33bdef 100%);
background:-o-linear-gradient(top, #019ad2 5%, #33bdef 100%);
background:-ms-linear-gradient(top, #019ad2 5%, #33bdef 100%);
background:linear-gradient(to bottom, #019ad2 5%, #33bdef 100%);
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#019ad2', endColorstr='#33bdef',GradientType=0);
background-color:#019ad2;
}
.myButton:active {
position:relative;
top:1px;
}
JavaScript
// get the button and make it respond to a click
var theButton = document.getElementById("b");
theButton.onclick = bypass;
// this function runs each time the button is clicked
// the simple function is called within this one
function bypass(url) {
var results = [];
var box1 = document.getElementById("f").value;
var prefx = 'https://cfworker-beatthatwall.jayass.workers.dev?url=';
var parts = prefx + box1;
console.log(parts);
// try { var newwindow = window.open(partss, 'my window');}
// catch (err){console.log(JSON.stringify(err))}
results.push(parts);
console.log(results);
}