Skip to content

Commit

Permalink
Adding easter egg :)
Browse files Browse the repository at this point in the history
  • Loading branch information
Depado committed May 9, 2016
1 parent 1622a29 commit 1c4e43c
Show file tree
Hide file tree
Showing 9 changed files with 387 additions and 23 deletions.
22 changes: 22 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
version = 1.0.2

.PHONY: release clean

release:
-mkdir -p releases/smallblog-linux-amd64-${version}/pages
-mkdir -p releases/smallblog-linux-arm-${version}/pages
cp -r assets/ releases/smallblog-linux-amd64-${version}
cp -r assets/ releases/smallblog-linux-arm-${version}
cp -r templates/ releases/smallblog-linux-amd64-${version}
cp -r assets/ releases/smallblog-linux-arm-${version}
cp examples/article.md.example releases/smallblog-linux-amd64-${version}/pages/article.md
cp examples/article.md.example releases/smallblog-linux-arm-${version}/pages/article.md
cp examples/conf.yml.example releases/smallblog-linux-amd64-${version}/conf.yml
cp examples/conf.yml.example releases/smallblog-linux-arm-${version}/conf.yml
go build -o releases/smallblog-linux-amd64-${version}/smallblog
GOARCH=arm go build -o releases/smallblog-linux-arm-${version}/smallblog
tar czf releases/smallblog-linux-amd64-${version}.tar.gz releases/smallblog-linux-amd64-${version}
tar czf releases/smallblog-linux-arm-${version}.tar.gz releases/smallblog-linux-arm-${version}

clean:
-rm -r releases/
7 changes: 7 additions & 0 deletions assets/grids-responsive-min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

105 changes: 105 additions & 0 deletions assets/konami.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
/*
* Konami-JS ~
* :: Now with support for touch events and multiple instances for
* :: those situations that call for multiple easter eggs!
* Code: https://github.com/snaptortoise/konami-js
* Examples: http://www.snaptortoise.com/konami-js
* Copyright (c) 2009 George Mandis (georgemandis.com, snaptortoise.com)
* Version: 1.4.5 (3/2/2016)
* Licensed under the MIT License (http://opensource.org/licenses/MIT)
* Tested in: Safari 4+, Google Chrome 4+, Firefox 3+, IE7+, Mobile Safari 2.2.1 and Dolphin Browser
*/

var Konami = function (callback) {
var konami = {
addEvent: function (obj, type, fn, ref_obj) {
if (obj.addEventListener)
obj.addEventListener(type, fn, false);
else if (obj.attachEvent) {
// IE
obj["e" + type + fn] = fn;
obj[type + fn] = function () {
obj["e" + type + fn](window.event, ref_obj);
}
obj.attachEvent("on" + type, obj[type + fn]);
}
},
input: "",
pattern: "38384040373937396665",
load: function (link) {
this.addEvent(document, "keydown", function (e, ref_obj) {
if (ref_obj) konami = ref_obj; // IE
konami.input += e ? e.keyCode : event.keyCode;
if (konami.input.length > konami.pattern.length)
konami.input = konami.input.substr((konami.input.length - konami.pattern.length));
if (konami.input == konami.pattern) {
konami.code(link);
konami.input = "";
e.preventDefault();
return false;
}
}, this);
this.iphone.load(link);
},
code: function (link) {
window.location = link
},
iphone: {
start_x: 0,
start_y: 0,
stop_x: 0,
stop_y: 0,
tap: false,
capture: false,
orig_keys: "",
keys: ["UP", "UP", "DOWN", "DOWN", "LEFT", "RIGHT", "LEFT", "RIGHT", "TAP", "TAP"],
code: function (link) {
konami.code(link);
},
load: function (link) {
this.orig_keys = this.keys;
konami.addEvent(document, "touchmove", function (e) {
if (e.touches.length == 1 && konami.iphone.capture == true) {
var touch = e.touches[0];
konami.iphone.stop_x = touch.pageX;
konami.iphone.stop_y = touch.pageY;
konami.iphone.tap = false;
konami.iphone.capture = false;
konami.iphone.check_direction();
}
});
konami.addEvent(document, "touchend", function (evt) {
if (konami.iphone.tap == true) konami.iphone.check_direction(link);
}, false);
konami.addEvent(document, "touchstart", function (evt) {
konami.iphone.start_x = evt.changedTouches[0].pageX;
konami.iphone.start_y = evt.changedTouches[0].pageY;
konami.iphone.tap = true;
konami.iphone.capture = true;
});
},
check_direction: function (link) {
x_magnitude = Math.abs(this.start_x - this.stop_x);
y_magnitude = Math.abs(this.start_y - this.stop_y);
x = ((this.start_x - this.stop_x) < 0) ? "RIGHT" : "LEFT";
y = ((this.start_y - this.stop_y) < 0) ? "DOWN" : "UP";
result = (x_magnitude > y_magnitude) ? x : y;
result = (this.tap == true) ? "TAP" : result;

if (result == this.keys[0]) this.keys = this.keys.slice(1, this.keys.length);
if (this.keys.length == 0) {
this.keys = this.orig_keys;
this.code(link);
}
}
}
}

typeof callback === "string" && konami.load(callback);
if (typeof callback === "function") {
konami.code = callback;
konami.load();
}

return konami;
};
24 changes: 11 additions & 13 deletions assets/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
body {
font-family: 'Roboto', serif;
text-align: justify;
margin: 40px auto;
max-width: 650px;
line-height: 1.6;
font-size: 18px;
color: #444;
Expand Down Expand Up @@ -69,6 +67,16 @@ pre {
overflow: auto;
border-radius: 0.3em;
}
code {
font-family: 'Roboto Mono';
background-color: rgba(0, 0, 0, 0.04);
padding: 0.2em;
padding-left: 0.3em;
padding-right: 0.3em;
padding-top: 0.3em;
font-size: 14px;
border-radius: 0.3em;
}
pre>code {
padding: 0;
padding-right: 1em;
Expand All @@ -82,16 +90,6 @@ pre>code {
word-wrap: normal;
line-height: 1.5;
}
code {
font-family: 'Roboto Mono';
background-color: rgba(0, 0, 0, 0.04);
padding: 0.2em;
padding-left: 0.3em;
padding-right: 0.3em;
padding-top: 0.3em;
font-size: 14px;
border-radius: 0.3em;
}

/* Custom */

Expand All @@ -102,7 +100,7 @@ code {
.head {
text-align: center;
margin-top: 0;
margin-bottom: 75px;
margin-bottom: 50px;
}
.tag {
background: grey;
Expand Down
192 changes: 192 additions & 0 deletions assets/term.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,192 @@
/* Global Design */

body {
font-family: 'Roboto', serif;
text-align: justify;
line-height: 1.6;
font-size: 18px;
color: #7cb4fc;
text-shadow: #89d3fd 0 -1px 35px;
background: #000;
font: 400 19px VT323, monospace;
}
h1:after,h2:after,h3:after,h4:after{
content: "\220E";
-webkit-animation: cursor .95s ease-in-out infinite;
-moz-animation: cursor .95s ease-in-out infinite;
-ms-animation: cursor .95s ease-in-out infinite;
-o-animation: cursor .95s ease-in-out infinite;
animation: cursor .95s ease-in-out infinite;
font-size: 120%;
}
th, td {
border-bottom: 1px solid #ddd;
padding: 15px;
}
tr:nth-child(even) {
background-color: #000;
}
table{
border-collapse: collapse;
}
a {
text-decoration: underline;;
color: #7cb4fc;
}
a:hover {
color: #444;
}
h1, h2, h3 {
line-height: 1.2;
margin-top: 50px;
}
hr {
border: 0;
height: 1px;
background: grey;
}
blockquote {
padding-left: 10px;
padding-bottom: 10px;
margin: 0;
border-left: 4px solid;
border-color: grey;
font-style: italic;
overflow: auto;
}
blockquote>p {
padding-right: 10px;
margin: 0;
}
cite {
float: right;
font-style: normal;
}

/* Code related stuff */

code[class*="language-"], pre[class*="language-"] {
font-family: 'Roboto Mono';
}
pre {
font-family: 'Roboto Mono';
font-size: 14px;
background: #272822;
padding: 1em;
margin: .5em 0;
overflow: auto;
border-radius: 0.3em;
}
code {
font-family: 'Roboto Mono';
border: 1px solid;
padding: 0;
padding-left: 0.3em;
padding-right: 0.3em;
font-size: 14px;
border-radius: 0.3em;
}
pre>code {
padding: 0;
padding-right: 1em;
color: #f8f8f2;
border: none;
background-color: transparent;
text-shadow: 0 1px rgba(0, 0, 0, 0.3);
text-align: left;
white-space: pre;
word-spacing: normal;
word-break: normal;
word-wrap: normal;
line-height: 1.5;
}

/* Custom */

.title {
margin-bottom: 0;
margin-top: 0;
}
.head {
text-align: center;
margin-top: 0;
margin-bottom: 50px;
}
.tag {
background: grey;
display: inline-block;
color: #fff;
position: relative;
border-radius: 16px;
padding-left: 0.6em;
padding-right: 0.6em;
padding-top: 0.2em;
padding-bottom: 0.2em;
text-decoration: none;
font-size: 14px;
}
.footerinfo {
text-align: center;
margin-top: 70px;
}

@-webkit-keyframes scan {
from {
top: -50%;
left: 0;
}
to {
top: 150%;
left: 0;
}
}
@keyframes scan {
from {
top: -50%;
left: 0;
}
to {
top: 150%;
left: 0;
}
}
@-webkit-keyframes cursor {
from {
opacity: 1.0;
}
to {
opacity: 0.0;
}
}
@-moz-keyframes cursor {
from {
opacity: 1.0;
}
to {
opacity: 0.0;
}
}
@-ms-keyframes cursor {
from {
opacity: 1.0;
}
to {
opacity: 0.0;
}
}
@-o-keyframes cursor {
from {
opacity: 1.0;
}
to {
opacity: 0.0;
}
}
@keyframes cursor {
from {
opacity: 1.0;
}
to {
opacity: 0.0;
}
}
12 changes: 12 additions & 0 deletions examples/article.md.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
title: First Article
description: Article's Description
slug: first-article
author: Yourself
date: 2016-05-06 11:22:00
tags:
- first

# Actual Markdown Content
Notice the blank line right after the `tags` list.
That's how you tell the parser that you are done with yaml format.
And that's a really long line you don't want to type every other day because it's excessively long.

0 comments on commit 1c4e43c

Please sign in to comment.