Update 404.html

This commit is contained in:
FURK4NGG
2025-03-15 23:06:09 +03:00
committed by GitHub
parent 6a5aa6e909
commit 313b9dd985
+36 -91
View File
@@ -25,52 +25,50 @@
<script src="JAVASCRIPT/404.js"></script> <script src="JAVASCRIPT/404.js"></script>
<style> <style>
body { margin: 0; background: #282c34; overflow: hidden; } body { margin: 0; background: #282c34; overflow: hidden; }
text { -webkit-user-select:none!important;fill: white; font-size: 18px; font-weight: bold; pointer-events: none; text-anchor: middle; } text, .output {
fill: white;
font-size: 18px;
font-weight: bold;
pointer-events: none;
text-anchor: middle;
-webkit-user-select:none!important;
}
.output { .output {
position: absolute; -webkit-user-select:none!important;
bottom: 8rem; position: absolute;
left: 50%; bottom: 8rem;
transform: translateX(-50%); left: 50%;
transform: translateX(-50%);
color: white; color: white;
font-size: 18px; font-size: 16px;
font-weight: bold;
text-align: center;
-webkit-user-select:none!important;/* Metnin seçilmesini engeller */
}
.output a {
color: #ff5733;
text-decoration: none;
}
h1 {
color: white;
font-size: 36px;
text-align: center;
user-select: none; /* Başlık metnini seçilemez yapar */
} }
.output a { color: #ff5733; text-decoration: none; font-weight: bold; }
</style> </style>
</head> </head>
<body> <body>
<svg></svg>
<p class="output">Please try to <a href="javascript:history.back()">go back</a> or <a href="/">return to the homepage</a>.</p>
<script> <script>
const width = window.innerWidth; let width = window.innerWidth;
const height = window.innerHeight; let height = window.innerHeight;
// Çekim gücü değişkeni (Pozitif olursa çeker, negatif olursa iter)
let cekimGucu = 7000;
const nodes = [ const nodes = [
{ id: 1, radius: 60, text: "Not", vx: 0, vy: 0 }, // Hız bileşenleri eklendi { id: 1, radius: 60, text: "Not" },
{ id: 2, radius: 60, text: "Found", vx: 0, vy: 0 }, { id: 2, radius: 60, text: "Found" },
{ id: 3, radius: 60, text: "404", vx: 0, vy: 0 } { id: 3, radius: 60, text: "404" }
]; ];
const svg = d3.select("body").append("svg") const svg = d3.select("svg")
.attr("width", width) .attr("width", width)
.attr("height", height); .attr("height", height);
const simulation = d3.forceSimulation(nodes) const simulation = d3.forceSimulation(nodes)
.force("center", d3.forceCenter(width / 2, height / 2)) // Ekran merkezine yönlendir .force("center", d3.forceCenter(width / 2, height / 2)) // Merkezde tutan kuvvet
.force("collision", d3.forceCollide().radius(d => d.radius + 2)) // Çarpışmayı engelle .force("collision", d3.forceCollide().radius(d => d.radius + 5))
.force("attraction", d3.forceManyBody().strength(cekimGucu)) // Topları çekmek için kuvvet ekledik .force("attraction", d3.forceManyBody().strength(100)) // Çekim kuvveti
.force("x", d3.forceX(width / 2).strength(0.1)) // X ekseninde merkezde tutar
.force("y", d3.forceY(height / 2).strength(0.1)) // Y ekseninde merkezde tutar
.on("tick", ticked); .on("tick", ticked);
const bubbles = svg.selectAll("circle") const bubbles = svg.selectAll("circle")
@@ -78,11 +76,7 @@
.enter() .enter()
.append("circle") .append("circle")
.attr("r", d => d.radius) .attr("r", d => d.radius)
.attr("fill", "rgba(255, 87, 51, 0.8)") .attr("fill", "rgba(255, 87, 51, 0.8)");
.call(d3.drag()
.on("start", dragStarted)
.on("drag", dragged)
.on("end", dragEnded));
const texts = svg.selectAll("text") const texts = svg.selectAll("text")
.data(nodes) .data(nodes)
@@ -91,71 +85,22 @@
.text(d => d.text) .text(d => d.text)
.attr("dy", 5); .attr("dy", 5);
// Bu fonksiyon her tick olayında çağrılacak
function ticked() { function ticked() {
// Momentum hesaplaması yapıyoruz (zamanla kaybolacak)
nodes.forEach(d => {
if (d.fx === null && d.fy === null) { // Eğer balon serbestse
// Momentum kaybolması: Hızı her adımda yavaşlatıyoruz
d.vx *= 0.99;
d.vy *= 0.99;
d.x += d.vx;
d.y += d.vy;
}
});
// Balonları konumlarına göre yerleştir
bubbles.attr("cx", d => d.x).attr("cy", d => d.y); bubbles.attr("cx", d => d.x).attr("cy", d => d.y);
texts.attr("x", d => d.x).attr("y", d => d.y); texts.attr("x", d => d.x).attr("y", d => d.y);
} }
function dragStarted(event, d) { function resize() {
if (!event.active) simulation.alphaTarget(0.3).restart();
d.fx = d.x;
d.fy = d.y;
d.vx = 0; // Drag başladığında hız sıfırlanır
d.vy = 0;
}
function dragged(event, d) {
// Sürükleme sırasında hız ekle
d.fx = event.x;
d.fy = event.y;
// Drag hareketine bağlı olarak hız artar
d.vx += (event.x - d.x) * 0.1;
d.vy += (event.y - d.y) * 0.1;
}
function dragEnded(event, d) {
if (!event.active) simulation.alphaTarget(0);
d.fx = null;
d.fy = null;
}
function resize() {
width = window.innerWidth; width = window.innerWidth;
height = window.innerHeight; height = window.innerHeight;
svg.attr("width", width).attr("height", height); svg.attr("width", width).attr("height", height);
simulation.force("center", d3.forceCenter(width / 2, height / 2)).alpha(1).restart(); simulation
.force("center", d3.forceCenter(width / 2, height / 2))
.force("x", d3.forceX(width / 2).strength(0.1))
.force("y", d3.forceY(height / 2).strength(0.1))
.alpha(1).restart();
} }
window.addEventListener("resize", resize); window.addEventListener("resize", resize);
const disabledKeys = ["c", "C", "x", "J", "u", "I"]; // keys that will be disabled
const showAlert = e => {
e.preventDefault(); // preventing its default behaviour
return alert("Sorry, you can't view or copy source codes this way!");
}
document.addEventListener("contextmenu", e => {
showAlert(e); // calling showAlert() function on mouse right click
});
document.addEventListener("keydown", e => {
// calling showAlert() function, if the pressed key matched to disabled keys
if((e.ctrlKey && disabledKeys.includes(e.key)) || e.key === "F12") {
showAlert(e);
}
});
</script>
<p class="output">Please try to <a href="javascript:history.back()">go back</a> or <a href="/">return to the homepage</a>.</p>
</body> </body>
</html> </html>