NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

<!DOCTYPE html>
<html lang="tr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Koordinat Takip Panosu</title>
<style>
:root {
--bg-color: #000000;
--input-bg: #0f0f0f;
--send-btn-color: #3d5afe;
--btn-gray: #666666; /* Kullanılmamış buton rengi */
--btn-used-bordo: #8b0000; /* Kopyalanmış buton (Bordo) */
--success-green: #00c853;
--text-main: #ffffff;
--text-dim: #888888;
--border-soft: #222222;
}

body {
font-family: -apple-system, system-ui, sans-serif;
background-color: var(--bg-color);
color: var(--text-main);
margin: 0;
padding: 12px;
display: flex;
flex-direction: column;
align-items: center;
}

.container {
width: 100%;
max-width: 500px;
display: flex;
flex-direction: column;
gap: 12px;
}

textarea {
width: 100%;
height: 120px;
padding: 15px;
background-color: var(--input-bg);
border: 1px solid var(--border-soft);
border-radius: 12px;
color: #fff;
font-size: 16px;
box-sizing: border-box;
outline: none;
resize: none;
}

textarea:focus { border-color: var(--send-btn-color); }

#sendBtn {
width: 100%;
padding: 16px;
background-color: var(--send-btn-color);
color: white;
border: none;
border-radius: 12px;
font-size: 16px;
font-weight: bold;
cursor: pointer;
text-transform: uppercase;
}

.history-list {
display: flex;
flex-direction: column;
gap: 8px;
margin-top: 10px;
}

.history-item {
background-color: var(--input-bg);
padding: 10px 14px;
border-radius: 10px;
display: flex;
justify-content: space-between;
align-items: center;
border: 1px solid var(--border-soft);
}

.text-content {
font-size: 13px;
color: var(--text-dim);
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
flex-grow: 1;
margin-right: 12px;
}

/* VARSAYILAN BUTON (GRİ) */
.item-copy-btn {
background-color: transparent;
border: 1px solid var(--btn-gray);
padding: 8px 12px;
border-radius: 8px;
cursor: pointer;
font-size: 11px;
font-weight: bold;
color: var(--btn-gray);
min-width: 90px;
transition: all 0.2s;
}

/* KULLANILMIŞ BUTON (BORDO) */
.item-copy-btn.used {
border-color: var(--btn-used-bordo) !important;
color: var(--btn-used-bordo) !important;
}

/* ANLIK KOPYALAMA EFEKTİ (YEŞİL) */
.item-copy-btn.copied {
background-color: var(--success-green) !important;
border-color: var(--success-green) !important;
color: #000000 !important;
}
</style>
</head>
<body>

<div class="container">
<textarea id="textInput" placeholder="Koordinat metnini buraya yapıştır..."></textarea>
<button id="sendBtn">VERİYİ GÖNDER</button>
<div id="historyList" class="history-list"></div>
</div>

<script type="module">
import { initializeApp } from "https://www.gstatic.com/firebasejs/10.7.1/firebase-app.js";
import { getDatabase, ref, push, onValue, query, limitToLast } from "https://www.gstatic.com/firebasejs/10.7.1/firebase-database.js";

const firebaseConfig = {
apiKey: "AIzaSyCsayg43LcFsIui1DuJrvUZzVPk6nxjADE",
authDomain: "pikamon-84920.firebaseapp.com",
projectId: "pikamon-84920",
storageBucket: "pikamon-84920.firebasestorage.app",
messagingSenderId: "318263126206",
appId: "1:318263126206:web:caa9dade5946e7912ed6ef",
measurementId: "G-V0JFNC0P76"
};

const app = initializeApp(firebaseConfig);
const db = getDatabase(app);
const pokemonRef = ref(db, 'Pokemon');

const textInput = document.getElementById('textInput');
const sendBtn = document.getElementById('sendBtn');
const historyList = document.getElementById('historyList');

// Gönder butonu
sendBtn.onclick = () => {
const val = textInput.value.trim();
if (val) {
push(pokemonRef, { content: val, timestamp: Date.now() });
textInput.value = "";
}
};

// Firebase'den verileri çek ve listele
const lastTenQuery = query(pokemonRef, limitToLast(10));
onValue(lastTenQuery, (snapshot) => {
historyList.innerHTML = "";
const data = snapshot.val();
if (data) {
// Firebase anahtarlarıyla (key) birlikte alıyoruz ki hangisi kopyalandı bilelim
const entries = Object.entries(data).reverse();
entries.forEach(([id, item]) => {
renderRow(item.content, id);
});
}
});

function renderRow(rawText, id) {
const div = document.createElement('div');
div.className = 'history-item';

const textSpan = document.createElement('span');
textSpan.className = 'text-content';
textSpan.innerText = rawText;

const btn = document.createElement('button');
btn.className = 'item-copy-btn';

// Daha önce kopyalanmış mı kontrol et (LocalStorage)
if (localStorage.getItem('copied_' + id)) {
btn.classList.add('used');
}

btn.innerText = "KOPYALA";

btn.onclick = () => {
let targetText = rawText;
if (rawText.includes('=')) {
targetText = rawText.split('=')[1].trim();
}

const performCopy = (text) => {
if (navigator.clipboard && window.isSecureContext) {
return navigator.clipboard.writeText(text);
} else {
let textArea = document.createElement("textarea");
textArea.value = text;
textArea.style.position = "fixed";
textArea.style.left = "-9999px";
document.body.appendChild(textArea);
textArea.select();
document.execCommand('copy');
textArea.remove();
return Promise.resolve();
}
};

performCopy(targetText).then(() => {
// Kalıcı hale getir (LocalStorage'a kaydet ve bordo yap)
localStorage.setItem('copied_' + id, 'true');
btn.classList.add('used');

// Anlık yeşil efekt
btn.innerText = "ALINDI ✓";
btn.classList.add('copied');

setTimeout(() => {
btn.innerText = "KOPYALA";
btn.classList.remove('copied');
}, 1200);
});
};

div.appendChild(textSpan);
div.appendChild(btn);
historyList.appendChild(div);
}
</script>

</body>
</html>
     
 
what is notes.io
 

Notes is a web-based application for online taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000+ notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 14 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.