-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
179 lines (160 loc) · 4.59 KB
/
index.html
File metadata and controls
179 lines (160 loc) · 4.59 KB
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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
<style>
.green {
background-color: green;
background-image:url('g.svg');
background-repeat: no-repeat;
background-position: center center ;
}
.white {
background-color: white;
background-image:url('w.svg');
background-repeat: no-repeat;
background-position: center center ;
}
body {
background: rgb(131, 58, 180);
background: linear-gradient(
90deg,
rgba(131, 58, 180, 1) 0%,
rgba(253, 29, 29, 1) 50%,
rgba(252, 176, 69, 1) 100%
);
}
#myimg {
max-width: 100%;
border-radius: 15% / 3%;
box-shadow: -8px -8px 5px -5px red, 5px 5px 5px -5px rgb(255, 0, 231),
-7px -7px 10px -5px transparent, 7px 7px 10px -5px transparent,
0 0 5px 0 rgba(255, 255, 255, 0), 0 55px 35px -20px rgba(0, 0, 0, 0.5);
}
@import url("https://fonts.googleapis.com/css?family=Open+Sans:400italic");
#otro-blockquote {
font-size: 1em;
width: 60%;
margin: 50px auto;
font-family: Open Sans;
font-style: italic;
color: #555555;
padding: 1.2em 30px 1.2em 75px;
border-left: 8px solid #78c0a8;
line-height: 1.6;
position: relative;
background: #ededed;
}
#otro-blockquote::before {
font-family: Arial;
content: "\201C";
color: #78c0a8;
font-size: 4em;
position: absolute;
left: 10px;
top: -10px;
}
.otro-blockquote::after {
content: "";
}
#img {
text-align: center;
margin: auto;
}
table {
margin: auto;
border-collapse: collapse;
max-width: 100%;
display: block;
font-size: 0.9em;
font-family: sans-serif;
box-shadow: 0 0 20px rgba(0, 0, 0, 0.15);
}
thead tr {
width: 100%;
color: #ffffff;
text-align: left;
}
th,
td {
padding: 12px 15px;
width: 100%;
}
tbody tr {
border-bottom: 1px solid #dddddd;
}
tbody tr:nth-of-type(even) {
background-color: #f3f3f3;
}
tbody tr:last-of-type {
border-bottom: 2px solid #009879;
}
</style>
</head>
<body>
<div id="img" class="shape-inner"></div>
<div id="otro-blockquote"></div>
<table>
<tr>
<th>Nom</th>
<th>release</th>
<th>color</th>
<th>price</th>
<th></th>
</tr>
<tr>
<td id="name"></td>
<td id="release"></td>
<td id="color"></td>
<td id="price"></td>
<td id="acheter"></td>
</tr>
</table>
<script>
document.addEventListener("DOMContentLoaded", function () {
fetch(" https://api.scryfall.com/cards/random")
.then((response) => response.json())
.then((data) => {
const cardname = data.name;
const release = data.released_at;
const color = data.colors;
const mana = data.mana_cost;
const price = data.prices.eur;
const img = data.image_uris.small;
const cardmarker = data.purchase_uris.cardmarket;
const oracle = data.oracle_text;
if (color[0] == "G") {
document.querySelector("#color").classList.add("green");
console.log("green card");
// document.querySelector('#color').innerHTML = ${changeColor};
} else if(color[0] == "W") {
white = document.querySelector("#color");
white.innerHTML = `${mana}`;
white.classList.add("white");
white.style.color = "black";
}
document.querySelector("#name").innerHTML = `${cardname}`;
document.querySelector("#release").innerHTML = `${release}`;
document.querySelector("#color").innerHTML = `
${mana}`;
document.querySelector("#price").innerHTML = `${price}`;
document.querySelector(
"#img"
).innerHTML = `<img id="myimg"src="${img}" alt="${name}">`;
document.querySelector(
"#otro-blockquote"
).innerHTML = `<p>${oracle}</p>`;
document.querySelector(
"#acheter"
).innerHTML = `<a href="${cardmarker}">
<button>buy</button>
</a>
`;
});
});
</script>
</body>
</html>