/* ===== RESET & BASE STYLES ===== */
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
:root {
/* Color Palette */
--primary-bg: #0a0a0f;
--secondary-bg: #1a1a2e;
--accent-bg: #16213e;
--card-bg: rgba(26, 26, 46, 0.9);
--border-color: rgba(120, 119, 198, 0.3);
--text-primary: #ffffff;
--text-secondary: #a0a0a0;
--text-accent: #f9e2af;
--gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
--gradient-secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
--gradient-accent: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
--shadow-light: 0 4px 20px rgba(0, 0, 0, 0.1);
--shadow-medium: 0 8px 32px rgba(0, 0, 0, 0.2);
--shadow-heavy: 0 16px 64px rgba(0, 0, 0, 0.3);
--border-radius: 16px;
--border-radius-large: 24px;
--transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
--transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}
body {
font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
background: var(--primary-bg);
color: var(--text-primary);
min-height: 100vh;
margin: 0;
padding: 0;
position: relative;
overflow-x: hidden;
line-height: 1.6;
font-weight: 400;
}
/* ===== BACKGROUND EFFECTS ===== */
body::before {
content: '';
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background:
radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.15) 0%, transparent 50%),
radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.15) 0%, transparent 50%),
radial-gradient(circle at 40% 40%, rgba(120, 219, 255, 0.1) 0%, transparent 50%),
linear-gradient(135deg, var(--primary-bg) 0%, var(--secondary-bg) 100%);
pointer-events: none;
z-index: -2;
animation: backgroundShift 20s ease-in-out infinite alternate;
}
@keyframes backgroundShift {
0% { transform: scale(1) rotate(0deg); }
100% { transform: scale(1.1) rotate(1deg); }
}
/* ===== FLOATING PARTICLES ===== */
.floating-particles {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
pointer-events: none;
z-index: -1;
overflow: hidden;
}
.particle {
position: absolute;
width: 2px;
height: 2px;
background: rgba(120, 119, 198, 0.6);
border-radius: 50%;
animation: float 6s ease-in-out infinite;
}
.particle:nth-child(1) { top: 10%; left: 10%; animation-delay: 0s; }
.particle:nth-child(2) { top: 20%; left: 80%; animation-delay: 1s; }
.particle:nth-child(3) { top: 60%; left: 20%; animation-delay: 2s; }
.particle:nth-child(4) { top: 80%; left: 70%; animation-delay: 3s; }
.particle:nth-child(5) { top: 40%; left: 90%; animation-delay: 4s; }
@keyframes float {
0%, 100% { transform: translateY(0px) translateX(0px); opacity: 0.3; }
50% { transform: translateY(-20px) translateX(10px); opacity: 1; }
}
/* ===== MAIN CONTAINER ===== */
.container {
max-width: 1200px;
margin: 0 auto;
padding: 40px 20px;
position: relative;
z-index: 1;
}
/* ===== HEADER SECTION ===== */
.header {
text-align: center;
margin-bottom: 60px;
position: relative;
}
.header::before {
content: '';
position: absolute;
top: -50px;
left: 50%;
transform: translateX(-50%);
width: 200px;
height: 200px;
background: var(--gradient-primary);
border-radius: 50%;
filter: blur(80px);
opacity: 0.3;
animation: headerGlow 4s ease-in-out infinite alternate;
}
@keyframes headerGlow {
0% { opacity: 0.2; transform: translateX(-50%) scale(1); }
100% { opacity: 0.4; transform: translateX(-50%) scale(1.1); }
}
.logo {
display: flex;
align-items: center;
justify-content: center;
gap: 24px;
margin-bottom: 20px;
position: relative;
z-index: 2;
}
.logo-icon {
position: relative;
width: 80px;
height: 80px;
background: var(--gradient-primary);
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
box-shadow: var(--shadow-heavy);
animation: logoFloat 3s ease-in-out infinite;
overflow: hidden;
}
.logo-icon::before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.2) 50%, transparent 70%);
animation: logoShine 2s ease-in-out infinite;
}
@keyframes logoShine {
0% { transform: translateX(-100%); }
100% { transform: translateX(100%); }
}
.logo-icon i {
font-size: 2.5rem;
color: white;
z-index: 1;
}
@keyframes logoFloat {
0%, 100% { transform: translateY(0px) rotate(0deg); }
50% { transform: translateY(-15px) rotate(5deg); }
}
.logo h1 {
font-size: 3rem;
font-weight: 800;
background: var(--gradient-primary);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
letter-spacing: -0.02em;
text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
position: relative;
}
.logo h1::after {
content: attr(data-text);
position: absolute;
top: 0;
left: 0;
background: linear-gradient(45deg, #f9e2af, #cba6f7, #f38ba8);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
opacity: 0;
animation: textGlow 3s ease-in-out infinite;
}
@keyframes textGlow {
0%, 100% { opacity: 0; }
50% { opacity: 0.8; }
}
.subtitle {
color: var(--text-secondary);
font-size: 1.25rem;
font-weight: 400;
margin-top: 16px;
opacity: 0.8;
animation: fadeInUp 0.8s ease-out 0.3s both;
}
/* ===== MAIN CONTENT ===== */
.main-content {
display: grid;
gap: 40px;
animation: fadeInUp 0.8s ease-out 0.5s both;
}
/* ===== SECTIONS ===== */
.section {
background: var(--card-bg);
border-radius: var(--border-radius-large);
padding: 40px;
border: 1px solid var(--border-color);
backdrop-filter: blur(20px);
box-shadow: var(--shadow-medium);
transition: var(--transition);
position: relative;
overflow: hidden;
}
.section::before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
height: 1px;
background: var(--gradient-primary);
opacity: 0.5;
}
.section:hover {
transform: translateY(-4px);
box-shadow: var(--shadow-heavy);
border-color: rgba(120, 119, 198, 0.5);
}
.section h3 {
font-size: 1.5rem;
font-weight: 600;
color: var(--text-accent);
margin-bottom: 24px;
display: flex;
align-items: center;
gap: 12px;
}
.section h3 i {
font-size: 1.25rem;
color: #667eea;
}
/* ===== INPUT SECTION ===== */
.input-section {
position: relative;
}
.file-upload-area {
margin-bottom: 20px;
}
.file-upload-btn {
display: inline-flex;
align-items: center;
gap: 8px;
padding: 12px 20px;
background: var(--gradient-secondary);
color: white;
border: none;
border-radius: 12px;
font-size: 0.9rem;
font-weight: 500;
cursor: pointer;
transition: var(--transition);
box-shadow: var(--shadow-light);
}
.file-upload-btn:hover {
transform: translateY(-2px);
box-shadow: var(--shadow-medium);
}
.file-upload-btn input[type="file"] {
display: none;
}
/* ===== TEXTAREA STYLING ===== */
textarea {
width: 100%;
min-height: 200px;
padding: 20px;
background: rgba(10, 10, 15, 0.8);
border: 1px solid var(--border-color);
border-radius: 12px;
color: var(--text-primary);
font-family: 'JetBrains Mono', 'Fira Code', monospace;
font-size: 0.9rem;
line-height: 1.6;
resize: vertical;
transition: var(--transition);
backdrop-filter: blur(10px);
}
textarea:focus {
outline: none;
border-color: #667eea;
box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
background: rgba(10, 10, 15, 0.9);
}
textarea::placeholder {
color: var(--text-secondary);
opacity: 0.6;
}
/* ===== SETTINGS SECTION ===== */
.settings-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
gap: 24px;
}
.setting-group {
position: relative;
}
.setting-group label {
display: flex;
align-items: flex-start;
gap: 16px;
padding: 20px;
background: rgba(10, 10, 15, 0.5);
border-radius: 12px;
border: 1px solid var(--border-color);
cursor: pointer;
transition: var(--transition);
position: relative;
overflow: hidden;
}
.setting-group label::before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: var(--gradient-primary);
opacity: 0;
transition: var(--transition);
z-index: 0;
}
.setting-group label:hover::before {
opacity: 0.1;
}
.setting-group label:hover {
transform: translateY(-2px);
border-color: #667eea;
}
.setting-group input[type="checkbox"] {
position: relative;
z-index: 1;
width: 20px;
height: 20px;
accent-color: #667eea;
cursor: pointer;
}
.setting-content {
position: relative;
z-index: 1;
flex: 1;
}
.setting-label {
display: block;
font-weight: 600;
color: var(--text-primary);
margin-bottom: 4px;
font-size: 1rem;
}
.setting-description {
color: var(--text-secondary);
font-size: 0.9rem;
line-height: 1.5;
}
/* ===== ACTION BUTTONS ===== */
.action-buttons {
display: flex;
gap: 16px;
justify-content: center;
flex-wrap: wrap;
}
.btn {
display: inline-flex;
align-items: center;
gap: 12px;
padding: 16px 32px;
border: none;
border-radius: 12px;
font-size: 1rem;
font-weight: 600;
cursor: pointer;
transition: var(--transition);
position: relative;
overflow: hidden;
text-decoration: none;
min-width: 160px;
justify-content: center;
}
.btn::before {
content: '';
position: absolute;
top: 0;
left: -100%;
width: 100%;
height: 100%;
background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
transition: var(--transition);
}
.btn:hover::before {
left: 100%;
}
.btn-primary {
background: var(--gradient-primary);
color: white;
box-shadow: var(--shadow-light);
}
.btn-primary:hover {
transform: translateY(-3px);
box-shadow: var(--shadow-medium);
}
.btn-secondary {
background: rgba(255, 255, 255, 0.1);
color: var(--text-primary);
border: 1px solid var(--border-color);
backdrop-filter: blur(10px);
}
.btn-secondary:hover {
background: rgba(255, 255, 255, 0.15);
transform: translateY(-2px);
border-color: #667eea;
}
.btn-small {
padding: 12px 20px;
font-size: 0.9rem;
min-width: auto;
}
/* ===== OUTPUT SECTION ===== */
.output-container {
position: relative;
}
.output-actions {
display: flex;
gap: 12px;
margin-top: 16px;
flex-wrap: wrap;
}
/* ===== MACHO INFO SECTION ===== */
.macho-info, .macho-examples {
background: var(--card-bg);
border-radius: var(--border-radius-large);
padding: 40px;
border: 1px solid var(--border-color);
backdrop-filter: blur(20px);
box-shadow: var(--shadow-medium);
}
.api-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
gap: 24px;
margin-top: 24px;
}
.api-card {
background: rgba(10, 10, 15, 0.6);
border-radius: 12px;
padding: 24px;
border: 1px solid var(--border-color);
transition: var(--transition);
position: relative;
overflow: hidden;
}
.api-card::before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
height: 2px;
background: var(--gradient-accent);
opacity: 0;
transition: var(--transition);
}
.api-card:hover {
transform: translateY(-4px);
border-color: #4facfe;
}
.api-card:hover::before {
opacity: 1;
}
.api-card h4 {
color: var(--text-accent);
font-size: 1.1rem;
font-weight: 600;
margin-bottom: 12px;
display: flex;
align-items: center;
gap: 8px;
}
.api-card code {
display: block;
background: rgba(0, 0, 0, 0.3);
padding: 12px;
border-radius: 8px;
font-family: 'JetBrains Mono', monospace;
font-size: 0.85rem;
color: #4facfe;
margin: 12px 0;
border-left: 3px solid #4facfe;
}
.api-card p {
color: var(--text-secondary);
font-size: 0.9rem;
line-height: 1.6;
}
/* ===== EXAMPLE SECTION ===== */
.example-container {
margin-top: 24px;
}
.example-container h4 {
color: var(--text-accent);
font-size: 1.2rem;
margin-bottom: 16px;
}
.example-container pre {
background: rgba(0, 0, 0, 0.4);
border-radius: 12px;
padding: 24px;
overflow-x: auto;
border: 1px solid var(--border-color);
position: relative;
}
.example-container code {
font-family: 'JetBrains Mono', monospace;
font-size: 0.85rem;
line-height: 1.6;
color: var(--text-primary);
}
/* ===== FOOTER ===== */
.footer {
text-align: center;
margin-top: 60px;
padding: 40px 0;
color: var(--text-secondary);
font-size: 0.9rem;
border-top: 1px solid var(--border-color);
opacity: 0.8;
}
/* ===== FLOATING ELEMENTS ===== */
.floating-elements {
position: fixed;
top: 20px;
right: 20px;
display: flex;
flex-direction: column;
gap: 16px;
z-index: 1000;
}
.fab-arrow {
width: 56px;
height: 56px;
background: var(--gradient-primary);
border: none;
border-radius: 50%;
color: white;
font-size: 1.2rem;
cursor: pointer;
box-shadow: var(--shadow-medium);
transition: var(--transition);
display: flex;
align-items: center;
justify-content: center;
animation: fabFloat 3s ease-in-out infinite;
}
.fab-arrow:hover {
transform: translateY(-4px) scale(1.1);
box-shadow: var(--shadow-heavy);
}
@keyframes fabFloat {
0%, 100% { transform: translateY(0px); }
50% { transform: translateY(-8px); }
}
.status-indicator {
background: rgba(10, 10, 15, 0.9);
border-radius: 12px;
padding: 12px 16px;
display: flex;
align-items: center;
gap: 8px;
border: 1px solid var(--border-color);
backdrop-filter: blur(10px);
box-shadow: var(--shadow-light);
animation: slideInRight 0.5s ease-out;
}
.status-dot {
width: 8px;
height: 8px;
border-radius: 50%;
background: #a6e3a1;
animation: pulse 2s ease-in-out infinite;
}
.status-dot.ready { background: #a6e3a1; }
.status-dot.processing { background: #f9e2af; animation: pulse 1s ease-in-out infinite; }
.status-dot.success { background: #a6e3a1; }
.status-dot.error { background: #f38ba8; }
.status-text {
font-size: 0.85rem;
color: var(--text-secondary);
font-weight: 500;
}
@keyframes pulse {
0%, 100% { opacity: 1; transform: scale(1); }
50% { opacity: 0.7; transform: scale(1.2); }
}
@keyframes slideInRight {
from { transform: translateX(100%); opacity: 0; }
to { transform: translateX(0); opacity: 1; }
}
/* ===== PROGRESS BAR ===== */
.progress-bar {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 4px;
background: rgba(255, 255, 255, 0.1);
z-index: 1001;
overflow: hidden;
}
.progress-fill {
height: 100%;
background: var(--gradient-primary);
width: 0%;
transition: width 0.3s ease;
position: relative;
}
.progress-fill::after {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
animation: progressShine 2s ease-in-out infinite;
}
@keyframes progressShine {
0% { transform: translateX(-100%); }
100% { transform: translateX(100%); }
}
/* ===== NOTIFICATIONS ===== */
.message {
position: fixed;
top: 20px;
left: 50%;
transform: translateX(-50%);
padding: 16px 24px;
border-radius: 12px;
color: white;
font-weight: 500;
z-index: 1002;
animation: slideInDown 0.3s ease-out;
box-shadow: var(--shadow-medium);
backdrop-filter: blur(10px);
}
.message.success {
background: linear-gradient(135deg, #a6e3a1, #89dceb);
border: 1px solid rgba(166, 227, 161, 0.3);
}
.message.error {
background: linear-gradient(135deg, #f38ba8, #f9e2af);
border: 1px solid rgba(243, 139, 168, 0.3);
}
@keyframes slideInDown {
from { transform: translateX(-50%) translateY(-100%); opacity: 0; }
to { transform: translateX(-50%) translateY(0); opacity: 1; }
}
/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
from {
opacity: 0;
transform: translateY(30px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
width: 8px;
}
::-webkit-scrollbar-track {
background: rgba(255, 255, 255, 0.1);
border-radius: 4px;
}
::-webkit-scrollbar-thumb {
background: var(--gradient-primary);
border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
background: var(--gradient-secondary);
}
/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
.container {
padding: 20px 16px;
}
.section {
padding: 24px;
}
.logo h1 {
font-size: 2rem;
}
.logo-icon {
width: 60px;
height: 60px;
}
.logo-icon i {
font-size: 2rem;
}
.settings-grid {
grid-template-columns: 1fr;
}
.action-buttons {
flex-direction: column;
align-items: center;
}
.btn {
width: 100%;
max-width: 300px;
}
.output-actions {
flex-direction: column;
}
.api-grid {
grid-template-columns: 1fr;
}
.floating-elements {
top: 10px;
right: 10px;
}
.fab-arrow {
width: 48px;
height: 48px;
font-size: 1rem;
}
.status-indicator {
padding: 8px 12px;
}
}
@media (max-width: 480px) {
.logo {
flex-direction: column;
gap: 16px;
}
.logo h1 {
font-size: 1.75rem;
text-align: center;
}
.section {
padding: 20px;
}
.btn {
padding: 14px 24px;
font-size: 0.9rem;
}
.floating-elements {
position: static;
margin-top: 20px;
align-items: center;
}
}
/* ===== UTILITY CLASSES ===== */
.hidden {
display: none !important;
}
.fade-in {
animation: fadeInUp 0.5s ease-out;
}
.slide-in {
animation: slideInRight 0.5s ease-out;
}
.glow {
box-shadow: 0 0 20px rgba(102, 126, 234, 0.3);
}
/* ===== LOADING STATES ===== */
.loading {
position: relative;
overflow: hidden;
}
.loading::after {
content: '';
position: absolute;
top: 0;
left: -100%;
width: 100%;
height: 100%;
background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
animation: loading 1.5s ease-in-out infinite;
}
@keyframes loading {
0% { left: -100%; }
100% { left: 100%; }
}
/* ===== MACHO API DOCUMENTATION ===== */
.macho-api-docs {
background: var(--card-bg);
border-radius: var(--border-radius-large);
padding: 40px;
border: 1px solid var(--border-color);
backdrop-filter: blur(20px);
box-shadow: var(--shadow-medium);
margin-bottom: 40px;
}
.macho-api-docs h3 {
color: var(--text-accent);
font-size: 1.8rem;
font-weight: 700;
margin-bottom: 20px;
display: flex;
align-items: center;
gap: 12px;
}
.macho-api-docs > p {
color: var(--text-secondary);
font-size: 1.1rem;
margin-bottom: 30px;
line-height: 1.6;
}
/* API Categories */
.api-category {
margin-bottom: 40px;
background: rgba(10, 10, 15, 0.4);
border-radius: 16px;
padding: 24px;
border: 1px solid rgba(120, 119, 198, 0.2);
transition: var(--transition);
}
.api-category:hover {
border-color: rgba(120, 119, 198, 0.4);
transform: translateY(-2px);
box-shadow: var(--shadow-light);
}
.api-category h4 {
color: var(--text-accent);
font-size: 1.3rem;
font-weight: 600;
margin-bottom: 20px;
display: flex;
align-items: center;
gap: 10px;
padding-bottom: 12px;
border-bottom: 2px solid var(--gradient-primary);
}
.api-category h4 i {
color: #667eea;
font-size: 1.2rem;
}
/* API Functions */
.api-functions {
display: grid;
gap: 16px;
}
.api-function {
background: rgba(0, 0, 0, 0.3);
border-radius: 12px;
padding: 20px;
border-left: 4px solid #667eea;
transition: var(--transition);
position: relative;
overflow: hidden;
}
.api-function::before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
height: 1px;
background: var(--gradient-primary);
opacity: 0;
transition: var(--transition);
}
.api-function:hover {
background: rgba(0, 0, 0, 0.5);
transform: translateX(4px);
border-left-color: #4facfe;
}
.api-function:hover::before {
opacity: 1;
}
.api-function code {
display: block;
background: rgba(0, 0, 0, 0.4);
padding: 16px;
border-radius: 8px;
font-family: 'JetBrains Mono', monospace;
font-size: 0.9rem;
color: #4facfe;
margin-bottom: 12px;
border: 1px solid rgba(79, 172, 254, 0.2);
line-height: 1.5;
overflow-x: auto;
white-space: nowrap;
}
.api-function p {
color: var(--text-secondary);
font-size: 0.95rem;
line-height: 1.6;
margin: 0;
}
/* Enhanced Examples Section */
.macho-examples {
background: var(--card-bg);
border-radius: var(--border-radius-large);
padding: 40px;
border: 1px solid var(--border-color);
backdrop-filter: blur(20px);
box-shadow: var(--shadow-medium);
margin-bottom: 40px;
}
.macho-examples h3 {
color: var(--text-accent);
font-size: 1.8rem;
font-weight: 700;
margin-bottom: 30px;
display: flex;
align-items: center;
gap: 12px;
position: relative;
}
.macho-examples h3::after {
content: '';
position: absolute;
bottom: -8px;
left: 0;
width: 60px;
height: 3px;
background: var(--gradient-primary);
border-radius: 2px;
}
.example-container {
margin-bottom: 40px;
background: rgba(10, 10, 15, 0.4);
border-radius: 16px;
padding: 24px;
border: 1px solid rgba(120, 119, 198, 0.2);
transition: var(--transition);
position: relative;
overflow: hidden;
}
.example-container::before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
height: 2px;
background: var(--gradient-primary);
opacity: 0;
transition: var(--transition);
}
.example-container:hover {
border-color: rgba(120, 119, 198, 0.4);
transform: translateY(-4px);
box-shadow: var(--shadow-medium);
background: rgba(10, 10, 15, 0.6);
}
.example-container:hover::before {
opacity: 1;
}
.example-container h4 {
color: var(--text-accent);
font-size: 1.2rem;
font-weight: 600;
margin-bottom: 16px;
display: flex;
align-items: center;
gap: 8px;
position: relative;
}
.example-container h4::before {
content: '📝';
font-size: 1.1rem;
animation: iconBounce 2s ease-in-out infinite;
}
@keyframes iconBounce {
0%, 100% { transform: translateY(0); }
50% { transform: translateY(-2px); }
}
.example-container pre {
background: rgba(0, 0, 0, 0.5);
border-radius: 12px;
padding: 24px;
overflow-x: auto;
border: 1px solid var(--border-color);
position: relative;
margin: 0;
font-family: 'JetBrains Mono', monospace;
font-size: 0.85rem;
line-height: 1.6;
}
.example-container pre::before {
content: 'Lua';
position: absolute;
top: 8px;
right: 12px;
background: var(--gradient-primary);
color: white;
padding: 4px 8px;
border-radius: 6px;
font-size: 0.75rem;
font-weight: 600;
font-family: 'Inter', sans-serif;
z-index: 1;
}
.example-container pre::after {
content: '';
position: absolute;
top: 0;
right: 0;
bottom: 0;
width: 4px;
background: var(--gradient-primary);
border-radius: 0 12px 12px 0;
}
.example-container code {
font-family: 'JetBrains Mono', monospace;
font-size: 0.85rem;
line-height: 1.6;
color: var(--text-primary);
display: block;
white-space: pre-wrap;
word-break: break-word;
}
/* Enhanced Code Syntax Highlighting */
.example-container code .comment {
color: #6a737d;
font-style: italic;
}
.example-container code .keyword {
color: #d73a49;
font-weight: 600;
}
.example-container code .string {
color: #032f62;
}
.example-container code .function {
color: #6f42c1;
}
.example-container code .number {
color: #005cc5;
}
.example-container code .variable {
color: #e36209;
}
.example-container code .operator {
color: #d73a49;
}
/* Code Block Scrollbar */
.example-container pre::-webkit-scrollbar {
height: 6px;
}
.example-container pre::-webkit-scrollbar-track {
background: rgba(255, 255, 255, 0.1);
border-radius: 3px;
}
.example-container pre::-webkit-scrollbar-thumb {
background: var(--gradient-primary);
border-radius: 3px;
}
.example-container pre::-webkit-scrollbar-thumb:hover {
background: var(--gradient-secondary);
}
/* Example Container Types */
.example-container.basic {
border-left: 4px solid #a6e3a1;
}
.example-container.basic h4::before {
content: '🔰';
}
.example-container.advanced {
border-left: 4px solid #f9e2af;
}
.example-container.advanced h4::before {
content: '⚡';
}
.example-container.security {
border-left: 4px solid #f38ba8;
}
.example-container.security h4::before {
content: '🔒';
}
.example-container.auth {
border-left: 4px solid #89dceb;
}
.example-container.auth h4::before {
content: '🔑';
}
.example-container.injection {
border-left: 4px solid #cba6f7;
}
.example-container.injection h4::before {
content: '💉';
}
/* Copy Button for Code Blocks */
.example-container {
position: relative;
}
.copy-code-btn {
position: absolute;
top: 8px;
right: 50px;
background: rgba(255, 255, 255, 0.1);
border: 1px solid rgba(255, 255, 255, 0.2);
color: var(--text-secondary);
padding: 4px 8px;
border-radius: 6px;
font-size: 0.7rem;
font-weight: 500;
cursor: pointer;
transition: var(--transition);
z-index: 2;
font-family: 'Inter', sans-serif;
}
.copy-code-btn:hover {
background: rgba(255, 255, 255, 0.2);
color: var(--text-primary);
transform: translateY(-1px);
}
.copy-code-btn.copied {
background: #a6e3a1;
color: #000;
border-color: #a6e3a1;
}
/* Enhanced Hover Effects */
.example-container:hover .copy-code-btn {
opacity: 1;
}
/* Code Line Numbers */
.example-container pre {
counter-reset: line;
}
.example-container code {
position: relative;
padding-left: 3.5em;
}
.example-container code::before {
content: counter(line);
counter-increment: line;
position: absolute;
left: 0;
color: #6a737d;
font-size: 0.8rem;
font-weight: 500;
width: 2.5em;
text-align: right;
padding-right: 1em;
border-right: 1px solid rgba(255, 255, 255, 0.1);
background: rgba(0, 0, 0, 0.3);
margin-left: -3.5em;
padding-left: 0.5em;
padding-top: 0.1em;
padding-bottom: 0.1em;
}
/* Responsive Design for Examples */
@media (max-width: 768px) {
.macho-examples {
padding: 24px;
}
.example-container {
padding: 20px;
margin-bottom: 30px;
}
.example-container h4 {
font-size: 1.1rem;
}
.example-container pre {
padding: 16px;
font-size: 0.8rem;
}
.example-container code {
font-size: 0.8rem;
padding-left: 2.5em;
}
.example-container code::before {
width: 2em;
margin-left: -2.5em;
font-size: 0.75rem;
}
.copy-code-btn {
right: 40px;
padding: 3px 6px;
font-size: 0.65rem;
}
}
@media (max-width: 480px) {
.macho-examples h3 {
font-size: 1.5rem;
}
.example-container {
padding: 16px;
margin-bottom: 24px;
}
.example-container h4 {
font-size: 1rem;
}
.example-container pre {
padding: 12px;
font-size: 0.75rem;
}
.example-container code {
font-size: 0.75rem;
padding-left: 2em;
}
.example-container code::before {
width: 1.5em;
margin-left: -2em;
font-size: 0.7rem;
}
.copy-code-btn {
right: 30px;
padding: 2px 4px;
font-size: 0.6rem;
}
}
/* Animation for Example Containers */
.example-container {
animation: slideInUp 0.6s ease-out;
}
.example-container:nth-child(1) { animation-delay: 0.1s; }
.example-container:nth-child(2) { animation-delay: 0.2s; }
.example-container:nth-child(3) { animation-delay: 0.3s; }
.example-container:nth-child(4) { animation-delay: 0.4s; }
.example-container:nth-child(5) { animation-delay: 0.5s; }
.example-container:nth-child(6) { animation-delay: 0.6s; }
@keyframes slideInUp {
from {
opacity: 0;
transform: translateY(30px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
/* Focus States for Accessibility */
.example-container:focus-within {
border-color: #667eea;
box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}
/* Print Styles */
@media print {
.example-container {
break-inside: avoid;
border: 1px solid #ccc;
background: white;
color: black;
}
.example-container pre {
background: #f5f5f5;
border: 1px solid #ddd;
}
.copy-code-btn {
display: none;
}
}
/* ===== SETTINGS BUTTON & POPUP ===== */
.settings-btn {
width: 56px;
height: 56px;
background: var(--gradient-primary);
border: none;
border-radius: 50%;
color: white;
font-size: 1.5rem;
cursor: pointer;
box-shadow: var(--shadow-medium);
transition: var(--transition);
display: flex;
align-items: center;
justify-content: center;
margin-bottom: 8px;
position: relative;
z-index: 1101;
}
.settings-btn:hover {
transform: scale(1.08) rotate(10deg);
box-shadow: var(--shadow-heavy);
background: var(--gradient-secondary);
}
.settings-popup {
position: absolute;
top: 70px;
right: 0;
min-width: 270px;
background: var(--card-bg);
border-radius: 18px;
box-shadow: var(--shadow-heavy);
border: 1px solid var(--border-color);
padding: 0;
z-index: 1102;
animation: fadeInUp 0.3s cubic-bezier(0.4,0,0.2,1);
display: flex;
flex-direction: column;
gap: 0;
}
.settings-popup.hidden {
display: none !important;
}
.settings-popup-header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 18px 22px 10px 22px;
border-bottom: 1px solid var(--border-color);
font-size: 1.1rem;
font-weight: 600;
color: var(--text-accent);
background: transparent;
}
.settings-popup-header i {
color: #667eea;
margin-right: 8px;
}
.close-settings {
background: none;
border: none;
color: var(--text-secondary);
font-size: 1.2rem;
cursor: pointer;
transition: color 0.2s;
}
.close-settings:hover {
color: #f38ba8;
}
.settings-popup-content {
padding: 18px 22px 18px 22px;
display: flex;
flex-direction: column;
gap: 18px;
}
.settings-group {
display: flex;
flex-direction: column;
gap: 6px;
margin-bottom: 0;
}
.settings-group label {
font-size: 1rem;
color: var(--text-primary);
font-weight: 500;
display: flex;
align-items: center;
gap: 8px;
}
.settings-group select {
padding: 8px 12px;
border-radius: 8px;
border: 1px solid var(--border-color);
background: rgba(30,30,46,0.7);
color: var(--text-primary);
font-size: 1rem;
font-family: inherit;
margin-top: 2px;
transition: var(--transition);
}
.settings-group select:focus {
outline: none;
border-color: #667eea;
box-shadow: 0 0 0 2px rgba(102,126,234,0.15);
}
.settings-link {
color: #89dceb;
text-decoration: none;
font-size: 1rem;
display: flex;
align-items: center;
gap: 8px;
transition: color 0.2s;
}
.settings-link:hover {
color: #f9e2af;
text-decoration: underline;
}
#reset-settings {
background: linear-gradient(90deg, #f38ba8, #cba6f7);
color: #23243a;
border: none;
font-weight: 600;
margin-top: 4px;
transition: var(--transition);
}
#reset-settings:hover {
background: linear-gradient(90deg, #cba6f7, #f38ba8);
color: #fff;
}
/* RTL Support for Arabic */
:root[dir="rtl"] .settings-popup, :root[dir="rtl"] .settings-popup-header, :root[dir="rtl"] .settings-popup-content {
direction: rtl;
}
:root[dir="rtl"] .settings-popup {
right: auto;
left: 0;
}
:root[dir="rtl"] .settings-popup-header i {
margin-right: 0;
margin-left: 8px;
}
@media (max-width: 600px) {
.settings-popup {
min-width: 200px;
right: 0;
left: auto;
}
:root[dir="rtl"] .settings-popup {
left: 0;
right: auto;
}
}
Process Lua Code
Clear All
Macho API Features
Macho API provides advanced security and error handling for your Lua triggers. Here are the key features:
Security Enhancement
MachoSetLoggerState(0)
Disables logging during execution for enhanced security and performance.
Error Handling
pcall(function() ... end)
Wraps your code in protected calls to prevent crashes and handle errors gracefully.
Notifications
MachoMenuNotification("SUCCESS", "Message")
Provides user-friendly notifications for success and error states.
Timing Control
Citizen.Wait(100)
Ensures proper timing and prevents blocking operations.
Complete Macho API Documentation
Comprehensive guide to all Macho API functions for FiveM Lua development:
Window Management
MachoMenuWindow(PositionX, PositionY, EndPositionX, EndPositionY)
Creates a new menu window and returns a handle reference.
MachoMenuTabbedWindow(Name, PosX, PosY, SizeX, SizeY, TabSectionWidth)
Creates a tabbed window interface.
MachoMenuDestroy(WindowReference)
Destroys the specified menu window.
MachoMenuSetAccent(WindowReference, r, g, b)
Sets the accent color for the menu window.
MachoMenuSetKeybind(WindowReference, Keybind)
Sets the keybind for menu toggle (use virtual key codes).
MachoMenuIsOpen(WindowReference)
Returns true if the menu window is currently open.
Widget Management
MachoMenuGroup(WindowReference, Name, PositionX, PositionY, EndPositionX, EndPositionY)
Creates a group section within a window.
MachoMenuAddTab(WindowReference, Name)
Adds a tab to the window and returns a tab reference.
MachoMenuSmallText(WindowReference, Text)
Adds small text to the window.
Interactive Widgets
MachoMenuButton(GroupReference, Name, Callback)
Creates a clickable button with callback function.
MachoMenuCheckbox(GroupReference, Name, CallbackEnabled, CallbackDisabled)
Creates a checkbox with enable/disable callbacks.
MachoMenuSlider(GroupReference, Name, DefaultValue, Minimum, Maximum, Unit, DecimalPrecision, Callback)
Creates a slider with value range and callback.
MachoMenuText(GroupReference, Text)
Adds static text to a group.
MachoMenuInputbox(GroupReference, Text, Placeholder)
Creates an input box for text entry.
MachoMenuGetInputbox(WidgetReference)
Gets the current value from an input box.
MachoMenuSetText(WidgetReference, Text)
Updates the text of any widget.
MachoMenuDropDown(GroupReference, Name, Callback, Selectable1, Selectable2...)
Creates a dropdown menu with options.
MachoMenuKeybind(GroupReference, Name, DefaultKey, Callback)
Creates a keybind selector with callback.
Security & Logging
MachoGetLoggerState()
Returns the current logger state (enabled/disabled bits).
MachoSetLoggerState(state)
Sets the logger state (0 = all disabled, 3 = all enabled).
MachoLockLogger()
Completely locks the event logger (irreversible until reload).
Resource Management
MachoInjectResource(Resource, Code)
Injects Lua code into a specific resource.
MachoHijackResource(ResourceName)
Injects the complete script into a resource (use at file start).
MachoResourceStop(Resource)
Stops a specific resource.
MachoResourceStart(Resource)
Starts a specific resource.
Authentication
MachoAuthenticationKey()
Returns the user's current authentication key.
MachoWebRequest(URL)
Makes a web request and returns the response body.
Notifications
MachoMenuNotification(Title, Description)
Displays a Macho-style notification to the user.
API Usage Examples
Complete Menu Example:
-- Create main window
local mainWindow = MachoMenuWindow(100, 100, 400, 600)
MachoMenuSetKeybind(mainWindow, 0x2E) -- DELETE key
-- Create tabs
local tab1 = MachoMenuAddTab(mainWindow, "Main")
local tab2 = MachoMenuAddTab(mainWindow, "Settings")
-- Create groups
local group1 = MachoMenuGroup(tab1, "Actions", 10, 50, 380, 200)
local group2 = MachoMenuGroup(tab2, "Configuration", 10, 50, 380, 300)
-- Add widgets to group1
MachoMenuButton(group1, "Execute Trigger", function()
-- Your trigger code here
TriggerEvent('esx:getSharedObject')
MachoMenuNotification("SUCCESS", "Trigger executed!")
end)
MachoMenuCheckbox(group1, "Enable Feature",
function() print("Feature enabled") end,
function() print("Feature disabled") end
)
local slider = MachoMenuSlider(group1, "Speed", 50, 0, 100, "km/h", 0, function(value)
print("Speed set to: " .. value)
end)
-- Add widgets to group2
local inputBox = MachoMenuInputbox(group2, "Player Name", "Enter name...")
MachoMenuButton(group2, "Get Name", function()
local name = MachoMenuGetInputbox(inputBox)
print("Player name: " .. name)
end)
MachoMenuDropDown(group2, "Vehicle Type", function(selection)
print("Selected: " .. selection)
end, "Car", "Bike", "Plane", "Boat")
MachoMenuKeybind(group2, "Teleport Key", 0, function(key, toggle)
print("Key pressed: " .. key .. ", Toggle: " .. tostring(toggle))
end)
Advanced Menu Layout with Multiple Sections:
-- Advanced menu layout with calculated sections
local MenuSize = vec2(600, 350)
local MenuStartCoords = vec2(500, 500)
local TabsBarWidth = 0 -- The width of the tabs bar, height is assumed to be MenuHeight as it goes top to bottom
local SectionChildWidth = MenuSize.x - TabsBarWidth -- The total size for sections on the left hand side
local SectionsCount = 3
local SectionsPadding = 10 -- pixels between each section (that makes SetionCount + 1 = total padding areas)
local MachoPaneGap = 10 -- Hard coded gap of accent at the top.
-- Therefore each section width must be:
local EachSectionWidth = (SectionChildWidth - (SectionsPadding * (SectionsCount + 1))) / SectionsCount
-- Now you have each sections absolute width, you can calculate their X coordinate and Y coordinate
local SectionOneStart = vec2(TabsBarWidth + (SectionsPadding * 1) + (EachSectionWidth * 0), SectionsPadding + MachoPaneGap)
local SectionOneEnd = vec2(SectionOneStart.x + EachSectionWidth, MenuSize.y - SectionsPadding)
local SectionTwoStart = vec2(TabsBarWidth + (SectionsPadding * 2) + (EachSectionWidth * 1), SectionsPadding + MachoPaneGap)
local SectionTwoEnd = vec2(SectionTwoStart.x + EachSectionWidth, MenuSize.y - SectionsPadding)
local SectionThreeStart = vec2(TabsBarWidth + (SectionsPadding * 3) + (EachSectionWidth * 2), SectionsPadding + MachoPaneGap)
local SectionThreeEnd = vec2(SectionThreeStart.x + EachSectionWidth, MenuSize.y - SectionsPadding)
-- Create our window, MenuStartCoords is where the menu starts
MenuWindow = MachoMenuWindow(MenuStartCoords.x, MenuStartCoords.y, MenuSize.x, MenuSize.y)
MachoMenuSetAccent(MenuWindow, 137, 52, 235)
-- First section
FirstSection = MachoMenuGroup(MenuWindow, "Section One", SectionOneStart.x, SectionOneStart.y, SectionOneEnd.x, SectionOneEnd.y)
MachoMenuButton(FirstSection, "Close", function()
MachoMenuDestroy(MenuWindow)
end)
-- Second section
SecondSection = MachoMenuGroup(MenuWindow, "Section Two", SectionTwoStart.x, SectionTwoStart.y, SectionTwoEnd.x, SectionTwoEnd.y)
MenuSliderHandle = MachoMenuSlider(SecondSection, "Slider", 10, 0, 100, "%", 0, function(Value)
print("Slider updated with value ".. Value)
end)
MachoMenuCheckbox(SecondSection, "Checkbox",
function()
print("Enabled")
end,
function()
print("Disabled")
end
)
TextHandle = MachoMenuText(SecondSection, "SomeText")
MachoMenuButton(SecondSection, "Change Text Example", function()
MachoMenuSetText(TextHandle, "ChangedText")
end)
-- Third section
ThirdSection = MachoMenuGroup(MenuWindow, "Section Three", SectionThreeStart.x, SectionThreeStart.y, SectionThreeEnd.x, SectionThreeEnd.y)
InputBoxHandle = MachoMenuInputbox(ThirdSection, "Input", "...")
MachoMenuButton(ThirdSection, "Print Input", function()
local LocatedText = MachoMenuGetInputbox(InputBoxHandle)
print(LocatedText)
end)
DropDownHandle = MachoMenuDropDown(ThirdSection, "Drop Down",
function(Index)
print("New Value is " .. Index)
end,
"Selectable 1",
"Selectable 2",
"Selectable 3"
)
Basic Menu Layout Example:
-- Basic menu layout with 3 sections
local MenuSize = vec2(500, 300)
local MenuStartCoords = vec2(500, 500)
local TabsBarWidth = 0 -- The width of the tabs bar, height is assumed to be MenuHeight as it goes top to bottom
local SectionChildWidth = MenuSize.x - TabsBarWidth -- The total size for sections on the left hand side
local SectionsCount = 3
local SectionsPadding = 10 -- pixels between each section (that makes SetionCount + 1 = total padding areas)
local MachoPaneGap = 10 -- Hard coded gap of accent at the top.
-- Therefore each section width must be:
local EachSectionWidth = (SectionChildWidth - (SectionsPadding * (SectionsCount + 1))) / SectionsCount
-- Now you have each sections absolute width, you can calculate their X coordinate and Y coordinate
local SectionOneStart = vec2(TabsBarWidth + (SectionsPadding * 1) + (EachSectionWidth * 0), SectionsPadding + MachoPaneGap)
local SectionOneEnd = vec2(SectionOneStart.x + EachSectionWidth, MenuSize.y - SectionsPadding)
local SectionTwoStart = vec2(TabsBarWidth + (SectionsPadding * 2) + (EachSectionWidth * 1), SectionsPadding + MachoPaneGap)
local SectionTwoEnd = vec2(SectionTwoStart.x + EachSectionWidth, MenuSize.y - SectionsPadding)
local SectionThreeStart = vec2(TabsBarWidth + (SectionsPadding * 3) + (EachSectionWidth * 2), SectionsPadding + MachoPaneGap)
local SectionThreeEnd = vec2(SectionThreeStart.x + EachSectionWidth, MenuSize.y - SectionsPadding)
-- Create our window, MenuStartCoords is where the menu starts
MenuWindow = MachoMenuWindow(MenuStartCoords.x, MenuStartCoords.y, MenuSize.x, MenuSize.y)
MachoMenuSetAccent(MenuWindow, 137, 52, 235)
-- First tab
FirstSection = MachoMenuGroup(MenuWindow, "Section One", SectionOneStart.x, SectionOneStart.y, SectionOneEnd.x, SectionOneEnd.y)
MachoMenuButton(FirstSection, "Close", function()
MachoMenuDestroy(MenuWindow)
end)
-- Second tab
SecondSection = MachoMenuGroup(MenuWindow, "Section Two", SectionTwoStart.x, SectionTwoStart.y, SectionTwoEnd.x, SectionTwoEnd.y)
MachoMenuButton(SecondSection, "Close", function()
MachoMenuDestroy(MenuWindow)
end)
-- Third tab
ThirdSection = MachoMenuGroup(MenuWindow, "Section Three", SectionThreeStart.x, SectionThreeStart.y, SectionThreeEnd.x, SectionThreeEnd.y)
MachoMenuButton(ThirdSection, "Close", function()
MachoMenuDestroy(MenuWindow)
end)
Authentication Example:
-- Paid script authentication
local KeysBin = MachoWebRequest("https://your-website.com/keys.txt")
local CurrentKey = MachoAuthenticationKey()
local KeyPresent = string.find(KeysBin, CurrentKey)
if KeyPresent ~= nil then
print("Key is authenticated [" .. CurrentKey .. "]")
MachoMenuNotification("SUCCESS", "Authentication successful!")
else
print("Key is not in the list [" .. CurrentKey .. "]")
MachoMenuNotification("ERROR", "Invalid authentication key!")
end
Resource Injection Example:
-- Inject code into a resource
MachoInjectResource('es_extended', [[
print("Injected into es_extended!")
-- Your injected code here
]])
-- Or hijack entire resource
-- [MachoHijackResource('es_extended')]
-- Your complete script here
-- Resource management
MachoResourceStop('es_extended')
Citizen.Wait(1000)
MachoResourceStart('es_extended')
Security & Logging Example:
-- Secure trigger execution
local function executeSecureTrigger()
-- Disable logger before execution
local loggerState = MachoGetLoggerState()
MachoSetLoggerState(0)
-- Execute your trigger
local success, result = pcall(function()
TriggerEvent('esx:getSharedObject')
-- Your sensitive code here
end)
-- Restore logger state
Citizen.Wait(100)
MachoSetLoggerState(loggerState)
if success then
MachoMenuNotification("SUCCESS", "Trigger executed securely")
else
MachoMenuNotification("ERROR", "Trigger failed: " .. tostring(result))
end
end
-- Completely lock logger (use with caution)
-- MachoLockLogger()
Basic Trigger Example
Basic Trigger Example:
-- Your original code
TriggerEvent('esx:getSharedObject')
local xPlayer = ESX.GetPlayerData()
print('Player data loaded successfully')
-- Gets processed to:
-- Macho API Support
local function executeSafely()
local loggerState = MachoGetLoggerState()
MachoSetLoggerState(0)
local success, result = pcall(function()
TriggerEvent('esx:getSharedObject')
local xPlayer = ESX.GetPlayerData()
print('Player data loaded successfully')
end)
Citizen.Wait(100)
MachoSetLoggerState(loggerState)
if success then
MachoMenuNotification("SUCCESS", "Trigger executed successfully")
print("^2[SUCCESS]^7 Trigger executed successfully")
return true
else
MachoMenuNotification("ERROR", "Failed to execute trigger: " .. tostring(result))
print("^1[ERROR]^7 Failed to execute trigger: " .. tostring(result))
return false
end
end
local result = executeSafely()
if result then
print("^3[INFO]^7 Trigger execution completed")
else
print("^1[INFO]^7 Trigger execution failed")
end