game-of-life-theme 0.5.0 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/README.md +8 -4
- data/_includes/header.html +17 -0
- data/_layouts/about.html +13 -0
- data/_layouts/home.html +11 -10
- data/_layouts/post.html +2 -1
- data/assets/css/card.css +19 -16
- data/assets/css/header.css +3 -0
- data/assets/game_of_life.js +39 -7
- data/assets/main.css +21 -0
- metadata +6 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 0ae1e523b44afa7ff218011297979ed7061493b156b8f43b6e8d74f82d135d85
|
4
|
+
data.tar.gz: 926ce127c15c437795faca8c1da2ccfb282d22ac3334d9db9fa2e1c36bbb6023
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 509a3f97f6f555021a8a166b1c2a8793e46af25712f77604cae9e8c368d0dc955cb2cda17b6ff52b896fe2840399734523473f5ab3d750ac9d7d4a3fdcd7404d
|
7
|
+
data.tar.gz: bdb90ee7d61091a09f209d351a57b9de551366c7e12f7ce7878c12308843c9ab7edae3caff253f78f6bc5284dd69be4d05558e8d7b58689152cb2cb64fa12380
|
data/README.md
CHANGED
@@ -13,16 +13,20 @@ board.fill(starting_column, ending_column, starting_row, ending_row);
|
|
13
13
|
|
14
14
|
### Functionality
|
15
15
|
|
16
|
-
This theme is breaking the rule
|
17
|
-
|
16
|
+
This theme is breaking the rule
|
17
|
+
and visitor can interact with the Game after it has started.
|
18
|
+
|
19
|
+
However, nice people are still able to observe how initial
|
18
20
|
game evolves.
|
19
21
|
|
20
|
-
-
|
22
|
+
- press `e` to start and/or restart the Game
|
23
|
+
- if your eyes are a bit tired and you'd prefer to quietly read a page you can
|
24
|
+
- type `q` to remove cells from the screen
|
25
|
+
- type `p` to pause the Game (use `s` to resume the Game)
|
21
26
|
- type `i` to start the Insert Mode where you can create new cells
|
22
27
|
- with a click of a mouse new cells will be randomily created around
|
23
28
|
- if you are feeling happy, drag mouse to create some more
|
24
29
|
- press `ESC` to --- escape the Insert Mode
|
25
|
-
- press `e` to restart the Game
|
26
30
|
- use `j` and `k` to control the speed
|
27
31
|
- to change the cells' color press any additional key
|
28
32
|
|
@@ -0,0 +1,17 @@
|
|
1
|
+
<nav class="header-nav">
|
2
|
+
<div>
|
3
|
+
{% if site.github %}
|
4
|
+
<a href="https://github.com/{{ site.github }}">github</a>
|
5
|
+
{% endif %}
|
6
|
+
{% if site.twitter %}
|
7
|
+
<a href="https://twitter.com/{{ site.twitter }}">twitter</a>
|
8
|
+
{% endif %}
|
9
|
+
{% if site.email %}
|
10
|
+
<a href="mailto:{{ site.email }}">email me</a>
|
11
|
+
{% endif %}
|
12
|
+
</div>
|
13
|
+
<div>
|
14
|
+
<a href="{{ "/" | relative_url }}">home</a>
|
15
|
+
<a href="{{ "/about" | relative_url }}">about</a>
|
16
|
+
</div>
|
17
|
+
</nav>
|
data/_layouts/about.html
ADDED
data/_layouts/home.html
CHANGED
@@ -2,7 +2,8 @@
|
|
2
2
|
layout: default
|
3
3
|
---
|
4
4
|
|
5
|
-
<div class="card
|
5
|
+
<div class="card card-background">
|
6
|
+
{% include header.html %}
|
6
7
|
{% if page.title %}
|
7
8
|
<h1 class="page-heading">{{ page.title }}</h1>
|
8
9
|
{% endif %}
|
@@ -10,22 +11,22 @@ layout: default
|
|
10
11
|
{{ content }}
|
11
12
|
|
12
13
|
{% if site.posts.size > 0 %}
|
13
|
-
<h3>{{ page.list_title | default: "
|
14
|
+
<h3>{{ page.list_title | default: "posts:" }}</h2>
|
14
15
|
<ul>
|
15
16
|
{% for post in site.posts %}
|
16
17
|
<li>
|
17
|
-
|
18
|
-
<a class="post-link" href="{{ post.url | relative_url }}">
|
18
|
+
<a href="{{ post.url | relative_url }}" class="index-list">
|
19
19
|
{{ post.title | escape }}
|
20
20
|
</a>
|
21
|
-
|
22
|
-
<p>
|
21
|
+
{% assign date_format = site.minima.date_format | default: "%b %-d, %Y" %}
|
23
22
|
{% if site.show_excerpts %}
|
24
|
-
|
23
|
+
<table>
|
24
|
+
<tr>
|
25
|
+
<td class="alnleft">{{ post.excerpt }}</td>
|
26
|
+
<td class="alnright">[{{ post.date | date: date_format }}]</td>
|
27
|
+
</tr>
|
28
|
+
</table>
|
25
29
|
{% endif %}
|
26
|
-
</p>
|
27
|
-
{% assign date_format = site.minima.date_format | default: "%b %-d, %Y" %}
|
28
|
-
<span class="post-meta">{{ post.date | date: date_format }}</span>
|
29
30
|
</li>
|
30
31
|
{% endfor %}
|
31
32
|
</ul>
|
data/_layouts/post.html
CHANGED
@@ -2,8 +2,9 @@
|
|
2
2
|
layout: default
|
3
3
|
---
|
4
4
|
|
5
|
-
<div class="card
|
5
|
+
<div class="card card-background">
|
6
6
|
<div class="post-title {% if page.feature %} feature {% endif %}">
|
7
|
+
{% include header.html %}
|
7
8
|
<h1>{{ page.title }}</h1>
|
8
9
|
<h4>{{ page.date | date_to_string }}</h4>
|
9
10
|
</div>
|
data/assets/css/card.css
CHANGED
@@ -1,27 +1,30 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
---
|
2
|
+
---
|
3
|
+
|
4
|
+
.card-background {
|
5
|
+
background-color: {{ "#" | append: site.background }}
|
3
6
|
}
|
4
7
|
|
5
8
|
.card {
|
6
|
-
font-family:
|
7
|
-
font-size:
|
9
|
+
font-family: {{ site.font }}
|
10
|
+
font-size: 16px;
|
11
|
+
font-weight: 400;
|
8
12
|
padding: 2em;
|
13
|
+
line-height: 1.5;
|
9
14
|
border-radius: 2px;
|
10
|
-
|
15
|
+
width: 80%;
|
11
16
|
}
|
12
17
|
|
13
18
|
.card:hover {
|
14
19
|
position: relative;
|
15
|
-
|
16
|
-
left: -5px;
|
17
|
-
box-shadow: 5px 5px 5px #969696;
|
20
|
+
box-shadow: 2px 2px 2px #969696;
|
18
21
|
}
|
19
22
|
|
20
23
|
.content {
|
21
24
|
max-width: 750px;
|
22
25
|
margin: 0 auto;
|
23
|
-
position:relative;
|
24
|
-
padding:
|
26
|
+
position: relative;
|
27
|
+
padding: 50px 50px;
|
25
28
|
justify-content: center;
|
26
29
|
display: flex;
|
27
30
|
}
|
@@ -29,10 +32,10 @@
|
|
29
32
|
/**
|
30
33
|
* Figures
|
31
34
|
*/
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
+
figure > img {
|
36
|
+
display: block;
|
37
|
+
}
|
35
38
|
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
+
figcaption {
|
40
|
+
font-size: $small-font-size;
|
41
|
+
}
|
data/assets/game_of_life.js
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
var w, columns, rows;
|
2
|
-
var insert_mode, clear_mode, easter_egg;
|
3
|
-
var counter, frequence;
|
2
|
+
var insert_mode, clear_mode, easter_egg, pause_mode;
|
3
|
+
var counter, frequence, touch_count;
|
4
4
|
let board, next;
|
5
5
|
|
6
6
|
function setup() {
|
7
7
|
createCanvas(windowWidth, windowHeight);
|
8
8
|
w = 8;
|
9
9
|
easter_egg = 0;
|
10
|
-
counter = 0; frequence = 50;
|
11
|
-
insert_mode = 0; clear_mode = 0;
|
10
|
+
counter = 0; frequence = 50; touch_count = 0;
|
11
|
+
insert_mode = 0; clear_mode = 0; pause_mode = 0;
|
12
12
|
columns = floor(width/w);
|
13
13
|
rows = floor(height/w);
|
14
14
|
|
@@ -43,9 +43,11 @@ function draw_board(){
|
|
43
43
|
}
|
44
44
|
|
45
45
|
function generate(){
|
46
|
-
|
47
|
-
|
48
|
-
|
46
|
+
if (pause_mode != 1) {
|
47
|
+
var temp = board;
|
48
|
+
board = Board.generate_next(board);
|
49
|
+
next = temp;
|
50
|
+
}
|
49
51
|
}
|
50
52
|
|
51
53
|
function windowResized() {
|
@@ -94,6 +96,12 @@ function keyTyped(){
|
|
94
96
|
insert_mode = 0;
|
95
97
|
frequence += 5;
|
96
98
|
}
|
99
|
+
else if (key === 's') {
|
100
|
+
pause_mode = 0;
|
101
|
+
}
|
102
|
+
else if (key === 'p') {
|
103
|
+
pause_mode = 1;
|
104
|
+
}
|
97
105
|
else if (key === 'i'){
|
98
106
|
if (clear_mode == 1) insert_mode = 0;
|
99
107
|
else {
|
@@ -105,6 +113,30 @@ function keyTyped(){
|
|
105
113
|
return false;
|
106
114
|
}
|
107
115
|
|
116
|
+
function keyPressed(){
|
117
|
+
if (keyCode === ESCAPE) insert_mode = 0;
|
118
|
+
}
|
119
|
+
|
120
|
+
function touchStarted() {
|
121
|
+
touch_count += 1;
|
122
|
+
if (touch_count % 2 === 0){
|
123
|
+
pause_mode = 1;
|
124
|
+
}
|
125
|
+
else {
|
126
|
+
pause_mode = 0;
|
127
|
+
frequence = 50;
|
128
|
+
easter_egg = 1;
|
129
|
+
randomize_colors();
|
130
|
+
board.empty();
|
131
|
+
board.fill(0, columns, rows - 30, rows);
|
132
|
+
}
|
133
|
+
return false;
|
134
|
+
}
|
135
|
+
|
136
|
+
function touchMoved() {
|
137
|
+
return false;
|
138
|
+
}
|
139
|
+
|
108
140
|
function randomize_colors(){
|
109
141
|
clear_mode = 0;
|
110
142
|
r = random(255);
|
data/assets/main.css
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
@import url("css/code.css");
|
2
2
|
@import url("css/card.css");
|
3
|
+
@import url("css/header.css");
|
3
4
|
|
4
5
|
html, body {
|
5
6
|
box-sizing: border-box;
|
@@ -19,6 +20,26 @@ h1, h2, h4 {
|
|
19
20
|
padding: 20px;
|
20
21
|
}
|
21
22
|
|
23
|
+
p {
|
24
|
+
padding: 10px;
|
25
|
+
}
|
26
|
+
|
27
|
+
.index-list{
|
28
|
+
font-size: 25px;
|
29
|
+
}
|
30
|
+
|
31
|
+
.alnleft {
|
32
|
+
text-align: left;
|
33
|
+
}
|
34
|
+
|
35
|
+
.alnright {
|
36
|
+
text-align: right;
|
37
|
+
}
|
38
|
+
|
39
|
+
table {
|
40
|
+
width: 100%;
|
41
|
+
}
|
42
|
+
|
22
43
|
body {
|
23
44
|
vertical-align: middle;
|
24
45
|
}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: game-of-life-theme
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Milana
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-06-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|
@@ -62,6 +62,8 @@ files:
|
|
62
62
|
- LICENSE.txt
|
63
63
|
- README.md
|
64
64
|
- _includes/head.html
|
65
|
+
- _includes/header.html
|
66
|
+
- _layouts/about.html
|
65
67
|
- _layouts/default.html
|
66
68
|
- _layouts/home.html
|
67
69
|
- _layouts/page.html
|
@@ -69,6 +71,7 @@ files:
|
|
69
71
|
- assets/board.js
|
70
72
|
- assets/css/card.css
|
71
73
|
- assets/css/code.css
|
74
|
+
- assets/css/header.css
|
72
75
|
- assets/game_of_life.js
|
73
76
|
- assets/img/2018-03-18-01-haskii.png
|
74
77
|
- assets/main.css
|
@@ -92,7 +95,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
92
95
|
version: '0'
|
93
96
|
requirements: []
|
94
97
|
rubyforge_project:
|
95
|
-
rubygems_version: 2.
|
98
|
+
rubygems_version: 2.7.6
|
96
99
|
signing_key:
|
97
100
|
specification_version: 4
|
98
101
|
summary: Jekyll and p5.js theme on famous Game of life
|