-
Notifications
You must be signed in to change notification settings - Fork 0
/
home.html
103 lines (92 loc) · 2.96 KB
/
home.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Zintis May - Home</title>
<link rel="stylesheet" href="robotoFont.css">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link
href="https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap"
rel="stylesheet">
<link rel="stylesheet" href="index.css">
</head>
<body class="home">
<div class="contentArea" id="contentArea">
<div class="headshot" id="headshot"></div>
<div class="">
<h1>Zintis May</h1>
<p>
<a href="work.html">Programmer</a>
<br>
<br>
<a href="work.html">Teacher</a>
<br>
<br>
<a href="work.html">Game Designer</a>
</p>
<div id="links"></div>
</div>
</div>
</body>
<script src="addMenu.js"></script>
<script>
// buildMenu(document.getElementById("links"));
</script>
<script>
let blueSquareArray = createShapes(10)
let contentArea = document.getElementById("contentArea")
blueSquareArray.forEach(tri => {
contentArea.appendChild(tri)
})
function rand(min, max) {
return min + Math.floor(Math.random() * Math.floor(max - min + 1));
}
function weightedRand(min, max, goHi, iterations) {
var numToReturn = max;
for (var k = 0; k < iterations; k++) {
var randomNumber = rand(min, max);
if (goHi && randomNumber > numToReturn) {
numToReturn = randomNumber
} else if (!goHi && randomNumber < numToReturn) {
numToReturn = randomNumber
}
}
return numToReturn;
}
function makeRandomBlueSquare(i, distanceFromTB, distanceFromLR) {
var heightWidth = rand(50, 100);
let tri = document.createElement("div")
tri.classList.add("blueSquare")
tri.style.zIndex = 0
tri.style.top = rand(distanceFromTB.lo, distanceFromTB.hi) + "%"
tri.style.left = rand(distanceFromLR.lo, distanceFromLR.hi) + "%"
tri.style.height = heightWidth + "px"
tri.style.width = heightWidth + "px"
tri.style.opacity = weightedRand(10, 70, false, 3) / 100
return tri
}
function createShapes(amount) {
//Version 1 sides
var blueSquareArray = []
// left
for (var x = 0; x < amount; x++) {
blueSquareArray.push(makeRandomBlueSquare(x, { lo: 15, hi: 100 }, { lo: -3, hi: 3 }))
}
// right
for (var y = 0; y < amount; y++) {
blueSquareArray.push(makeRandomBlueSquare(x, { lo: 15, hi: 100 }, { lo: 97, hi: 103 }))
}
// top
for (var z = 0; z < amount; z++) {
blueSquareArray.push(makeRandomBlueSquare(x, { lo: -3, hi: 5 }, { lo: 10, hi: 90 }))
}
// bottom
for (var q = 0; q < amount; q++) {
blueSquareArray.push(makeRandomBlueSquare(x, { lo: 97, hi: 103 }, { lo: -10, hi: 100 }))
}
return blueSquareArray
}
</script>
</html>