I'll add a style parameter, so that it can be customized any time it's used. I'll also see if a minWidth parameter could make sense as well.
This little GitHub icon is really elegant
That doesn't feel like it's generic enough to be achieved with an injector. For this and similar scenarios, we can provide separate vals that (a) infer the val URL and (b) returns the Val Town logo URL. Users can then build a more integrated component in their website.
Would be awesome if these "inject" utilities were able to inject arbitrary stuff
I don't know when or why, but now on @stevekrouse/dateme, the ribbon links to this page, not the dateme val. I will set it manually. I wonder why the rootVal inference broke
Seems like it adds this artifact:
URL: https://dateme.directory/home
Also, clicking it seems to go to this val, not the val where my code lives
Should be fixed now!
Thanks!
New issue: on mobile it's getting in the way of my important navbar element. Demo: https://www.val.town/v/stevekrouse/dateme_code_on_val_town
So I had to remove it. It'd be awesome to have it be configurable to show up on other spots on the page or be smaller or be a footer :)
For now, I removed it for screens below 768px
It looks like the css itself is fairly fixed: https://github.com/simonwhitaker/github-fork-ribbon-css/blob/gh-pages/gh-fork-ribbon.css
I see a couple options on how to customize this:
<style>
tag to be injected in the shadow DOMgithub-fork-ribbon-css
and use that instead. Then we'd do css wrangling to enable placement and color customization.To show it on other spots or to make it smaller, either option works. In order for it to be a footer, I think the best way is option (1).
As a user of the wrapper, what would you prefer?
I don't want it removed on small screens always. I have it on other small screens looking good now.
I like the idea of passing a custom element or providing other options.
This little GitHub icon is really elegant: https://counterscale.dev/
Would be awesome if these "inject" utilities were able to inject arbitrary stuff, ie like this https://www.val.town/v/stevekrouse/ReloadScript
modifyFetchHandler
should work on fetch handlers that don't return Promises as wellI'll add a
style
parameter, so that it can be customized any time it's used. I'll also see if aminWidth
parameter could make sense as well.That doesn't feel like it's generic enough to be achieved with an injector. For this and similar scenarios, we can provide separate vals that (a) infer the val URL and (b) returns the Val Town logo URL. Users can then build a more integrated component in their website.
True! @andreterron/InjectHTMLElementStream can inject anything. We can also build generic injectors for strings, handlers, responses, etc.
Good catch!
Added the
style
parameter, and updated themodifyFetchHandler
to support non-Promise returns!Nice! Worked well - updated @stevekrouse/dateme
I don't know when or why, but now on @stevekrouse/dateme, the ribbon links to this page, not the dateme val. I will set it manually. I wonder why the rootVal inference broke
When I tried including it in my val https://www.val.town/v/willthereader/Jumpchain_Website, it takes me to this page.
Sent you a pr that fixes it by just bumping the version to the latest: https://www.val.town/pulls/56b82afc-4935-11ef-8dcf-de64eea55b61
I also sent a pr to this val to update the readme usage to also use v50: https://www.val.town/pulls/42c48072-4935-11ef-a7c9-de64eea55b61
Thank you @ stevekrouse for fixing my bug!
Merged!