VideojuCan Creator Kit - Con arrastre
by CosmicCobra59672 lines19.6 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>VideojuCan Creator Kit - Con arrastre</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;
align-items: center;
justify-content: center;
padding: 16px;
position: relative;
overflow: hidden;
touch-action: none; /* Evita scroll durante el arrastre */
}
/* ===== ESTRELLAS ===== */
.stars {
position: fixed;
top: 0; left: 0;
width: 100%; height: 100%;
pointer-events: none;
z-index: 0;
}
.star {
position: absolute;
font-size: 1.8rem;
opacity: 0.6;
animation: floatStar linear infinite alternate;
}
.star:nth-child(1) { top: 8%; left: 4%; animation-duration: 9s; animation-delay: 0s; }
.star:nth-child(2) { top: 75%; left: 90%; animation-duration: 11s; animation-delay: 2s; }
.star:nth-child(3) { top: 20%; left: 88%; animation-duration: 8s; animation-delay: 1s; }
.star:nth-child(4) { top: 82%; left: 6%; animation-duration: 10s; animation-delay: 3s; }
@keyframes floatStar {
0% { transform: translate(0,0) rotate(0deg) scale(1); }
100% { transform: translate(30px,-35px) rotate(15deg) scale(1.2); }
}
/* ===== APP ===== */
.app {
position: relative;
z-index: 1;
width: 100%;
max-width: 1200px;
height: 90vh;
max-height: 900px;
background: transparent;
display: flex;
flex-direction: column;
}
/* ===== PANTALLAS ===== */
.screen {
display: none;
flex-direction: column;
height: 100%;
width: 100%;
animation: fadeIn 0.4s ease;
}
.screen.active { display: flex; }
@keyframes fadeIn {
0% { opacity: 0; transform: scale(0.96); }
100% { opacity: 1; transform: scale(1); }
}
/* ===== MENÚ ===== */
.menu-container {
flex: 1;
display: flex;
align-items: center;
justify-content: center;
}
.menu {
background: #15102a;
padding: 45px 40px 40px;
border-radius: 70px 70px 40px 40px;
border: 3px solid #9b59b6;
background-image: radial-gradient(circle at 20% 30%, #2a1f44 1px, transparent 1px);
background-size: 30px 30px;
max-width: 720px;
width: 100%;
text-align: center;
box-shadow: 0 20px 40px #00000099, 0 0 60px #9b59b655;
}
.title-videojucan {
font-size: 3.2rem;
font-weight: 900;
color: #f1c40f;
text-shadow: 5px 5px 0 #9b59b6, 0 0 30px #f1c40f44;
letter-spacing: 3px;
line-height: 1.1;
display: block;
}
.title-creator {
font-size: 2.8rem;
font-weight: 900;
color: #e94560;
text-shadow: 4px 4px 0 #7a1a2a, 0 0 30px #e9456044;
letter-spacing: 5px;
display: block;
margin-top: -8px;
}
.tagline {
color: #b8a9d4;
font-size: 1.2rem;
margin: 15px 0 30px;
background: #1a142b;
padding: 14px 20px;
border-radius: 60px;
border: 1px dashed #9b59b6;
display: inline-block;
}
.btn-group {
display: flex;
flex-direction: column;
gap: 18px;
margin-top: 5px;
}
.btn {
font-family: inherit;
font-weight: 800;
padding: 22px 28px;
font-size: 1.4rem;
border: none;
border-radius: 60px;
cursor: pointer;
transition: all 0.25s ease;
width: 100%;
letter-spacing: 0.8px;
touch-action: manipulation;
user-select: none;
min-height: 76px;
display: inline-flex;
align-items: center;
justify-content: center;
gap: 10px;
}
.btn-primary {
background: linear-gradient(145deg, #e94560, #c0395a);
color: #fff;
box-shadow: 0 12px 0 #7a1a2a, 0 8px 25px #e9456066;
font-size: 1.6rem;
}
.btn-primary:hover { transform: scale(1.02) translateY(-4px); box-shadow: 0 16px 0 #7a1a2a, 0 12px 30px #e9456088; }
.btn-primary:active { transform: translateY(6px); box-shadow: 0 6px 0 #7a1a2a; }
.btn-secondary {
background: #2d1f4a;
color: #f1c40f;
border: 2px solid #9b59b6;
box-shadow: 0 8px 0 #3d1f5a;
}
.btn-secondary:hover { transform: translateY(-4px); box-shadow: 0 12px 0 #3d1f5a; background: #3a2860; }
.btn-secondary:active { transform: translateY(4px); box-shadow: 0 4px 0 #3d1f5a; }
.btn-row {
display: flex;
gap: 18px;
}
.btn-row .btn {
width: 50%;
min-height: 70px;
font-size: 1.2rem;
padding: 16px 12px;
}
.fox-wrapper {
margin-top: 28px;
display: inline-block;
font-size: 4rem;
line-height: 1;
animation: floatFox 4s ease-in-out infinite;
filter: drop-shadow(0 0 20px #f1c40f66);
}
@keyframes floatFox {
0%, 100% { transform: translateY(0); }
50% { transform: translateY(-12px); }
}
.fox-wrapper .fox-emoji {
display: inline-block;
animation: wink 4s ease-in-out infinite;
}
@keyframes wink {
0%, 95%, 100% { transform: scaleY(1); }
96% { transform: scaleY(0.1); }
97% { transform: scaleY(1); }
}
/* ===== EDITOR CON ARRASTRE ===== */
.editor-container {
flex: 1;
display: flex;
flex-direction: column;
gap: 12px;
padding: 8px 0;
height: 100%;
min-height: 0;
}
.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 {
min-height: 56px;
font-size: 1.1rem;
padding: 12px 24px;
background: #2d1f4a;
color: #f1c40f;
border: 2px solid #9b59b6;
box-shadow: 0 6px 0 #3d1f5a;
border-radius: 50px;
width: auto;
}
.topbar .btn-primary {
background: linear-gradient(145deg, #e94560, #c0395a);
color: #fff;
border-color: #f1c40f;
box-shadow: 0 6px 0 #7a1a2a;
}
.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:hover { box-shadow: 0 9px 0 #7a1a2a; }
.topbar .btn-primary:active { box-shadow: 0 3px 0 #7a1a2a; }
.main-area {
display: flex;
flex: 1;
gap: 12px;
min-height: 0;
}
/* Paleta */
.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;
}
.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: grab;
transition: all 0.2s;
box-shadow: 0 4px 0 #3d1f5a;
touch-action: none;
user-select: none;
display: flex;
align-items: center;
justify-content: center;
gap: 10px;
min-height: 64px;
position: relative;
}
.block:hover { transform: translateY(-3px); box-shadow: 0 7px 0 #3d1f5a; background: #3a2860; }
.block:active { cursor: grabbing; }
.block .emoji { font-size: 1.6rem; }
/* Lienzo */
.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;
position: relative;
min-height: 250px;
overflow: hidden;
transition: background 0.3s;
}
.canvas.drag-over {
background: rgba(155, 89, 182, 0.25);
border-color: #f1c40f;
box-shadow: 0 0 50px #f1c40f44;
}
.canvas-placeholder {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
color: #7a6a9e;
font-size: 1.8rem;
text-align: center;
pointer-events: none;
user-select: none;
opacity: 0.7;
width: 100%;
padding: 20px;
}
.canvas-placeholder span { display: block; font-size: 4rem; margin-bottom: 10px; }
/* Bloques colocados dentro del lienzo */
.placed-blocks {
position: relative;
width: 100%;
height: 100%;
pointer-events: none; /* Para que los eventos se capturen en el canvas */
}
.placed-block {
position: absolute;
background: #2d1f4a;
border: 2px solid #f1c40f;
border-radius: 30px;
padding: 12px 16px;
color: #f1c40f;
font-weight: 700;
font-size: 1rem;
display: flex;
align-items: center;
gap: 8px;
box-shadow: 0 4px 0 #3d1f5a, 0 0 20px #f1c40f22;
cursor: grab;
touch-action: none;
user-select: none;
pointer-events: auto;
transition: box-shadow 0.2s;
min-width: 80px;
justify-content: center;
}
.placed-block:hover {
box-shadow: 0 6px 0 #3d1f5a, 0 0 30px #f1c40f44;
z-index: 10;
}
.placed-block:active { cursor: grabbing; }
.placed-block .emoji { font-size: 1.4rem; }
.placed-block.selected {
border-color: #e94560;
box-shadow: 0 0 30px #e9456088, 0 4px 0 #3d1f5a;
}
/* Propiedades */
.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; }
.prop-hint {
color: #7a6a9e;
font-size: 0.8rem;
text-align: center;
border-top: 1px dashed #9b59b6;
padding-top: 12px;
margin-top: 8px;
}
.btn-delete {
background: #e94560;
color: #fff;
border: none;
border-radius: 60px;
padding: 12px 20px;
font-weight: 700;
font-size: 1rem;
width: 100%;
cursor: pointer;
transition: 0.2s;
box-shadow: 0 4px 0 #7a1a2a;
margin-top: 8px;
}
.btn-delete:hover { transform: translateY(-2px); box-shadow: 0 6px 0 #7a1a2a; }
.btn-delete:active { transform: translateY(2px); box-shadow: 0 2px 0 #7a1a2a; }
/* Elemento flotante para arrastre */
.drag-ghost {
position: fixed;
pointer-events: none;
z-index: 9999;
background: #4a3370;
border: 3px solid #f1c40f;
border-radius: 30px;
padding: 14px 22px;
color: #f1c40f;
font-weight: 700;
font-size: 1.2rem;
display: flex;
align-items: center;
gap: 10px;
box-shadow: 0 20px 40px #000000cc, 0 0 60px #f1c40f44;
transform: translate(-50%, -50%) scale(1.1);
transition: transform 0.1s;
opacity: 0.95;
white-space: nowrap;
}
.drag-ghost .emoji { font-size: 1.8rem; }
/* Toast */
.toast {
position: fixed;
bottom: 30px;
left: 50%;
transform: translateX(-50%) translateY(80px);
background: #1a142b;
color: #f1c40f;
padding: 16px 32px;
border-radius: 60px;
border: 2px solid #f1c40f;
box-shadow: 0 0 40px #f1c40f44;
font-weight: 700;
font-size: 1.2rem;
opacity: 0;
transition: all 0.4s ease;
z-index: 999;
pointer-events: none;
backdrop-filter: blur(8px);
}
.toast.show {
opacity: 1;
transform: translateX(-50%) translateY(0);
}
/* ===== RESPONSIVE ===== */
@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; }
.menu { padding: 35px 30px; }
.title-videojucan { font-size: 2.8rem; }
.title-creator { font-size: 2.4rem; }
}
@media (max-width: 768px) {
.app { height: 95vh; max-height: none; }
.menu { padding: 30px 20px; border-radius: 50px; }
.title-videojucan { font-size: 2.4rem; }
.title-creator { font-size: 2rem; }
.tagline { font-size: 1rem; padding: 10px 16px; }
.btn { font-size: 1.2rem; min-height: 64px; padding: 16px 18px; }
.btn-primary { font-size: 1.4rem; }
.btn-row { flex-direction: column; gap: 14px; }
.btn-row .btn { width: 100%; min-height: 60px; }
.fox-wrapper { font-size: 3.2rem; }
.editor-container { padding: 4px 0; gap: 8px; }
.topbar { padding: 8px 16px; gap: 10px; justify-content: center; }
.topbar .btn { font-size: 0.9rem; padding: 10px 16px; min-height: 48px; }
.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;
}
.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;
}
.properties.open { display: block; }
.toggle-prop {
display: inline-block;
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: 480px) {
.title-videojucan { font-size: 1.8rem; }
.title-creator { font-size: 1.6rem; }
.btn { font-size: 1rem; min-height: 56px; padding: 14px 14px; }
.btn-primary { font-size: 1.2rem; }
.fox-wrapper { font-size: 2.8rem; }
.topbar .btn { font-size: 0.75rem; padding: 8px 10px; min-height: 40px; }
.block { font-size: 0.8rem; min-height: 46px; padding: 8px 12px; }
.properties { max-height: 160px; }
}
</style>
</head>
<body>
<!-- ===== ESTRELLAS ===== -->
<div class="stars">
<span class="star">✦</span>
<span class="star">✦</span>
<span class="star">✦</span>
<span class="star">✦</span>
</div>
<!-- ===== TOAST ===== -->
<div class="toast" id="toast">▶️ Modo prueba</div>
<!-- ===== APP ===== -->
<div class="app">
<!-- ==================== MENÚ ==================== -->
<div class="screen active" id="screen-menu">
<div class="menu-container">
<div class="menu">
<span class="title-videojucan">🎲 VIDEOJUCAN</span>
<span class="title-creator">CREATOR KIT</span>
<div class="tagline">✦ Crea sin código, juega sin límites ✦</div>
<div class="btn-group">
<button class="btn btn-primary" id="btnNewGame">➕ Crear nuevo juego</button>
<div class="btn-row">
<button class="btn btn-secondary">🖼️ Galería</button>
<button class="btn btn-secondary">📘 Tutoriales</button>
</div>
<button class="btn btn-secondary" style="background:#1a1128; border-color:#7a5a9a;">🔧 Ajustes</button>
</div>
<div class="fox-wrapper"><span class="fox-emoji">🦊</span></div>
</div>
</div>
</div>
<!-- ==================== EDITOR ==================== -->
<div class="screen" id="screen-editor">
<div class="editor-container">
<header class="topbar">
<button class="btn btn-primary" id="btnSave">💾 Guardar</button>
<button class="btn" id="btnTest">▶️ Probar</button>
<button class="btn" id="btnExit">🚪 Salir</button>
</header>
<div class="main-area">
<!-- Paleta -->
<aside class="palette" id="palette">
<div class="palette-title">🧩 Bloques</div>
<div class="block" data-type="move"><span class="emoji">➡️</span> Mover</div>
<div class="block" data-type="jump"><span class="emoji">⬆️</span> Saltar</div>
<div class="block" data-type="points"><span class="emoji">⭐</span> Sumar puntos</div>
<div class="block" data-type="color"><span class="emoji">🎨</span> Cambiar color</div>
<div class="block" data-type="sound"><span class="emoji">🔊</span> Sonido</div>
<div class="block" data-type="end"><span class="emoji">🏁</span> Terminar juego</div>
</aside>
<!-- Lienzo -->
<section class="canvas" id="canvas">
<div class="canvas-placeholder" id="placeholder">
<span>🕹️</span>
Arrastra bloques aquí
</div>
<div class="placed-blocks" id="placedBlocks"></div>
</section>
<!-- Propiedades -->
<aside class="properties" id="propertiesPanel">
<div class="properties-title">⚙️ Propiedades</div>
<div id="propContent">
<div class="prop-group">
<label class="prop-label">Color</label>
<input type="color" class="prop-input" id="propColor" value="#e94560" />
</div>
<div class="prop-group">
<label class="prop-label">Velocidad</label>
<select class="prop-select" id="propSpeed">
<option>Lenta</option>
<option selected>Media</option>
<option>Rápida</option>
</select>
</div>
<div class="prop-group">
<label class=Game Source: VideojuCan Creator Kit - Con arrastre
Creator: CosmicCobra59
Libraries: none
Complexity: complex (672 lines, 19.6 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: videojucan-creator-kit-con-arrastre-cosmiccobra59" to link back to the original. Then publish at arcadelab.ai/publish.