Пропустить навигацию
COBE v2: reliably use any DOM elements as markers & arcs.
0:00 / 0:29

COBE v2: reliably use any DOM elements as markers & arcs.

Shu

@shuding67 тыс. подписчиков

Открыть в X
4 185 отметок «Нравится»СкачатьОригинальный пост

225 972 просмотра

COBE v2: reliably use any DOM elements as markers & arcs. CSS transition, animation, filter, interactivity, ...all just work. High perf, zero deps, still ~5KB. Coming soon.

37 комментариев

Комментарии из оригинального поста в X (Twitter)

  • Фото профиля Shu

    @shuding

    It creatively uses CSS-native APIs, position-anchor and CSS variable. Here's how you style a label without any JS: Your marker automatically follows the anchored position on the 3D space. Use the `--cobe-visible-` prefixed variable to toggle between visible/invisible styles.

    118 отметок «Нравится»

  • Фото профиля Shu

    @shuding

    2 years ago I was working on the separated marker/arc layers. But I stopped there because there’s no great APIs to anchor DOM nodes reliably and declaratively. I really don’t want JS to be involved here like exposing {x,y,z}[] and have positioning a userland thing. It’s definitely going to have perf and frame-syncing issues in different frameworks. And users need to handle all the DOM layering and position: relative/fixed things. So I waited until the declarative CSS anchor positioning API gets wider adopted. It feels great!

    52 отметки «Нравится»

  • Фото профиля Shu

    @shuding

    And the conditional CSS trick. You can define the fallback value: .marker { opacity: 1; opacity: var(--cobe-visible-marker, 0); transition: opacity .3s ease; } And COBE will unset the variable when the marker is invisible (behind the globe) so final opacity fallbacks to 0. If visible, the variable is set to “invalid” and the CSS is equivalent to: .marker { opacity: 1; opacity: invalid; transition: opacity .3s ease; } So it shows as 1. Transitions all work. You can use this variable to toggle any CSS properties too including blur in the demo video.

    22 отметки «Нравится»

  • Фото профиля Gonzalo Cordova

    @gonzalo_io

    clean! I posted my first design yesterday and just got humbled

    14 отметок «Нравится»

  • Фото профиля Manu Arora

    @mannupaaji

    youre the best

    7 отметок «Нравится»

  • Фото профиля Kevin Okinedo

    @KevinOkinedo

    This is gorgeous, currently using v1 on and will be upgrading once available. Awesome work!

    6 отметок «Нравится»

  • Фото профиля stonechat

    @thestonechat

    is there a marker limit?

    3 отметки «Нравится»

  • Фото профиля Igor bedesqui

    @bedesqui

    @1weiho whaaaaaat, so cool

    3 отметки «Нравится»

  • Фото профиля Andrew Gadzik ▲

    @z0oks

    @samko_cx We should chat 😂

    2 отметки «Нравится»

  • Фото профиля Rajat

    @rajatsandeepsen

    im pretty sure AI can't recreate this kind of DX

    2 отметки «Нравится»

  • Фото профиля Pablo Stanley

    @pablostanley

    DARK MAGIC

    2 отметки «Нравится»

  • Фото профиля Asad Synt

    @AsadSynt

    need it

    1 отметка «Нравится»

  • Фото профиля rege

    @rege_dev

    This is soooo good! 🤏😎 🤏🕶️ 😲

    1 отметка «Нравится»

  • Фото профиля Christo Ribeiro

    @ChristoRibeiro

    This is beautiful 🤩

    1 отметка «Нравится»

  • Фото профиля dom

    @loopdom

    I ended up using this for a side project tool - very cool stuff. Thanks for sharing!

    1 отметка «Нравится»

  • Фото профиля Jp 🦝

    @jpvalery

    Literally started using it yesterday for a project—if you have an alpha or beta, I’m happy to give it a try 🙏

    1 отметка «Нравится»

  • Фото профиля Evil Rabbit

    @evilrabbit_

    🤍

    1 отметка «Нравится»

  • Фото профиля Michael Houghton 🐺

    @merlindotcom_

    Man I need this on our maps these marker styles are dope and ffffaaast

    1 отметка «Нравится»

  • Фото профиля Matt

    @uixmat

    this is so f beautiful bro ❤️🥰

    1 отметка «Нравится»

  • Фото профиля Atif Saleem

    @malikatifsaleem

    It looks great and I got few ideas to adopt from it. I saw something similar at @Replit Agent 4 launch where @amasad prompted the agent to build.

    1 отметка «Нравится»