From Online Sandboxes to Complex Interactive Web Pages: A Practical Guide to Evaluating Large Language Models

    This article presents a practical framework for evaluating large language models through runnable interactive artifacts rather than text alone. It examines draggable desktop windows, glassmorphism effects, real-time strategy games, simulation loops, AI-assisted research, pathfinding, hexagonal grids, performance, reproducibility, safety, and regression testing. The goal is to distinguish a convincing demo from a reliable, maintainable deliverable.

    From Online Sandboxes to Complex Interactive Web Pages: A Practical Guide to Evaluating Large Language Models

    1. Why Runnable Artifacts Are a Better Test of Model Capability Than Plain Text

    A notable trend in newly launched large language model experiences is that the interface is moving beyond a conventional chat box. Many products now include online sandboxes, preview environments, and the ability to generate runnable web pages or small games in real time.

    After receiving a natural-language request, the model may produce more than an explanation. It can generate a page or game that users can click, drag, and run directly in a browser. This shifts the evaluation target from “Is the answer fluent?” to “Can the model deliver a usable end-to-end result?”

    Such tasks involve multiple capabilities, including:

    • Understanding requirements
    • Decomposing tasks
    • Organizing code
    • Reproducing visual designs
    • Implementing interaction logic
    • Maintaining performance and stability
    • Debugging and iterating

    For developers, this workflow has an obvious advantage: the feedback loop is short. Ideas can be validated quickly, and generated code can serve as a prototype foundation.

    However, it also amplifies randomness and environmental noise. Sampling behavior, model parameters, system prompts, service load, rendering environments, and input wording can all affect the result. A single example is useful for discovering signals, but it is not sufficient for drawing broad conclusions.

    A better approach is to treat the online sandbox as a rapid validation tool, then combine it with a fixed acceptance checklist and multiple runs to create a reproducible evaluation process.

    2. The Real Strengths and Limitations of Online Sandbox Features

    The first major strength of an online sandbox is that it shortens the distance between an idea and a runnable artifact.

    For example, suppose a user wants to create a desktop window system with draggable windows. Traditional development would require setting up the page, implementing drag behavior, managing stacking order, and adding styles. An online sandbox may generate an initial version immediately, allowing the user to inspect the result in a browser.

    The second strength is iterative interaction. If the layout is not satisfactory, the user can provide additional natural-language instructions to adjust the layout, add interactions, or refine the visual design.

    These capabilities also have clear limitations.

    First, online results are affected by service load. Waiting time may come from queueing, inference, preview compilation, or network transmission. It should not automatically be interpreted as a measure of model capability.

    Second, iterative improvement is not always monotonic. Each modification may rewrite a large portion of the code and cause previously working features to regress.

    Third, subjective descriptions can be ambiguous. Terms such as “glass-like,” “3D transition,” or “more polished” do not define a single visual standard. Without design constraints and explicit acceptance criteria, results can vary substantially.

    Fourth, generated code should be treated as a prototype. It still requires human code review, testing, and security hardening before it can be considered production-ready.

    3. Scenario One: Draggable Windows and Translucent Window Transitions

    3.1 Abstracting the Requirements

    A typical desktop-window task can be divided into the following verifiable requirements:

    1. The page contains draggable windows. When the title bar is pressed and moved, the window follows the pointer.
    2. Multiple windows have a stacking order. Clicking or dragging a window brings it to the front.
    3. Windows provide basic controls and states, such as close, minimize, maximize, or restore.
    4. A window-switching view presents a three-dimensional layered effect through perspective, scaling, or translation.
    5. Windows use translucent, blurred, or gradient-based glassmorphism effects while keeping text readable.
    6. Text is not selected during dragging. Mouse and touch interactions are handled consistently, with reasonable boundary behavior.
    7. Dragging and switching remain smooth as the number of windows increases.

    Although these requirements may appear to concern only front-end styling, they also test the model’s understanding of event handling, z-index management, state synchronization, and visual design constraints.

    3.2 Common Generation Problems

    Models can often generate windows that are basically draggable, but they frequently fail on details.

    Common problems include:

    • Listening only for mouse events and ignoring pointer events, which prevents reliable use on touch devices
    • Changing left and top without accounting for scaling or positioning
    • Failing to update the window’s stacking order when dragging begins
    • Implementing a static 3D rotation without managing transition states
    • Applying excessive transparency, reducing button and text contrast
    • Allowing title-bar buttons to conflict with the drag region, so clicking Close also starts a drag

    In one public test sample, the initial version and two iterations all implemented parts of the window-dragging behavior, but their visual details, button styling, glass effect, and transition animations were inconsistent and less complete than those in an earlier comparison sample.

    This observation is worth recording, but it is not enough to conclude that the model’s overall capability is weaker. A more rigorous evaluation should use fixed prompts, fixed parameters, multiple samples, and the same acceptance checklist.

    During multi-turn iteration, the model may focus on newly added requirements and unintentionally damage visual features that were already working.

    3.3 Key Points in Drag Implementation

    A simplified drag state manager can look like this:

    1. function enableDrag(el) {
    2. let dragging = null;
    3. el.addEventListener('pointerdown', (e) => {
    4. const titlebar = e.target.closest('.titlebar');
    5. if (!titlebar) return;
    6. const rect = el.getBoundingClientRect();
    7. dragging = {
    8. id: e.pointerId,
    9. offsetX: e.clientX - rect.left,
    10. offsetY: e.clientY - rect.top
    11. };
    12. el.setPointerCapture(e.pointerId);
    13. el.style.zIndex = String(++globalZIndex);
    14. e.preventDefault();
    15. });
    16. el.addEventListener('pointermove', (e) => {
    17. if (!dragging || e.pointerId !== dragging.id) return;
    18. const x = e.clientX - dragging.offsetX;
    19. const y = e.clientY - dragging.offsetY;
    20. el.style.transform = `translate(${x}px, ${y}px)`;
    21. });
    22. const stop = (e) => {
    23. if (!dragging || e.pointerId !== dragging.id) return;
    24. dragging = null;
    25. };
    26. el.addEventListener('pointerup', stop);
    27. el.addEventListener('pointercancel', stop);
    28. }

    This skeleton demonstrates three important principles:

    • Use unified pointer events
    • Raise the window’s stacking order when dragging starts
    • Use transform to manage movement and reduce layout thrashing

    A production implementation would also need window-boundary constraints, mobile gesture handling, keyboard accessibility, and focus management.

    3.4 Acceptance Criteria

    Manual acceptance testing for draggable windows can include:

    • Whether the window follows the pointer naturally
    • Whether buttons remain clickable
    • Whether close and minimize states work correctly
    • Whether stacking order behaves as users expect
    • Whether the switching view includes a transition animation
    • Whether translucency affects readability
    • Whether the layout remains correct on narrow and high-resolution screens
    • Whether the browser console contains obvious errors

    For automated testing, useful measurements include:

    • Window coordinates before and after dragging
    • Stacking-order values
    • Button visibility
    • Whether expected DOM events fire
    • Animation frame rate

    4. Scenario Two: Converting a Turn-Based Strategy Game into a Real-Time Strategy Game

    Compared with a window system, a small strategy game provides a stronger test of a model’s overall reasoning ability.

    A representative task is to generate a browser-based strategy game while converting the original turn-based mechanics into real-time strategy gameplay and adding several extra features. The key challenge is not reproducing assets from an existing title. It is understanding the structural difference between turn-based and real-time systems.

    4.1 Requirement Breakdown and Acceptance Criteria

    The original requirements can be abstracted into the following items:

    1. Convert the game from turn-based to real-time progression and remove the “End Turn” button.
    2. Allow both sides to progress fairly on the same timeline, with resources generated over time.
    3. Add an AI-assisted technology tree. When enabled, it automatically selects and completes research when resources are available.
    4. Allow all units to automatically search for opponents or target cities.
    5. Add a speed slider supporting 1x to 10x speed.
    6. Use a regular hexagonal grid for the map.
    7. Use the arrow keys to move the camera.
    8. Represent cities and units with character icons or system-provided graphics.
    9. Add pause, resume, restart, and zoom controls.
    10. Implement basic interactions correctly, including movement, combat, resources, and victory conditions.

    The first requirement is particularly easy to satisfy only superficially. Some generated implementations remove the End Turn button but retain discrete turn-based settlement internally, replacing the button with a timer.

    A true real-time strategy system requires continuous simulation, time-based resource production, speed-scaled simulation, and consistent game speed across different frame rates.

    4.2 A Real-Time Game Loop

    A stable real-time loop can use a fixed simulation timestep to avoid speed drift on high-refresh-rate devices:

    1. let lastTime = performance.now();
    2. let accumulator = 0;
    3. const STEP = 1000 / 60;
    4. function loop(now) {
    5. const rawDelta = Math.min(now - lastTime, 100);
    6. lastTime = now;
    7. accumulator += rawDelta * state.speed;
    8. while (accumulator >= STEP) {
    9. simulate(STEP);
    10. accumulator -= STEP;
    11. }
    12. render();
    13. requestAnimationFrame(loop);
    14. }

    The state.speed value can be controlled by a slider. The speed multiplier should affect every time-dependent system, including:

    • Resource generation
    • Unit movement
    • Research progress
    • Combat cooldowns

    It should not merely accelerate animations. Otherwise, the game may look faster while its internal logic remains unchanged, producing an inconsistent experience.

    4.3 AI-Assisted Research

    “Automatic research” is an additional capability that may not exist in the original game. The model must understand the intended behavior: provide a selectable AI assistant that automatically chooses and advances available research when resources are sufficient.

    Typical problems include:

    • Starting research when resources are insufficient
    • Selecting only one technology and stopping afterward
    • Implementing incorrect technology-tree dependencies
    • Updating the UI checkbox without changing the underlying logic

    A simplified implementation could look like this:

    1. function updateResearch(state, dt) {
    2. if (!state.autoResearch) return;
    3. if (state.currentResearch) {
    4. state.currentResearch.progress += state.scienceRate * dt;
    5. if (state.currentResearch.progress >= state.currentResearch.cost) {
    6. completeResearch(state, state.currentResearch.id);
    7. state.currentResearch = null;
    8. }
    9. return;
    10. }
    11. const available = getAvailableTechs(state)
    12. .filter(t => state.science >= t.cost)
    13. .sort((a, b) => a.cost - b.cost);
    14. if (available.length > 0) {
    15. startResearch(state, available[0].id);
    16. }
    17. }

    Acceptance testing should verify:

    • Whether research begins automatically after the option is enabled
    • Whether the system waits when resources are insufficient
    • Whether it continues to the next technology after completing one
    • Whether disabling the option stops automatic selection
    • Whether manual selection conflicts with the assistant

    The feature is complete only when these state transitions are clear and correct.

    4.4 Automatic Target Selection and Pathfinding

    “Have all units automatically seek opponents” involves both target selection and pathfinding.

    Target selection is relatively straightforward: iterate through enemy units and cities, then choose a target based on distance or threat level. The more difficult issues involve pathfinding, blocked positions, invalid targets, map boundaries, and performance.

    On a hexagonal grid, the implementation can first establish neighboring cells and then use breadth-first search or an A*-style algorithm to calculate paths.

    To control computation, it is not necessary to calculate a complete path for every unit on every frame. Possible strategies include:

    • Scheduling pathfinding across frames
    • Caching paths
    • Recalculating only when a path becomes invalid
    • Limiting the frequency of path searches

    The following pseudocode combines target selection and path calculation:

    1. function updateUnit(unit, world, dt) {
    2. if (!unit.target || !isAlive(unit.target)) {
    3. unit.target = findNearestEnemy(unit, world.enemies, world.cities);
    4. unit.path = unit.target ? findPath(unit.cell, targetCell(unit.target)) : [];
    5. }
    6. if (!unit.path || unit.path.length === 0) return;
    7. const next = unit.path[0];
    8. if (moveToward(unit, next, dt)) {
    9. unit.path.shift();
    10. }
    11. if (unit.target && inAttackRange(unit, unit.target)) {
    12. attack(unit, unit.target);
    13. }
    14. }

    A real implementation must also handle:

    • Impassable terrain
    • Whether units may overlap
    • Attack range
    • Cleanup after a target is destroyed
    • Changes in city ownership
    • Multiple units competing for the same cell
    • Pathfinding timeouts

    4.5 Hexagonal Grids and Controls

    The main challenge of a regular hexagonal grid is coordinate conversion and hit detection. Axial or offset coordinates can be used to store cells, followed by conversion to screen coordinates for rendering.

    A simplified axial-coordinate conversion is:

    1. const SIZE = 28;
    2. function hexToPixel(q, r) {
    3. return {
    4. x: SIZE * Math.sqrt(3) * (q + r / 2),
    5. y: SIZE * 1.5 * r
    6. };
    7. }

    The speed slider should update more than the displayed value. It must also change the game-state multiplier.

    Arrow-key camera movement should update the camera offset and enforce map boundaries.

    The icon system should clearly distinguish different units and cities while avoiding unauthorized visual assets. Self-drawn graphics, character symbols, or system-provided graphics can be used. Text labels may also be provided as a fallback.

    5. How to Evaluate “Slow” Performance and Unexpectedly Poor Results

    The word “slow” in an online experience needs to be decomposed.

    The delay may come from:

    1. Model inference
    2. Queueing and resource scheduling
    3. Code generation, building, or preview compilation
    4. Rendering performance in the generated page

    Only by recording timestamps such as request start, first response, complete artifact delivery, and page interactivity can the bottleneck be identified. A single delay during a period of high service load should not automatically be attributed to the model’s architecture or capability.

    The statement “the result is worse than an earlier version” also requires further analysis.

    Visual differences may be caused by:

    • The prompt not being followed completely
    • A rewrite that degraded existing styles
    • Event conflicts in the generated code
    • Differences in map size, unit count, or pathfinding frequency
    • A model misunderstanding the original requirement

    A recommended process is:

    1. Fix the task description and parameters, then run multiple samples.
    2. Assign identifiers to requirements, such as R1 for dragging, R2 for stacking order, and R3 for transition animation.
    3. Define observable acceptance criteria for every requirement.
    4. Record screenshots, console errors, interaction latency, and device conditions for each generated artifact.
    5. Score functionality, visual quality, performance, and code maintainability separately.
    6. Regression-test requirements that passed in the previous iteration so that older features do not disappear.

    6. A Reproducible Evaluation Method

    For interactive web pages and small games, a lightweight but executable evaluation matrix can be used:

    Dimension What to Observe Recommended Records
    Requirement fidelity Whether every explicit requirement is implemented Requirement IDs, pass/fail status, omissions
    Functional correctness Whether dragging, collisions, pathfinding, and research work Operation steps and failure symptoms
    Interaction quality Whether buttons, keyboard controls, pause, and resume feel smooth Interaction latency and conflicts
    Visual completeness Layout, hierarchy, transparency, and icon clarity Screenshot comparisons and readability checks
    Performance stability Frame rate, memory growth, and pathfinding time Device, unit count, and frame-rate range
    Code quality Modularity, state management, and maintainability Ease of making follow-up changes
    Iteration cost How many prompts are needed to fix problems Number of rounds and regressions
    Security and compliance Whether untrusted resources or dangerous execution are introduced Sandbox configuration, policies, and resource sources

    For game tasks, a small set of automated scripts can verify whether:

    • The End Turn button has been removed
    • Resource growth differs appropriately between 1x and 10x speed
    • Research advances automatically after the assistant is enabled
    • A unit changes targets after moving
    • The camera offset changes when arrow keys are pressed
    • Frame rate and errors remain acceptable when many units are active

    For window tasks, automation can drag a window and record coordinate changes, inspect stacking-order values, simulate button clicks, and verify close and minimize states.

    7. How to Interpret Anonymous or Gray-Release Evaluations

    Some model products are initially offered under anonymous labels or through limited gray releases before a formal launch.

    This approach can reduce the influence of brand expectations and encourage users to focus on the actual output. It can also reveal problems under real workloads and realistic tasks.

    However, an anonymous version and a final version may not be identical. System prompts, safety policies, sampling parameters, inference resources, and routing strategies may all change.

    Therefore, an impressive result from a single anonymous test should not be treated as proof of the final version’s capabilities. Likewise, one disappointing experience does not demonstrate that the model is generally weak.

    A better approach is to treat the anonymous stage as an early signal. Observe whether the system can consistently complete high-complexity tasks, whether it avoids basic interaction errors, and whether it remains consistent after multiple iterations.

    After the official release, repeat the same tests with the same task descriptions and acceptance checklist. This preserves the bias-reduction benefit of anonymous evaluation while avoiding overinterpretation of isolated samples.

    8. Engineering and Security Recommendations

    When using generated interactive pages in real projects, several principles are important.

    First, generated code should be treated as a prototype and reviewed carefully.

    Second, if external code is executed in an online preview, it should run in a restricted sandbox with appropriate browser security policies.

    Third, unverified code strings should not be executed directly because of injection risks.

    Fourth, icons, fonts, audio, and other assets should be self-owned or clearly licensed.

    Fifth, interactions should support keyboard operation, provide reasonable contrast, and offer a reduced-motion option where appropriate.

    Sixth, pathfinding and unit updates in the game loop should be bounded to prevent large maps from blocking the main thread.

    Architecturally, simulation logic, rendering logic, and UI controls should be separated.

    • Simulation logic advances the game using a fixed timestep.
    • The rendering layer is responsible only for drawing.
    • The control layer handles sliders, pause and resume, keyboard input, and buttons.

    This separation makes it easier to replace the visual style without breaking the game logic. By contrast, when game logic is tightly coupled to DOM operations, the result becomes difficult to maintain after several rounds of generated modifications.

    9. Conclusion

    The progression from online sandboxes to draggable windows, glassmorphism transitions, and real-time strategy games demonstrates more than the ability to generate code. It shows the potential for natural language to drive an entire interactive prototyping workflow.

    For developers, the most important advantages are rapid validation and iterative development—not whether a single screenshot looks impressive.

    Online sandboxes clearly shorten the feedback loop, but service load, sampling randomness, and regressions during iteration introduce noise. A single experience of slow performance or disappointing output should be analyzed using controlled variables, repeated samples, and explicit acceptance criteria.

    A more reliable practice is to:

    • Break requirements into measurable items
    • Treat generated output as a first draft
    • Track iterations through version control
    • Include performance, security, and accessibility in acceptance testing
    • Perform regression testing after every major modification

    Only by combining the speed of natural-language generation with engineering-grade validation can developers move from a demo that merely appears to run to an application that is maintainable and deliverable.