-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
121 lines (114 loc) · 4.08 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
118
119
120
121
<!DOCTYPE html>
<html lang="en-US">
<head>
<title>Bruno Zhong's Website</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
<meta name="author" content="Bruno Zhong">
<meta name="description" content="About Bruno Zhong">
<meta name="keywords" content="Bruno Zhong, About Bruno Zhong, Bruno, Bruno Z">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="https://unpkg.com/packery@2/dist/packery.pkgd.min.js"></script>
<script src="https://unpkg.com/draggabilly@3/dist/draggabilly.pkgd.min.js"></script>
<style>
.grid-item {
float: left;
width: 300px;
height: 288px;
}
.grid-item:hover {
border-color: #888888;
cursor: move;
}
.grid-item.is-dragging,
.grid-item.is-positioning-post-drag {
z-index: 2;
}
.packery-drop-placeholder {
outline: 3px dashed #444444;
outline-offset: -6px;
-webkit-transition: -webkit-transform 0.2s;
transition: transform 0.2s;
}
</style>
</head>
<body data-bs-spy="scroll" data-bs-target="#navbar-example">
<nav id="navbar-example" class="navbar navbar-light bg-light px-3 sticky-top" data-bs-offset="0">
<a class="navbar-brand" href="#">Bruno Zhong's Website</a>
<ul class="nav nav-pills" role="tablist">
<li class="nav-item">
<a class="nav-link" href="#about-me">About Me</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#my-projects">My Projects</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#resources">Resources</a>
</li>
</ul>
</nav>
<div id="quote"></div>
<div id="about-me">
<h2>About Me</h2>
<p>Hi! My name is Bruno Zhong. I am 11 years old. I know eleven programming languages: HTML, CSS, JavaScript, Python, Go, C, C++, Java, C#, Kotlin, and Swift.</p>
<p><img src="img/bruno.png" width="500" fetchpriority="high"></p>
</div>
<div id="my-projects">
<h2>My Projects</h2>
<div id="projects-container">
</div>
</div>
<script defer>
var packery = new Packery('#projects-container', {
columnWidth: 300,
gutter: 10,
itemSelector: '.grid-item'
});
fetch("quotes.json")
.then(r => r.json())
.then(quotes => {
const q = quotes[Math.floor(Math.random() * 25)];
document.getElementById("quote").innerHTML = `<figure>
<blockquote class="blockquote">
<p>${q.quote}</p>
</blockquote>
<figcaption class="blockquote-footer">
${q.author}
</figcaption>
</figure>`
});
fetch("projects.json")
.then(r => r.json())
.then(projects => {
projects.forEach(p => {
let display;
if (p.image) {
display = `<img src="${p.image}" width="250px" height="150px" style="display: block;">`
} else {
display = `<video autoplay muted loop width="250px" height="150px">
<source src="${p.video}" class="vid">
</video>`
}
const layout = `<div class="grid-item card p-1 m-1">
<div class="card-body">
<h5>${p.name}</h5>
${display}
<p>
<a class="btn btn-success mt-1" href="${p.link}">Find out more!</a>
</p>
</div>
</div>`
document.getElementById('projects-container').innerHTML += layout;
console.log("zzz")
})
packery.reloadItems()
packery.layout()
packery.getItemElements().forEach(function(e) {
var draggie = new Draggabilly(e)
packery.bindDraggabillyEvents(draggie)
console.log("yay")
})
})
</script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" crossorigin="anonymous"></script>
</body>
</html>