-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
78 lines (65 loc) · 3.12 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
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]> <html class="no-js"> <!--<![endif]-->
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title> 🤣Preparat per riure?</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="index.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://kit.fontawesome.com/101000f347.js" crossorigin="anonymous"></script>
</head>
<body>
<div class="top-container">
<div id="weather-container"></div>
<div id="right-blob"></div>
</div>
<!-- add class of blob to see blob again -->
<div id="main-container">
<h1 id="main-heading">Preparat per riure?</h1>
<div id="joke-container"></div>
<div id="scores-container">
<button type="button" onclick="giveScore(1)" class="btn score-btn">
<i class="fas fa-grin-beam-sweat fa-2x"></i>
</button>
<button type="button" onclick="giveScore(2)" class="btn score-btn"><i class="fas fa-grin-tears fa-2x"></i></i>
</button>
<button type="button" onclick="giveScore(3)" class="btn score-btn"><i class="fas fa-grin-squint-tears fa-2x"></i></button>
</div>
<button id="btn-jokes" type="button" onclick="getJoke(); generateBlob()" class="btn btn-outline-dark">Següent acudit</button>
</div>
<div id="small-blob" class="blob"></div>
<script>
$(document).ready(function(){
generateBlob();
});
function generateBlob() {
const percentage1 = randomNum(25, 75);
const percentage2 = randomNum(25, 75);
const percentage3 = randomNum(25, 75);
const percentage4 = randomNum(25, 75);
var percentage11 = 100 - percentage1;
var percentage21 = 100 - percentage2;
var percentage31 = 100 - percentage3;
var percentage41 = 100 - percentage4;
var borderRadius = `${percentage1}% ${percentage11}% ${percentage21}% ${percentage2}% / ${percentage3}% ${percentage4}% ${percentage41}% ${percentage31}%`;
var colorR = Math.floor((Math.random() * 256));
var colorG = Math.floor((Math.random() * 256));
var colorB = Math.floor((Math.random() * 256));
$(".blob").css("border-radius", borderRadius);
$(".blob").css("background-color", "rgb(" + colorR + "," + colorG + "," + colorB + ")");
// $(".style span").html(borderRadius);
}
function randomNum(min, max) {
return Math.floor(Math.random() * (max - min)) + min; // You can remove the Math.floor if you don't want it to be an integer
}
</script>
<script>var exports = {};</script>
<script src="index.js" async defer></script>
</body>
</html>