minimal-music-project 0.0.6 → 0.0.7

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: be9a010e0f48570412378b9081c7c98b679fdb3e0d0e299aece41f8569865007
4
- data.tar.gz: 2c241be3e8f4c5f6ae116701b997914d6acefcf3e31ed81327a68e51d1eb2951
3
+ metadata.gz: 83c6d910205c9328757cf56b0c2e50df907fedcd650966b0b9898cbd3fb51aaa
4
+ data.tar.gz: cc1222e1c478d9cb01840d7567b99b354251c5c29c7255446d8463c7293a602d
5
5
  SHA512:
6
- metadata.gz: 9ee664db5a3b579113ca4e3d1920a21d6ca24be6656633a51defafd1baca182cc6c3ad673890e65ea4c1493cab8847e5aba32648ae696c57fbed4ab9d4468dc1
7
- data.tar.gz: 717caff78c28277d289d3973d5cc4e841c0c2604b5e98fca92532a50410273772f37f3a60f9da2c7021ca60fb4f415fa6afcf5e5351f653665f62b399fca60a1
6
+ metadata.gz: 3c2952ee9d4a34a6e3eabed59790d60a14937e5bbe8d95ca79a573fcd15aa70a84e9999eaa9ff499335fda3b418f8146f7bfb3f9f7ffb747e81761c255fba879
7
+ data.tar.gz: 99af8f826d34e242fc443712a3396bb7b511c3c405072bba1c2731cf766ddb0a981b9bef7725bd527598a58ebda18439f4943edc2959bcf011f244e8c60ef3e7
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # [minimal-music-project Jekyll theme](https://github.com/ItsMeaga1n/minimal-music-project/)
1
+ <h1><a href="https://github.com/ItsMeaga1n/minimal-music-project/"><img src="https://raw.githubusercontent.com/ItsMeaga1n/minimal-music-project/master/assets/img/favicon.ico" height="21" alt="minimal-categorized logo" /> minimal-music-project Jekyll theme </h1></a>
2
2
 
3
3
  [![LICENSE](https://img.shields.io/badge/license-MIT-lightgrey.svg)](https://raw.githubusercontent.com/itsmeaga1n/minimal-music-project/master/LICENSE.txt)
4
4
  [![Jekyll](https://img.shields.io/badge/jekyll-%3E%3D%203.9-blue.svg)](https://jekyllrb.com/)
@@ -10,7 +10,7 @@
10
10
 
11
11
  minimal-music-project is a flexible, extendable Jekyll theme. With this theme it's plain simple to create a good looking website for a music band with all the required components to list all releases and news. Demo is available [here](https://minimal-music-project.netlify.app/).
12
12
 
13
- ![layout examples](screenshot.png)
13
+ ![layout examples](https://raw.githubusercontent.com/ItsMeaga1n/minimal-music-project/master/screenshot.png)
14
14
 
15
15
  ## Installation
16
16
 
@@ -71,8 +71,14 @@ Structure of `_data/metaData.yml`:
71
71
  * enabled: determine if should show cookies pop-up
72
72
  * message: text on cookie pop-up
73
73
  * agreeButtonText: text on agree button
74
+ * disagreeButtonText: text on disagree button
74
75
  * agreeButtonFnName: function in the `window` scope to execute on cookie agree
75
-
76
+ * disagreeButtonFnName: function in the `window` scope to execute on cookie disagree
77
+ * header: title of the pop-up window
78
+ * consent: list of objects that will be rendered on a site with "cookies" layout for acceptance. Each object needs to have:
79
+ * name: bolded on render
80
+ * description: description of the cookie
81
+ * cookieName: under what name it will be saved in the local storage (selected checkbox as "true", unselected as "false")
76
82
 
77
83
  Structure of `_data/customs.yml`:
78
84
  * custom-css: a list of urls to custom css files
data/_data/metaData.yml CHANGED
@@ -3,5 +3,15 @@ logo: assets/img/band_logo.png
3
3
  cookies:
4
4
  enabled: True
5
5
  message: This site might be using cookies! Customize your message or disable cookies in metaData.yml!
6
- agreeButtonText: Agree
7
- agreeButtonFnName: console.log
6
+ agreeButtonText: Yes, I agree
7
+ disagreeButtonText: No, take me to settings
8
+ agreeButtonFnName: cookiesAcceptDefaultFn
9
+ disagreeButtonFnName: cookiesDisagreeDefaultFn
10
+ header: Ask your users if they agree to cookies
11
+ consent:
12
+ - name: Google Analytics
13
+ description: some description describing the purpose of this consent as well as what it will collect and where send
14
+ cookieName: GA
15
+ - name: Some other cookie
16
+ description: some description describing the purpose of this consent as well as what it will collect and where send
17
+ cookieName: SA
data/_includes/cookies.js CHANGED
@@ -1,33 +1,61 @@
1
+
1
2
  (function() {
2
- const consentPropName = "cookies_consent";
3
+ const interactedWithCookiesBanner = "interacted_with_cookies_banner";
3
4
  const storageType = localStorage;
5
+ const cookieContainerId = "cookieContainer";
6
+
7
+ acceptAllCookieConsent = () => {
8
+ {% for consent in site.data.metaData.cookies.consent %}
9
+ eval("storageType.setItem('{{consent.cookieName}}', true);");
10
+ {% endfor %}
11
+ }
4
12
 
5
- areCookiesAccepted = () => storageType.getItem(consentPropName);
6
- acceptCookieConsent = () => storageType.setItem(consentPropName, true);
13
+ window.cookiesAcceptDefaultFn = () => {
14
+ const cookieContainer = document.getElementById(cookieContainerId);
15
+ cookieContainer.classList.add("hidden");
16
+ window.setTimeout(cookieContainer.remove.bind(cookieContainer), 1000);
17
+ storageType.setItem(interactedWithCookiesBanner, true);
18
+ acceptAllCookieConsent();
19
+ }
20
+ window.cookiesDisagreeDefaultFn = () => {
21
+ const cookieContainer = document.getElementById(cookieContainerId);
22
+ cookieContainer.classList.add("hidden");
23
+ window.setTimeout(cookieContainer.remove.bind(cookieContainer), 1000);
24
+ storageType.setItem(interactedWithCookiesBanner, true);
25
+ window.location = "cookies";
26
+ }
27
+
7
28
  window.addEventListener("load", () => {
8
- if(areCookiesAccepted()) {
29
+ if(storageType.getItem(interactedWithCookiesBanner) === "true" || window.location.href.indexOf("cookies") !== -1) {
9
30
  return;
10
31
  }
11
32
  const cookieContainer = document.createElement("div");
33
+ cookieContainer.setAttribute("id", cookieContainerId);
12
34
  cookieContainer.classList.add("hidden");
35
+
36
+ const cookieHeader = document.createElement("h2");
37
+ const cookieHeaderContent = document.createTextNode("{{ site.data.metaData.cookies.header }}");
38
+
13
39
  const cookieParagraph = document.createElement("p");
14
- const cookieContent = document.createTextNode("{{ site.data.metaData.cookies.message }}");
40
+ const cookieParagraphContent = document.createTextNode("{{ site.data.metaData.cookies.message }}");
41
+
42
+ const cookieButtonsContainer = document.createElement("div");
43
+ cookieButtonsContainer.classList.add("cookie-container--buttons");
44
+
15
45
  const cookieAgreeButton = document.createElement("button");
16
46
  const cookieButtonContent = document.createTextNode("{{ site.data.metaData.cookies.agreeButtonText }}");
17
47
  cookieAgreeButton.appendChild(cookieButtonContent);
18
- cookieAgreeButton.onclick = () => {
19
- acceptCookieConsent();
20
- cookieContainer.classList.add("hidden");
21
- window.setTimeout(cookieContainer.remove.bind(cookieContainer), 1000);
22
- window.setTimeout(cookieContainer.remove.bind(cookieContainer), 1000);
23
- try {
24
- {{ site.data.metaData.cookies.agreeButtonFnName }}();
25
- } catch(e) {
26
- console.error(e);
27
- }
28
- }
29
- cookieParagraph.append(cookieContent);
30
- cookieContainer.append(cookieParagraph, cookieAgreeButton);
48
+ eval("cookieAgreeButton.onclick = {{ site.data.metaData.cookies.agreeButtonFnName }};");
49
+
50
+ const cookieButtonDisagree = document.createElement("button");
51
+ const cookieButtonDisagreeContent = document.createTextNode("{{ site.data.metaData.cookies.disagreeButtonText }}");
52
+ cookieButtonDisagree.append(cookieButtonDisagreeContent);
53
+ eval("cookieButtonDisagree.onclick = {{ site.data.metaData.cookies.disagreeButtonFnName }};");
54
+
55
+ cookieHeader.append(cookieHeaderContent);
56
+ cookieParagraph.append(cookieParagraphContent);
57
+ cookieButtonsContainer.append(cookieAgreeButton, cookieButtonDisagree)
58
+ cookieContainer.append(cookieHeader, cookieParagraph, cookieButtonsContainer);
31
59
  cookieContainer.classList.add("cookie-container")
32
60
  document.body.appendChild(cookieContainer);
33
61
  window.setTimeout(() => cookieContainer.classList.remove("hidden"));
@@ -0,0 +1,28 @@
1
+ ---
2
+ layout: default
3
+ ---
4
+ <div class="content-container cookies">
5
+ {{ content }}
6
+ <hr />
7
+ <h2>Consents</h2>
8
+ {% for consent in site.data.metaData.cookies.consent %}
9
+ <fieldset>
10
+ <input type="checkbox" id="{{ consent.name }}">
11
+ <label for="{{ consent.name }}">
12
+ <strong>{{ consent.name }}</strong>
13
+ {{ consent.description }}
14
+ </label>
15
+ </fieldset>
16
+ {% endfor %}
17
+ </div>
18
+ <script>
19
+ const storageType = localStorage;
20
+ const consents = eval('{{ site.data.metaData.cookies.consent | jsonify }}');
21
+ consents.forEach(consent => {
22
+ const element = document.getElementById(consent.name);
23
+ element.checked = storageType.getItem(consent.cookieName) === "true";
24
+ element.addEventListener("click", () => {
25
+ storageType.setItem(consent.cookieName, element.checked);
26
+ });
27
+ });
28
+ </script>
@@ -23,22 +23,30 @@
23
23
  opacity: 0;
24
24
  visibility: hidden;
25
25
  }
26
- button {
27
- line-height: 1.4;
28
- font-weight: 700;
29
- display: inline-block;
30
- padding: 10px 20px;
31
- background-color: $white;
32
- color: $p_text;
33
- border: 1px solid;
34
- border-radius: 3px;
35
- text-decoration: none;
36
- cursor: pointer;
37
- -webkit-transition: background-color 200ms;
38
- transition: background-color 200ms;
39
- &:hover {
40
- background-color: rgb(168, 168, 168);
41
- }
26
+ &--buttons {
27
+ display: flex;
28
+ button {
29
+ line-height: 1.4;
30
+ font-weight: 700;
31
+ display: inline-block;
32
+ padding: 10px 20px;
33
+ background-color: $white;
34
+ color: $p_text;
35
+ border: 1px solid;
36
+ border-radius: 3px;
37
+ text-decoration: none;
38
+ cursor: pointer;
39
+ -webkit-transition: background-color 200ms;
40
+ transition: background-color 200ms;
41
+ &:hover {
42
+ background-color: rgb(168, 168, 168);
43
+ }
44
+ width: calc(50% - 10px);
45
+ &:last-of-type {
46
+ margin-left: 10px;
47
+ }
48
+ }
49
+
42
50
  }
43
51
  @include mobile {
44
52
  bottom: 0;
@@ -46,6 +46,11 @@ main {
46
46
  margin: $gap auto 0 auto;
47
47
  }
48
48
  }
49
+ fieldset {
50
+ border: none;
51
+ padding: 0;
52
+ margin-bottom: 1em;
53
+ }
49
54
  }
50
55
 
51
56
  .pager {
data/pages/about.html CHANGED
@@ -3,36 +3,46 @@ layout: default
3
3
  title: About
4
4
  permalink: about.html
5
5
  category: about
6
-
7
6
  ---
8
7
  <div class="content-container about">
9
8
  <h1>About</h1>
10
- It's a good place to write something about the project. This projects repository is located on <a href="https://github.com/ItsMeaga1n/minimal-music-project" target="_blank">GitHub</a>. Since you are here, feel free to check out my other stuff either on <a href="https://github.com/ItsMeaga1n" target="_blank">GitHub</a> or on my <a href="http://itsmeaga1n.github.io" target="_blank">blog</a>!
9
+ It's a good place to write something about the project. This projects repository is located on <a
10
+ href="https://github.com/ItsMeaga1n/minimal-music-project" target="_blank">GitHub</a>. Since you are here, feel
11
+ free to check out my other stuff either on <a href="https://github.com/ItsMeaga1n" target="_blank">GitHub</a> or on
12
+ my <a href="http://itsmeaga1n.github.io" target="_blank">blog</a>!
11
13
 
12
14
  <hr />
13
15
  <p>
14
16
  Listen and get music from this example project at:
15
- <ul>
16
- <li>
17
- <a>
18
- YouTube
19
- <i class="fab fa-youtube" ></i>
20
- </a>
21
- </li>
22
- <li>
23
- <a>
24
- SoundCloud
25
- <i class="fab fa-soundcloud" ></i>
26
- </a>
27
- </li>
28
- <li>
29
- <a>
30
- BandCamp
31
- <i class="fab fa-bandcamp" ></i>
32
- </a>
33
- </li>
34
- </ul>
17
+ <ul>
18
+ <li>
19
+ <a>
20
+ YouTube
21
+ <i class="fab fa-youtube"></i>
22
+ </a>
23
+ </li>
24
+ <li>
25
+ <a>
26
+ SoundCloud
27
+ <i class="fab fa-soundcloud"></i>
28
+ </a>
29
+ </li>
30
+ <li>
31
+ <a>
32
+ BandCamp
33
+ <i class="fab fa-bandcamp"></i>
34
+ </a>
35
+ </li>
36
+ </ul>
35
37
  </p>
38
+ <hr />
39
+ <a href="/privacy-policy">
40
+ Privacy Policy
41
+ </a>
42
+ /
43
+ <a href="/cookies">
44
+ Cookies
45
+ </a>
36
46
  </div>
37
47
 
38
48
  <style>
@@ -45,10 +55,11 @@ category: about
45
55
  cursor: pointer;
46
56
  color: #290099;
47
57
  }
48
- a:hover {
58
+
59
+ a:hover {
49
60
  text-decoration-color: #290099;
50
61
  transition: 0.4s;
51
62
  -webkit-text-decoration-color: #290099;
52
63
  -moz-text-decoration-color: #290099;
53
- }
64
+ }
54
65
  </style>
@@ -0,0 +1,9 @@
1
+ ---
2
+ layout: cookies
3
+ title: Manage your data
4
+ permalink: cookies
5
+ category: about
6
+ ---
7
+ <h1>Manage your data</h1>
8
+ <p>This website uses cookies to provide you with the best user experience.</p>
9
+ <p>Below are checkboxes, that you need to confirm in order to enable/disable specific data collection. Some of them might be needed for specific functionalities on site.</p>
@@ -0,0 +1,10 @@
1
+ ---
2
+ layout: default
3
+ title: Privacy Policy
4
+ permalink: privacy-policy
5
+ category: about
6
+ ---
7
+ <div class="content-container about">
8
+ <h1>Privacy Policy</h1>
9
+ Put your privacy policy here
10
+ </div>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: minimal-music-project
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Patryk Bieszke
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-05-29 00:00:00.000000000 Z
11
+ date: 2021-09-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll
@@ -50,6 +50,7 @@ files:
50
50
  - _includes/music-player.html
51
51
  - _includes/pagination-buttons.html
52
52
  - _includes/read-more.html
53
+ - _layouts/cookies.html
53
54
  - _layouts/default.html
54
55
  - _layouts/discography.html
55
56
  - _layouts/post.html
@@ -86,6 +87,8 @@ files:
86
87
  - assets/img/z-is-for-zero.png
87
88
  - assets/styles/styles.scss
88
89
  - pages/about.html
90
+ - pages/cookies.html
91
+ - pages/privacyPolicy.html
89
92
  homepage: https://github.com/ItsMeaga1n/minimal-music-project
90
93
  licenses:
91
94
  - MIT