acayip-home/index.html
2024-08-25 20:54:11 +03:00

216 lines
5.1 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<link rel="stylesheet" href="/style/style.css" />
<style>
p {
margin: 0;
}
.app-name {
font-family: "Source Sans Pro", sans-serif;
font-size: 36px;
}
body {
margin-top: 48px;
display: flex;
flex-direction: column;
align-items: center;
}
#logo {
display: flex;
flex-direction: column;
align-items: center;
gap: 8px;
border: 1px solid white;
padding: 24px 48px;
gap: 24px;
transition-property: transform;
transition-duration: 150ms;
}
#logo-container {
display: flex;
flex-direction: column;
align-items: center;
grid-area: main;
}
#pan-container {
padding: 20px;
}
.brand-name {
font-family: "Source Code Pro", monospace;
font-size: 64px;
width: 100%;
display: flex;
flex-direction: row;
justify-content: space-between;
}
.reverse {
transform: scaleX(-1);
}
.container {
width: 1280px;
display: grid;
grid-template-columns: 256px 1fr 256px;
grid-template-rows: 290px 290px 290px;
gap: 24px 0px;
grid-auto-flow: row;
grid-template-areas:
"app1 main app2"
". main app3"
". main .";
}
.app {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
border: 1px solid black;
gap: 24px;
height: 290px;
transition-property: opacity;
transition-duration: 500ms;
opacity: 0.3;
}
.app:hover {
transition-property: opacity;
transition-duration: 500ms;
opacity: 0.8;
}
.app1 {
grid-area: app1;
padding: 20px 0;
}
.app2 {
grid-area: app2;
padding: 20px 0;
}
.app3 {
grid-area: app3;
padding: 20px 0;
}
@media (prefers-color-scheme: light) {
#logo {
border: 1px solid black;
}
}
</style>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + TS</title>
</head>
<body>
<div class="container">
<div class="app1">
<div class="app">
<img src="/ikon.png" height="128px" width="128px" />
<p class="app-name">Blog</p>
</div>
</div>
<div class="app2">
<div class="app">
<img src="/konulu-konum-logo.jpg" height="128px" width="128px" />
<p class="app-name">Konulu<br />Konum</p>
</div>
</div>
<div class="app3">
<div class="app">
<img src="/degisim-kotudur.png" height="128px" width="128px" />
<p class="app-name">Değişim<br />Kötüdür</p>
</div>
</div>
<div id="logo-container">
<div id="pan-container">
<div id="logo">
<div id="brand-reversed" class="brand-name reverse">
<p>A</p>
<p>C</p>
<p>A</p>
<p>Y</p>
<p>İ</p>
<p>P</p>
</div>
<img width="624" height="624" src="/acayip-logo.png" />
<div id="brand" class="brand-name">
<p>A</p>
<p>C</p>
<p>A</p>
<p>Y</p>
<p>İ</p>
<p>P</p>
</div>
</div>
</div>
</div>
</div>
<script>
let constrain = 800;
let panContainer = document.getElementById("pan-container");
let ex1Layer = document.getElementById("logo");
function transforms(x, y, el) {
let box = el.getBoundingClientRect();
let calcX = -(y - box.y - box.height / 2) / constrain;
let calcY = (x - box.x - box.width / 2) / constrain;
return (
"perspective(100px) " +
" rotateX(" +
calcX +
"deg) " +
" rotateY(" +
calcY +
"deg) "
);
}
function resetTransform(x, y, el) {
return (
"perspective(100px) " + " rotateX(0deg) " + " rotateY(0deg) "
);
}
function transformElement(el, xyEl) {
el.style.transform = transforms.apply(null, xyEl);
}
function resetElement(el, xyEl) {
el.style.transform = resetTransform.apply(null, xyEl);
}
panContainer.onmousemove = function (e) {
let xy = [e.clientX, e.clientY];
let position = xy.concat([ex1Layer]);
window.requestAnimationFrame(function () {
transformElement(ex1Layer, position);
});
};
panContainer.onmouseleave = function (e) {
let xy = [0, 0];
let position = xy.concat([ex1Layer]);
window.requestAnimationFrame(function () {
resetElement(ex1Layer, position);
});
};
</script>
</body>
</html>