Skip to content

Commit

Permalink
Adding linkedin link
Browse files Browse the repository at this point in the history
  • Loading branch information
nemanjamitric committed Jan 19, 2024
1 parent 9e4f508 commit 3662f80
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 69 deletions.
135 changes: 68 additions & 67 deletions box.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,10 @@
justify-content: space-around;
}

.header-container h1 {
font-size: 24px;
font-weight: 600;
.header-container a {
font-size: 18px;
color: #fff;
text-decoration: none;
}

.header-container p {
Expand Down Expand Up @@ -141,7 +142,7 @@

<section>
<div class="header-container">
<p>Nemanja Mitric</p>
<a href="www.linkedin.com/in/nemanja-mitric" target="_blank">Nemanja Mitric</a>
<h1>Box</h1>
<div class="switch-container">
<label class="switch-label" for="theme-switch">Dark Mode</label>
Expand All @@ -158,69 +159,69 @@ <h1>Box</h1>
</div>
</section>
<script>
const canvas = document.getElementById('canvasId');
const context = canvas.getContext('2d');
const scale = 0.4;
const vertices = [
[-scale, -scale, -scale], [scale, -scale, -scale], [scale, scale, -scale], [-scale, scale, -scale],
[-scale, -scale, scale], [scale, -scale, scale], [scale, scale, scale], [-scale, scale, scale]
];
let angle = 0;

function rotateX(point, angle) {
const [x, y, z] = point;
const s = Math.sin(angle);
const c = Math.cos(angle);
return [x, c * y - s * z, s * y + c * z];
}

function rotateY(point, angle) {
const [x, y, z] = point;
const s = Math.sin(angle);
const c = Math.cos(angle);
return [c * x - s * z, y, s * x + c * z];
}

function rotateZ(point, angle) {
const [x, y, z] = point;
const s = Math.sin(angle);
const c = Math.cos(angle);
return [c * x - s * y, s * x + c * y, z];
}

function drawLine(v1, v2) {
context.beginPath();
context.moveTo(v1[0], v1[1]);
context.lineTo(v2[0], v2[1]);
context.stroke();
}

function render() {
context.clearRect(0, 0, canvas.width, canvas.height);
context.save();
context.translate(canvas.width / 2, canvas.height / 2);
const transformedVertices = vertices.map(vertex => {
let rotated = rotateX(vertex, angle);
rotated = rotateY(rotated, angle);
rotated = rotateZ(rotated, angle);
return [rotated[0] * 100, rotated[1] * 100]; // Scale for visibility
});

for (let i = 0; i < 4; i++) {
drawLine(transformedVertices[i], transformedVertices[(i + 1) % 4]);
drawLine(transformedVertices[i + 4], transformedVertices[(i + 1) % 4 + 4]);
drawLine(transformedVertices[i], transformedVertices[i + 4]);
}

context.restore();
angle += 0.01;
requestAnimationFrame(render);
}

render();

</script>
const canvas = document.getElementById('canvasId');
const context = canvas.getContext('2d');
const scale = 0.4;
const vertices = [
[-scale, -scale, -scale], [scale, -scale, -scale], [scale, scale, -scale], [-scale, scale, -scale],
[-scale, -scale, scale], [scale, -scale, scale], [scale, scale, scale], [-scale, scale, scale]
];
let angle = 0;

function rotateX(point, angle) {
const [x, y, z] = point;
const s = Math.sin(angle);
const c = Math.cos(angle);
return [x, c * y - s * z, s * y + c * z];
}

function rotateY(point, angle) {
const [x, y, z] = point;
const s = Math.sin(angle);
const c = Math.cos(angle);
return [c * x - s * z, y, s * x + c * z];
}

function rotateZ(point, angle) {
const [x, y, z] = point;
const s = Math.sin(angle);
const c = Math.cos(angle);
return [c * x - s * y, s * x + c * y, z];
}

function drawLine(v1, v2) {
context.beginPath();
context.moveTo(v1[0], v1[1]);
context.lineTo(v2[0], v2[1]);
context.stroke();
}

function render() {
context.clearRect(0, 0, canvas.width, canvas.height);
context.save();
context.translate(canvas.width / 2, canvas.height / 2);

const transformedVertices = vertices.map(vertex => {
let rotated = rotateX(vertex, angle);
rotated = rotateY(rotated, angle);
rotated = rotateZ(rotated, angle);
return [rotated[0] * 100, rotated[1] * 100]; // Scale for visibility
});

for (let i = 0; i < 4; i++) {
drawLine(transformedVertices[i], transformedVertices[(i + 1) % 4]);
drawLine(transformedVertices[i + 4], transformedVertices[(i + 1) % 4 + 4]);
drawLine(transformedVertices[i], transformedVertices[i + 4]);
}

context.restore();
angle += 0.01;
requestAnimationFrame(render);
}

render();

</script>
</body>

</html>
6 changes: 4 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,10 @@
font-weight: 600;
}

.header-container p {
.header-container a {
font-size: 18px;
color: #fff;
text-decoration: none;
}

.switch-container {
Expand Down Expand Up @@ -202,7 +204,7 @@

<section>
<div class="header-container">
<p>Nemanja Mitric</p>
<a href="www.linkedin.com/in/nemanja-mitric" target="_blank">Nemanja Mitric</a>
<h1>Donut</h1>
<div class="switch-container">
<label class="switch-label" for="theme-switch">Dark Mode</label>
Expand Down

0 comments on commit 3662f80

Please sign in to comment.