Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
KatsuyaAkasaka committed Dec 15, 2017
2 parents 1bfa8ee + e5e70e4 commit 8bd955f
Show file tree
Hide file tree
Showing 21 changed files with 400 additions and 135 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -186,4 +186,8 @@ Session.vim
# auto-generated tag files
tags

#SCSSs
app/assets/stylesheets/bootstrap
app/assets/stylesheets/bootflat

# End of https://www.gitignore.io/api/osx,vim,ruby,rails,emacs
114 changes: 114 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ GIT
GEM
remote: https://rubygems.org/
specs:
CFPropertyList (2.3.6)
actioncable (5.1.4)
actionpack (= 5.1.4)
nio4r (~> 2.0)
Expand Down Expand Up @@ -102,9 +103,118 @@ GEM
responders
warden (~> 1.2.3)
erubi (1.7.0)
excon (0.59.0)
execjs (2.7.0)
ffi (1.9.18)
ffi (1.9.18-x64-mingw32)
fission (0.5.0)
CFPropertyList (~> 2.2)
fog (1.36.0)
fog-aliyun (>= 0.1.0)
fog-atmos
fog-aws (>= 0.6.0)
fog-brightbox (~> 0.4)
fog-core (~> 1.32)
fog-dynect (~> 0.0.2)
fog-ecloud (~> 0.1)
fog-google (<= 0.1.0)
fog-json
fog-local
fog-powerdns (>= 0.1.1)
fog-profitbricks
fog-radosgw (>= 0.0.2)
fog-riakcs
fog-sakuracloud (>= 0.0.4)
fog-serverlove
fog-softlayer
fog-storm_on_demand
fog-terremark
fog-vmfusion
fog-voxel
fog-xenserver
fog-xml (~> 0.1.1)
ipaddress (~> 0.5)
nokogiri (~> 1.5, >= 1.5.11)
fog-aliyun (0.2.0)
fog-core (~> 1.27)
fog-json (~> 1.0)
ipaddress (~> 0.8)
xml-simple (~> 1.1)
fog-atmos (0.1.0)
fog-core
fog-xml
fog-aws (2.0.0)
fog-core (~> 1.38)
fog-json (~> 1.0)
fog-xml (~> 0.1)
ipaddress (~> 0.8)
fog-brightbox (0.14.0)
fog-core (~> 1.22)
fog-json
inflecto (~> 0.0.2)
fog-core (1.45.0)
builder
excon (~> 0.58)
formatador (~> 0.2)
fog-dynect (0.0.3)
fog-core
fog-json
fog-xml
fog-ecloud (0.3.0)
fog-core
fog-xml
fog-google (0.1.0)
fog-core
fog-json
fog-xml
fog-json (1.0.2)
fog-core (~> 1.0)
multi_json (~> 1.10)
fog-local (0.4.0)
fog-core (~> 1.27)
fog-powerdns (0.1.1)
fog-core (~> 1.27)
fog-json (~> 1.0)
fog-xml (~> 0.1)
fog-profitbricks (4.1.1)
fog-core (~> 1.42)
fog-json (~> 1.0)
fog-radosgw (0.0.5)
fog-core (>= 1.21.0)
fog-json
fog-xml (>= 0.0.1)
fog-riakcs (0.1.0)
fog-core
fog-json
fog-xml
fog-sakuracloud (1.7.5)
fog-core
fog-json
fog-serverlove (0.1.2)
fog-core
fog-json
fog-softlayer (1.1.4)
fog-core
fog-json
fog-storm_on_demand (0.1.1)
fog-core
fog-json
fog-terremark (0.1.0)
fog-core
fog-xml
fog-vmfusion (0.1.0)
fission
fog-core
fog-voxel (0.1.0)
fog-core
fog-xml
fog-xenserver (0.3.0)
fog-core
fog-xml
fog-xml (0.1.3)
fog-core
nokogiri (>= 1.5.11, < 2.0.0)
formatador (0.2.5)
formtastic (3.1.5)
actionpack (>= 3.2.13)
formtastic_i18n (0.6.0)
Expand All @@ -116,6 +226,8 @@ GEM
httpclient (2.8.3)
i18n (0.9.1)
concurrent-ruby (~> 1.0)
inflecto (0.0.2)
ipaddress (0.8.3)
jbuilder (2.7.0)
activesupport (>= 4.2.0)
multi_json (>= 1.2)
Expand Down Expand Up @@ -263,6 +375,7 @@ GEM
websocket-driver (0.6.5)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.3)
xml-simple (1.1.5)

PLATFORMS
ruby
Expand All @@ -278,6 +391,7 @@ DEPENDENCIES
chartjs-ror
coffee-rails (~> 4.2)
devise
fog (= 1.36.0)
httpclient
inherited_resources!
jbuilder (~> 2.5)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Heroku [![Build Status](https://travis-ci.org/enpitut2017/kakei_gakuen.svg?branc
AWS [![CircleCI](https://circleci.com/gh/enpitut2017/kakei_gakuen/tree/master.svg?style=svg)](https://circleci.com/gh/enpitut2017/kakei_gakuen/tree/master)

## 概要
> 既存の家計簿アプリの"続けられない"、"入力が面倒くさい"という問題を解決したい
> 既存の家計簿アプリの"続けられない"、"入力が面倒くさい"という問題を解決したい!
そんな想いのもと誕生した新しい家計簿アプリが、この**家計学園**
この家計学園は通常の手入力に加えて、**音声入力で簡単に買い物の記録をする**ことができます。また、残高などを**ゲーム的に管理**することで、家計簿にありがちな"めんどくさいから入力しなくていいや"を解消することができます。  
Expand Down
Binary file modified app/assets/images/icons/toclosets.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/assets/images/icons/totop.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 18 additions & 7 deletions app/assets/javascripts/closet.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,23 @@ function switch_items(category) {
$('#ClosetsItems').children().remove();
items = $(id).data('hoge');
$.each(items, function(i, item){
$('#ClosetsItems').append('<div class="col-md-6 col-sm-12">' +
'<div class="ItemBox" onclick="draw_image(\'' + item.category + '\', \'' + item.path + '\', ' + item.priority + ', ' + item.id + ')">' +
'<img src=' + item.path +'>' +
'</div></div>');
if (item.has_clothe) {
$('#ClosetsItems').append(
'<div class="col-md-6 col-sm-12">' +
'<div class="ItemBox" onclick="draw_image(\'' + item.category + '\', \'' + item.path + '\', ' + item.priority + ', ' + item.id + ')">' +
'<div class="ItemImg" style="background-image: url(' + item.path +')">' +
'</div></div></div>'
);
console.log(item.path);

} else {
$('#ClosetsItems').append(
'<div class="col-md-6 col-sm-12">' +
'<div class="ItemBox" onclick="confirm_clothes_purchase(\'' + item.name + '\', ' + item.user_coin + ', ' + item.price + ', ' + item.id + ', ' + item.user_id + ')">' +
'<div class="ItemImg" style="background-image: url(' + item.path +')">' +
'<div class="ItemDark"></div></div></div></div>'
);
}
});
}

Expand All @@ -25,9 +38,7 @@ function post_json(user_path) {
$('.Layers').each(function(i, elm) {
users_wear[$(elm).attr('id')] = $(elm).children().val();
});

$.post('/closets', users_wear ,function(data){
console.log(data);
$.post('/closets', users_wear ,function(){
location.href=user_path;
});
}
6 changes: 5 additions & 1 deletion app/assets/javascripts/recognition.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
// books/new 音声入力
function record() {
var SpeechRecognition = SpeechRecognition || webkitSpeechRecognition;

window.SpeechRecognition = window.SpeechRecognition || window.webkitSpeechRecognition;
if (!window.SpeechRecognition) {
$("#modal").modal("show");
}
recognition = new SpeechRecognition();
recognition.lang = 'ja';
recognition.start();
Expand Down
41 changes: 41 additions & 0 deletions app/assets/javascripts/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,47 @@ function confirm_item_delete(bookid) {
$('#Delete-Modal').modal('show');
}

function confirm_clothes_purchase(item, coin, price, bookid, userid) {
var pricediv = document.getElementById("Closet-Modal-Price");
pricediv.innerHTML =
'<p style="font-size:22px;">' + item + '</p>' +
'<p style="font-size:20px;">カケイコイン:' +coin+' - '+price+' = '+(coin-price)+ '</p>';
var footer = document.getElementById("Closet-Modal-Footer");
if ((coin-price) >= 0) {
footer.innerHTML =
'<button type="button" class="btn btn-default" data-dismiss="modal">キャンセル</button>' +
'<a class="btn btn-primary" rel="nofollow" onclick="buy_clothes('+bookid+','+userid+')">購入</a>';
} else {
footer.innerHTML =
'<button type="button" class="btn btn-default" data-dismiss="modal">キャンセル</button>' +
'<a class="btn btn-primary disabled" rel="nofollow">コインが足りません</a>';
}
$('#Closet-Modal').modal('show');
}

function buy_clothes(bookid, userid){

var data = {
"buy_id" : bookid,
"user_id" : userid,
}
console.log(data);
$.ajax({
type: "post",
url: "/buy_clothes",
data: JSON.stringify(data),
contentType: "application/json",
dataType: "json",
success: function(response) {
location.reload();
console.log(response);
},
error: function() {
console.log("error");
}
});
}

function escape_html(string) {
if(typeof string !== 'string') {
return string;
Expand Down
25 changes: 18 additions & 7 deletions app/assets/stylesheets/_closets.scss
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,19 @@
position: absolute;
top: 20px;
right: 35px;
z-index: 9900;
z-index: 1000;
@media (max-width: 767px) {
top: 10px;
right: 25px;
height: 48px;
width: 48px;
}
&:hover {
filter: brightness(200%);
}
}
#ClosetsItemGroupsIcons{
width: 564px;
width: 940px;
height: 64px;
margin: auto;
position: absolute;
Expand All @@ -54,7 +57,7 @@
right: 0;
left: 0;
@media (max-width: 767px) {
width: 408px;
width: 680px;
height: 48px;
}
}
Expand All @@ -78,11 +81,19 @@
background-size: auto 100%;
background-position: center center;
background-repeat: no-repeat;
img{
height: 150px;
width: auto;
}
}
.ItemImg{
height: 148px;
background-size: auto 100%;
background-position: center center;
background-repeat: no-repeat;
}
.ItemDark{
border-radius: 3px;
background-color: rgba(0,0,0,0.5);
height: 148px;
}

.GroupBox{
width: 64px;
height: 64px;
Expand Down
3 changes: 3 additions & 0 deletions app/assets/stylesheets/_general.scss
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ hr{
.main{
padding-top: 15px;
}
.alert{
margin-bottom: 0;
}
.box{
margin-bottom: 15px;
padding: 0 0 15px 0;
Expand Down
5 changes: 4 additions & 1 deletion app/assets/stylesheets/_users.scss
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,16 @@
position: absolute;
top: 20px;
right: 35px;
z-index: 9900;
z-index: 1000;
@media (max-width: 767px) {
top: 10px;
right: 25px;
height: 48px;
width: 48px;
}
&:hover{
filter: brightness(200%);
}
}
#Charactor-Img{
height: 100%;
Expand Down
Loading

0 comments on commit 8bd955f

Please sign in to comment.