~vivaldi
5 itemsDownload ./*


..
common.css
homepage-terminal.html
scrollbars-crux
twily.css
vivaldi.gif


vivaldihomepage-terminal.html
6 months agoDownloadRawClose


<!DOCTYPE html>
<!--

    Author:        Twily                                        2017
    Website:       http://twily.info/
    Compatibility: Mozilla Firefox, Internet Explorer, Google Chrome

-->
<html>
<head>
<title>&gt;_</title>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />

<link id="favicon" rel="shortcut icon" href="http://twily.info/terminal.ico" />
<style type="text/css">
html,body {
    margin: 0; padding: 0; overflow: auto;
    background: #300A24; color: #FFFFFF;
    width: 100%; height: 100%; margin: 0; padding: 0;
}
* {
	box-sizing: border-box;
	font-family: Monospace;
	font-size: 12pt;
}
*:focus { outline: none !important; }

a:link, a:visited { color: #606163; text-decoration: none; }
a:hover, a:active { color: #EA75BC; }

.tbl {
	display: table; width: 100%; height: 100%;
	background: transparent; overflow: hidden;
	cursor: text;
}
.tr { display: table-row; }
.tc { display: table-cell; }

#q {
	border: 0; padding: 0px; width: 100%;
	background: transparent; color: #FFFFFF;
}
#container {
	position: relative;
	width: 100%; height: 100%; /* auto */
	overflow-x: hidden; overflow-y: auto;
}
#output {
	height: auto; width: 100%; max-height: 100%;
	position: absolute; bottom: 0; left: 0; /* If you want terminal input to start on top; Remove this line, Swap #container height to auto, Swap .tbl height to max-height, Swap Javascript function bottom() to body. */
	word-break: break-all; white-space: pre;
}
</style>

<script type="text/javascript">
var $=function(id) { return document.getElementById(id); };

var openNewWindow=true; // Open websites in new window or redirect current

// Bookmark cathegories
var bmark=[
	"News",
	"4chan",
	"Entertainment",
	"Store",
	"Other",
];

// Bookmark list (Separate in order with bmark array above)
// Tip: Use VIM to format and make list into column for easy reading (%!column -ts ',')
var marklist=[
	[
["Arch Linux",                       "http://archlinux.org"],
["Dagbladet",                        "http://dagbladet.no"],
["Gamer",                            "http://gamer.no"],
["GameSpot",                         "http://www.gamespot.com/"],
["IGN",                              "http://ign.com"],
["IT-Avisen",                        "http://itavisen.no"],
["NRK",                              "http://nrk.no"],
["OA",                               "http://oa.no"],
["PressFire",                        "http://pressfire.no"],
["Teknofil",                         "http://tek.no"],
["The Guardian",                     "http://www.theguardian.com/"],
["The New York Times",               "http://www.nytimes.com/"],
["VG",                               "http://vg.no"],
["WikiLeaks",                        "https://wikileaks.org/index.en.html"],
	],
	[
["/b/ - Random",                     "https://boards.4chan.org/b/catalog"],
["/diy/ - Do It Yourself",           "https://boards.4chan.org/diy/catalog"],
["/f/ - Flash",                      "https://boards.4chan.org/f/"],
["/g/ - Technology",                 "https://boards.4chan.org/g/catalog"],
["/lgbt/ - Les, Gay, Bi, Trans",     "https://boards.4chan.org/lgbt/catalog"],
["/mu/ - Music",                     "https://boards.4chan.org/mu/catalog"],
["/r9k/ - ROBOT9001",                "https://boards.4chan.org/r9k/catalog"],
["/sci/ - Science & Math",           "https://boards.4chan.org/sci/catalog"],
["/tv/ - Television & Film",         "https://boards.4chan.org/tv/catalog"],
["/v/ - Video Games",                "https://boards.4chan.org/v/catalog"],
["/vg/ - Video Games Generals",      "https://boards.4chan.org/vg/catalog"],
["/wg/ - Wallpaper General",         "https://boards.4chan.org/wg/catalog"],
["/wsg/ - Worksafe GIF",             "https://boards.4chan.org/wsg/catalog"],
["/x/ - Paranormal",                 "https://boards.4chan.org/x/catalog"],
	],
	[
["8Chan",                            "https://8ch.net/index.html"],
["DeviantArt",                       "http://deviantart.com/"],
["Facebook",                         "http://facebook.com"],
["GW2 Timer",                        "http://gw2timer.com/?enu_Language=en"],
["I Am Bored",                       "http://www.i-am-bored.com/"],
["Imgur",                            "https://imgur.com/"],
["LiveLeak",                         "https://www.liveleak.com"],
["Netflix",                          "http://netflix.com"],
["Norsk Freakforum",                 "http://freak.no/"],
["PartyCloud",                       "http://www.partycloud.fm/"],
["Reddit",                           "http://reddit.com"],
["StumbleUpon",                      "http://stumbleupon.com"],
["The Useless Web",                  "http://www.theuselessweb.com/"],
["uWall.tv",                         "http://uwall.tv/"],
["Your World of Text",               "http://www.yourworldoftext.com/"],
["YouTube",                          "http://youtube.com"],
	],
	[
["AliExpress",                       "http://www.aliexpress.com/"],
["Amazon",                           "http://www.amazon.com/"],
["Biltema",                          "http://www.biltema.no/no/"],
["Byggmakker",                       "http://www.byggmakker.no/"],
["Byggmax",                          "https://www.byggmax.no/"],
["Clas Ohlson",                      "http://www.clasohlson.com/no/"],
["DressLilly",                       "https://www.dresslily.com"],
["eBay",                             "http://www.ebay.com/"],
["Elkjøp",                           "http://www.elkjop.no/"],
["iHerb",                            "https://no.iherb.com"],
["Jula",                             "http://www.jula.no/"],
["Jysk",                             "http://jysk.no/"],
["Komplett",                         "https://www.komplett.no/"],
["Kondomeriet",                      "https://www.kondomeriet.no/"],
["Prisjakt",                         "http://www.prisjakt.no/"],
["Rusta",                            "http://www.rusta.com/no/"],
["Zalando",                          "https://www.zalando.no/herre-home/"],
	],
	[
["Altinn",                           "https://www.altinn.no/"],
["amaliestar.com",                   "https://amaliestar.com"],
["CamModelDirectory",                "https://www.cammodeldirectory.com"],
["Chaturbate",                       "https://chaturbate.com/"],
["CoinBase",                         "https://www.coinbase.com/signin"],
["DigiPost",                         "https://www.digipost.no/app/#/"],
["DnB",                              "http://www.dnb.no/en/"],
["DreamHost",                        "https://www.dreamhost.com/"],
["FanCentro",                        "https://fancentro.com/home"],
["FirstChoicePay",                   "https://www.firstchoicepay.com"],
["Hastebin",                         "https://hastebin.com"],
["IndieBill",                        "https://www.getindiebill.com/beta/"],
["Outlook",                          "http://outlook.com"],
["PayPal",                           "http://www.paypal.com/"],
["Paxum",                            "https://www.paxum.com/sign-in/"],
["TriTrans.net",                     "http://www.tritrans.net/"],
["twily.info",                       "http://twily.info"],
["Zombaio",                          "https://zombaio.com/"],
	],
];

// Customize Ascii Art on clear/load (Remember to escape characters)
// http://www.chris.com/ascii/index.php?art=animals/horses
var art=[
"                               _(\\_/) ",
"                             ,((((^`\\",
"                            ((((  (6 \\ ",
"                          ,((((( ,    \\",
"      ,,,_              ,(((((  /\"._  ,`,",
"     ((((\\\\ ,...       ,((((   /    `-.-'",
"     )))  ;'    `\"'\"'\"\"((((   (      ",
"    (((  /            (((      \\",
"     )) |                      |",
"    ((  |        .       '     |",
"    ))  \\     _ '      `t   ,.')",
"    (   |   y;- -,-\"\"'\"-.\\   \\/  ",
"    )   / ./  ) /         `\\  \\",
"       |./   ( (           / /'",
"       ||     \\\\          //'|",
"   jgs ||      \\\\       _//'||",
"       ||       ))     |_/  ||",
"       \\_\\     |_/          ||",
"       `'\"                  \\_\\",
"                            `'\" ",
];

// Search engine/commands (include command as 'case "xx":' in command execution search)
var search=[
	["gg","https://www.google.no/#q="],
	["img","https://www.google.no/search?tbm=isch&q="],
	["yt","https://www.youtube.com/results?search_query="],
	["wiki","http://en.wikipedia.org/w/index.php?search="],
	["db","http://www.imdb.com/find?q="],
	["ddg","https://duckduckgo.com/?q="],
    ["ts","http://www.thesaurus.com/browse/"],
	["ud","http://www.urbandictionary.com/define.php?term="],
	["ebay","https://www.ebay.com/sch/i.html?_from=R40&_trksid=p2050601.m570.l1313.TR0.TRC0.H0.Xtest.TRS0&_nkw="],
	["eng","https://translate.google.no/?hl=en#auto/en/"],
	["nor","https://translate.google.no/?hl=no#auto/no/"],
];

// Command list for HELP
var commands=[
	["help","Display list of commands."],
	["bmark","List bookmarks."],
	["go","Open bookmark number."],
	["url","Open Website address."],
    ["",""],
	["gg","Search Google."],
	["img","Search Images."],
	["yt","Search YouTube."],
	["wiki","Search Wikipedia."],
	["db","Search ImDB."],
	["ddg","Search DuckDuckGo."],
	["ts","Lookup Thesaurus."],
	["ud","Lookup UrbanDictionary."],
	["ebay","Find on eBay."],
	["nor","Translate to Norwegian"],
	["eng","Translate to English."],
    ["",""],
	["art","Show art."],
	["time","Todays time and date."],
	["bc","Calculator."],
	["cls","Clear the buffer."],
	["exit","Close window."],
];

var hist=[],hpos=0;
var mark=[];
function run(str) { // Command execution
	hist.push(str);
	hpos=hist.length;
	str=str.replace(/</g,"&lt;");
	str=str.replace(/>/g,"&gt;");

	var cmd=str.split(" ");
	cmd[0]=cmd[0].toLowerCase();
	
	print("&gt;&nbsp;"+str);
	
	var str="";
	switch(cmd[0]) {
		case "help": case "?": // List commands
			print("List of commands: <br />");
			for(var i=0;i<commands.length;i++) {
				var str_spaces="",spaces=10;
				spaces-=commands[i][0].length;
				for(var j=0;j<spaces;j++) str_spaces+="&nbsp;";
				print(commands[i][0]+str_spaces+commands[i][1]);
			}
			break;
		case "bmark": case "bm": case ":b": // Bookmarks
			mark=[];
			if(!cmd[1]) {
				print("Please chose a bookmark cathegory: <br />");
				for(var i=0;i<bmark.length;i++) {
					print(bmark[i]);
				}
                print("<br />All");
			} else {
				cmd[1]=cmd[1].toLowerCase();
                if("all".indexOf(cmd[1])!=-1) { // All boomarks
                /*if(cmd[1]=="all") {*/
                    var x=0;
                    print("All bookmarks: <br />");
                    for(var i=0;i<marklist.length;i++) {
                        print("&nbsp; "+bmark[i]);
                        for(var j=0;j<marklist[i].length;j++) {
                            var str_spaces="",spaces=10;
                            spaces-=(x+1).toString().length;
                            for(var k=0;k<spaces;k++) str_spaces+="&nbsp;";
                            print((x+1)+str_spaces+marklist[i][j][0]);
                            mark.push(marklist[i][j][1]);
                            x++;
                        }
                    }
                    print("<br />'go #' to follow bookmark.");
                } else { // Selective bookmark
                    var x=-1;
                    for(var i=0;i<bmark.length;i++) {
                        if(bmark[i].toLowerCase().indexOf(cmd[1])!=-1) {
                            x=i;
                            break;
                        }
                    }
                    if(x!=-1) {
                        print("Bookmarks under '"+bmark[x]+"': <br />");
                        for(var i=0;i<marklist[x].length;i++) {
                            var str_spaces="",spaces=10;
                            spaces-=(i+1).toString().length;
                            for(var j=0;j<spaces;j++) str_spaces+="&nbsp;";
                            print((i+1)+str_spaces+marklist[x][i][0]);
                            mark.push(marklist[x][i][1]);
                        }
                        print("<br />'go #' to follow bookmark.");
                    } else {
                        print("Please chose a bookmark cathegory: <br />");
                        for(var i=0;i<bmark.length;i++) {
                            print(bmark[i]);
                        }
                    }
                }
			}
			break;
		case "go": case ":g": // Follow bookmark
			if(cmd[1]) {
				cmd[1]=parseInt(cmd[1])-1;
				if(mark[cmd[1]]) {
					print("Opening bookmark: "+mark[cmd[1]]+".");
					if(openNewWindow) {
						window.open(mark[cmd[1]]);
					} else {
						window.location.href=mark[cmd[1]];
					}
				} else {
					print("Bookmark number is out of range.");
				}
			} else {
				print("Please a specify bookmark number.");
			}
			break;
		case "url": case "open": case ":o": // Open address
			print("Opening address: "+cmd[1]+".");
			if(openNewWindow) {
				window.open("http://"+cmd[1]);
			} else {
				window.location.href="http://"+cmd[1];
			}
			break;
		case "gg": // Search commands
		case "img":
		case "yt":
		case "wiki":
		case "db":
		case "ddg":
		case "ts":
		case "ud":
		case "ebay":
		case "nor":
		case "eng":
			for(var i=1;i<cmd.length;i++) str+=cmd[i]+" ";
			str=str.substr(0,str.length-1);
			
			print("Searching '"+cmd[0]+"' for: "+str+".");
			
			var lnk="";
			for(var i=0;i<search.length;i++) {
				if(search[i][0]==cmd[0]) {
					lnk=search[i][1];
					break;
				}
			}

			if(openNewWindow) {
				window.open(lnk+str);
			} else {
				window.location.href=lnk+str;
			}
			break;
		case "art":
			printart();
			break;
		case "time": case "date":
			printtime();
			break;
		case "bc":
			for(var i=1;i<cmd.length;i++) str+=cmd[i]+" ";
			str=str.substr(0,str.length-1);
			print(eval(str));
			break;
		case "cls": case "clear": // Clear buffer
			$('output').innerHTML="";
			
			printart();
			print("");
			printtime();
			print("");
			run("help");
			break;
        case "exit": case "quit": case ":q": // Close window
            window.close();
            break;
		default: // Try search
			if(cmd[0].length>0) {
				print("Unknown command: "+cmd[0]+".");

                for(var i=0;i<cmd.length;i++) str+=cmd[i]+" ";
			    str=str.substr(0,str.length-1);

                cmd[0]="gg"; // Default search Google
                var lnk="";
			    for(var i=0;i<search.length;i++) {
				    if(search[i][0]==cmd[0]) {
					    lnk=search[i][1];
					    break;
				    }
			    }

				print("Trying to search '"+cmd[0]+"' for: "+str+".");

				if(openNewWindow) {
					window.open(lnk+str);
				} else {
					window.location.href=lnk+str;
				}
			}
	}
	
	//print("");
}
function printtime() {
	var t=new Date();
	var days=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];
	var day=days[t.getDay()];
	var months=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];
	var month=months[t.getMonth()];
	var date=t.getDate();
	var hour="0"+t.getHours().toString();
	var minute="0"+t.getMinutes().toString();
	var second="0"+t.getSeconds().toString();
	var year=t.getFullYear();
	var timediff=t.getTimezoneOffset()/-60;
	if(timediff>=0) timediff="+"+timediff;
	print(day+" "+month+" "+date+" "+hour.substr(hour.length-2)+":"+minute.substr(minute.length-2)+":"+second.substr(second.length-2)+" UTC"+timediff+" "+year);
}

function printart() {
	for(var i=0;i<art.length;i++) {
		print(art[i]);
	}
}

function print(ln) {
	$('output').innerHTML+=ln+"<br />";
	
	bottom();
}

var qT,d=false;
function focustimer(e,x) { // Focus input on buffer click
	clearTimeout(qT);
	
	if(e.which==1) {
		switch(x) {
			case 1:
				d=true;
				qT=setTimeout(function() { focustimer(e,0); },200);
				break;
			case 2:
				if(d) { focusq(); }
				break;
			default:
				d=false;
		}
	}
}

function focusq() {
	$('q').focus();
}

function bottom() {
	$('container').scrollTop=$('container').scrollHeight;
	/*document.body.scrollTop=document.body.scrollHeight;*/
}

var ctrlC=[0,0];
function handleq(e,q) { // Handle search query
    var key=e.keyCode || e.which;

    if(key==13) { // Enter
		run(q);

        $('q').value="";
        focusq();
    }
	
	if(key==17) ctrlC[0]=1;
	if(key==67) ctrlC[1]=1;
	if(ctrlC[0]==1 && ctrlC[1]==1) {
		var str=$('q').value;
		str=str.replace(/</g,"&lt;");
		str=str.replace(/>/g,"&gt;");
		
		print("&gt;&nbsp;"+str);
		$('q').value="";
		focusq();
	}
}

function scrollq(e,q) {
    var key=e.keyCode || e.which;

	if(key==38) { // Up
		if(hpos>0) hpos--;
		if(hist[hpos].length>0) {
			$('q').value=hist[hpos];
		}
	} else if(key==40) { // Down
		hpos++;
		if(hpos>=hist.length) {
			$('q').value="";
			hpos=hist.length;
		}
		if(hist[hpos].length>0) {
			$('q').value=hist[hpos];
		}
	}
	
	if(key==17) ctrlC[0]=0;
	if(key==67) ctrlC[1]=0;
}

function init() {
	run("cls");

    focusq();
}
</script>
</head>
<body onload="init();">


<div class="tbl" style="padding: 8px;">
	<div class="tr">
		<div class="tc" style="height: 100%;">
			<div id="container" onmousedown="focustimer(event,1);" onmouseup="focustimer(event,2)">
				<div id="output"></div>
			</div>
		</div>
	</div>
	<div class="tr">
		<div class="tc">
		
		<div class="tbl">
			<div class="tr">
				<div class="tc" style="height: 100%;">
					&gt;&nbsp;
				</div>
				<div class="tc" style="height: 100%; width: 100%;">
					<input type="text" value="" placeholder="" id="q" onkeydown="handleq(event,this.value);" onkeyup="scrollq(event,this.value);" autocomplete="off" onfocus="this.value=this.value;" />
				</div>
			</div>
		</div>
			
		</div>
	</div>
</div>


</body>
</html>

Top
amalie at twily dot info
©twily.info 2013 - 2018



918 439 visits
... ^ v