Fixe Dogify
This commit is contained in:
parent
bfc935c450
commit
a05f5c638f
@ -5,35 +5,39 @@
|
|||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<title>Doge Meme Generator</title>
|
<title>Doge Meme Generator</title>
|
||||||
<script defer src="https://stats.ponywave.de/script" data-website-id="9ef713d2-adb9-4906-9df5-708d8a8b9131" data-tag="dogify"></script>
|
<script defer src="https://stats.ponywave.de/script" data-website-id="9ef713d2-adb9-4906-9df5-708d8a8b9131" data-tag="dogify"></script>
|
||||||
|
<script src="https://html2canvas.hertzen.com/dist/html2canvas.min.js"></script>
|
||||||
<style>
|
<style>
|
||||||
body {
|
body {
|
||||||
font-family: Arial, sans-serif;
|
font-family: Arial, sans-serif;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
|
||||||
height: 100vh;
|
|
||||||
margin: 0;
|
|
||||||
background-color: #f0f0f0;
|
background-color: #f0f0f0;
|
||||||
|
padding: 20px;
|
||||||
}
|
}
|
||||||
#meme-container {
|
#meme-container {
|
||||||
position: relative;
|
position: relative;
|
||||||
width: 640px;
|
width: 640px;
|
||||||
height: 480px;
|
height: 480px;
|
||||||
margin-bottom: 20px;
|
margin-bottom: 20px;
|
||||||
|
background-color: white;
|
||||||
}
|
}
|
||||||
#doge-image {
|
#doge-image {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
object-fit: cover;
|
||||||
}
|
}
|
||||||
.meme-text {
|
.meme-text {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
width: 100%;
|
|
||||||
text-align: center;
|
text-align: center;
|
||||||
color: white;
|
color: white;
|
||||||
font-size: 20px;
|
font-size: 24px;
|
||||||
font-family: Comic Sans MS, cursive, sans-serif;
|
font-family: Comic Sans MS, cursive, sans-serif;
|
||||||
text-shadow: 2px 2px 4px #000000;
|
text-shadow: 2px 2px 4px #000000;
|
||||||
|
pointer-events: none;
|
||||||
|
max-width: 80%;
|
||||||
|
white-space: nowrap;
|
||||||
|
padding: 5px;
|
||||||
}
|
}
|
||||||
input[type="text"] {
|
input[type="text"] {
|
||||||
width: 300px;
|
width: 300px;
|
||||||
@ -41,66 +45,127 @@
|
|||||||
margin: 5px;
|
margin: 5px;
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
}
|
}
|
||||||
|
button {
|
||||||
|
padding: 10px 20px;
|
||||||
|
margin: 5px;
|
||||||
|
cursor: pointer;
|
||||||
|
background-color: #4CAF50;
|
||||||
|
color: white;
|
||||||
|
border: none;
|
||||||
|
border-radius: 4px;
|
||||||
|
}
|
||||||
|
.info-box {
|
||||||
|
background: #f8f9fa;
|
||||||
|
border: 2px dashed #4CAF50;
|
||||||
|
border-radius: 8px;
|
||||||
|
padding: 15px;
|
||||||
|
margin: 20px 0;
|
||||||
|
max-width: 640px;
|
||||||
|
font-size: 14px;
|
||||||
|
color: #666;
|
||||||
|
}
|
||||||
|
|
||||||
|
.info-box p {
|
||||||
|
margin: 8px 0;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="meme-container">
|
<div id="meme-container">
|
||||||
<img id="doge-image" src="doge.jpg" alt="Doge Meme">
|
<img id="doge-image" src="doge.jpg" alt="Doge Meme">
|
||||||
<div id="random-text" class="meme-text"></div>
|
|
||||||
</div>
|
</div>
|
||||||
<input type="text" id="text-input" placeholder="Text eingeben">
|
|
||||||
<button id="add-text-button">Text hinzufügen</button>
|
<div class="info-box">
|
||||||
|
<p>🔹 Texte mit Komma trennen (z.B. "Hund, Katze, Maus")</p>
|
||||||
|
<p>🔹 Beim Hinzufügen werden automatisch Meme-Wörter ergänzt</p>
|
||||||
|
<p>🔹 Klicke "Meme speichern" zum Download</p>
|
||||||
|
<p>🔹 Textposition und Farbe werden zufällig generiert</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<input type="text" id="text-input" placeholder="Deine Texte hier...">
|
||||||
|
<div>
|
||||||
|
<button id="add-text-button">Text hinzufügen</button>
|
||||||
|
<button id="save-button">Meme speichern</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
const textInput = document.getElementById('text-input');
|
const memeWords = ["wow", "such meme", "chimken", "many fun"];
|
||||||
const addTextButton = document.getElementById('add-text-button');
|
|
||||||
const randomText = document.getElementById('random-text');
|
function createTextElement(text) {
|
||||||
|
const memeContainer = document.getElementById('meme-container');
|
||||||
|
const textElement = document.createElement('div');
|
||||||
|
|
||||||
|
textElement.className = 'meme-text';
|
||||||
|
textElement.textContent = text;
|
||||||
|
textElement.style.color = getRandomColor();
|
||||||
|
textElement.style.fontSize = `${Math.random() * 20 + 20}px`;
|
||||||
|
|
||||||
|
const position = getRandomPosition(textElement);
|
||||||
|
textElement.style.top = `${position.top}px`;
|
||||||
|
textElement.style.left = `${position.left}px`;
|
||||||
|
|
||||||
|
memeContainer.appendChild(textElement);
|
||||||
|
}
|
||||||
|
|
||||||
function getRandomColor() {
|
function getRandomColor() {
|
||||||
const letters = '0123456789ABCDEF';
|
return `hsl(${Math.random() * 360}, 100%, 50%)`;
|
||||||
let color = '#';
|
}
|
||||||
for (let i = 0; i < 6; i++) {
|
|
||||||
color += letters[Math.floor(Math.random() * 16)];
|
function getRandomPosition(element) {
|
||||||
}
|
const container = document.getElementById('meme-container');
|
||||||
return color;
|
|
||||||
}
|
// Element muss erst im DOM sein um die Größe zu berechnen
|
||||||
|
container.appendChild(element);
|
||||||
function getRandomPosition() {
|
|
||||||
const memeContainer = document.getElementById('meme-container');
|
const maxTop = container.offsetHeight - element.offsetHeight - 10; // 10px Puffer
|
||||||
const textElement = document.getElementById('random-text');
|
const maxLeft = container.offsetWidth - element.offsetWidth - 10;
|
||||||
const textWidth = textElement.offsetWidth;
|
|
||||||
const textHeight = textElement.offsetHeight;
|
// Sicherstellen dass die Position nicht negativ wird
|
||||||
const top = Math.floor(Math.random() * (memeContainer.offsetHeight - textHeight));
|
return {
|
||||||
const left = Math.floor(Math.random() * (memeContainer.offsetWidth - textWidth));
|
top: Math.max(10, Math.random() * maxTop),
|
||||||
return { top, left };
|
left: Math.max(10, Math.random() * maxLeft)
|
||||||
}
|
};
|
||||||
|
}
|
||||||
function updateTextPosition() {
|
|
||||||
const memeContainer = document.getElementById('meme-container');
|
// Event-Listener
|
||||||
const textElement = document.getElementById('random-text');
|
document.getElementById('add-text-button').addEventListener('click', () => {
|
||||||
const textWidth = textElement.offsetWidth;
|
const userInput = document.getElementById('text-input').value;
|
||||||
const textHeight = textElement.offsetHeight;
|
|
||||||
const top = Math.floor(Math.random() * (memeContainer.offsetHeight - textHeight));
|
// Teile den Eingabetext bei Kommas und bereinige die Teile
|
||||||
const left = Math.floor(Math.random() * (memeContainer.offsetWidth - textWidth));
|
const textParts = userInput.split(',')
|
||||||
textElement.style.top = `${top}px`;
|
.map(part => part.trim())
|
||||||
textElement.style.left = `${left}px`;
|
.filter(part => part.length > 0);
|
||||||
}
|
|
||||||
|
// Füge jedes bereinigte Textteil hinzu
|
||||||
addTextButton.addEventListener('click', function() {
|
textParts.forEach(part => {
|
||||||
const text = textInput.value;
|
createTextElement(part);
|
||||||
if (text) {
|
});
|
||||||
randomText.textContent = text;
|
|
||||||
randomText.style.color = getRandomColor();
|
// Füge zufälliges Meme-Wort hinzu (50% Chance)
|
||||||
updateTextPosition();
|
if (Math.random() > 0.5 && textParts.length > 0) {
|
||||||
|
const randomWord = memeWords[Math.floor(Math.random() * memeWords.length)];
|
||||||
|
createTextElement(randomWord);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
document.getElementById('text-input').value = '';
|
||||||
});
|
});
|
||||||
|
|
||||||
// Initialisiere die Positionierung des Textes beim Laden der Seite
|
// Speicherfunktion
|
||||||
window.addEventListener('load', function() {
|
document.getElementById('save-button').addEventListener('click', () => {
|
||||||
// Setze den Text zuerst, um die Größe des Textelements zu bestimmen
|
html2canvas(document.querySelector("#meme-container")).then(canvas => {
|
||||||
randomText.textContent = "Beispieltext";
|
const link = document.createElement('a');
|
||||||
randomText.style.color = getRandomColor();
|
link.download = 'doge-meme.png';
|
||||||
updateTextPosition();
|
link.href = canvas.toDataURL();
|
||||||
|
link.click();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
// Initiale Meme-Wörter beim Laden
|
||||||
|
window.addEventListener('load', () => {
|
||||||
|
memeWords.forEach(word => {
|
||||||
|
if (Math.random() > 0.3) createTextElement(word);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
@ -189,7 +189,7 @@
|
|||||||
</a>
|
</a>
|
||||||
<a href="https://tools.ponywave.de/dogify" class="tool-bubble">
|
<a href="https://tools.ponywave.de/dogify" class="tool-bubble">
|
||||||
<h2 class="tool-title">Dogify</h2>
|
<h2 class="tool-title">Dogify</h2>
|
||||||
<p class="tool-description">Wow such doge many fun (In Arbeit)</p>
|
<p class="tool-description">Wow such doge many fun</p>
|
||||||
</a>
|
</a>
|
||||||
<a href="https://tools.ponywave.de/ba_memory" class="tool-bubble">
|
<a href="https://tools.ponywave.de/ba_memory" class="tool-bubble">
|
||||||
<h2 class="tool-title">Blue Archive Memory</h2>
|
<h2 class="tool-title">Blue Archive Memory</h2>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user