Created
July 16, 2024 08:10
-
-
Save asrorbekh/bbf5ef101d2c68ba54c0449352959afd to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Telegram Post Generator</title> | |
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"> | |
<style> | |
.phone-mockup { | |
width: 360px; | |
height: 720px; | |
border: 16px solid #ccc; | |
border-top: 60px solid #ccc; | |
border-bottom: 60px solid #ccc; | |
border-radius: 36px; | |
position: relative; | |
background-color: white; | |
} | |
.phone-mockup:before { | |
content: ''; | |
display: block; | |
position: absolute; | |
left: 50%; | |
top: 10px; | |
width: 60px; | |
height: 5px; | |
background-color: #333; | |
border-radius: 10px; | |
transform: translateX(-50%); | |
} | |
.phone-mockup:after { | |
content: ''; | |
display: block; | |
position: absolute; | |
left: 50%; | |
bottom: 10px; | |
width: 35px; | |
height: 35px; | |
background-color: #333; | |
border-radius: 50%; | |
transform: translateX(-50%); | |
} | |
.telegram-ui { | |
width: 100%; | |
height: 100%; | |
overflow: hidden; | |
padding: 10px; | |
} | |
.telegram-message { | |
display: flex; | |
flex-direction: column; | |
align-items: flex-start; | |
background-color: #e9f5fe; | |
padding: 10px; | |
border-radius: 10px; | |
margin-bottom: 10px; | |
} | |
.telegram-message img { | |
max-width: 100%; | |
border-radius: 10px; | |
} | |
.telegram-message .message-content { | |
margin-top: 10px; | |
} | |
.telegram-message .message-content p { | |
margin: 0; | |
} | |
.telegram-message .message-time { | |
align-self: flex-end; | |
font-size: 0.8rem; | |
color: #888; | |
} | |
</style> | |
</head> | |
<body> | |
<div class="container mt-5"> | |
<h2>Create Campaign</h2> | |
<form id="campaignForm"> | |
<div class="form-group"> | |
<label for="botSelect">Select bot:</label> | |
<select class="form-control" id="botSelect" required> | |
<option>Land of Art: Land of Art Group</option> | |
<option>Facebook: Toy Shop</option> | |
<option>Facebook: ForSport</option> | |
<option>Telegram: Toy Shop</option> | |
</select> | |
</div> | |
<div class="form-group"> | |
<label for="messageContent">Message Content:</label> | |
<textarea class="form-control" id="messageContent" rows="4" required></textarea> | |
</div> | |
<div class="form-group mb-2"> | |
<label for="imageUrl">Image URL:</label> | |
<input type="url" class="form-control" id="imageUrl" required> | |
</div> | |
<button type="submit" class="btn btn-primary mb-2">Preview</button> | |
</form> | |
<hr> | |
<h3>Preview</h3> | |
<div id="preview" class="d-flex justify-content-center"> | |
<div class="phone-mockup"> | |
<div class="telegram-ui"> | |
<div class="telegram-message"> | |
<img src="https://placehold.co/600x400" id="previewImage" alt="Preview Image"> | |
<div class="message-content" id="previewMessage">Hello ๐<br>Next week we will have an online master class with oil paints. Don't miss it ๐</div> | |
<div class="message-time">12:15</div> | |
</div> | |
<button class="btn btn-primary w-100">Sign Up</button> | |
</div> | |
</div> | |
</div> | |
</div> | |
<script src="https://code.jquery.com/jquery-3.7.1.min.js"></script> | |
<script> | |
$(function () { | |
$('#campaignForm').on('submit', function (event) { | |
event.preventDefault(); | |
const messageContent = $('#messageContent').val(); | |
const imageUrl = $('#imageUrl').val(); | |
$('#previewMessage').html(messageContent); | |
$('#previewImage').attr('src', imageUrl); | |
}); | |
}); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment