minima-rock 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/_includes/head.html +1 -0
- data/_includes/tags_bar.html +11 -0
- data/_layouts/post.html +10 -2
- data/_sass/minima/_layout.scss +16 -0
- data/assets/js/color.js +47 -0
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9bbd3e891698ea6cbce71a03ece57b8b990d835e1732fc2f9435a12c5d761b2a
|
4
|
+
data.tar.gz: c93af1a2799471a4e05ebbd994adfd6d58803d20d6cba03d90bec7032ceb6a94
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 92c6e08b9a57a7b892ff36dbde8ab1711861153f9930ea639fe974b74ac01226d6b37e934d30b5d7e58a20ab2e95ac51bf96d698f1470dd8d7ffa5e96bc8759c
|
7
|
+
data.tar.gz: 9df8225b1fbfadb81c5841692e14eb974ee59ef441039e7cc759f6e96cd2b4cb41ee0391a7ab5e153ddb9f769e56cc61e0b048ac6885313a6e9e94ff2dc2447c
|
data/_includes/head.html
CHANGED
@@ -4,6 +4,7 @@
|
|
4
4
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
5
5
|
{%- seo -%}
|
6
6
|
<link rel="stylesheet" href="{{ "/assets/css/style.css" | relative_url }}">
|
7
|
+
<script type="text/javascript" src="/assets/js/color.js"></script>
|
7
8
|
{%- feed_meta -%}
|
8
9
|
{%- if jekyll.environment == 'production' and site.google_analytics -%}
|
9
10
|
{%- include google-analytics.html -%}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
<div class="tags-bar">
|
2
|
+
{% assign tags = page.tags | sort %}
|
3
|
+
{% for tag in tags %}
|
4
|
+
<span class="site-tag">
|
5
|
+
<a class="site-tag-text" href="/tags/{{ tag | slugify }}.html">{{ tag | replace:'-', ' ' }}</a>
|
6
|
+
</span>
|
7
|
+
{% endfor %}
|
8
|
+
</div>
|
9
|
+
<script type="text/javascript">
|
10
|
+
setInvertedColor('site-tag-text');
|
11
|
+
</script>
|
data/_layouts/post.html
CHANGED
@@ -6,13 +6,21 @@ layout: default
|
|
6
6
|
<header class="post-header">
|
7
7
|
<h1 class="post-title p-name" itemprop="name headline">{{ page.title | escape }}</h1>
|
8
8
|
<p class="post-meta">
|
9
|
+
{%- assign date_format = site.date_format | default: "%b %-d, %Y" -%}
|
9
10
|
<time class="dt-published" datetime="{{ page.date | date_to_xmlschema }}" itemprop="datePublished">
|
10
|
-
{%- assign date_format = site.date_format | default: "%b %-d, %Y" -%}
|
11
11
|
{{ page.date | date: date_format }}
|
12
12
|
</time>
|
13
|
+
{%- if page.modified_date -%}
|
14
|
+
/ Last modified at:
|
15
|
+
<time class="dt-published" datetime="{{ page.modified_date | date_to_xmlschema }}" itemprop="dateModified">
|
16
|
+
{{ page.modified_date | date: date_format }}
|
17
|
+
</time>
|
18
|
+
{%- endif -%}
|
13
19
|
{%- if page.author -%}
|
14
20
|
• <span itemprop="author" itemscope itemtype="http://schema.org/Person"><span class="p-author h-card" itemprop="name">{{ page.author | escape }}</span></span>
|
15
|
-
{%- endif -%}
|
21
|
+
{%- endif -%}
|
22
|
+
{% include tags_bar.html %}
|
23
|
+
</p>
|
16
24
|
</header>
|
17
25
|
|
18
26
|
<div class="post-content e-content" itemprop="articleBody">
|
data/_sass/minima/_layout.scss
CHANGED
@@ -289,6 +289,22 @@
|
|
289
289
|
}
|
290
290
|
|
291
291
|
|
292
|
+
.site-tag a {
|
293
|
+
//color: orange;
|
294
|
+
//background-color: $grey-color-light;
|
295
|
+
display: inline-block;
|
296
|
+
padding-left: 2px;
|
297
|
+
padding-right: 2px;
|
298
|
+
border: 1px solid darken($grey-color-light, 5%);
|
299
|
+
border-radius: 3px;
|
300
|
+
|
301
|
+
&:hover {
|
302
|
+
text-decoration: unset;
|
303
|
+
background-color: $grey-color;
|
304
|
+
}
|
305
|
+
}
|
306
|
+
|
307
|
+
|
292
308
|
/**
|
293
309
|
* Grid helpers
|
294
310
|
*/
|
data/assets/js/color.js
ADDED
@@ -0,0 +1,47 @@
|
|
1
|
+
function invertColor(hex, bw) {
|
2
|
+
if (hex.indexOf('#') === 0) {
|
3
|
+
hex = hex.slice(1);
|
4
|
+
}
|
5
|
+
// convert 3-digit hex to 6-digits.
|
6
|
+
if (hex.length === 3) {
|
7
|
+
hex = hex[0] + hex[0] + hex[1] + hex[1] + hex[2] + hex[2];
|
8
|
+
}
|
9
|
+
if (hex.length !== 6) {
|
10
|
+
throw new Error('Invalid HEX color.');
|
11
|
+
}
|
12
|
+
var r = parseInt(hex.slice(0, 2), 16),
|
13
|
+
g = parseInt(hex.slice(2, 4), 16),
|
14
|
+
b = parseInt(hex.slice(4, 6), 16);
|
15
|
+
if (bw) {
|
16
|
+
// http://stackoverflow.com/a/3943023/112731
|
17
|
+
return (r * 0.299 + g * 0.587 + b * 0.114) > 186
|
18
|
+
? '#000000'
|
19
|
+
: '#FFFFFF';
|
20
|
+
}
|
21
|
+
// invert color components
|
22
|
+
r = (255 - r).toString(16);
|
23
|
+
g = (255 - g).toString(16);
|
24
|
+
b = (255 - b).toString(16);
|
25
|
+
// pad each with zeros and return
|
26
|
+
return "#" + padZero(r) + padZero(g) + padZero(b);
|
27
|
+
}
|
28
|
+
function padZero(str, len) {
|
29
|
+
len = len || 2;
|
30
|
+
var zeros = new Array(len).join('0');
|
31
|
+
return (zeros + str).slice(-len);
|
32
|
+
}
|
33
|
+
|
34
|
+
function randomColor() {
|
35
|
+
color = Math.floor(Math.random()*16777215).toString(16);
|
36
|
+
return '#' + padZero(color, 6);
|
37
|
+
}
|
38
|
+
|
39
|
+
function setInvertedColor(className) {
|
40
|
+
let elems = document.getElementsByClassName(className);
|
41
|
+
for (const elem of elems) {
|
42
|
+
const bgColor = randomColor();
|
43
|
+
let color = invertColor(bgColor, true);
|
44
|
+
elem.style['color'] = color;
|
45
|
+
elem.style['background-color'] = bgColor;
|
46
|
+
}
|
47
|
+
}
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: minima-rock
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joel Glovier
|
@@ -101,6 +101,7 @@ files:
|
|
101
101
|
- _includes/head.html
|
102
102
|
- _includes/header.html
|
103
103
|
- _includes/social.html
|
104
|
+
- _includes/tags_bar.html
|
104
105
|
- _layouts/default.html
|
105
106
|
- _layouts/home.html
|
106
107
|
- _layouts/page.html
|
@@ -110,6 +111,7 @@ files:
|
|
110
111
|
- _sass/minima/_layout.scss
|
111
112
|
- _sass/minima/_syntax-highlighting.scss
|
112
113
|
- assets/css/style.scss
|
114
|
+
- assets/js/color.js
|
113
115
|
- assets/minima-social-icons.svg
|
114
116
|
homepage: https://github.com/alxdhuang/minima-rock
|
115
117
|
licenses:
|