当前位置: 首页 > news >正文

Web工程化命题,拒绝页面仔

Web工程化命题,拒绝页面仔

这里整理了五条纯前端开发命题。这些题目不涉及游戏逻辑,也不依赖后端接口,完全聚焦于浏览器端的能力边界:复杂交互、性能优化、数据可视化、离线存储以及底层API的封装。它们考察的是开发者在没有框架“魔法”加持下,对DOM、事件循环、内存管理和浏览器兼容性的真实掌控力。别只会在React里写`useEffect`,我要看你能不能徒手搞定这些脏活累活。

1. High-Performance Virtual Data Grid Web Page

Build a single-page web application featuring a data grid component that handles 100,000+ rows without lagging. The core requirement is windowing (virtualization): only render the DOM nodes currently visible in the viewport. Implement column sorting, filtering, and resizable columns. The challenge is to ensure smooth scrolling (60 FPS) even when each row contains complex content (e.g., avatars, status badges). Do not use any third-party grid libraries (like AG Grid or TanStack Table). Use native JavaScript or a lightweight framework (Preact/Svelte) to minimize overhead. Implement a "sticky header" and "sticky first column" feature. Measure performance using Chrome DevTools; ensure no layout thrashing during scroll events. The page should include a control panel to toggle between virtualized and non-virtualized modes for comparison.

Tech Stack:
- Core: Vanilla JavaScript or Preact/Svelte (no heavy frameworks).
- Rendering: HTML5 DOM manipulation with `transform: translateY` for performance.
- State: Minimal local state management for sort/filter logic.
- Optimization: `requestAnimationFrame` for scroll handling; CSS `contain` property for isolation.

2. Offline-First Rich Text Editor Web App

Develop a single-page rich text editor web application that works fully offline and supports basic formatting (bold, italic, lists, links). Use the `contenteditable` API or a custom implementation based on `div` structures. Store documents in `IndexedDB` using a wrapper like `idb`. Implement a versioning system: every save creates a new version, allowing users to revert to previous states. The hard part: simulate a "sync conflict" scenario where two tabs edit the same document. Implement a simple merge strategy (e.g., last-write-wins or character-level diff) to resolve conflicts when both tabs come back online. No backend required; simulate the network state with a toggle switch in the UI. The interface should resemble a minimalist writing tool like Notion or Obsidian.

Tech Stack:
- Core: Vanilla JavaScript, Web Components (optional for encapsulation).
- Storage: IndexedDB (via `idb` or raw API) for large text storage.
- Algorithm: Diff-Match-Patch algorithm for text comparison and merging.
- UI: Custom toolbar with accessibility support (ARIA labels).

3. Interactive SVG Map Viewer Web Page

Create a single-page interactive map viewer web application using inline SVG. The map should represent a fictional city with districts, streets, and points of interest. Implement smooth zooming (mouse wheel) and panning (drag) using CSS transforms or SVG matrix transformations. Clicking on a district should highlight it and show a tooltip with details. The challenge is performance: the SVG may contain thousands of path elements. Optimize rendering by grouping elements and using `pointer-events` wisely. Implement a "search" feature that filters districts and animates the camera to focus on the result. Ensure the map is responsive and works on touch devices (pinch-to-zoom). No mapping libraries (like Leaflet or Mapbox) allowed. The page should include a sidebar for listing search results and district info.

Tech Stack:
- Core: Vanilla JavaScript, Inline SVG.
- Math: Matrix transformation logic for zoom/pan calculations.
- Interaction: Pointer Events API for unified mouse/touch handling.
- Animation: CSS Transitions or Web Animations API for smooth camera movements.

4. Browser-Based Image Editor Web Studio

Build a single-page image editor web studio that allows users to upload an image and apply real-time filters (grayscale, sepia, blur, brightness, contrast). The core requirement is to use WebGL for filter processing, not Canvas 2D API, to ensure high performance on large images. Write custom fragment shaders for each filter. Implement a histogram display that updates in real-time as filters are applied. Allow users to adjust filter intensity via sliders. Save the processed image as a PNG/JPEG. Handle CORS issues if loading images from external URLs (use proxy or base64). The UI should be clean and minimalist, resembling a professional photo editing tool like Lightroom, with a dark theme and dockable panels.

Tech Stack:
- Core: Vanilla JavaScript, WebGL (raw API, no Three.js/PixiJS).
- Shaders: GLSL for custom fragment shaders.
- Input: HTML File API for image upload.
- Output: Canvas `toDataURL` for saving images.

5. Accessible Modal Dialog System Demo Page

Implement a single-page demo web application showcasing a robust modal dialog system that strictly adheres to WAI-ARIA Authoring Practices. The page should feature multiple trigger buttons opening different types of modals (simple alert, form input, nested modal). When a modal opens, focus must move to the first interactive element inside it. Tabbing through elements must trap focus within the modal; pressing Tab on the last element should loop back to the first. Pressing Escape must close the modal and restore focus to the trigger element. Support nested modals (stacking context). Ensure screen readers announce the modal title and content upon opening. Disable scrolling on the body element when the modal is open. Include a "Accessibility Report" section that runs automated checks on the current modal state. No external accessibility libraries allowed.

Tech Stack:
- Core: Vanilla JavaScript or Web Components.
- Testing: Jest/Vitest + Jest-DOM for accessibility assertions (can be run in browser console).
- Standards: WAI-ARIA roles (`dialog`, `alertdialog`), `aria-modal`, `aria-labelledby`.
- Styling: CSS for backdrop blur and transition animations.

这五个命题涵盖了大数据渲染、离线数据同步、矢量图形交互、GPU加速图像处理以及无障碍访问合规性。它们都是前端工程中容易被忽视但至关重要的领域。能独立完成这些任务,说明你不再只是一个UI绘制者,而是一个懂性能、懂标准、懂底层原理的真正前端工程师。

http://www.jsqmd.com/news/937266/

相关文章:

  • python中的浅拷贝和深拷贝
  • 向量空间JBoltAI:从产品痛点看AI怎么解
  • 智能音箱DIY改造:移植SONOS模块到传统户外音箱
  • 2026 深圳钻石回收实测榜单|五大正规机构真实测评! - 合扬奢侈品交易中心
  • 终极免费Mac鼠标指针定制指南:如何告别单调光标的完整解决方案
  • 1200kV/120kJ冲击发生器的结构配置
  • 2026 儿童读书会体系哪家好?TOP5 标杆品牌实测,省心省力选对课 - 资讯快报
  • 从特斯拉到理想:拆解主流车型ADAS摄像头参数,看车企的‘视觉方案’到底怎么选
  • 如何用Boss Show Time插件掌握招聘时效性:求职者的智能时间管理工具
  • 基于Arduino与PCA9685的智能LED灯光系统设计与实现
  • 大模型的典型应用场景
  • 不止于点击高亮:用Unity的QuickOutline插件,5分钟搞定AR/VR中的物体交互反馈
  • 2026 东莞石排镇新房除甲醛怎么选?实地调研对比后优先推荐东莞佰家环保科技有限公司 - 专注室内空气检测治理
  • 常见的性能测试方法
  • WuWa-Mod:鸣潮游戏模组终极指南,5分钟解锁15+隐藏功能
  • Ansaldo 167A.0100009电源驱动板
  • 2026年图文识别转文字工具保姆级教程:免费方案推荐+手把手教你用 - AI测评专家
  • 2026互联网大厂Java面试风向已变(附牛客网最新高频题+答案)
  • 1200kV/120kJ雷电冲击电压发生器的技术参数
  • 金橙子LMC1控制卡二次开发避坑指南:从‘通用错误码1’到‘UNICODE字符’的五个常见问题
  • 翎渡 LinkDo 完善日本至中国跨境供应链服务能力,推进医药健康品类合规流通
  • 2026重庆劳动仲裁维权,靠谱本土律所帮打工族高效维权 - 可口饭
  • Untrunc终极指南:免费快速修复损坏MP4/MOV视频的完整教程
  • 从DOCK 6.9到6.11:手把手教你升级UCSF DOCK并体验RDKit集成新功能
  • 英雄联盟智能助手:本地自动化工具LeagueAkari完整使用指南
  • 基于Arduino与555/4017的软硬件分离西蒙游戏设计与实现
  • 证件遗失不用跑报社,线上就能办登报挂失 - GrowthUME
  • 基于ATtiny167的电蚊拍智能化改造:电流采样与信号处理实战
  • 如何快速掌握开源游戏助手:5个实用技巧完整指南
  • OpCore-Simplify:三分钟搞定黑苹果配置的终极自动化工具