Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5bfcb4a7af | ||
|
|
0d4e80837f |
@ -1,346 +1,215 @@
|
||||
:root {
|
||||
--color-bg: #ffffff;
|
||||
--color-text: #1a1a1a;
|
||||
--color-primary: #2563EB; /* Vibrant Blue */
|
||||
--color-secondary: #000000;
|
||||
--color-accent: #A3E635; /* Lime Green */
|
||||
--color-surface: #f8f9fa;
|
||||
--font-heading: 'Space Grotesk', sans-serif;
|
||||
--font-body: 'Inter', sans-serif;
|
||||
--border-width: 2px;
|
||||
--shadow-hard: 5px 5px 0px #000;
|
||||
--shadow-hover: 8px 8px 0px #000;
|
||||
--radius-pill: 50rem;
|
||||
--radius-card: 1rem;
|
||||
--primary-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
|
||||
--bg-color: #f8fafc;
|
||||
--card-bg: rgba(255, 255, 255, 0.8);
|
||||
--text-main: #1e293b;
|
||||
--text-muted: #64748b;
|
||||
--border-color: rgba(226, 232, 240, 0.8);
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: var(--font-body);
|
||||
background-color: var(--color-bg);
|
||||
color: var(--color-text);
|
||||
overflow-x: hidden;
|
||||
background-color: var(--bg-color);
|
||||
background-image:
|
||||
radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.05) 0px, transparent 50%),
|
||||
radial-gradient(at 100% 0%, rgba(168, 85, 247, 0.05) 0px, transparent 50%);
|
||||
font-family: 'Inter', system-ui, -apple-system, sans-serif;
|
||||
color: var(--text-main);
|
||||
min-height: 100vh;
|
||||
letter-spacing: -0.01em;
|
||||
}
|
||||
|
||||
h1, h2, h3, h4, h5, h6, .navbar-brand {
|
||||
font-family: var(--font-heading);
|
||||
letter-spacing: -0.03em;
|
||||
}
|
||||
|
||||
/* Utilities */
|
||||
.text-primary { color: var(--color-primary) !important; }
|
||||
.bg-black { background-color: #000 !important; }
|
||||
.text-white { color: #fff !important; }
|
||||
.shadow-hard { box-shadow: var(--shadow-hard); }
|
||||
.border-2-black { border: var(--border-width) solid #000; }
|
||||
.py-section { padding-top: 5rem; padding-bottom: 5rem; }
|
||||
|
||||
/* Navbar */
|
||||
.navbar {
|
||||
background: rgba(255, 255, 255, 0.9);
|
||||
background: rgba(255, 255, 255, 0.7);
|
||||
backdrop-filter: blur(10px);
|
||||
border-bottom: var(--border-width) solid transparent;
|
||||
transition: all 0.3s;
|
||||
padding-top: 1rem;
|
||||
padding-bottom: 1rem;
|
||||
border-bottom: 1px solid var(--border-color);
|
||||
padding: 1rem 0;
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 1000;
|
||||
}
|
||||
|
||||
.navbar.scrolled {
|
||||
border-bottom-color: #000;
|
||||
padding-top: 0.5rem;
|
||||
padding-bottom: 0.5rem;
|
||||
}
|
||||
|
||||
.brand-text {
|
||||
.navbar-brand {
|
||||
font-weight: 800;
|
||||
font-size: 1.5rem;
|
||||
background: var(--primary-gradient);
|
||||
-webkit-background-clip: text;
|
||||
-webkit-text-fill-color: transparent;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
}
|
||||
|
||||
.hero-section {
|
||||
padding: 4rem 0 3rem;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.hero-section h1 {
|
||||
font-weight: 900;
|
||||
font-size: clamp(2.5rem, 5vw, 4rem);
|
||||
margin-bottom: 1rem;
|
||||
letter-spacing: -0.04em;
|
||||
background: linear-gradient(to bottom, #1e293b, #475569);
|
||||
-webkit-background-clip: text;
|
||||
-webkit-text-fill-color: transparent;
|
||||
}
|
||||
|
||||
.hero-section p {
|
||||
color: var(--text-muted);
|
||||
font-size: 1.25rem;
|
||||
max-width: 600px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.card {
|
||||
background: var(--card-bg);
|
||||
backdrop-filter: blur(20px);
|
||||
border: 1px solid var(--border-color);
|
||||
border-radius: 24px;
|
||||
box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
|
||||
transition: transform 0.3s ease, box-shadow 0.3s ease;
|
||||
}
|
||||
|
||||
.dropzone {
|
||||
border: 2px dashed #cbd5e1;
|
||||
border-radius: 20px;
|
||||
padding: 3rem 2rem;
|
||||
text-align: center;
|
||||
transition: all 0.2s ease;
|
||||
cursor: pointer;
|
||||
background: rgba(248, 250, 252, 0.5);
|
||||
}
|
||||
|
||||
.dropzone:hover, .dropzone.drag-active {
|
||||
border-color: #6366f1;
|
||||
background: rgba(99, 102, 241, 0.05);
|
||||
transform: scale(1.01);
|
||||
}
|
||||
|
||||
.dropzone.drag-active {
|
||||
border-style: solid;
|
||||
box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
|
||||
}
|
||||
|
||||
.dropzone i {
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
color: #6366f1;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
.form-control, .form-select {
|
||||
border-radius: 12px;
|
||||
padding: 0.75rem 1rem;
|
||||
border: 2px solid #f1f5f9;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.form-control:focus, .form-select:focus {
|
||||
border-color: #6366f1;
|
||||
box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
|
||||
}
|
||||
|
||||
.stats-row {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: 1rem;
|
||||
margin-bottom: 1.5rem;
|
||||
}
|
||||
|
||||
.stat-item {
|
||||
background: white;
|
||||
padding: 1.25rem;
|
||||
border-radius: 16px;
|
||||
border: 1px solid #f1f5f9;
|
||||
}
|
||||
|
||||
.stat-label {
|
||||
font-size: 0.75rem;
|
||||
font-weight: 700;
|
||||
text-transform: uppercase;
|
||||
color: var(--text-muted);
|
||||
margin-bottom: 0.25rem;
|
||||
}
|
||||
|
||||
.stat-value {
|
||||
font-size: 1.75rem;
|
||||
font-weight: 800;
|
||||
}
|
||||
|
||||
.nav-link {
|
||||
font-weight: 500;
|
||||
color: var(--color-text);
|
||||
margin-left: 1rem;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.nav-link:hover, .nav-link.active {
|
||||
color: var(--color-primary);
|
||||
}
|
||||
|
||||
/* Buttons */
|
||||
.btn {
|
||||
font-weight: 700;
|
||||
font-family: var(--font-heading);
|
||||
padding: 0.8rem 2rem;
|
||||
border-radius: var(--radius-pill);
|
||||
border: var(--border-width) solid #000;
|
||||
transition: all 0.2s cubic-bezier(0.25, 1, 0.5, 1);
|
||||
box-shadow: var(--shadow-hard);
|
||||
}
|
||||
|
||||
.btn:hover {
|
||||
transform: translate(-2px, -2px);
|
||||
box-shadow: var(--shadow-hover);
|
||||
}
|
||||
|
||||
.btn:active {
|
||||
transform: translate(2px, 2px);
|
||||
box-shadow: 0 0 0 #000;
|
||||
}
|
||||
|
||||
.btn-primary {
|
||||
background-color: var(--color-primary);
|
||||
border-color: #000;
|
||||
color: #fff;
|
||||
background: var(--primary-gradient);
|
||||
border: none;
|
||||
border-radius: 14px;
|
||||
font-weight: 700;
|
||||
padding: 0.8rem 1.5rem;
|
||||
box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
|
||||
.btn-primary:hover {
|
||||
background-color: #1d4ed8;
|
||||
border-color: #000;
|
||||
color: #fff;
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
|
||||
}
|
||||
|
||||
.btn-outline-dark {
|
||||
background-color: #fff;
|
||||
color: #000;
|
||||
.batch-card {
|
||||
margin-bottom: 1.5rem;
|
||||
border-left: 6px solid #6366f1;
|
||||
}
|
||||
|
||||
.btn-cta {
|
||||
background-color: var(--color-accent);
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.btn-cta:hover {
|
||||
background-color: #8cc629;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
/* Hero Section */
|
||||
.hero-section {
|
||||
min-height: 100vh;
|
||||
padding-top: 80px;
|
||||
}
|
||||
|
||||
.background-blob {
|
||||
position: absolute;
|
||||
border-radius: 50%;
|
||||
filter: blur(80px);
|
||||
opacity: 0.6;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.blob-1 {
|
||||
top: -10%;
|
||||
right: -10%;
|
||||
width: 600px;
|
||||
height: 600px;
|
||||
background: radial-gradient(circle, var(--color-accent), transparent);
|
||||
}
|
||||
|
||||
.blob-2 {
|
||||
bottom: 10%;
|
||||
left: -10%;
|
||||
width: 500px;
|
||||
height: 500px;
|
||||
background: radial-gradient(circle, var(--color-primary), transparent);
|
||||
}
|
||||
|
||||
.highlight-text {
|
||||
background: linear-gradient(120deg, transparent 0%, transparent 40%, var(--color-accent) 40%, var(--color-accent) 100%);
|
||||
background-repeat: no-repeat;
|
||||
background-size: 100% 40%;
|
||||
background-position: 0 88%;
|
||||
padding: 0 5px;
|
||||
}
|
||||
|
||||
.dot { color: var(--color-primary); }
|
||||
|
||||
.badge-pill {
|
||||
display: inline-block;
|
||||
padding: 0.5rem 1rem;
|
||||
border: 2px solid #000;
|
||||
border-radius: 50px;
|
||||
font-weight: 700;
|
||||
background: #fff;
|
||||
box-shadow: 4px 4px 0 #000;
|
||||
font-family: var(--font-heading);
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
|
||||
/* Marquee */
|
||||
.marquee-container {
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
border-top: 2px solid #000;
|
||||
border-bottom: 2px solid #000;
|
||||
}
|
||||
|
||||
.rotate-divider {
|
||||
transform: rotate(-2deg) scale(1.05);
|
||||
z-index: 10;
|
||||
position: relative;
|
||||
margin-top: -50px;
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
|
||||
.marquee-content {
|
||||
display: inline-block;
|
||||
animation: marquee 20s linear infinite;
|
||||
font-family: var(--font-heading);
|
||||
font-weight: 700;
|
||||
font-size: 1.5rem;
|
||||
letter-spacing: 2px;
|
||||
}
|
||||
|
||||
@keyframes marquee {
|
||||
0% { transform: translateX(0); }
|
||||
100% { transform: translateX(-50%); }
|
||||
}
|
||||
|
||||
/* Portfolio Cards */
|
||||
.project-card {
|
||||
border: 2px solid #000;
|
||||
border-radius: var(--radius-card);
|
||||
overflow: hidden;
|
||||
background: #fff;
|
||||
transition: transform 0.3s ease;
|
||||
box-shadow: var(--shadow-hard);
|
||||
height: 100%;
|
||||
.batch-header {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
.project-card:hover {
|
||||
transform: translateY(-10px);
|
||||
box-shadow: 8px 8px 0 #000;
|
||||
}
|
||||
|
||||
.card-img-holder {
|
||||
height: 250px;
|
||||
.batch-title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border-bottom: 2px solid #000;
|
||||
position: relative;
|
||||
font-size: 4rem;
|
||||
gap: 0.75rem;
|
||||
}
|
||||
|
||||
.placeholder-art {
|
||||
transition: transform 0.3s ease;
|
||||
.badge-count {
|
||||
background: #f1f5f9;
|
||||
color: #475569;
|
||||
padding: 0.25rem 0.75rem;
|
||||
border-radius: 99px;
|
||||
font-size: 0.85rem;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.project-card:hover .placeholder-art {
|
||||
transform: scale(1.2) rotate(10deg);
|
||||
.sticky-panel {
|
||||
position: sticky;
|
||||
top: 6rem;
|
||||
}
|
||||
|
||||
.bg-soft-blue { background-color: #e0f2fe; }
|
||||
.bg-soft-green { background-color: #dcfce7; }
|
||||
.bg-soft-purple { background-color: #f3e8ff; }
|
||||
.bg-soft-yellow { background-color: #fef9c3; }
|
||||
|
||||
.category-tag {
|
||||
position: absolute;
|
||||
top: 15px;
|
||||
right: 15px;
|
||||
background: #000;
|
||||
color: #fff;
|
||||
padding: 5px 12px;
|
||||
border-radius: 20px;
|
||||
font-size: 0.75rem;
|
||||
font-weight: 700;
|
||||
.dynamic-batch-input .input-group-text {
|
||||
min-width: 100px;
|
||||
font-size: 0.8rem;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.card-body { padding: 1.5rem; }
|
||||
|
||||
.link-arrow {
|
||||
text-decoration: none;
|
||||
color: #000;
|
||||
font-weight: 700;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
margin-top: auto;
|
||||
@keyframes fadeIn {
|
||||
from { opacity: 0; transform: translateY(10px); }
|
||||
to { opacity: 1; transform: translateY(0); }
|
||||
}
|
||||
|
||||
.link-arrow i { transition: transform 0.2s; margin-left: 5px; }
|
||||
.link-arrow:hover i { transform: translateX(5px); }
|
||||
|
||||
/* About */
|
||||
.about-image-stack {
|
||||
position: relative;
|
||||
height: 400px;
|
||||
width: 100%;
|
||||
.animate-fadeIn {
|
||||
animation: fadeIn 0.4s ease forwards;
|
||||
}
|
||||
|
||||
.stack-card {
|
||||
position: absolute;
|
||||
width: 80%;
|
||||
height: 100%;
|
||||
border-radius: var(--radius-card);
|
||||
border: 2px solid #000;
|
||||
box-shadow: var(--shadow-hard);
|
||||
left: 10%;
|
||||
transform: rotate(-3deg);
|
||||
background-size: cover;
|
||||
/* Custom scrollbar */
|
||||
::-webkit-scrollbar {
|
||||
width: 8px;
|
||||
}
|
||||
|
||||
/* Forms */
|
||||
.form-control {
|
||||
border: 2px solid #000;
|
||||
border-radius: 0.5rem;
|
||||
padding: 1rem;
|
||||
font-weight: 500;
|
||||
background: #f8f9fa;
|
||||
::-webkit-scrollbar-track {
|
||||
background: #f1f5f9;
|
||||
}
|
||||
|
||||
.form-control:focus {
|
||||
box-shadow: 4px 4px 0 var(--color-primary);
|
||||
border-color: #000;
|
||||
background: #fff;
|
||||
::-webkit-scrollbar-thumb {
|
||||
background: #cbd5e1;
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
/* Animations */
|
||||
.animate-up {
|
||||
opacity: 0;
|
||||
transform: translateY(30px);
|
||||
animation: fadeUp 0.8s ease forwards;
|
||||
}
|
||||
|
||||
.delay-100 { animation-delay: 0.1s; }
|
||||
.delay-200 { animation-delay: 0.2s; }
|
||||
|
||||
@keyframes fadeUp {
|
||||
to {
|
||||
opacity: 1;
|
||||
transform: translateY(0);
|
||||
}
|
||||
}
|
||||
|
||||
/* Social */
|
||||
.social-links a {
|
||||
transition: transform 0.2s;
|
||||
display: inline-block;
|
||||
}
|
||||
.social-links a:hover {
|
||||
transform: scale(1.2) rotate(10deg);
|
||||
color: var(--color-accent) !important;
|
||||
}
|
||||
|
||||
/* Responsive */
|
||||
@media (max-width: 991px) {
|
||||
.rotate-divider {
|
||||
transform: rotate(0);
|
||||
margin-top: 0;
|
||||
margin-bottom: 2rem;
|
||||
}
|
||||
|
||||
.hero-section {
|
||||
padding-top: 120px;
|
||||
text-align: center;
|
||||
min-height: auto;
|
||||
padding-bottom: 100px;
|
||||
}
|
||||
|
||||
.display-1 { font-size: 3.5rem; }
|
||||
|
||||
.blob-1 { width: 300px; height: 300px; right: -20%; }
|
||||
.blob-2 { width: 300px; height: 300px; left: -20%; }
|
||||
::-webkit-scrollbar-thumb:hover {
|
||||
background: #94a3b8;
|
||||
}
|
||||
@ -1,73 +1,254 @@
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
const numberInput = document.getElementById('numberInput');
|
||||
const fileInput = document.getElementById('fileInput');
|
||||
const dropzone = document.getElementById('dropzone');
|
||||
const splitMode = document.getElementById('splitMode');
|
||||
const splitValue = document.getElementById('splitValue');
|
||||
const splitBtn = document.getElementById('splitBtn');
|
||||
const autoDedupe = document.getElementById('autoDedupe');
|
||||
const resultsContainer = document.getElementById('resultsContainer');
|
||||
const totalCountEl = document.getElementById('totalCount');
|
||||
const uniqueCountEl = document.getElementById('uniqueCount');
|
||||
const dynamicCountsContainer = document.getElementById('dynamicCountsContainer');
|
||||
const dynamicInputsList = document.getElementById('dynamicInputsList');
|
||||
const unitText = document.getElementById('unitText');
|
||||
const batchCountBadge = document.getElementById('batchCountBadge');
|
||||
|
||||
// Smooth scrolling for navigation links
|
||||
document.querySelectorAll('a[href^="#"]').forEach(anchor => {
|
||||
anchor.addEventListener('click', function (e) {
|
||||
e.preventDefault();
|
||||
const targetId = this.getAttribute('href');
|
||||
if (targetId === '#') return;
|
||||
let allNumbers = [];
|
||||
|
||||
const targetElement = document.querySelector(targetId);
|
||||
if (targetElement) {
|
||||
// Close mobile menu if open
|
||||
const navbarToggler = document.querySelector('.navbar-toggler');
|
||||
const navbarCollapse = document.querySelector('.navbar-collapse');
|
||||
if (navbarCollapse.classList.contains('show')) {
|
||||
navbarToggler.click();
|
||||
}
|
||||
// Helper: Extract numbers from text (Flexible digit extraction)
|
||||
const extractNumbers = (text) => {
|
||||
// First try to match standard 11-digit mobile numbers
|
||||
let matches = text.match(/1[3-9]\d{9}/g) || [];
|
||||
|
||||
// Scroll with offset
|
||||
const offset = 80;
|
||||
const elementPosition = targetElement.getBoundingClientRect().top;
|
||||
const offsetPosition = elementPosition + window.pageYOffset - offset;
|
||||
|
||||
window.scrollTo({
|
||||
top: offsetPosition,
|
||||
behavior: "smooth"
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// Navbar scroll effect
|
||||
const navbar = document.querySelector('.navbar');
|
||||
window.addEventListener('scroll', () => {
|
||||
if (window.scrollY > 50) {
|
||||
navbar.classList.add('scrolled', 'shadow-sm', 'bg-white');
|
||||
navbar.classList.remove('bg-transparent');
|
||||
} else {
|
||||
navbar.classList.remove('scrolled', 'shadow-sm', 'bg-white');
|
||||
navbar.classList.add('bg-transparent');
|
||||
// If no mobile numbers found, try matching any sequence of 5-15 digits (IDs, account numbers, etc.)
|
||||
if (matches.length === 0) {
|
||||
matches = text.match(/\d{5,15}/g) || [];
|
||||
}
|
||||
});
|
||||
|
||||
// Intersection Observer for fade-up animations
|
||||
const observerOptions = {
|
||||
threshold: 0.1,
|
||||
rootMargin: "0px 0px -50px 0px"
|
||||
return matches;
|
||||
};
|
||||
|
||||
const observer = new IntersectionObserver((entries) => {
|
||||
entries.forEach(entry => {
|
||||
if (entry.isIntersecting) {
|
||||
entry.target.classList.add('animate-up');
|
||||
entry.target.style.opacity = "1";
|
||||
observer.unobserve(entry.target); // Only animate once
|
||||
}
|
||||
});
|
||||
}, observerOptions);
|
||||
// Update stats and allNumbers array
|
||||
const updateStats = () => {
|
||||
const text = numberInput.value;
|
||||
const extracted = extractNumbers(text);
|
||||
const unique = [...new Set(extracted)];
|
||||
|
||||
// Select elements to animate (add a class 'reveal' to them in HTML if not already handled by CSS animation)
|
||||
// For now, let's just make sure the hero animations run.
|
||||
// If we want scroll animations, we'd add opacity: 0 to elements in CSS and reveal them here.
|
||||
// Given the request, the CSS animation I added runs on load for Hero.
|
||||
// Let's make the project cards animate in.
|
||||
totalCountEl.textContent = extracted.length.toLocaleString();
|
||||
uniqueCountEl.textContent = unique.length.toLocaleString();
|
||||
|
||||
const projectCards = document.querySelectorAll('.project-card');
|
||||
projectCards.forEach((card, index) => {
|
||||
card.style.opacity = "0";
|
||||
card.style.animationDelay = `${index * 0.1}s`;
|
||||
observer.observe(card);
|
||||
allNumbers = autoDedupe.checked ? unique : extracted;
|
||||
};
|
||||
|
||||
numberInput.addEventListener('input', updateStats);
|
||||
autoDedupe.addEventListener('change', updateStats);
|
||||
|
||||
// Dynamic UI for split modes
|
||||
const updateSplitUI = () => {
|
||||
const mode = splitMode.value;
|
||||
if (mode === 'count') {
|
||||
unitText.textContent = '份';
|
||||
generateDynamicInputs();
|
||||
} else {
|
||||
unitText.textContent = '条';
|
||||
dynamicCountsContainer.classList.add('d-none');
|
||||
}
|
||||
};
|
||||
|
||||
const generateDynamicInputs = () => {
|
||||
const numBatches = parseInt(splitValue.value);
|
||||
dynamicInputsList.innerHTML = '';
|
||||
|
||||
if (isNaN(numBatches) || numBatches <= 1 || splitMode.value !== 'count') {
|
||||
dynamicCountsContainer.classList.add('d-none');
|
||||
return;
|
||||
}
|
||||
|
||||
dynamicCountsContainer.classList.remove('d-none');
|
||||
|
||||
// Create N-1 inputs because the last one is always the remainder
|
||||
for (let i = 0; i < numBatches - 1; i++) {
|
||||
const div = document.createElement('div');
|
||||
div.className = 'input-group input-group-sm mb-2';
|
||||
div.innerHTML = `
|
||||
<span class="input-group-text bg-white border-2 fw-bold" style="width: 100px;">第 ${i + 1} 份数量</span>
|
||||
<input type="number" class="form-control border-2 batch-size-input" placeholder="留空则自动分配" min="1">
|
||||
`;
|
||||
dynamicInputsList.appendChild(div);
|
||||
}
|
||||
};
|
||||
|
||||
splitMode.addEventListener('change', updateSplitUI);
|
||||
splitValue.addEventListener('input', generateDynamicInputs);
|
||||
|
||||
// File handling
|
||||
const handleFile = (file) => {
|
||||
if (!file) return;
|
||||
const reader = new FileReader();
|
||||
reader.onload = (event) => {
|
||||
const content = event.target.result;
|
||||
numberInput.value += (numberInput.value ? '\n' : '') + content;
|
||||
updateStats();
|
||||
fileInput.value = '';
|
||||
};
|
||||
reader.readAsText(file);
|
||||
};
|
||||
|
||||
dropzone.addEventListener('click', () => fileInput.click());
|
||||
fileInput.addEventListener('change', (e) => handleFile(e.target.files[0]));
|
||||
|
||||
// Drag and Drop
|
||||
['dragenter', 'dragover', 'dragleave', 'drop'].forEach(eventName => {
|
||||
dropzone.addEventListener(eventName, (e) => {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
}, false);
|
||||
});
|
||||
|
||||
['dragenter', 'dragover'].forEach(eventName => {
|
||||
dropzone.addEventListener(eventName, () => dropzone.classList.add('drag-active'), false);
|
||||
});
|
||||
|
||||
['dragleave', 'drop'].forEach(eventName => {
|
||||
dropzone.addEventListener(eventName, () => dropzone.classList.remove('drag-active'), false);
|
||||
});
|
||||
|
||||
dropzone.addEventListener('drop', (e) => {
|
||||
const dt = e.dataTransfer;
|
||||
const file = dt.files[0];
|
||||
handleFile(file);
|
||||
}, false);
|
||||
|
||||
// Splitting logic
|
||||
splitBtn.addEventListener('click', () => {
|
||||
updateStats();
|
||||
if (allNumbers.length === 0) {
|
||||
alert('请先导入或粘贴号码!');
|
||||
return;
|
||||
}
|
||||
|
||||
const mode = splitMode.value;
|
||||
const val = parseInt(splitValue.value);
|
||||
|
||||
if (isNaN(val) || val <= 0) {
|
||||
alert('请输入有效的分批数值!');
|
||||
return;
|
||||
}
|
||||
|
||||
let batches = [];
|
||||
let tempNumbers = [...allNumbers];
|
||||
|
||||
if (mode === 'count') {
|
||||
const sizeInputs = document.querySelectorAll('.batch-size-input');
|
||||
let hasAnySpecificSize = false;
|
||||
let specificSizes = [];
|
||||
|
||||
sizeInputs.forEach(input => {
|
||||
const s = parseInt(input.value);
|
||||
if (!isNaN(s) && s > 0) {
|
||||
hasAnySpecificSize = true;
|
||||
specificSizes.push(s);
|
||||
} else {
|
||||
specificSizes.push(null);
|
||||
}
|
||||
});
|
||||
|
||||
if (hasAnySpecificSize) {
|
||||
// If some sizes are specified, follow them.
|
||||
for (let i = 0; i < val - 1; i++) {
|
||||
const size = specificSizes[i];
|
||||
if (size !== null && size > 0) {
|
||||
batches.push(tempNumbers.splice(0, size));
|
||||
} else {
|
||||
// For empty inputs when others are filled, we calculate an average of the remaining
|
||||
const remainingSlots = val - batches.length;
|
||||
const avg = Math.ceil(tempNumbers.length / remainingSlots);
|
||||
batches.push(tempNumbers.splice(0, avg));
|
||||
}
|
||||
}
|
||||
// Last batch always gets the remainder
|
||||
batches.push(tempNumbers);
|
||||
} else {
|
||||
// Default even split if no inputs are filled
|
||||
const batchSize = Math.ceil(tempNumbers.length / val);
|
||||
for (let i = 0; i < val; i++) {
|
||||
if (i === val - 1) {
|
||||
batches.push(tempNumbers); // Last one takes all remainder
|
||||
} else {
|
||||
batches.push(tempNumbers.splice(0, batchSize));
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// Split by fixed size per batch (mode === 'size')
|
||||
while (tempNumbers.length > 0) {
|
||||
batches.push(tempNumbers.splice(0, val));
|
||||
}
|
||||
}
|
||||
|
||||
renderResults(batches);
|
||||
});
|
||||
|
||||
const renderResults = (batches) => {
|
||||
resultsContainer.innerHTML = '';
|
||||
// Filter out empty batches if they occurred due to split logic
|
||||
const finalBatches = batches.filter(b => b.length > 0);
|
||||
|
||||
batchCountBadge.textContent = `${finalBatches.length} 个批次`;
|
||||
batchCountBadge.classList.remove('d-none');
|
||||
|
||||
finalBatches.forEach((batch, index) => {
|
||||
const card = document.createElement('div');
|
||||
card.className = 'card batch-card animate-fadeIn';
|
||||
|
||||
const previewText = batch.slice(0, 15).join(', ');
|
||||
const hasMore = batch.length > 15;
|
||||
|
||||
card.innerHTML = `
|
||||
<div class="card-body p-4">
|
||||
<div class="batch-header">
|
||||
<div class="batch-title">
|
||||
<span class="badge bg-primary" style="background: var(--primary-gradient) !important;">第 ${index + 1} 份</span>
|
||||
<span class="badge-count">${batch.length.toLocaleString()} 条</span>
|
||||
</div>
|
||||
<button class="btn btn-primary btn-sm px-3 download-btn">
|
||||
<i data-lucide="download" style="width: 14px;"></i> 下载
|
||||
</button>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<input type="text" class="form-control form-control-sm bg-light border-0 remark-input" placeholder="备注名称(即文件名)">
|
||||
</div>
|
||||
<div class="small text-muted font-monospace bg-light p-2 rounded" style="font-size: 0.75rem; word-break: break-all;">
|
||||
预览: ${batch.length > 0 ? previewText + (hasMore ? ' ...' : '') : '无号码'}
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
|
||||
resultsContainer.appendChild(card);
|
||||
|
||||
// Download handler
|
||||
card.querySelector('.download-btn').addEventListener('click', () => {
|
||||
const remark = card.querySelector('.remark-input').value.trim() ||
|
||||
`batch_${index + 1}_${batch.length}`;
|
||||
const blob = new Blob([batch.join('\n')], { type: 'text/plain;charset=utf-8' });
|
||||
const url = URL.createObjectURL(blob);
|
||||
const a = document.createElement('a');
|
||||
a.href = url;
|
||||
a.download = `${remark}.txt`;
|
||||
document.body.appendChild(a);
|
||||
a.click();
|
||||
document.body.removeChild(a);
|
||||
URL.revokeObjectURL(url);
|
||||
});
|
||||
});
|
||||
|
||||
if (window.lucide) {
|
||||
lucide.createIcons();
|
||||
}
|
||||
|
||||
resultsContainer.scrollIntoView({ behavior: 'smooth', block: 'start' });
|
||||
};
|
||||
|
||||
// Initial UI Setup
|
||||
updateSplitUI();
|
||||
});
|
||||
272
index.php
272
index.php
@ -2,149 +2,145 @@
|
||||
declare(strict_types=1);
|
||||
@ini_set('display_errors', '1');
|
||||
@error_reporting(E_ALL);
|
||||
@date_default_timezone_set('UTC');
|
||||
|
||||
$phpVersion = PHP_VERSION;
|
||||
$now = date('Y-m-d H:i:s');
|
||||
$projectName = $_SERVER['PROJECT_NAME'] ?? '号码分批大师';
|
||||
?>
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<title>New Style</title>
|
||||
<?php
|
||||
// Read project preview data from environment
|
||||
$projectDescription = $_SERVER['PROJECT_DESCRIPTION'] ?? '';
|
||||
$projectImageUrl = $_SERVER['PROJECT_IMAGE_URL'] ?? '';
|
||||
?>
|
||||
<?php if ($projectDescription): ?>
|
||||
<!-- Meta description -->
|
||||
<meta name="description" content='<?= htmlspecialchars($projectDescription) ?>' />
|
||||
<!-- Open Graph meta tags -->
|
||||
<meta property="og:description" content="<?= htmlspecialchars($projectDescription) ?>" />
|
||||
<!-- Twitter meta tags -->
|
||||
<meta property="twitter:description" content="<?= htmlspecialchars($projectDescription) ?>" />
|
||||
<?php endif; ?>
|
||||
<?php if ($projectImageUrl): ?>
|
||||
<!-- Open Graph image -->
|
||||
<meta property="og:image" content="<?= htmlspecialchars($projectImageUrl) ?>" />
|
||||
<!-- Twitter image -->
|
||||
<meta property="twitter:image" content="<?= htmlspecialchars($projectImageUrl) ?>" />
|
||||
<?php endif; ?>
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap" rel="stylesheet">
|
||||
<style>
|
||||
:root {
|
||||
--bg-color-start: #6a11cb;
|
||||
--bg-color-end: #2575fc;
|
||||
--text-color: #ffffff;
|
||||
--card-bg-color: rgba(255, 255, 255, 0.01);
|
||||
--card-border-color: rgba(255, 255, 255, 0.1);
|
||||
}
|
||||
body {
|
||||
margin: 0;
|
||||
font-family: 'Inter', sans-serif;
|
||||
background: linear-gradient(45deg, var(--bg-color-start), var(--bg-color-end));
|
||||
color: var(--text-color);
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
min-height: 100vh;
|
||||
text-align: center;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
}
|
||||
body::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><path d="M-10 10L110 10M10 -10L10 110" stroke-width="1" stroke="rgba(255,255,255,0.05)"/></svg>');
|
||||
animation: bg-pan 20s linear infinite;
|
||||
z-index: -1;
|
||||
}
|
||||
@keyframes bg-pan {
|
||||
0% { background-position: 0% 0%; }
|
||||
100% { background-position: 100% 100%; }
|
||||
}
|
||||
main {
|
||||
padding: 2rem;
|
||||
}
|
||||
.card {
|
||||
background: var(--card-bg-color);
|
||||
border: 1px solid var(--card-border-color);
|
||||
border-radius: 16px;
|
||||
padding: 2rem;
|
||||
backdrop-filter: blur(20px);
|
||||
-webkit-backdrop-filter: blur(20px);
|
||||
box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
.loader {
|
||||
margin: 1.25rem auto 1.25rem;
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
border: 3px solid rgba(255, 255, 255, 0.25);
|
||||
border-top-color: #fff;
|
||||
border-radius: 50%;
|
||||
animation: spin 1s linear infinite;
|
||||
}
|
||||
@keyframes spin {
|
||||
from { transform: rotate(0deg); }
|
||||
to { transform: rotate(360deg); }
|
||||
}
|
||||
.hint {
|
||||
opacity: 0.9;
|
||||
}
|
||||
.sr-only {
|
||||
position: absolute;
|
||||
width: 1px; height: 1px;
|
||||
padding: 0; margin: -1px;
|
||||
overflow: hidden;
|
||||
clip: rect(0, 0, 0, 0);
|
||||
white-space: nowrap; border: 0;
|
||||
}
|
||||
h1 {
|
||||
font-size: 3rem;
|
||||
font-weight: 700;
|
||||
margin: 0 0 1rem;
|
||||
letter-spacing: -1px;
|
||||
}
|
||||
p {
|
||||
margin: 0.5rem 0;
|
||||
font-size: 1.1rem;
|
||||
}
|
||||
code {
|
||||
background: rgba(0,0,0,0.2);
|
||||
padding: 2px 6px;
|
||||
border-radius: 4px;
|
||||
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
|
||||
}
|
||||
footer {
|
||||
position: absolute;
|
||||
bottom: 1rem;
|
||||
font-size: 0.8rem;
|
||||
opacity: 0.7;
|
||||
}
|
||||
</style>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<title><?= htmlspecialchars($projectName) ?> - 智能号码去重分批工具</title>
|
||||
|
||||
<!-- Fonts & Icons -->
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700;800&display=swap" rel="stylesheet">
|
||||
<script src="https://unpkg.com/lucide@latest"></script>
|
||||
|
||||
<!-- CSS -->
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
<link rel="stylesheet" href="assets/css/custom.css?v=<?= time() ?>">
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
<div class="card">
|
||||
<h1>Analyzing your requirements and generating your website…</h1>
|
||||
<div class="loader" role="status" aria-live="polite" aria-label="Applying initial changes">
|
||||
<span class="sr-only">Loading…</span>
|
||||
</div>
|
||||
<p class="hint"><?= ($_SERVER['HTTP_HOST'] ?? '') === 'appwizzy.com' ? 'AppWizzy' : 'Flatlogic' ?> AI is collecting your requirements and applying the first changes.</p>
|
||||
<p class="hint">This page will update automatically as the plan is implemented.</p>
|
||||
<p>Runtime: PHP <code><?= htmlspecialchars($phpVersion) ?></code> — UTC <code><?= htmlspecialchars($now) ?></code></p>
|
||||
</div>
|
||||
</main>
|
||||
<footer>
|
||||
Page updated: <?= htmlspecialchars($now) ?> (UTC)
|
||||
</footer>
|
||||
|
||||
<nav class="navbar">
|
||||
<div class="container">
|
||||
<a class="navbar-brand" href="/">
|
||||
<i data-lucide="zap" fill="currentColor"></i>
|
||||
<span><?= htmlspecialchars($projectName) ?></span>
|
||||
</a>
|
||||
<div class="d-flex align-items-center gap-3">
|
||||
<span class="text-muted small d-none d-md-inline">隐私安全:数据不经过服务器</span>
|
||||
<button class="btn btn-sm btn-light rounded-pill px-3" onclick="location.reload()">
|
||||
<i data-lucide="refresh-cw" style="width: 14px;"></i> 重置
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<header class="hero-section container">
|
||||
<h1>智能号码处理中心</h1>
|
||||
<p>支持万级号码一键去重、灵活分批。专注效率,保护隐私。</p>
|
||||
</header>
|
||||
|
||||
<main class="container pb-5">
|
||||
<div class="row g-4">
|
||||
<!-- Left: Input Area -->
|
||||
<div class="col-lg-7">
|
||||
<div class="card h-100 border-0">
|
||||
<div class="card-body p-4 p-md-5">
|
||||
<div class="d-flex justify-content-between align-items-center mb-4">
|
||||
<h4 class="fw-bold mb-0">1. 输入号码</h4>
|
||||
<div class="form-check form-switch mb-0">
|
||||
<input class="form-check-input" type="checkbox" id="autoDedupe" checked>
|
||||
<label class="form-check-label small fw-bold" for="autoDedupe">自动去重</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="dropzone" class="dropzone mb-4">
|
||||
<i data-lucide="upload-cloud"></i>
|
||||
<h5 class="fw-bold">点击或拖拽上传文件</h5>
|
||||
<p class="text-muted small mb-0">支持 TXT, CSV 等文本格式内容提取</p>
|
||||
<input type="file" id="fileInput" class="d-none">
|
||||
</div>
|
||||
|
||||
<div class="mb-4">
|
||||
<textarea id="numberInput" class="form-control" rows="12" placeholder="在此粘贴号码列表(每行一个或任意分隔符),系统会自动识别..."></textarea>
|
||||
</div>
|
||||
|
||||
<div class="stats-row">
|
||||
<div class="stat-item">
|
||||
<div class="stat-label">识别总数</div>
|
||||
<div class="stat-value" id="totalCount">0</div>
|
||||
</div>
|
||||
<div class="stat-item">
|
||||
<div class="stat-label">处理后数量</div>
|
||||
<div class="stat-value text-primary" id="uniqueCount">0</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Right: Settings & Results -->
|
||||
<div class="col-lg-5">
|
||||
<div class="sticky-panel">
|
||||
<div class="card border-0 mb-4">
|
||||
<div class="card-body p-4 p-md-5">
|
||||
<h4 class="fw-bold mb-4">2. 拆分配置</h4>
|
||||
|
||||
<div class="mb-4">
|
||||
<label class="form-label small fw-bold text-muted text-uppercase">分批模式</label>
|
||||
<select id="splitMode" class="form-select border-2">
|
||||
<option value="count">按分批份数 (平均分配或指定分配)</option>
|
||||
<option value="size">按每批固定额度 (每份 X 条)</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="mb-4">
|
||||
<label class="form-label small fw-bold text-muted text-uppercase">分批数值</label>
|
||||
<div class="input-group">
|
||||
<input type="number" id="splitValue" class="form-control border-2" value="2" min="1">
|
||||
<span class="input-group-text bg-light border-2 fw-bold" id="unitText">份</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Dynamic Inputs -->
|
||||
<div id="dynamicCountsContainer" class="mb-4 d-none">
|
||||
<label class="form-label small fw-bold text-muted text-uppercase mb-3">指定前 N-1 份的数量(末份自动补足)</label>
|
||||
<div id="dynamicInputsList"></div>
|
||||
</div>
|
||||
|
||||
<button id="splitBtn" class="btn btn-primary w-100 py-3 fs-5">
|
||||
<i data-lucide="scissors" class="me-2"></i> 开始智能拆分
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="resultsWrapper" class="mt-4">
|
||||
<div class="d-flex justify-content-between align-items-center mb-3">
|
||||
<h4 class="fw-bold mb-0">3. 处理结果</h4>
|
||||
<span id="batchCountBadge" class="badge bg-primary rounded-pill d-none">0 个批次</span>
|
||||
</div>
|
||||
<div id="resultsContainer">
|
||||
<div class="text-center py-5 text-muted bg-white rounded-4 border">
|
||||
<i data-lucide="inbox" style="width: 48px; height: 48px; opacity: 0.2;" class="mb-2"></i>
|
||||
<p class="small mb-0">等待拆分结果...</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<footer class="container py-5 text-center text-muted small border-top mt-5">
|
||||
<p class="mb-0">© <?= date('Y') ?> <?= htmlspecialchars($projectName) ?>. 本工具完全在您的浏览器中运行,绝不上传任何隐私数据。</p>
|
||||
</footer>
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
|
||||
<script>lucide.createIcons();</script>
|
||||
<script src="assets/js/main.js?v=<?= time() ?>"></script>
|
||||
</body>
|
||||
</html>
|
||||
Loading…
x
Reference in New Issue
Block a user