-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
71 lines (68 loc) · 2.11 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
<!DOCTYPE html>
<html lang="pt-br">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, initial-scale=1.0, user-scalable=no">
<title>Random Quote Machine</title>
<link rel="stylesheet" href="./styles.css" />
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css"
rel="stylesheet"
integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC"
crossorigin="anonymous">
</head>
<body>
<main id="quote-box" class="container">
<div class="row">
<div class="col-12">
<blockquote id="app" class="border border-success" :key="controll">
<p id="text" class="lead">{{ quote }}</p>
<small id="author">{{ author }}</small>
</blockquote>
</div>
</div>
<div class="row rows-cols-2 align-items-center">
<div class="col-8">
<a href="twitter.com/intent/tweet" id="tweet-quote" class="text-muted" target="_blank">
Tweet this!
</a>
</div>
<div class="col">
<button id="new-quote" class="btn btn-outline-light">Nova citação</button>
</div>
</div>
</main>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js"
integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM"
crossorigin="anonymous"></script>
<script src="https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js"></script>
<script src="script.js"></script>
<script type="module">
import { createApp } from 'https://unpkg.com/vue@3/dist/vue.esm-browser.js'
createApp({
data() {
return {
quote: "Quote",
author: "Fonte",
controll: 0
}
},
mounted() {
const url = "https://api.quotable.io/random?tags=history";
fetch(url, { method: "GET"})
.then(res => res.json())
.then(json => {
this.quote = json.content;
this.author = json.author;
})
.catch(rej => console.error(rej));
},
methods: {
forceRerender(){
this.controll += 1;
}
}
}).mount('#app');
</script>
</body>
</html>