Hacker News 中文摘要

RSS订阅

展示HN:看到这个酷炫的导航效果后,我用HTML+CSS做了个简易版 -- Show HN: I saw this cool navigation reveal, so I made a simple HTML+CSS version

文章摘要

这是一个GitHub项目"fun-with-clip-path",主要展示CSS clip-path属性的创意应用。项目页面包含GitHub平台导航菜单,涉及AI编程助手、开发者工作流和应用安全等功能,但核心内容是关于CSS剪裁路径效果的趣味实现。

文章总结

GitHub项目:Fun with clip-path(CSS剪裁路径趣味实验)

项目地址:https://github.com/Momciloo/fun-with-clip-path

核心内容: 1. 项目简介 - 一个纯HTML+CSS实现的动态菜单效果,无需JavaScript - 灵感来源于iventions.com网站的设计(作者在X平台看到后受启发) - 演示地址:https://fun-with-clip-path.vercel.app/

  1. 技术实现
  • 使用两个clip-path剪裁路径: a) 圆形剪裁:从屏幕左上角向右下角扩展的动画效果

    • 采用vmax单位(视口最大尺寸)
    • 使用1.42倍率(√2,保持宽高比)
    • 关键代码:clip-path: circle(calc(1.42 * 100vmax) at 0 0)

    b) 多边形剪裁:模拟"光线"效果

    • 当前为硬编码多边形
    • 可通过JS实现动态计算(增强响应式适配)
  1. 项目状态
  • 许可协议:MIT
  • 获得75颗星标
  • 最后更新:2026年2月8日(样式调整)
  1. 技术构成
  • CSS占比60.4%
  • HTML占比39.6%
  • 包含基础项目文件(.gitignore/LICENSE/README等)

项目特点: 通过创新的CSS clip-path应用,实现了原本需要JavaScript才能完成的动态视觉效果,展示了CSS的强大能力。作者特别说明了数学计算在实现完美圆形扩展动画中的关键作用。

评论总结

总结评论内容:

  1. 正面评价(认可设计创意):

    • "Nice work!" "Good job! Looks amazing!"(评论1,6)
    • "It is a great way to call attention to content."(评论6)
    • "This is just awesome!"(评论13)
  2. 负面评价(质疑实用性):

    • "one thing i dislike about 'good design'...it usually takes away from information density"(评论2)
    • "to have to navigate from one side of the screen to the opposite one is quite suboptimal"(评论3)
    • "Design is about solving problems...Why do I have to click on a thing to reveal the menu"(评论4)
  3. 可访问性问题:

    • "Tabbing doesn't seem to respond very well...can't expand without using a mouse"(评论7)
    • "i wish that designers cared about making things more accessible"(评论2)
  4. 技术问题反馈:

    • "Is there a demo? The link points to a github repo"(评论11)
    • "Site is death hugged? Anyone have a working link?"(评论12)
  5. 怀旧/类比评价:

    • "Flashback to the days of Macromedia Flash."(评论5)
    • "You made me recalled we made something similar...last decade"(评论9)
  6. 技术细节指正:

    • "calc(1.42 * 100vmax) is the same as 142vmax"(评论10)