Editor - VideojuCan Creator Kit
by CosmicCobra59457 lines13.9 KB
<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.5, user-scalable=yes" />
<title>Editor - VideojuCan Creator Kit</title>
<style>
/* Reset y base */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
background: #0b0813;
font-family: 'Segoe UI', 'Courier New', monospace;
min-height: 100vh;
display: flex;
flex-direction: column;
overflow: hidden;
height: 100vh;
position: relative;
}
/* Estrellas flotantes (igual que en el menú) */
.stars {
position: fixed;
top: 0; left: 0;
width: 100%; height: 100%;
pointer-events: none;
z-index: 0;
}
.star {
position: absolute;
font-size: 1.6rem;
opacity: 0.5;
animation: floatStar linear infinite alternate;
}
.star:nth-child(1) { top: 5%; left: 3%; animation-duration: 9s; animation-delay: 0s; }
.star:nth-child(2) { top: 80%; left: 92%; animation-duration: 11s; animation-delay: 2s; }
.star:nth-child(3) { top: 15%; left: 90%; animation-duration: 8s; animation-delay: 1s; }
.star:nth-child(4) { top: 70%; left: 2%; animation-duration: 10s; animation-delay: 3s; }
@keyframes floatStar {
0% { transform: translate(0,0) rotate(0deg) scale(1); }
100% { transform: translate(25px,-30px) rotate(15deg) scale(1.2); }
}
/* Contenedor principal */
.editor {
position: relative;
z-index: 1;
display: flex;
flex-direction: column;
height: 100vh;
padding: 12px;
gap: 12px;
background: transparent;
}
/* Barra superior */
.topbar {
display: flex;
justify-content: flex-end;
gap: 15px;
padding: 10px 20px;
background: rgba(21, 16, 42, 0.8);
backdrop-filter: blur(6px);
border-radius: 60px;
border: 2px solid #9b59b6;
box-shadow: 0 0 30px #9b59b633;
flex-shrink: 0;
flex-wrap: wrap;
}
.topbar .btn {
font-family: inherit;
font-weight: 800;
padding: 14px 28px;
border: none;
border-radius: 50px;
font-size: 1.2rem;
cursor: pointer;
transition: all 0.2s;
touch-action: manipulation;
min-height: 60px;
display: inline-flex;
align-items: center;
gap: 8px;
background: #2d1f4a;
color: #f1c40f;
border: 2px solid #9b59b6;
box-shadow: 0 6px 0 #3d1f5a;
}
.topbar .btn:hover { transform: translateY(-3px); box-shadow: 0 9px 0 #3d1f5a; }
.topbar .btn:active { transform: translateY(3px); box-shadow: 0 3px 0 #3d1f5a; }
.topbar .btn-primary {
background: linear-gradient(145deg, #e94560, #c0395a);
color: #fff;
border-color: #f1c40f;
box-shadow: 0 6px 0 #7a1a2a;
}
.topbar .btn-primary:hover { box-shadow: 0 9px 0 #7a1a2a; }
.topbar .btn-primary:active { box-shadow: 0 3px 0 #7a1a2a; }
/* Cuerpo principal: lienzo + paneles */
.main-area {
display: flex;
flex: 1;
gap: 12px;
min-height: 0;
}
/* Paleta de bloques (izquierda) */
.palette {
background: rgba(21, 16, 42, 0.85);
backdrop-filter: blur(4px);
border-radius: 40px;
border: 2px solid #9b59b6;
padding: 18px 14px;
width: 200px;
flex-shrink: 0;
overflow-y: auto;
display: flex;
flex-direction: column;
gap: 14px;
box-shadow: inset 0 0 30px #2a1f4433;
}
.palette-title {
color: #b8a9d4;
font-size: 0.9rem;
text-transform: uppercase;
letter-spacing: 2px;
text-align: center;
border-bottom: 1px dashed #9b59b6;
padding-bottom: 10px;
margin-bottom: 4px;
}
.block {
background: #2d1f4a;
border: 2px solid #9b59b6;
border-radius: 30px;
padding: 16px 12px;
color: #f1c40f;
font-weight: 700;
font-size: 1.1rem;
text-align: center;
cursor: pointer;
transition: all 0.2s;
box-shadow: 0 4px 0 #3d1f5a;
touch-action: manipulation;
display: flex;
align-items: center;
justify-content: center;
gap: 10px;
min-height: 64px;
}
.block:hover { transform: translateY(-3px); box-shadow: 0 7px 0 #3d1f5a; background: #3a2860; }
.block:active { transform: translateY(3px); box-shadow: 0 1px 0 #3d1f5a; }
.block.selected {
border-color: #f1c40f;
background: #4a3370;
box-shadow: 0 0 20px #f1c40f55;
}
.block .emoji { font-size: 1.6rem; }
/* Lienzo central */
.canvas {
flex: 1;
background: rgba(21, 16, 42, 0.7);
backdrop-filter: blur(4px);
border-radius: 40px;
border: 2px solid #9b59b6;
background-image: radial-gradient(circle at 20% 30%, #3a2a55 1px, transparent 1px);
background-size: 30px 30px;
box-shadow: inset 0 0 60px #00000066;
display: flex;
align-items: center;
justify-content: center;
position: relative;
min-height: 300px;
}
.canvas-placeholder {
color: #7a6a9e;
font-size: 1.8rem;
text-align: center;
padding: 20px;
opacity: 0.7;
pointer-events: none;
user-select: none;
}
.canvas-placeholder span { display: block; font-size: 4rem; margin-bottom: 10px; }
/* Panel de propiedades (derecha) */
.properties {
background: rgba(21, 16, 42, 0.85);
backdrop-filter: blur(4px);
border-radius: 40px;
border: 2px solid #9b59b6;
padding: 20px 18px;
width: 220px;
flex-shrink: 0;
overflow-y: auto;
box-shadow: inset 0 0 30px #2a1f4433;
transition: all 0.3s ease;
}
.properties-title {
color: #b8a9d4;
font-size: 0.9rem;
text-transform: uppercase;
letter-spacing: 2px;
text-align: center;
border-bottom: 1px dashed #9b59b6;
padding-bottom: 12px;
margin-bottom: 16px;
}
.prop-group {
margin-bottom: 18px;
}
.prop-label {
color: #b8a9d4;
font-size: 0.8rem;
display: block;
margin-bottom: 5px;
font-weight: 600;
}
.prop-input {
width: 100%;
padding: 12px 14px;
border-radius: 30px;
border: 2px solid #9b59b6;
background: #1a142b;
color: #f1c40f;
font-size: 1rem;
font-family: inherit;
outline: none;
transition: border 0.2s;
}
.prop-input:focus { border-color: #f1c40f; }
.prop-input[type="color"] { height: 50px; padding: 4px; cursor: pointer; }
.prop-select {
width: 100%;
padding: 12px 14px;
border-radius: 30px;
border: 2px solid #9b59b6;
background: #1a142b;
color: #f1c40f;
font-size: 1rem;
font-family: inherit;
outline: none;
}
.prop-select:focus { border-color: #f1c40f; }
/* Responsive: tablet y móvil */
@media (max-width: 1024px) {
.palette { width: 160px; padding: 14px 10px; }
.block { font-size: 0.9rem; min-height: 56px; padding: 12px 8px; }
.properties { width: 180px; padding: 16px 12px; }
}
@media (max-width: 768px) {
.editor { padding: 8px; gap: 8px; }
.topbar { padding: 8px 16px; gap: 10px; justify-content: center; }
.topbar .btn { font-size: 1rem; padding: 10px 18px; min-height: 50px; }
.main-area { flex-direction: column; }
.palette {
width: 100%;
flex-direction: row;
overflow-x: auto;
overflow-y: hidden;
padding: 12px 16px;
gap: 10px;
border-radius: 30px;
min-height: auto;
flex-shrink: 0;
order: 2; /* paleta abajo */
}
.palette-title { display: none; }
.block {
min-height: 54px;
padding: 10px 16px;
font-size: 0.9rem;
white-space: nowrap;
flex-shrink: 0;
}
.canvas {
min-height: 200px;
order: 1;
}
.properties {
width: 100%;
order: 3;
border-radius: 30px;
padding: 14px 16px;
max-height: 200px;
overflow-y: auto;
display: none; /* oculto por defecto en móvil, se muestra con toggle */
}
.properties.open { display: block; }
.canvas-placeholder { font-size: 1.2rem; }
.canvas-placeholder span { font-size: 3rem; }
}
@media (max-width: 480px) {
.topbar .btn { font-size: 0.8rem; padding: 8px 12px; min-height: 44px; }
.block { font-size: 0.8rem; min-height: 46px; padding: 8px 12px; }
.properties { max-height: 160px; }
}
/* Pequeño toggle para móvil (abrir propiedades) */
.toggle-prop {
display: none;
background: #2d1f4a;
color: #f1c40f;
border: 2px solid #9b59b6;
border-radius: 60px;
padding: 8px 20px;
font-weight: 700;
font-size: 0.9rem;
cursor: pointer;
margin-top: 6px;
align-self: center;
touch-action: manipulation;
}
@media (max-width: 768px) {
.toggle-prop { display: inline-block; }
}
</style>
</head>
<body>
<!-- Estrellas de fondo -->
<div class="stars">
<span class="star">✦</span>
<span class="star">✦</span>
<span class="star">✦</span>
<span class="star">✦</span>
</div>
<!-- EDITOR -->
<div class="editor">
<!-- Barra superior -->
<header class="topbar">
<button class="btn btn-primary">💾 Guardar</button>
<button class="btn">▶️ Probar</button>
<button class="btn">🚪 Salir</button>
</header>
<!-- Cuerpo -->
<div class="main-area">
<!-- Paleta de bloques -->
<aside class="palette">
<div class="palette-title">🧩 Bloques</div>
<div class="block" data-block="move"><span class="emoji">➡️</span> Mover</div>
<div class="block" data-block="jump"><span class="emoji">⬆️</span> Saltar</div>
<div class="block" data-block="points"><span class="emoji">⭐</span> Sumar puntos</div>
<div class="block" data-block="color"><span class="emoji">🎨</span> Cambiar color</div>
<div class="block" data-block="sound"><span class="emoji">🔊</span> Sonido</div>
<div class="block" data-block="end"><span class="emoji">🏁</span> Terminar juego</div>
</aside>
<!-- Lienzo central -->
<section class="canvas" id="canvas">
<div class="canvas-placeholder">
<span>🕹️</span>
Tu juego aparecerá aquí<br>
<small style="font-size:0.7rem;">Arrastra bloques al lienzo (demo)</small>
</div>
</section>
<!-- Panel de propiedades -->
<aside class="properties" id="propertiesPanel">
<div class="properties-title">⚙️ Propiedades</div>
<div class="prop-group">
<label class="prop-label">Color</label>
<input type="color" class="prop-input" value="#e94560" />
</div>
<div class="prop-group">
<label class="prop-label">Velocidad</label>
<select class="prop-select">
<option>Lenta</option>
<option selected>Media</option>
<option>Rápida</option>
</select>
</div>
<div class="prop-group">
<label class="prop-label">Texto / Puntos</label>
<input type="text" class="prop-input" placeholder="Ej: +10" value="+10" />
</div>
<div class="prop-group">
<label class="prop-label">Sonido</label>
<select class="prop-select">
<option>Ping</option>
<option>Boing</option>
<option selected>Láser</option>
</select>
</div>
<div style="color:#7a6a9e; font-size:0.8rem; text-align:center; border-top:1px dashed #9b59b6; padding-top:12px;">
🦊 Haz clic en un bloque para editarlo
</div>
</aside>
</div>
<!-- Botón toggle para móvil (abrir/cerrar propiedades) -->
<button class="toggle-prop" id="togglePropBtn">⚙️ Mostrar propiedades</button>
</div>
<script>
// Selección de bloques (simulación)
const blocks = document.querySelectorAll('.block');
const propPanel = document.getElementById('propertiesPanel');
const toggleBtn = document.getElementById('togglePropBtn');
// Quitar selección previa y añadir clase 'selected' al bloque clickado
blocks.forEach(block => {
block.addEventListener('click', function(e) {
blocks.forEach(b => b.classList.remove('selected'));
this.classList.add('selected');
// En móvil, si está cerrado, abrir propiedades (solo si existe el toggle)
if (window.innerWidth <= 768) {
propPanel.classList.add('open');
toggleBtn.textContent = '⚙️ Ocultar propiedades';
}
// Podríamos actualizar el panel de propiedades con datos del bloque aquí
// (demo: solo mostramos selección)
console.log('Bloque seleccionado:', this.dataset.block);
});
});
// Toggle para propiedades en móvil
toggleBtn.addEventListener('click', function() {
propPanel.classList.toggle('open');
this.textContent = propPanel.classList.contains('open') ?
'⚙️ Ocultar propiedades' :
'⚙️ Mostrar propiedades';
});
// Cerrar propiedades si se hace clic fuera en móvil (opcional)
document.addEventListener('click', function(e) {
if (window.innerWidth <= 768) {
const isProp = propPanel.contains(e.target);
const isToggle = toggleBtn.contains(e.target);
if (!isProp && !isToggle && propPanel.classList.contains('open')) {
propPanel.classList.remove('open');
toggleBtn.textContent = '⚙️ Mostrar propiedades';
}
}
});
// Pequeño efecto: al hacer clic en el lienzo, mostrar mensaje
document.getElementById('canvas').addEventListener('click', function() {
// Para demo, solo feedback visual (podríamos soltar un bloque)
this.style.transition = 'background 0.2s';
this.style.background = 'rgba(155, 89, 182, 0.2)';
setTimeout(() => { this.style.background = ''; }, 300);
});
</script>
</body>
</html>Game Source: Editor - VideojuCan Creator Kit
Creator: CosmicCobra59
Libraries: none
Complexity: complex (457 lines, 13.9 KB)
The full source code is displayed above on this page.
Remix Instructions
To remix this game, copy the source code above and modify it. Add a ARCADELAB header at the top with "remix_of: editor-videojucan-creator-kit-cosmiccobra59" to link back to the original. Then publish at arcadelab.ai/publish.