anycoder-4bdd91e2 / index.html
Mmdv2's picture
Upload folder using huggingface_hub
12adee2 verified
<!DOCTYPE html>
<html lang="fa" dir="rtl">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>برنامه سلام و احوالپرسی</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
:root {
--primary-color: #4f46e5;
--secondary-color: #7c73e6;
--accent-color: #f59e0b;
--text-color: #1f2937;
--bg-color: #f8fafc;
--card-bg: #ffffff;
--shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
--gradient: linear-gradient(135deg, #4f46e5, #7c73e6);
}
body {
background: var(--bg-color);
color: var(--text-color);
min-height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 20px;
transition: all 0.3s ease;
}
.header {
position: absolute;
top: 20px;
left: 20px;
}
.anycoder-link {
color: var(--primary-color);
text-decoration: none;
font-size: 14px;
display: flex;
align-items: center;
gap: 5px;
transition: all 0.3s ease;
}
.anycoder-link:hover {
color: var(--secondary-color);
transform: translateY(-2px);
}
.container {
max-width: 800px;
width: 100%;
background: var(--card-bg);
border-radius: 20px;
box-shadow: var(--shadow);
overflow: hidden;
animation: fadeIn 1s ease;
}
@keyframes fadeIn {
from { opacity: 0; transform: translateY(20px); }
to { opacity: 1; transform: translateY(0); }
}
.hero {
background: var(--gradient);
color: white;
padding: 40px 30px;
text-align: center;
position: relative;
overflow: hidden;
}
.hero::before {
content: '';
position: absolute;
top: -50%;
left: -50%;
width: 200%;
height: 200%;
background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 70%);
animation: rotate 20s linear infinite;
}
@keyframes rotate {
from { transform: rotate(0deg); }
to { transform: rotate(360deg); }
}
.hero h1 {
font-size: 2.5rem;
margin-bottom: 10px;
position: relative;
z-index: 1;
}
.hero p {
font-size: 1.2rem;
opacity: 0.9;
position: relative;
z-index: 1;
}
.content {
padding: 40px 30px;
}
.greeting-section {
display: flex;
flex-direction: column;
align-items: center;
gap: 20px;
margin-bottom: 40px;
}
.greeting-box {
background: var(--gradient);
color: white;
padding: 20px 30px;
border-radius: 15px;
text-align: center;
font-size: 1.8rem;
box-shadow: var(--shadow);
transition: transform 0.3s ease;
}
.greeting-box:hover {
transform: scale(1.05);
}
.response-box {
background: var(--card-bg);
border: 2px dashed var(--secondary-color);
padding: 20px 30px;
border-radius: 15px;
text-align: center;
font-size: 1.8rem;
color: var(--primary-color);
min-height: 80px;
display: flex;
align-items: center;
justify-content: center;
transition: all 0.3s ease;
}
.response-box:hover {
border-style: solid;
background: rgba(79, 70, 229, 0.05);
}
.interaction-section {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
gap: 20px;
margin-top: 30px;
}
.interaction-card {
background: var(--card-bg);
border-radius: 15px;
padding: 25px;
box-shadow: var(--shadow);
display: flex;
flex-direction: column;
align-items: center;
text-align: center;
transition: all 0.3s ease;
cursor: pointer;
}
.interaction-card:hover {
transform: translateY(-10px);
box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}
.interaction-card i {
font-size: 2.5rem;
color: var(--primary-color);
margin-bottom: 15px;
}
.interaction-card h3 {
margin-bottom: 10px;
color: var(--text-color);
}
.interaction-card p {
color: #6b7280;
font-size: 0.9rem;
}
.emoji-section {
display: flex;
justify-content: center;
gap: 15px;
margin-top: 30px;
flex-wrap: wrap;
}
.emoji-btn {
background: var(--card-bg);
border: none;
border-radius: 50%;
width: 60px;
height: 60px;
font-size: 1.8rem;
cursor: pointer;
box-shadow: var(--shadow);
transition: all 0.3s ease;
}
.emoji-btn:hover {
transform: scale(1.2) rotate(10deg);
background: var(--gradient);
color: white;
}
.theme-toggle {
position: absolute;
top: 20px;
right: 20px;
background: var(--card-bg);
border: none;
border-radius: 50%;
width: 50px;
height: 50px;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
box-shadow: var(--shadow);
font-size: 1.2rem;
color: var(--primary-color);
transition: all 0.3s ease;
}
.theme-toggle:hover {
transform: rotate(180deg);
}
.footer {
margin-top: 40px;
text-align: center;
color: #6b7280;
font-size: 0.9rem;
}
/* Dark theme */
body.dark-theme {
--text-color: #f9fafb;
--bg-color: #111827;
--card-bg: #1f2937;
--shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}
/* Responsive styles */
@media (max-width: 768px) {
.hero h1 {
font-size: 2rem;
}
.hero p {
font-size: 1rem;
}
.greeting-box, .response-box {
font-size: 1.5rem;
padding: 15px 20px;
}
.content {
padding: 30px 20px;
}
}
@media (max-width: 480px) {
.hero {
padding: 30px 20px;
}
.hero h1 {
font-size: 1.7rem;
}
.interaction-section {
grid-template-columns: 1fr;
}
}
</style>
</head>
<body>
<div class="header">
<a href="https://huggingface.co/spaces/akhaliq/anycoder" class="anycoder-link">
<i class="fas fa-code"></i>
Built with anycoder
</a>
</div>
<button class="theme-toggle" id="themeToggle">
<i class="fas fa-moon"></i>
</button>
<div class="container">
<div class="hero">
<h1>سلام! خوبی؟</h1>
<p>برنامه تعاملی سلام و احوالپرسی به زبان فارسی</p>
</div>
<div class="content">
<div class="greeting-section">
<div class="greeting-box" id="greeting">
سلام! خوبی؟
</div>
<div class="response-box" id="response">
من خوبم، ممنون! شما چطورید؟
</div>
</div>
<div class="interaction-section">
<div class="interaction-card" onclick="changeGreeting('سلام! چطوری؟')">
<i class="fas fa-handshake"></i>
<h3>سلام دوستانه</h3>
<p>یک سلام صمیمانه و گرم</p>
</div>
<div class="interaction-card" onclick="changeGreeting('درود! حالتون چطوره؟')">
<i class="fas fa-user-friends"></i>
<h3>درود رسمی</h3>
<p>سلام و احوالپرسی رسمی</p>
</div>
<div class="interaction-card" onclick="changeGreeting('سلام عزیزم! چطوری؟')">
<i class="fas fa-heart"></i>
<h3>سلام عاشقانه</h3>
<p>سلامی پر از محبت و عشق</p>
</div>
</div>
<div class="emoji-section">
<button class="emoji-btn" onclick="showResponse('😊 خیلی خوبم! ممنون')">😊</button>
<button class="emoji-btn" onclick="showResponse('😐 بدک نیستم')">😐</button>
<button class="emoji-btn" onclick="showResponse('😔 حالم خوب نیست')">😔</button>
<button class="emoji-btn" onclick="showResponse('🤩 عالیم!')">🤩</button>
<button class="emoji-btn" onclick="showResponse('👍 خوبم، مرسی')">👍</button>
</div>
</div>
</div>
<div class="footer">
طراحی شده با HTML, CSS و JavaScript
</div>
<script>
// Theme toggle functionality
const themeToggle = document.getElementById('themeToggle');
const body = document.body;
themeToggle.addEventListener('click', () => {
body.classList.toggle('dark-theme');
if (body.classList.contains('dark-theme')) {
themeToggle.innerHTML = '<i class="fas fa-sun"></i>';
} else {
themeToggle.innerHTML = '<i class="fas fa-moon"></i>';
}
});
// Greeting change functionality
function changeGreeting(newGreeting) {
const greetingElement = document.getElementById('greeting');
greetingElement.textContent = newGreeting;
// Add animation
greetingElement.style.transform = 'scale(1.1)';
setTimeout(() => {
greetingElement.style.transform = 'scale(1)';
}, 300);
// Reset response
document.getElementById('response').textContent = 'من خوبم، ممنون! شما چطورید؟';
}
// Response change functionality
function showResponse(newResponse) {
const responseElement = document.getElementById('response');
responseElement.textContent = newResponse;
// Add animation
responseElement.style.transform = 'scale(1.1)';
setTimeout(() => {
responseElement.style.transform = 'scale(1)';
}, 300);
}
// Add some random animations to emojis
const emojiButtons = document.querySelectorAll('.emoji-btn');
emojiButtons.forEach(btn => {
btn.addEventListener('mouseover', () => {
const randomRotation = Math.floor(Math.random() * 20) - 10;
btn.style.transform = `scale(1.2) rotate(${randomRotation}deg)`;
});
btn.addEventListener('mouseout', () => {
btn.style.transform = 'scale(1) rotate(0deg)';
});
});
</script>
</body>
</html>