From 90041444ec481829b9af0383dcea9d432fb82130 Mon Sep 17 00:00:00 2001 From: John Cleaver Date: Mon, 21 Mar 2016 14:38:24 -0400 Subject: [PATCH 1/4] Added items from the River Fish Bundle. --- bundles.json | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/bundles.json b/bundles.json index 109026e..d75dd7a 100644 --- a/bundles.json +++ b/bundles.json @@ -487,6 +487,38 @@ "seasons": ["spring", "summer", "fall", "winter"], "skills": ["farming", "foraging"], "bundles": [11] + }, + { + "id": 61, + "name": "Sunfish", + "source": "Found in Rivers, Daytime, Spring, and Summer.", + "seasons": ["spring", "summer"] + "skills": ["fishing"], + "bundles": [12] + }, + { + "id": 62, + "name": "Catfish", + "source": "Found in Rivers, Anytime, Spring and Fall. Only when raining.", + "seasons": ["spring", "fall"] + "skills": ["fishing"], + "bundles": [12] + }, + { + "id": 63, + "name": "Shad", + "source": "Found in Rivers, Daytime, Spring, Summer, and Fall. Only when raining.", + "seasons": ["spring", "summer", "fall"] + "skills": ["fishing"], + "bundles": [12] + }, + { + "id": 64, + "name": "Tiger Trout", + "source": "Found in Rivers, Daytime (Early afternoon), Fall and Winter.", + "seasons": ["fall", "winter"] + "skills": ["fishing"], + "bundles": [12] } ], "bundles": [ From b753627c53b5d6561accec3b82206486dcbf6450 Mon Sep 17 00:00:00 2001 From: John Cleaver Date: Mon, 21 Mar 2016 19:12:48 -0400 Subject: [PATCH 2/4] Fixed some malformed JSON. --- bundles.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bundles.json b/bundles.json index d75dd7a..0d62f78 100644 --- a/bundles.json +++ b/bundles.json @@ -492,7 +492,7 @@ "id": 61, "name": "Sunfish", "source": "Found in Rivers, Daytime, Spring, and Summer.", - "seasons": ["spring", "summer"] + "seasons": ["spring", "summer"], "skills": ["fishing"], "bundles": [12] }, @@ -500,7 +500,7 @@ "id": 62, "name": "Catfish", "source": "Found in Rivers, Anytime, Spring and Fall. Only when raining.", - "seasons": ["spring", "fall"] + "seasons": ["spring", "fall"], "skills": ["fishing"], "bundles": [12] }, @@ -508,7 +508,7 @@ "id": 63, "name": "Shad", "source": "Found in Rivers, Daytime, Spring, Summer, and Fall. Only when raining.", - "seasons": ["spring", "summer", "fall"] + "seasons": ["spring", "summer", "fall"], "skills": ["fishing"], "bundles": [12] }, @@ -516,7 +516,7 @@ "id": 64, "name": "Tiger Trout", "source": "Found in Rivers, Daytime (Early afternoon), Fall and Winter.", - "seasons": ["fall", "winter"] + "seasons": ["fall", "winter"], "skills": ["fishing"], "bundles": [12] } From f330975a17f0079e7fd00736ab8c4d8fa3dca19a Mon Sep 17 00:00:00 2001 From: John Cleaver Date: Wed, 30 Mar 2016 17:59:40 -0400 Subject: [PATCH 3/4] Converted app to use Bulma. --- index.html | 668 ++++++++++++++++++++++++++++++++--------------------- main.css | 97 +------- main.js | 130 +++++++++-- 3 files changed, 528 insertions(+), 367 deletions(-) diff --git a/index.html b/index.html index c12351e..208f315 100644 --- a/index.html +++ b/index.html @@ -1,283 +1,435 @@ - - + + + Stardew Valley Community Checklist - - + + + - -
-

Stardew Valley Community Center Checklist

- -
-
- -
-
- - + +
+ +
+ -
-
-
-
-
-
- - + + + + + + + +
+
+
+ +
+

{{ static.bundles[active_bundle].name }}

+ +
+
+
+
+

+ {{ item.name }} +

+
+
+
+
+
+
{{ item.source }}
+
+
- -
-
-
- +
+ +
+
+ +
+
+
+
+
-
-
- - - -
-
- -
-
- - - -
-
- -
-
-

I wanted to have an easy way to keep track of my community center bundles since it is a pain to - do it in game. Here it is. This will be a better explanation when I actually write it.

-

{{ user_data | json }}

+ +
+
+
+
+
+
+ +
+
+ +
+
+
+
+
+

+ {{ item.name }} +

+
+
+
+
+
+
{{ item.source }}
+
+
+
+ +
+
+ +
+
+ +
+
+
+
-
- + + + +
+
+
+
+ +
+
+

{{ getSeasonName(active_season) }}

+ +
+
+
+
+

+ {{ item.name }} +

+
+
+
+
+
+
{{ item.source }}
+
+
+
+ +
+
+ +
+
+ +
+
+
+
+
+
+
+
+ + +
+
+
+
+ +
+
+

{{ getSkillName(active_skill) }}

+ +
+
+
+
+

+ {{ item.name }} +

+
+
+
+
+
+
{{ item.source }}
+
+
+
+ +
+
+ +
+
+ +
+
+
+
+
+
+
+
+ + - - + + - diff --git a/main.css b/main.css index 25add83..079e79a 100644 --- a/main.css +++ b/main.css @@ -1,101 +1,12 @@ -.just-padding { - padding: 15px; -} - -.list-group.list-group-root { - padding: 0; - overflow: hidden; -} - -.list-group.list-group-root .list-group { - margin-bottom: 0; -} - -.list-group.list-group-root .list-group-item { - border-radius: 0; - border-width: 1px 0 0 0; -} - -.list-group.list-group-root > .list-group-item:first-child { - border-top-width: 0; -} - -.list-group.list-group-root > .list-group > .list-group-item { - padding-left: 30px; -} - -.list-group.list-group-root > .list-group > .list-group > .list-group-item { - padding-left: 45px; -} - -.list-group-item .glyphicon { - margin-right: 5px; -} - -.row-eq-height, .row-eq-height > div[class*='col-']{ - display: -webkit-box; - display: -moz-box; - display: -ms-flexbox; - display: -webkit-flex; - display: flex; +.eq-line { flex: 1 0 auto; - flex-wrap: wrap; } -.panel { - display: flex; - flex-direction:column; - align-content:stretch; - flex-grow: 1; -} - -.panel-body{ - display: flex; +.card { flex-direction: column; - flex-grow: 1; } -.panel-body > p{ - flex-grow: 1; -} - -.panel-body > .button-area{ - display: flex; - flex-direction: row; - flex-wrap: wrap; -} - -.button-area > .btn{ - flex: 1 0 auto; - margin-top: 1rem; -} - -.panel-footer{ - display: flex; +.card-content{ flex-direction: column; - flex-wrap: wrap; -} - -.panel-footer-area{ - display: flex; - flex-direction: row; - flex: 1 0 auto; - justify-content: space-around; -} - -.footer-text-area{ - margin-left: 1rem; - flex: 1 0 auto; - display: flex; - flex-direction: row; - flex-wrap: wrap; - justify-content: space-around; -} - -.footer-text{ - flex-grow: 1; -} - -form{ - margin-bottom: 1rem; + justify-content: space-between; } diff --git a/main.js b/main.js index d7ef1f6..3158fa6 100644 --- a/main.js +++ b/main.js @@ -4,34 +4,132 @@ var v = new Vue({ debug: true, static: null, user_data: [], - btnChecked: 'btn-success', - btnUnchecked: 'btn-warning', - boxChecked: 'glyphicon-check', - boxUnchecked: 'glyphicon-unchecked' - }, - created: function(){ - this.fetchData(); + active_page: "bundles", + active_room: 0, + active_bundle: 0, + active_season: "spring", + active_skill: "farming", + save_mode: false, + load_mode: false }, ready: function(){ - $('.list-group-item').on('click', function() { - $('.glyphicon', this) - .toggleClass('glyphicon-chevron-right') - .toggleClass('glyphicon-chevron-down'); - }); + this.fetchData(); + new Clipboard('.copy'); + storedUserData = localStorage.getItem('user_data'); + if(storedUserData !== null){ + this.loadData(storedUserData); + } + }, + computed: { + user_data_serialized: function(){ + return JSON.stringify(this.user_data); + } }, methods: { fetchData: function(){ this.$http.get('bundles.json', function(data, status, response){ if(status == 200){ this.static = data; - for(var i = 0; i < this.static.items.length; i++){ - this.user_data.push(false); + if(this.user_data.length <= 0){ + for(i=0; i -1){ + return true; + } + else{ + return false; + } + }, + getSeasonName: function(seasonId){ + for(i = 0; i < this.static.seasons.length; i++){ + if(this.static.seasons[i].id === seasonId){ + return this.static.seasons[i].name; + } + } + return ""; + }, + getSkillName: function(skillId){ + for(i = 0; i < this.static.skills.length; i++){ + if(this.static.skills[i].id === skillId){ + return this.static.skills[i].name; + } + } + return ""; } } }); + +Vue.filter('inBundle', function(value, id){ + return value.filter(function(element){ + if(element.bundles.indexOf(id) > -1){ + return true; + } + else{ + return false; + } + }); +}); + +Vue.filter('filterByArray', function(array1, array2){ + return array1.filter(function(element){ + if(array2.indexOf(element.id) > -1){ + return true; + } + else{ + return false; + } + }); +}); From 872769a74d7076034700f1e35fe3aa28b906b61c Mon Sep 17 00:00:00 2001 From: John Cleaver Date: Wed, 30 Mar 2016 22:16:17 -0400 Subject: [PATCH 4/4] Added base64 encoding of the string. --- main.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/main.js b/main.js index 3158fa6..f5132a2 100644 --- a/main.js +++ b/main.js @@ -16,13 +16,13 @@ var v = new Vue({ this.fetchData(); new Clipboard('.copy'); storedUserData = localStorage.getItem('user_data'); - if(storedUserData !== null){ + if(storedUserData !== null && storedUserData !== ""){ this.loadData(storedUserData); } }, computed: { user_data_serialized: function(){ - return JSON.stringify(this.user_data); + return btoa(JSON.stringify(this.user_data)); } }, methods: { @@ -45,7 +45,7 @@ var v = new Vue({ this.load_mode = false; }, loadData: function(data){ - this.user_data = JSON.parse(data); + this.user_data = JSON.parse(atob(data)); this.exitLoadMode(); }, enterSaveMode: function(){