Skip to content

Commit 519e19e

Browse files
committed
Performance and logo spin improvements
1 parent db3d713 commit 519e19e

6 files changed

+17
-17
lines changed

index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
</div>
7575
<div class = "canvas-cover primary-cover">
7676
<h1 class = "cover-header">Frederik Davidson</h1>
77-
<p>Thinker and Creator </p>
77+
<p>Engineer and Creator </p>
7878
</div>
7979
</div>
8080
</div>

js/expanding-circle-canvas-driver.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ window.onload = () => {
1010

1111
var createTicker = 0;
1212

13-
var creationInterval = 2;
14-
var expandSpeed = 100;
13+
var creationInterval = 4;
14+
var expandSpeed = 50;
1515
var prevTick = Date.now();
1616

1717
var testCircle = new Circle(1000, COLOR_RED, context);

js/landing.js

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

2727
var baseFontSz = window.innerWidth / 10;
2828

29-
var text1 = 'Software Developer and Mentor';
29+
var text1 = 'Engineer and Creator';
3030
var text2 = 'This is my website:';
3131

3232
var redirecting = false;
@@ -63,7 +63,7 @@ window.onload = function () {
6363
} else if (ticker > 1 && ticker < 1.5) {
6464
squareOffset.x = cosineInterpolate(
6565
0,
66-
context.measureText('FradZGenius').width / 2 + sqDiag * 0.125,
66+
context.measureText('Fred Davidson').width / 2 + sqDiag * 0.125,
6767
(ticker - 1) / 0.5
6868
);
6969
whiteSquare.size.x = window.innerWidth / 10;
@@ -76,15 +76,15 @@ window.onload = function () {
7676
squareX = window.innerWidth / 2 - (ticker - 1) * 500;
7777
} else if (ticker > 1.5 && ticker < 2) {
7878
squareOffset.x =
79-
context.measureText('FradZGenius').width / 2 + sqDiag * 0.125;
79+
context.measureText('Fred Davidson').width / 2 + sqDiag * 0.125;
8080
context.fillStyle =
8181
'rgba(255,255,255,' +
8282
cosineInterpolate(0, 1, (ticker - 1.5) / 0.5) +
8383
')';
8484
context.textAlign = 'center';
8585
context.textBaseline = 'middle';
8686
context.fillText(
87-
'FradZGenius',
87+
'Fred Davidson',
8888
window.innerWidth / 2 +
8989
sqDiag * 1.125 -
9090
cosineInterpolate(sqDiag, 0, (ticker - 1.5) / 0.5),
@@ -101,12 +101,12 @@ window.onload = function () {
101101
);
102102
} else if (ticker > 2 && ticker < 3) {
103103
squareOffset.x =
104-
context.measureText('FradZGenius').width / 2 + sqDiag * 0.125;
104+
context.measureText('Fred Davidson').width / 2 + sqDiag * 0.125;
105105
context.fillStyle = 'white';
106106
context.textAlign = 'center';
107107
context.textBaseline = 'middle';
108108
context.fillText(
109-
'FradZGenius',
109+
'Fred Davidson',
110110
window.innerWidth / 2 + sqDiag * 1.125,
111111
window.innerHeight / 2
112112
); ///0.625
@@ -123,7 +123,7 @@ window.onload = function () {
123123
cosineInterpolate(1, 0, (ticker - 3) * 2) +
124124
')';
125125
context.fillText(
126-
'FradZGenius',
126+
'Fred Davidson',
127127
window.innerWidth / 2 +
128128
sqDiag * 1.125 -
129129
cosineInterpolate(0, sqDiag, (ticker - 3) / 0.5),
@@ -135,7 +135,7 @@ window.onload = function () {
135135
(ticker - 3) / 0.5
136136
);
137137
squareOffset.x = cosineInterpolate(
138-
context.measureText('FradZGenius').width / 2 + sqDiag * 0.125,
138+
context.measureText('Fred Davidson').width / 2 + sqDiag * 0.125,
139139
0,
140140
(ticker - 3) / 0.5
141141
);

js/main-page-canvas-driver.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ window.onload = () => {
2222

2323
var lineWidth = 200;
2424

25-
var lineSpeed = 200;
25+
var lineSpeed = 50;
2626

27-
var frameRate = 40;
27+
//var frameRate = 40;
2828

2929
let a = window.innerHeight;
3030
let c = ROOT_2 * a;
@@ -72,7 +72,7 @@ window.onload = () => {
7272

7373
var draw = (tick) => {
7474
let now = Date.now();
75-
let dt = 1/frameRate;
75+
let dt = 1/FRAME_RATE;
7676
prevTick = now;
7777

7878
if (fadeTicker < 1) {

js/useful.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const FRAME_RATE = 40;
1+
const FRAME_RATE = 24;
22

33
function degToRad(deg) {
44
return deg * (Math.PI / 180);
@@ -111,5 +111,5 @@ class vec2 {
111111

112112
const logo = document.getElementById('logo');
113113
window.onscroll = function () {
114-
logo.style.transform = `rotate(${window.pageYOffset / 2}deg)`;
114+
logo.style.transform = `rotate(${(window.pageYOffset / window.innerHeight) * 135}deg)`;
115115
};

style/essential.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ body {
3434
}
3535

3636
.logo {
37-
transition: transform 1s;
37+
transition: transform .1s;
3838
transition-timing-function: ease-out;
3939
display: block;
4040
width: 150px;

0 commit comments

Comments
 (0)