Skip to content

Commit c349691

Browse files
committed
9 juli, 1911, HF
1 parent 6b92c8f commit c349691

File tree

5 files changed

+133
-5
lines changed

5 files changed

+133
-5
lines changed

assets/.DS_Store

2 KB
Binary file not shown.

assets/css/.DS_Store

0 Bytes
Binary file not shown.

assets/css/images/henrik.jpg

499 KB
Loading

assets/js/neuronAnimation.js

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
const canvas = document.getElementById("bg");
2+
const ctx = canvas.getContext("2d");
3+
4+
let width, height;
5+
function resize() {
6+
width = window.innerWidth;
7+
height = window.innerHeight;
8+
canvas.width = width * window.devicePixelRatio;
9+
canvas.height = height * window.devicePixelRatio;
10+
canvas.style.width = width + "px";
11+
canvas.style.height = height + "px";
12+
ctx.setTransform(window.devicePixelRatio, 0, 0, window.devicePixelRatio, 0, 0);
13+
ctx.imageSmoothingEnabled = true;
14+
ctx.imageSmoothingQuality = "high";
15+
}
16+
resize();
17+
window.addEventListener("resize", resize);
18+
19+
let points = [];
20+
const totalPoints = 140;
21+
for (let i = 0; i < totalPoints; i++) {
22+
points.push({
23+
x: Math.random() * width,
24+
y: Math.random() * height,
25+
vx: (Math.random() - 0.5) * 0.1,
26+
vy: (Math.random() - 0.5) * 0.1,
27+
});
28+
}
29+
30+
function randomPoint() {
31+
return points[Math.floor(Math.random() * points.length)];
32+
}
33+
34+
function findNearbyPoint(from) {
35+
let candidates = points
36+
.map(p => ({ p, dist: Math.hypot(p.x - from.x, p.y - from.y) }))
37+
.filter(entry => entry.dist > 20 && entry.dist < 140);
38+
if (candidates.length === 0) return randomPoint();
39+
candidates.sort((a, b) => a.dist - b.dist);
40+
const closeFew = candidates.slice(0, Math.min(5, candidates.length));
41+
return closeFew[Math.floor(Math.random() * closeFew.length)].p;
42+
}
43+
44+
let current = randomPoint();
45+
let next = findNearbyPoint(current);
46+
let progress = 0;
47+
let duration = 240;
48+
49+
function drawBackgroundNet() {
50+
for (let i = 0; i < points.length; i++) {
51+
let p = points[i];
52+
p.x += p.vx;
53+
p.y += p.vy;
54+
if (p.x < 0 || p.x > width) p.vx *= -1;
55+
if (p.y < 0 || p.y > height) p.vy *= -1;
56+
57+
for (let j = i + 1; j < points.length; j++) {
58+
let q = points[j];
59+
let dx = p.x - q.x;
60+
let dy = p.y - q.y;
61+
let dist = Math.sqrt(dx * dx + dy * dy);
62+
if (dist < 120) {
63+
ctx.beginPath();
64+
ctx.moveTo(p.x, p.y);
65+
ctx.lineTo(q.x, q.y);
66+
ctx.strokeStyle = `rgba(160, 200, 255, ${0.08 + (1 - dist / 120) * 0.25})`;
67+
ctx.lineWidth = 0.45;
68+
ctx.stroke();
69+
}
70+
}
71+
72+
ctx.beginPath();
73+
ctx.arc(p.x, p.y, 1.1, 0, Math.PI * 2);
74+
ctx.fillStyle = '#99bbdd';
75+
ctx.shadowColor = 'transparent';
76+
ctx.shadowBlur = 0;
77+
ctx.fill();
78+
}
79+
}
80+
81+
function drawNeuronEffect() {
82+
const pulse = 2 + Math.sin(progress / duration * Math.PI) * 2.1;
83+
84+
ctx.beginPath();
85+
ctx.arc(current.x, current.y, pulse, 0, Math.PI * 2);
86+
ctx.fillStyle = `rgba(255, 255, 255, ${0.14 + 0.24 * Math.sin(progress / duration * Math.PI)})`;
87+
ctx.shadowColor = '#ffffff';
88+
ctx.shadowBlur = 8;
89+
ctx.fill();
90+
91+
for (let i = 0; i < points.length; i++) {
92+
let p = points[i];
93+
let dx = current.x - p.x;
94+
let dy = current.y - p.y;
95+
let dist = Math.sqrt(dx * dx + dy * dy);
96+
if (dist < 140 && dist > 12) {
97+
ctx.beginPath();
98+
ctx.moveTo(current.x, current.y);
99+
ctx.lineTo(p.x, p.y);
100+
ctx.strokeStyle = `rgba(255, 255, 255, ${0.07 + 0.14 * Math.sin(progress / duration * Math.PI)})`;
101+
ctx.lineWidth = 0.55;
102+
ctx.stroke();
103+
104+
ctx.beginPath();
105+
ctx.arc(p.x, p.y, 1.8, 0, Math.PI * 2);
106+
ctx.fillStyle = 'rgba(255, 255, 255, 0.07)';
107+
ctx.shadowColor = '#ffffff';
108+
ctx.shadowBlur = 4;
109+
ctx.fill();
110+
}
111+
}
112+
113+
progress++;
114+
if (progress >= duration) {
115+
current = next;
116+
next = findNearbyPoint(current);
117+
progress = 0;
118+
duration = 220 + Math.random() * 100;
119+
}
120+
}
121+
122+
function draw() {
123+
ctx.clearRect(0, 0, width, height);
124+
drawBackgroundNet();
125+
drawNeuronEffect();
126+
requestAnimationFrame(draw);
127+
}
128+
129+
draw();

index.html

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,9 @@
1212
<body class="is-preload">
1313
<header id="header">
1414
<div class="inner">
15-
<h1>I am Henry Moe</h1>
15+
<h1>Henry Moe</h1>
1616
<p>
17-
Exploring psychology, neuroscience, and AI/ML with a focus on connecting research to real-world applications.
18-
</p>
17+
Cognitive Neuroscience Student Researcher
1918
</div>
2019
</header>
2120

@@ -24,7 +23,7 @@ <h1>I am Henry Moe</h1>
2423
<section id="about" class="inner">
2524
<h2>About Me</h2>
2625
<p>
27-
I’m a student exploring the intersections of psychology, neuroscience, and technology. My current focus is on learning how to analyze datasets and apply machine learning techniques to uncover insights into brain function and cognition. I aim to build a strong foundation for future research and practical applications.
26+
I'm a psychology and computer science student at the University of Oslo, interested in the intersection of cognitive neuroscience, neuroimaging, machine learning, and data science. I’m particularly interested in vision, perception, memory, and decision-making, and overall predictive modeling, using statistical and computational methods to study brain dynamics.
2827
</p>
2928
</p>
3029
</section>
@@ -43,7 +42,7 @@ <h2>Get In Touch</h2>
4342
<!-- Social Links -->
4443
<ul class="social">
4544
<li><a href="https://orcid.org/0009-0000-0909-5139" class="icon brands fa-orcid"><span>ORCID</span></a></li>
46-
<li><a href="https://github.com/fishtangerine" class="icon brands fa-github"><span>GitHub</span></a></li>
45+
<li><a href="https://github.com/henrfo" class="icon brands fa-github"><span>GitHub</span></a></li>
4746
<li><a href="mailto:[email protected]" class="icon solid fa-envelope"><span>Email</span></a></li>
4847
</ul>
4948
</section>

0 commit comments

Comments
 (0)