Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Final #14

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion project/.jshintrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"eqeqeq": true,
"eqnull": true,
"immed": true,
"indent": 2,
"latedef": "nofunc",
"newcap": true,
"noarg": true,
Expand Down
15 changes: 15 additions & 0 deletions project/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,21 @@
controller: 'HomeCtrl',
controllerAs: 'home',
})
.when('/exo03', {
templateUrl: 'src/app/exo03/exo03.html',
controller: 'Exo03Ctrl',
controllerAs: 'exo03',
})
.when('/exo04', {
templateUrl: 'src/app/exo04/exo04.html',
controller: 'Exo04Ctrl',
controllerAs: 'exo04',
})
.when('/final', {
templateUrl: 'src/app/final/final.html',
controller: 'FinalCtrl',
controllerAs: 'final',
})
.otherwise({redirectTo:'/'});
}

Expand Down
8 changes: 8 additions & 0 deletions project/app.less
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
@import "variables.less";
/* Add App LESS files below */
@import "src/app/home/home.less";
@import "src/app/exo03/exo03.less";
@import "src/app/exo04/exo04.less";
@import "src/app/final/final.less";

/* Add Fonts below */
@fa-font-path: "bower_components/font-awesome/fonts";
Expand Down Expand Up @@ -40,3 +43,8 @@ body {

/* Required for Angular UI Bootstrap */
.nav, .pagination, .carousel, .panel-title a { cursor: pointer; }





Binary file added project/img/boisson-skittles.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions project/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,15 @@
<!-- Main App JS -->
<script src="app.js"></script>
<script src="src/app/home/home.controller.js"></script>
<script src="src/components/setting/setting.service.js"></script>
<script src="src/components/meteo/meteo.service.js"></script>
<script src="src/app/exo03/exo03.controller.js"></script>
<script src="src/app/exo03/detail-partial/detail.controller.js"></script>
<script src="src/app/exo04/exo04.controller.js"></script>
<script src="src/components/searchConfig/searchConfig.service.js"></script>
<script src="src/components/cocktailSearch/cocktail.service.js"></script>
<script src="src/app/final/Final.controller.js"></script>

<!-- Add New Component JS Above -->

<toast></toast>
Expand Down
3 changes: 3 additions & 0 deletions project/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,8 @@
"karma-mocha-reporter": "~0.2.5",
"karma-phantomjs-launcher": "~0.1.4",
"load-grunt-tasks": "~0.2"
},
"dependencies": {
"angular-background-image": "^0.1.2"
}
}
15 changes: 15 additions & 0 deletions project/src/app/exo03/detail-partial/detail.controller.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
(function() {
'use strict';

function DetailCtrl() {
var vm = this;
vm.msg = 'Welcome All!';
vm.subMsg = 'A seed Project';
}

DetailCtrl.$inject = [];

angular.module('daproject')
.controller('DetailCtrl', DetailCtrl);

})();
7 changes: 7 additions & 0 deletions project/src/app/exo03/detail-partial/detail.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<div ng-controller="DetailCtrl as detail" >
<div ng-if="exo03.idFilms">
<p>{{exo03.idFilms.name}}<p>
<p>{{exo03.idFilms.year}}</p>
</div>
</div>

Empty file.
34 changes: 34 additions & 0 deletions project/src/app/exo03/exo03.controller.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
(function() {
'use strict';

function Exo03Ctrl() {
var vm = this;
vm.msg = 'Welcome All!';
vm.subMsg = 'A seed Project';
vm.films = [
{name: 'Fast and Furious', img: 'https://image.tmdb.org/t/p/w600_and_h900_bestv2/AkSMd8AXSpA1L1SbBPc2AfVJfmE.jpg', year: 2001},
{name: '2 Fast 2 Furious', img: 'https://image.tmdb.org/t/p/w600_and_h900_bestv2/u1Snfl40rXmAJNiMyZUczUyFVuf.jpg', year: 2003},
{name: 'Fast & Furious: Tokyo Drift', img: 'https://image.tmdb.org/t/p/w600_and_h900_bestv2/4ceW7kWPAc2uFG5WzYDbP8Od3gw.jpg', year: 2006}
];


vm.clickImg = clickImg;
var idFilms;
vm.idFilms = null;
function clickImg (index){
vm.idFilms = vm.films[index];
console.log(idFilms.name);
}
}






Exo03Ctrl.$inject = [];

angular.module('daproject')
.controller('Exo03Ctrl', Exo03Ctrl);

})();
25 changes: 25 additions & 0 deletions project/src/app/exo03/exo03.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<div class="contenerFilms">



<div class="flex-item" id="listeFilms">Movies

<ul>
<li ng-repeat="film in exo03.films" ng-click="exo03.clickImg($index)"><img src="{{film.img}}" ng-class="{'borderPink': film.name === exo03.idFilms.name}"></li>
</ul>
</div>


<div class="flex-item" id="detailsFilms">
<div>
<ng-include src="'src/app/exo03/detail-partial/detail.html'"></ng-include>
</div>

detailMovies

</div>


</div>

</div>
40 changes: 40 additions & 0 deletions project/src/app/exo03/exo03.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
.contenerFilms {
padding: 0;
margin: 0;
list-style: none;

display: flex;

flex-flow: row wrap;
justify-content: space-around;
}

.flex-item {
background: tomato;
width: 43%;
height: 100%;
margin-top: 10px;

line-height: 150px;
color: white;
font-weight: bold;
font-size: 3em;
text-align: center;
}

li
{
list-style-type: none;

}

li img {
width: 50%;
height: 50%;
padding: 5px auto;
}

.borderPink
{
border: 4px solid pink;
}
25 changes: 25 additions & 0 deletions project/src/app/exo04/exo04.controller.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
(function() {
'use strict';

function Exo04Ctrl(settingService, meteoService) {
var vm = this;
vm.input = '';
vm.click = click;
vm.settingService = settingService;
vm.meteoService = meteoService;

function click() {
settingService.city = vm.input;
}
}





Exo04Ctrl.$inject = ['settingService', 'meteoService'];

angular.module('daproject')
.controller('Exo04Ctrl', Exo04Ctrl);

})();
3 changes: 3 additions & 0 deletions project/src/app/exo04/exo04.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<input ng-model="exo04.input" /><button ng-click="exo04.click()">search</button>
<div>{{exo04.settingService.city}}</div>
<div><img src="http://openweathermap.org/img/w/{{exo04.service.meteoliste[0].weather[0].icon}}.png"></div>
Empty file.
19 changes: 19 additions & 0 deletions project/src/app/final/final.controller.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
(function() {
'use strict';

function FinalCtrl(searchConfig) {
var vm = this;
vm.input = '';

function click() {
searchConfig.ingredient = vm.ingredient;
}
}


FinalCtrl.$inject = ['searchConfig'];

angular.module('daproject')
.controller('FinalCtrl', FinalCtrl);

})();
5 changes: 5 additions & 0 deletions project/src/app/final/final.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<div>
<input ng-model="final.input" /><button ng-click="final.click(), cocktail.getCocktail()">buvons</button>
{{final.searchConfig.ingredient}}
</div>

8 changes: 8 additions & 0 deletions project/src/app/final/final.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
div
{
height : 300px;
background-image : url("https://www.123bonbon.com/2530-thickbox_default/boisson-skittles.jpg");
background-size : cover;
width : 600px;

}
5 changes: 3 additions & 2 deletions project/src/app/home/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
<div class="subTitle">{{home.subMsg}}</div>
</div>
<a class="highscoreLink" ng-click="home.goToExo(3)">Exo03</a>
<a class="highscoreLink" href="/#/exo05">Exo05</a>
<a class="highscoreLink" href="/#/exo06">Exo06</a>
<a class="highscoreLink" href="/#/exo04">Exo04</a>
<a class="highscoreLink" href="/#/final">final</a>

</div>
</div>
</div>
30 changes: 30 additions & 0 deletions project/src/components/cocktailSearch/cocktail.service.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
(function() {
'use strict';

function cocktailSearch(searchConfig, $http) {
var vm = {};
vm.cocktailist = [];
vm.getCocktail = getCocktail;

function getCocktail(){
return $http.get('http://www.thecocktaildb.com/api/json/v1/1/filter.php?i=' + searchConfig.ingredient)
.then(function(response){
console.log('Success: %o', response);
vm.cocktailist = response.data.list;
})
.catch(function(error){
console.log('Error: %o', error);
});
}


return vm;
}


cocktailSearch.$inject = ['searchConfig', '$http'];

angular.module('daproject')
.factory('cocktailSearch', cocktailSearch);

})();
31 changes: 31 additions & 0 deletions project/src/components/meteo/meteo.service.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
(function() {
'use strict';

function meteoService($http, settingService) {
var service = {};
service.meteoliste = [];
service.getMeteo = getMeteo;

function getMeteo() {
return $http.get('http://api.openweathermap.org/data/2.5/forecast?q={{exo04.service.city}}&APPID=&APPID=1f7da13f24fda94160547b9e4403aee5&units=metric=' + toto + '&param2=' + tata)
.then(function(response){
console.log('Success: %o', response);
service.meteoliste = response.data.list;
})
.catch(function(error){
console.log('Error: %o', error);
});
}

return service;
}




meteoService.$inject = ['$http', 'settingService'];

angular.module('daproject')
.factory('meteoService', meteoService);

})();
20 changes: 20 additions & 0 deletions project/src/components/searchConfig/searchConfig.service.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
(function() {
'use strict';

function searchConfig() {
var vm = {};
vm.ingredient = '';

return vm;


}



searchConfig.$inject = [];

angular.module('daproject')
.factory('searchConfig', searchConfig);

})();
17 changes: 17 additions & 0 deletions project/src/components/setting/setting.service.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
(function() {
'use strict';

function settingService() {
var service = {};
service.city = '';
service.isCelsius = true;

return service;
}

settingService.$inject = [];

angular.module('daproject')
.factory('settingService', settingService);

})();