-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
117 lines (98 loc) · 3.81 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
<!DOCTYPE html>
<html ng-app="app" lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Intensivão AnguarJS e Java</title>
<!--importando o angular, bootstrap -->
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.8.0/angular.min.js"></script>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" integrity="sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z" crossorigin="anonymous">
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js" integrity="sha384-B4gt1jrGC7Jh4AgTPSdUtOBvfO8shuf57BaghqFfPlYxofvL8/KUEfYiJOMMV+rV" crossorigin="anonymous"></script>
<style>
.match {
display: flex;
justify-content: space-around;
align-items: center;
}
.match__team {
padding: 15px;
position: relative;
}
.match__team:first-child .match__team--bg {
border-left: 3px solid red;
}
.match__team:last-child .match__team--bg {
border-right: 3px solid blue;
}
.match__team--bg {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left:0;
transform: skew(-25deg);
z-index: -1;
}
.match__team--name{
text-align: center;
}
.match__team--name:not(:focus){
border: none;
}
.match__score {
text-align: center;
}
</style>
</head>
<body>
<cb-match-list></cb-match-list>
<script>
//conectar o html ao Angular
var app = angular.module("app",[]);
app.component("cbMatchList",{
templateUrl: "cb-match-list.html",
controller: function($scope,$http){
$scope.matches = [];
$scope.addA = function(match){
match.scoreA++;
};
$scope.minusA = function(match){
if(match.scoreA > 0){
match.scoreA--;
}
};
$scope.addB = function(match){
match.scoreB++;
};
$scope.minusB = function(match){
if(match.scoreB > 0){
match.scoreB--;
}
};
$scope.finish = function(match){
match.status = 'Finalizada';
match.done = true;
};
$scope.save = function(){
//Fazer uma requisição HTTP GET
$http.post('http://localhost:5555',$scope.matches)
.then(function(response){
console.log(response.data);
} , function(error){ } );
};
$scope.create = function(){
var m = {
scoreA: 0,
scoreB: 0,
teamA: "Mandante",
teamB: "Visitante",
status: "Jogando",
done: false,
};
$scope.matches.push(m)
};
},
});
</script>
</body>
</html>