Skip to content

Commit c6ccdf6

Browse files
committed
Fixed animation, reduced fps, changed information
Fixed the sliding animation on the first page to be less graphically intensive and work better, plus lowered the FPS. Also changed the text on a few pages to make it more formal and presentable.
1 parent d8b666f commit c6ccdf6

6 files changed

+35
-25
lines changed

about.html

+6-9
Original file line numberDiff line numberDiff line change
@@ -95,20 +95,17 @@ <h1 class = "card-title">
9595
Who Am I?
9696
</h1>
9797
<p class = "card-text">
98-
I'm Fred. Hello.
99-
98+
I am a rising high school senior and the programming team lead for FRC Team 6423.
10099
</p>
101100
</div>
102101
<div class = "showcase-card">
103102
<h1 class = "card-title">
104103
Interests
105104
</h1>
106105
<p class = "card-text">
107-
Some of my interests include game development, web development, programming, math, computer science, and really just building anything in general.
108-
I also like to teach my skills to others. I am currently working part time as a Mentor/Student Mentor at
109-
<a class = "link-in-text" href = "https://kidoyo.com/" target = "_blank" rel = "noopener noreferrer">KidOYO</a>
110-
and I run a <a class = "link-in-text" href = "https://www.youtube.com/channel/UCxkhPyPBxjc_AfXWWrP_JGw" target = "_blank" rel = "noopener noreferrer">YouTube channel</a>
111-
where I post videos teaching people how to build cool stuff.
106+
Some of my interests include game development, embedded systems, software, math, computer science, and engineering.
107+
I also like to teach my skills to others. I currently run a <a class = "link-in-text" href = "https://www.youtube.com/channel/UCxkhPyPBxjc_AfXWWrP_JGw" target = "_blank" rel = "noopener noreferrer">YouTube channel</a>
108+
where I sometimes post videos teaching people how to build cool stuff.
112109

113110
</p>
114111
</div>
@@ -117,7 +114,7 @@ <h1 class = "card-title">
117114
Other Things I Like To Do
118115
</h1>
119116
<p class = "card-text">
120-
I like to ski, play badminton, swim, bike, and occasionally play video games.
117+
I like to ski, play badminton, swim, bike, and work on personal projects.
121118

122119
</p>
123120
</div>
@@ -132,7 +129,7 @@ <h1 class = "card-title">
132129
Discord: fredd#5872
133130
</p>
134131
<p class = "card-text">
135-
Email: thefradzgenius@gmail.com
132+
Email: freddy.davidson@yahoo.com
136133
</p>
137134
</div>
138135
</div>

index.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@
7373
<canvas class = "background-canvas" id = "canvas"></canvas>
7474
</div>
7575
<div class = "canvas-cover primary-cover">
76-
<h1 class = "cover-header">Hi, I'm Fred.</h1>
77-
<p>I like programming, computer science, math, and game development. IDK what else to put here</p>
76+
<h1 class = "cover-header">Frederik Davidson</h1>
77+
<p>Software Developer</p>
7878
</div>
7979
</div>
8080
</div>

js/expanding-circle-canvas-driver.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@ window.onload = () => {
103103
var dt = 0;
104104

105105
var draw = () => {
106-
requestAnimationFrame(draw);
107106
if (window.innerWidth < MIN_WIDTH) {
108107
return;
109108
}
@@ -121,6 +120,8 @@ window.onload = () => {
121120
circleCreation();
122121

123122
deleteCircles();
123+
setTimeout(()=>{requestAnimationFrame(draw);}, 1000/FRAME_RATE);
124+
124125
};
125126

126127
window.onfocus = window.onresize = initCircles;

js/landing.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ window.onload = function () {
2626

2727
var baseFontSz = window.innerWidth / 10;
2828

29-
var text1 = 'Mentor and Game Developer';
30-
var text2 = 'Welcome to My Site.';
29+
var text1 = 'Software Developer and Mentor';
30+
var text2 = 'This is my website:';
3131

3232
var redirecting = false;
3333

js/main-page-canvas-driver.js

+17-11
Original file line numberDiff line numberDiff line change
@@ -16,33 +16,36 @@ window.onload = () => {
1616

1717
var lastColor = 'white';
1818

19+
var trailingLine;
20+
1921
var ROOT_2 = Math.sqrt(2);
2022

2123
var lineWidth = 200;
2224

2325
var lineSpeed = 200;
2426

27+
var frameRate = 40;
28+
2529
let a = window.innerHeight;
2630
let c = ROOT_2 * a;
2731
let b = Math.sqrt(Math.pow(c, 2) - Math.pow(a, 2));
28-
let sqDiag = lineWidth * ROOT_2;
29-
32+
let sqDiag = 2 * Math.cos(degToRad(45)) * lineWidth;//lineWidth * (ROOT_2/2);
33+
//2cos(45 deg) / width
3034
var initLines = () => {
3135
a = window.innerHeight;
3236
c = ROOT_2 * a;
3337
b = Math.sqrt(Math.pow(c, 2) - Math.pow(a, 2));
3438
let linesRequired =
35-
Math.ceil((window.innerWidth + b + sqDiag) / sqDiag) + 1;
39+
Math.ceil(window.innerWidth/sqDiag)+1//Math.ceil((window.innerWidth + b + sqDiag) / sqDiag) + 1;
3640
linesRequired =
3741
linesRequired % 2 == 0 ? linesRequired : linesRequired + 1;
3842

3943
lines = [];
40-
console.log(linesRequired);
4144
lastColor = 'white';
42-
for (let i = 0; i < linesRequired; i++) {
45+
for (let i = linesRequired; i > 0; i--) {
4346
let rect = new Rectangle(lineWidth, 100000, COLOR_WHITE, context);
4447
rect.rotation = 45;
45-
rect.position = new vec2(i * sqDiag - sqDiag, 0);
48+
rect.position = new vec2(i * sqDiag,0) //- sqDiag, 0);
4649
if (lastColor == 'red') {
4750
rect.color = COLOR_WHITE;
4851
lastColor = 'white';
@@ -51,6 +54,7 @@ window.onload = () => {
5154
lastColor = 'red';
5255
}
5356
lines.push(rect);
57+
trailingLine = rect;
5458
}
5559
if (lastColor == 'red') {
5660
lastColor = 'white';
@@ -68,7 +72,7 @@ window.onload = () => {
6872

6973
var draw = (tick) => {
7074
let now = Date.now();
71-
let dt = Math.min((now - prevTick) / 1000, 1);
75+
let dt = 1/frameRate;
7276
prevTick = now;
7377

7478
if (fadeTicker < 1) {
@@ -78,19 +82,21 @@ window.onload = () => {
7882

7983
canvas.width = window.innerWidth;
8084
canvas.height = window.innerHeight + 50;
81-
if (ticker >= sqDiag / lineSpeed) {
85+
if (trailingLine.position.x > 0){//ticker >= (sqDiag) / lineSpeed) {
86+
console.log(trailingLine.color)
8287
ticker = 0;
8388
let rect = new Rectangle(lineWidth, 100000, COLOR_WHITE, context);
8489
rect.rotation = 45;
85-
if (lastColor == 'red') {
90+
if (trailingLine.color == COLOR_RED) {
8691
rect.color = COLOR_WHITE;
8792
lastColor = 'white';
8893
} else {
8994
rect.color = COLOR_RED;
9095
lastColor = 'red';
9196
}
92-
rect.position = new vec2(-sqDiag, 0);
97+
rect.position = new vec2(trailingLine.position.x - sqDiag, 0);
9398
lines.push(rect);
99+
trailingLine = rect;
94100
}
95101
let newLines = [];
96102
lines.forEach((item) => {
@@ -103,7 +109,7 @@ window.onload = () => {
103109
});
104110
lines = newLines;
105111
ticker += dt;
106-
requestAnimationFrame(draw);
112+
setTimeout(()=>{requestAnimationFrame(draw);}, (1/FRAME_RATE) * 1000);
107113
};
108114

109115
window.onfocus = () => {

js/useful.js

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
const FRAME_RATE = 40;
2+
3+
function degToRad(deg) {
4+
return deg * (Math.PI / 180);
5+
}
6+
17
function randint(min, max) {
28
return Math.floor(Math.random() * max) + min;
39
}

0 commit comments

Comments
 (0)