Skip to content

Commit

Permalink
fix astro-rainbow-line
Browse files Browse the repository at this point in the history
  • Loading branch information
spearwolf committed Aug 29, 2024
1 parent 16ed2bb commit 7941db7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
3 changes: 2 additions & 1 deletion packages/astro-rainbow-line/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@

An astro wrapper for the [rainbow-line web component](https://github.com/spearwolf/visual-fx-web-components/tree/main/packages/rainbow-line).

> It is currently assumed that the [rainbow-line.js](./rainbow-line-v0.2.1.js) is located under `${import.meta.env.BASE_URL}/js/rainbow-line-v0.2.1.js`.
> It is currently assumed that the [rainbow-line.js](./rainbow-line-v0.2.1.js) is located under `${import.meta.env.BASE_URL}/js/rainbow-line-v0.2.1.js`
> or set the `RAINBOW_LINE_JS` environment variable to a different location than `js/rainbow-line-v0.2.1.js` by editing your `.env` file
6 changes: 5 additions & 1 deletion packages/astro-rainbow-line/RainbowLine.astro
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ interface Props {
}
const {shadow = false, colorSliceWidth = 10, sliceCycleTime = 7, cycleDirection = 'right'} = Astro.props;
const baseUrl = import.meta.env.BASE_URL;
const rainbowLineJs = import.meta.env.RAINBOW_LINE_JS || 'js/rainbow-line-v0.2.1.js';
const rainbowLineSrc = `${baseUrl}${baseUrl.endsWith('/') ? '' : '/'}${rainbowLineJs}`;
---

<rainbow-line
Expand All @@ -25,7 +29,7 @@ const {shadow = false, colorSliceWidth = 10, sliceCycleTime = 7, cycleDirection
)
}

<script is:inline async type="module" src={`${import.meta.env.BASE_URL}/js/rainbow-line-v0.2.1.js`}></script>
<script is:inline async type="module" src={rainbowLineSrc}></script>

<style>
.rainbow {
Expand Down
2 changes: 1 addition & 1 deletion packages/astro-rainbow-line/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@spearwolf/astro-rainbow-line",
"description": "astro wrapper for the rainbow-line web component",
"version": "1.0.0",
"version": "1.1.0",
"main": "RainbowLine.astro",
"author": {
"name": "Wolfger Schramm",
Expand Down

0 comments on commit 7941db7

Please sign in to comment.