minimal-categorized 0.0.9 → 0.0.10

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2762d3812ac32b52b4d337aad712ed6a22aa0a52664efc96cbbffd41ba41907e
4
- data.tar.gz: 3173b0082fdf37a21e672387dad00d87bef144914b37f5b82e6126093352efb2
3
+ metadata.gz: 156570bfb4f581a3e86595e953d9ca2590a38090df109e508def1672dd846643
4
+ data.tar.gz: 1a447df98586bb3a1163f732db414be39672f5b679b4b37e9bccbc6b2b80abb7
5
5
  SHA512:
6
- metadata.gz: 27fe24c24ed97436b4a1857941437a84211e1c9722cbd0c9675590dcc0983bf8301cf1d0cb2eb714e0d465f792410b50a5f7d2deb0a47574fba60bb41a82a5b2
7
- data.tar.gz: e909c87aeeb0e3fac77c9a81e3f09b8255984f6649aa9610e4ef9b3dff61d3e4a170c32517cd15daacf4aff1a7ea82e7f2cf86b6e632dc14b9501deef314401d
6
+ metadata.gz: e92a5f75922ba7ad82fcee985c0de87601b2e36879938f63b193e5bacf10266bf9299eae364fae51237b6d35438a8a204e9d7a0b949285a75358ed1ff6336a5b
7
+ data.tar.gz: ff0ee93d37f6f377f9435e554077a27151f7cdd7670212b95700ce92e8526571ae3eafb8b0eedac90622ce4552694f2dadf8b2b3102b7adb6fb55bfad8384f88
data/README.md CHANGED
@@ -55,6 +55,10 @@ Structure of `_data/menu.yml`:
55
55
  * faicon: FavIcon to be displayed in menu
56
56
  * url: URL for href
57
57
  * target: target value of \<a> tag
58
+ * cookies: customize information about site cookies
59
+ * enabled: determine if should show cookies pop-up
60
+ * message: text on cookie pop-up
61
+ * agreeButtonText: text on agree button
58
62
 
59
63
  Structure of `_data/metaData.yml`:
60
64
  author: Site Author name
@@ -1,2 +1,6 @@
1
1
  author: Site Author
2
- avatar_url: assets/img/avatar.png
2
+ avatar_url: assets/img/avatar.png
3
+ cookies:
4
+ enabled: True
5
+ message: This site might be using cookies! Customize your message or disable cookies in metaData.yml!
6
+ agreeButtonText: Agree
@@ -0,0 +1,29 @@
1
+ (function() {
2
+ const consentPropName = "cookies_consent";
3
+ const storageType = localStorage;
4
+
5
+ shouldShowCookieConsent = () => !storageType.getItem(consentPropName);
6
+ acceptCookieConsent = () => storageType.setItem(consentPropName, true);
7
+ window.addEventListener("load", () => {
8
+ if(!shouldShowCookieConsent()) {
9
+ return;
10
+ }
11
+ const cookieContainer = document.createElement("div");
12
+ cookieContainer.classList.add("hidden");
13
+ const cookieParagraph = document.createElement("p");
14
+ const cookieContent = document.createTextNode("{{ site.data.metaData.cookies.message }}");
15
+ const cookieAgreeButton = document.createElement("button");
16
+ const cookieButtonContent = document.createTextNode("{{ site.data.metaData.cookies.agreeButtonText }}");
17
+ cookieAgreeButton.appendChild(cookieButtonContent);
18
+ cookieAgreeButton.onclick = () => {
19
+ acceptCookieConsent();
20
+ cookieContainer.classList.add("hidden");
21
+ window.setTimeout(cookieContainer.remove.bind(cookieContainer), 1000);
22
+ }
23
+ cookieParagraph.append(cookieContent);
24
+ cookieContainer.append(cookieParagraph, cookieAgreeButton);
25
+ cookieContainer.classList.add("cookie-container")
26
+ document.body.appendChild(cookieContainer);
27
+ window.setTimeout(() => cookieContainer.classList.remove("hidden"));
28
+ });
29
+ })();
@@ -27,5 +27,5 @@
27
27
 
28
28
  attachEvents(category1, category2);
29
29
  attachEvents(category2, category1);
30
- })
31
- })()
30
+ });
31
+ })();
@@ -1,6 +1,11 @@
1
1
  <!doctype html>
2
2
  <html>
3
3
  <head>
4
+ {% if site.data.metaData.cookies.enabled %}
5
+ <script>
6
+ {% include cookies.js %}
7
+ </script>
8
+ {% endif %}
4
9
  {% include common-head.html %}
5
10
  </head>
6
11
  {% if site.data.menu.minimal_menu %}
@@ -0,0 +1,39 @@
1
+ .cookie-container {
2
+ position: fixed;
3
+ right: 0;
4
+ padding: 20px 15px;
5
+ z-index: 100;
6
+ background-image: radial-gradient(farthest-corner at 25% 0, $primary, $p_dark);
7
+ box-shadow: 0 0 6px 0 $p_dark;
8
+ text-align: center;
9
+ opacity: 0.95;
10
+ -webkit-transition: opacity 800ms, visibility 800ms;
11
+ transition: opacity 800ms, visibility 800ms;
12
+ bottom: 30px;
13
+ left: 30px;
14
+ max-width: 300px;
15
+ border-radius: 3px;
16
+ border: 3px solid $p_dark;
17
+
18
+ p {
19
+ color: $p_text;
20
+ line-height: 1.6em;
21
+ margin-bottom: 10px;
22
+ }
23
+ &.hidden {
24
+ opacity: 0;
25
+ visibility: hidden;
26
+ }
27
+ button {
28
+ line-height: 1.5;
29
+ font-weight: 700;
30
+ font-family: Titillium Web,sans-serif;
31
+ display: inline-block;
32
+ padding: 15px 30px;
33
+ background: $p_text;
34
+ color: $primary;
35
+ border: 3px solid $p_light;
36
+ border-radius: 3px;
37
+ text-decoration: none;
38
+ }
39
+ }
@@ -6,7 +6,7 @@ h1 {
6
6
  text-align: center;
7
7
  font-size: 2.5em;
8
8
  letter-spacing: -1px;
9
- margin: 1em 50px 1em;
9
+ padding: 1em 50px 1em;
10
10
  }
11
11
 
12
12
  h2, h2 a {
@@ -34,9 +34,13 @@ main {
34
34
  width: 90%;
35
35
  padding: 0px 18px 24px;
36
36
  flex-grow: 1;
37
+ position: relative;
37
38
 
38
39
  .content-separator {
39
40
  margin: $gap auto;
41
+ &:last-child {
42
+ margin: $gap auto 0 auto;
43
+ }
40
44
  }
41
45
  }
42
46
  }
@@ -4,4 +4,5 @@
4
4
  @import './home';
5
5
  @import './category-aggregator';
6
6
  @import './profile';
7
- @import "./post";
7
+ @import './post';
8
+ @import './cookies';
@@ -16,6 +16,7 @@ main {
16
16
  top: $menu-size;
17
17
  left: 0;
18
18
  width: 100%;
19
+ height: calc(100% - #{$menu-size});
19
20
  }
20
21
  &.no-menu {
21
22
  width: 100%;
@@ -43,6 +44,7 @@ footer {
43
44
  top: $minimal-menu-size;
44
45
  left: 0;
45
46
  width: 100%;
47
+ height: calc(100% - #{$minimal-menu-size});
46
48
  }
47
49
  }
48
50
  }
@@ -76,7 +76,7 @@
76
76
 
77
77
  h1 {
78
78
  font-size: 2em;
79
- margin: 0.5em;
79
+ padding: 0.5em;
80
80
  }
81
81
 
82
82
  h2 {
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: minimal-categorized
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Patryk Bieszke
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-11-02 00:00:00.000000000 Z
11
+ date: 2020-11-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll
@@ -39,6 +39,7 @@ files:
39
39
  - _data/menu.yml
40
40
  - _data/metaData.yml
41
41
  - _includes/common-head.html
42
+ - _includes/cookies.js
42
43
  - _includes/customizations.html
43
44
  - _includes/footer.html
44
45
  - _includes/home.js
@@ -49,6 +50,7 @@ files:
49
50
  - _layouts/post.html
50
51
  - _sass/minimal-categorized.scss
51
52
  - _sass/styles/_category-aggregator.scss
53
+ - _sass/styles/_cookies.scss
52
54
  - _sass/styles/_defaults.scss
53
55
  - _sass/styles/_home.scss
54
56
  - _sass/styles/_index.scss