Astro工具站

astroway-widget — Astro 工具站模板

作者 astroway

Astroway 星盘计算组件,通过一个 div 和一段脚本嵌入任意网站,Swiss Ephemeris 以 WASM 在访客浏览器内本地计算,无需 API key 或后端。

看看你的网站会是什么样

浏览真实页面截图,比较内容排版与手机效果。点击下方缩略图切换,放大查看整页细节。

3 个预览视图
桌面端首页1 / 3
桌面端截图首屏预览

由服务器浏览器实际访问页面后截取。

全部页面与视图 3

截图用于了解视觉与布局,交互效果请以实际项目为准。

采集于 2026-10-13查看来源

值得关注的模板亮点

从已有项目资料中,快速了解它的特点。

01

一个 div 加一段脚本即可嵌入,无需构建步骤和 API key

02

Swiss Ephemeris 编译为 WASM,在访客浏览器内本地计算星盘

03

支持十种界面语言与深色、浅色、跟随系统三种主题,同页可放多个组件

04

提供静态 HTML、React、Vue 3、WordPress 短代码示例

05

支持 Placidus、Koch、Regiomontanus、Campanus、Whole Sign、Equal 等宫制

06

MIT 许可,可从 npm 安装 @astroway/widget 自行托管加载器

模板详细介绍

这是一个可嵌入的出生星盘计算组件。集成方式是在页面中放置一个带 data-astroway-widget="natal" 的 div,并引入托管在 app.astroway.info 的 widget.js;脚本会查找页面上所有匹配元素,在其中挂载 iframe 并随星盘绘制调整尺寸。也可以从 npm 安装 @astroway/widget 自行托管加载器,仓库提供静态 HTML、React、Vue 3 和 WordPress 短代码示例。

计算由编译为 WebAssembly 的 Swiss Ephemeris 完成,运行在访客浏览器中,因此不需要 API key 或后端服务,访客输入的日期、时间和地点留在浏览器内。组件支持 data-lang 指定界面语言(uk、en、de、pl、es、pt、fr、it、hi、ko),data-theme 指定深色、浅色或跟随系统,同一页面可放置多个组件并各自设置语言与主题。输出包括行星位置、宫头、可配置容许度的相位以及绘制的星盘轮。宫制包含 Placidus、Koch、Regiomontanus、Campanus、Whole Sign 与 Equal。星历覆盖范围沿用 DE431 模型,约为公元前 13000 年至公元 17000 年。

使用上有若干限制需要注意。托管的 widget.js 会原地更新,因此无法在 script 标签上使用 SRI 哈希;若安全策略要求 SRI,需改用 npm 包并从自有源提供 widget.js 再固定哈希。站点若发送严格 CSP,需要放行 script-src 与 frame-src 的 app.astroway.info。组件在 iframe 内渲染的“Powered by AstroWay”链接位于其自身域名,不会被搜索引擎计为来自你站点的链接;如需可被识别的署名,可在组件旁另加普通链接。旧版全局变量写法仍可用,但每页仅支持一个组件,新集成应使用 data 属性形式。

Astro工具站

适合你的项目吗?

适用场景

  • 在占星、星座类内容网站中嵌入出生星盘计算器
  • 在 WordPress 站点通过短代码加入星盘工具
  • 在 React 或 Vue 3 项目中以组件形式集成星盘计算
  • 需要访客出生数据不离开浏览器的隐私敏感场景

适合人群

  • 运营占星或星座内容的网站与博客
  • 使用 WordPress、React 或 Vue 3 的开发者
  • 希望以 iframe 方式快速嵌入工具、不自行搭建计算后端的团队
  • 对访客出生数据本地处理有要求的站点

上手与定制指南

结合仓库当前版本的说明,按下面的资料检查内容、配置与运行要求。

  1. 1

    在页面中加入 <div data-astroway-widget="natal" data-lang="en" data-theme="dark"></div> 并引入 https://app.astroway.info/widget.js(async)

  2. 2

    如需自行托管,执行 npm install @astroway/widget 并 import '@astroway/widget'

  3. 3

    托管版 widget.js 会原地更新,无法使用 SRI;安全策略要求 SRI 时应自托管并固定哈希

  4. 4

    严格 CSP 下需放行 script-src 与 frame-src 的 https://app.astroway.info

  5. 5

    旧版全局变量写法每页仅支持一个组件,新集成请使用 data 属性形式

查看仓库使用说明

授权与来源资料

使用条件与限制

免费使用 · 保留许可声明

本次收录的是公开仓库中采用 MIT 许可的免费版本;免费范围为该版本代码,不代表外部服务或第三方素材免费。

使用时需要遵守

  • 允许免费使用、修改、商用和分发该版本代码。
  • 分发代码副本或实质性部分时,保留原作者版权声明和完整 MIT 许可声明。
  • 代码按现状提供;担保与责任限制以原许可证及适用法律为准。

额外费用与待核对事项

  • 演示图片、字体、图标及其他第三方素材需按各自许可核对,不能仅凭代码的 MIT 许可判断。
  • 域名、托管、数据库、支付或 AI 等外部服务可能另外收费。
  • 托管版 widget.js 会原地更新,无法在 script 标签上使用 SRI 哈希;若安全策略要求 SRI,必须改用 npm 包并从自有源提供 widget.js 再固定哈希。
  • 站点若发送严格 CSP,必须放行加载器与 iframe 的 app.astroway.info(script-src 与 frame-src),否则组件无法加载。
  • 组件在 iframe 内渲染的“Powered by AstroWay”链接位于 Astroway 自身域名,不会被搜索引擎计为来自你站点的链接,因此无法作为你站点的署名链接。
  • 旧版全局变量写法每页仅支持一个组件,新集成应改用 data 属性形式。
  • 星历文件在 iframe 内从 Astroway 自有源获取,因此组件依赖 app.astroway.info 这一外部服务可用。
查看原文依据

Permission is hereby granted, free of charge

许可证原文

The hosted `widget.js` updates in place, so a Subresource Integrity hash on the `<script>` tag would break the embed on the next release. If your security policy requires SRI, install the npm package instead, serve `widget.js` from your own origin and pin the hash there.

README 原文

If your site sends a strict CSP, allow the loader and the iframe:

README 原文

The widget renders a "Powered by AstroWay" line inside the iframe, but that link lives on our domain, not on yours, so search engines do not read it as a link from your site.

README 原文

This form supports a single widget per page. New integrations should use the data-attribute form above.

README 原文

the ephemeris files are fetched inside the iframe, on our origin.

README 原文
https://github.com/astroway/astroway-widget/blob/main/LICENSEhttps://github.com/astroway/astroway-widget/blob/main/README.md

DeepSeek 根据仓库许可证和 README 整理 ·2026-10-13。结果仅覆盖已读取资料,依赖、图片、字体及后续条款变更以各自原文为准。

项目核对记录与介绍依据

模板资料

来源平台
GitHub
资料与维护参考分
资料较完整 · 80 / 100
技术栈
Astro
网站类型
工具站
这个分数如何计算

本站按许可资料(最高30分)、演示链接(12分)、预览图(10分)、Star数(15分)、记录的维护时间(15分)、描述完整度(8分)、功能记录(5分)和分类资料(5分)计算。它不是代码、安全或性能测试,也不是 Google 评分;有链接不代表已实测可用。

这个项目需要核对什么

记录的仓库更新时间
2026-08-22
截图检查日期
2026-10-13

已收录演示链接。请用你的内容与屏幕尺寸检查;有演示不代表表单、认证或支付已经可用。

目录记录的主要技术栈是 Astro。请通过依赖清单和锁文件核对实际版本与托管要求。这些说明基于收录资料,不代表代码审计或部署实测。

查看具体选型方法 →

介绍的制作与核对状态

介绍由 AI 辅助整理目录与仓库资料。仓库作者不等于这篇介绍的审核者。

审核声明: [email protected] · 2026-10-13

查看当时使用的来源资料

SHA-256: d608f3d2bf27d71c13cfd57c1ad97948cccf807ca84e756cf946cc4b3beb1062

2026-10-13T00:57:13.053Z

来源文件 / 仓库
# Astroway Natal Chart Widget

[![npm](https://img.shields.io/npm/v/@astroway/widget)](https://www.npmjs.com/package/@astroway/widget)
[![license](https://img.shields.io/npm/l/@astroway/widget)](LICENSE)

Embeddable natal chart calculator for any website. One `<div>`, one `<script>`, no build step and no API key.

Positions come from [Swiss Ephemeris](https://www.astro.com/swisseph/) compiled to WebAssembly and are computed **in the visitor's browser**. Birth data is never sent to a server.

**Live demo and configurator:** https://app.astroway.info/widget

## Install

```html
<div data-astroway-widget="natal" data-lang="en" data-theme="dark"></div>
<script src="https://app.astroway.info/widget.js" async></script>
```

That is the whole integration. The script finds every `[data-astroway-widget]` on the page, mounts an iframe into it and resizes it as the chart is drawn.

Or from npm, if you prefer to self-host the loader:

```bash
npm install @astroway/widget
```

```js
import '@astroway/widget'
```

### Pinning a version

The hosted `widget.js` updates in place, so a Subresource Integrity hash on the `<script>` tag would break the embed on the next release. If your security policy requires SRI, install the npm package instead, serve `widget.js` from your own origin and pin the hash there.

## Options

| Attribute | Values | Default | Meaning |
|---|---|---|---|
| `data-astroway-widget` | `natal` | `natal` | Which widget to mount |
| `data-lang` | `uk` `en` `de` `pl` `es` `pt` `fr` `it` `hi` `ko` | `en` | Interface language |
| `data-theme` | `dark` `light` `auto` | `dark` | Colour scheme; `auto` follows the visitor's system setting |

Several widgets can live on one page, each with its own language and theme:

```html
<div data-astroway-widget="natal" data-lang="de" data-theme="light"></div>
<div data-astroway-widget="natal" data-lang="pl" data-theme="dark"></div>
<script src="https://app.astroway.info/widget.js" async></script>
```

## Content Security Policy

If your site sends a strict CSP, allow the loader and the iframe:

```
script-src  https://app.astroway.info;
frame-src   https://app.astroway.info;
```

Nothing else is needed: the widget loads no third-party assets on your page, and the ephemeris files are fetched inside the iframe, on our origin.

## Attribution

The widget renders a "Powered by AstroWay" line inside the iframe, but that link lives on our domain, not on yours, so search engines do not read it as a link from your site. If you want to credit the project in a way that counts, add a plain link next to the widget:

```html
<p>Chart engine by <a href="https://app.astroway.info" rel="noopener">Astroway</a>.</p>
```

This is optional. The widget works the same either way.

## What the visitor gets

Planet positions to the arcsecond, house cusps to the arcminute, aspects with configurable orbs, and a rendered chart wheel. House systems include Placidus, Koch, Regiomontanus, Campanus, Whole Sign and Equal.

The full application behind the widget covers synastry, transits, progressions, directions, solar and lunar returns, Human Design and around forty other techniques: https://app.astroway.info/features

## Accuracy

The engine is the same one that powers [app.astroway.info](https://app.astroway.info) and the [Astroway Calculation API](https://api.astroway.info). Planet longitudes are checked against Swiss Ephemeris reference output to within one arcsecond, house cusps to within one arcminute.

Ephemeris coverage follows the DE431 model: roughly 13000 BCE to 17000 CE.

## Privacy

The iframe runs on `app.astroway.info` and loads the WASM ephemeris on demand. Date, time and place entered by the visitor stay in the browser: the chart is computed locally and no birth data is transmitted. The loader adds no cookies and no tracking of its own.

## Legacy integration

Pages that already use the global-variable form keep working:

```html
<div id="astroway-widget"></div>
<script>
  var astrowayWidget = "natal";
  var astrowayLang   = "en";
  var astrowayTheme  = "dark";
</script>
<script src="https://app.astroway.info/widget.js"></script>
```

This form supports a single widget per page. New integrations should use the data-attribute form above.

## Examples

- [`examples/plain.html`](examples/plain.html): static HTML
- [`examples/react.jsx`](examples/react.jsx): React component
- [`examples/vue.vue`](examples/vue.vue): Vue 3 single file component
- [`examples/wordpress.php`](examples/wordpress.php): WordPress shortcode

## Related

- [Astroway app](https://app.astroway.info): the full application
- [Calculation API](https://api.astroway.info): REST access to the same engine, 760 endpoints
- [`@astroway/mcp`](https://www.npmjs.com/package/@astroway/mcp): MCP server for AI assistants

## Licence

MIT. See [LICENSE](LICENSE).
反馈内容错误

看看同类模板

对比同技术栈与用途的模板,找到更适合的视觉与内容结构。