Compare commits

..

2 Commits

Author SHA1 Message Date
Pablo Moyano
12fbb048f4 aaa 2023-10-06 19:51:16 +02:00
Pablo Moyano
5008e06064 Holy Fuckles It's the 3D Knuckles 2023-10-06 19:32:00 +02:00
6 changed files with 108 additions and 19 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 147 KiB

After

Width:  |  Height:  |  Size: 102 KiB

View File

@ -0,0 +1,88 @@
---
import foscLogo from "../assets/img/fosc-logo-old.png";
import { Image } from "astro:assets";
---
<div id="container" class="h-[30vh]">
<Image id="logo" class="h-full w-auto" src={foscLogo} alt="FOSC Logo" />
</div>
<style>
#logo {
/* Add border styles to create thickness */
border: -2px solid #ccc; /* Adjust border width for thickness */
border-radius: 50%;
box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.8); /* Optional: Add a shadow for depth */
}
#container {
perspective: 400px; /* Add perspective to the container for 3D effect */
}
</style>
<script>
// script.ts
interface LogoElement extends HTMLElement {
rotationX: number;
rotationY: number;
}
const logo = document.querySelector("#logo") as LogoElement;
const logoContainer = document.querySelector("#container") as HTMLElement;
let sensitivity = 100; // Adjust the sensitivity as needed
let mouseX = 0;
let mouseY = 0;
let targetRotationX = 0;
let targetRotationY = 0;
function updateLogoRotation() {
const { left, top, width, height } = logoContainer.getBoundingClientRect();
const centerX = left + width / 2;
const centerY = top + height / 2;
const dx = (mouseX - centerX) / sensitivity;
const dy = (mouseY - centerY) / sensitivity;
targetRotationX = -dy;
targetRotationY = dx;
}
function animateRotation() {
const smoothingFactor = 0.1; // Adjust this value for smoother or more abrupt transitions
const dx = targetRotationX - logo.rotationX;
const dy = targetRotationY - logo.rotationY;
logo.rotationX += dx * smoothingFactor;
logo.rotationY += dy * smoothingFactor;
logo.style.transform = `rotateX(${logo.rotationX}deg) rotateY(${logo.rotationY}deg)`;
requestAnimationFrame(animateRotation);
}
document.addEventListener('mousemove', (e: MouseEvent) => {
mouseX = e.clientX;
mouseY = e.clientY;
updateLogoRotation();
});
document.addEventListener('mouseleave', () => {
mouseX = 0;
mouseY = 0;
targetRotationX = 0;
targetRotationY = 0;
updateLogoRotation();
});
// Initial rotation values
logo.rotationX = 0;
logo.rotationY = 0;
animateRotation();
</script>

View File

@ -6,7 +6,7 @@ interface Props {
const { text } = Astro.props; const { text } = Astro.props;
--- ---
<p id="text" data-value={text} class="mt-4 text-center text-white text-7xl font-['Researcher']">{text}</p> <p id="text" data-value={text} class="mt-4 text-center text-7xl font-['Researcher']">{text}</p>
<script> <script>
// Code I stole // Code I stole

View File

@ -6,10 +6,4 @@ interface Props {
const { href, title } = Astro.props; const { href, title } = Astro.props;
--- ---
<li> <li><a href={href}>{title}</a></li>
<a
href={href}
class=""
>{title}
</a>
</li>

View File

@ -6,7 +6,7 @@ import NavItem from "./NavItem.astro";
import foscLogo from '../assets/img/fosc-logo-new.png' import foscLogo from '../assets/img/fosc-logo-new.png'
--- ---
<div class="navbar backdrop-blur backdrop-brightness-50 drop-shadow-lg"> <div class="navbar bg-base-100 backdrop-blur backdrop-brightness-50 drop-shadow-lg">
<div class="navbar-start"> <div class="navbar-start">
<!-- <Image class="h-24 w-auto" src={foscLogo} alt="FOSC Logo"/> --> <!-- <Image class="h-24 w-auto" src={foscLogo} alt="FOSC Logo"/> -->
@ -48,7 +48,15 @@ import foscLogo from '../assets/img/fosc-logo-new.png'
<div class="navbar-end"> <div class="navbar-end">
<button class="btn btn-ghost" data-toggle-theme="dark,light" data-act-class="ACTIVECLASS">🌚</button> <select class="select select-ghost" data-choose-theme>
<option value="">Default</option>
<option value="light">Light</option>
<option value="dark">Dark</option>
<option value="cyberpunk">Cyberpunk</option>
<option value="black">Black</option>
<option value="retro">Retro</option>
<option value="synthwave">Synthwave</option>
</select>
</div> </div>

View File

@ -3,6 +3,7 @@ import "@/styles/globals.css";
import Navbar from "../components/Navbar.astro"; import Navbar from "../components/Navbar.astro";
import HackerText from "../components/HackerText.astro"; import HackerText from "../components/HackerText.astro";
import Badge from "../components/Badge.astro"
// Image imports // Image imports
import { Image } from "astro:assets"; import { Image } from "astro:assets";
@ -48,17 +49,15 @@ import foscLogo from "../assets/img/fosc-logo-old.png";
<!-- Floating center items --> <!-- Floating center items -->
<div class="container-sm mx-auto px-4 flex flex-col justify-center items-center"> <div class="container-sm mx-auto px-4 flex flex-col justify-center items-center">
<div class="mt-[10vh] h-[30vh]"> <div class="mt-[10vh]">
<Image class="h-full w-auto" src={foscLogo} alt="FOSC Logo" /> <Badge></Badge>
</div>
<div class="mt-[5vh]">
<HackerText text="FOSC"></HackerText>
</div> </div>
<HackerText text="FOSC"></HackerText>
</div> </div>
<div class="container mx-auto flex justify-center items-center"> <div class="container mx-auto flex justify-center items-center">
<button class="btn" data-set-theme="" data-act-class="ACTIVECLASS">none</button>
<button class="btn" data-set-theme="light" data-act-class="ACTIVECLASS">light</button>
<button class="btn" data-set-theme="dark" data-act-class="ACTIVECLASS">dark</button>
<button class="btn" data-set-theme="cyberpunk" data-act-class="ACTIVECLASS">cyber</button>
</div> </div>
@ -68,9 +67,9 @@ import foscLogo from "../assets/img/fosc-logo-old.png";
</html> </html>
<style> <style>
body { /* body {
background-color: black !important; background-color: black !important;
background-image: url(../img/coreboot2.webp); background-image: url(../img/coreboot2.webp);
} } */
</style> </style>