This repository contains a collection of SVG and other art assets for use in Star Wars Roleplaying Game (SWRPG) online tools and applications.
npm install @swrpg-online/art
import { ProficiencyDice } from '@swrpg-online/art/dice/narrative/D12-Proficiency-Success.svg';
function DiceComponent() {
return (
<div>
<ProficiencyDice className="w-12 h-12" />
</div>
);
}
To make this work, add the following to your vite.config.ts
:
import { defineConfig } from 'vite';
import svgr from 'vite-plugin-svgr';
export default defineConfig({
plugins: [svgr()],
});
import { Component } from '@angular/core';
import { DomSanitizer } from '@angular/platform-browser';
import type { SafeUrl } from '@angular/platform-browser';
@Component({
selector: 'app-dice',
template: `
<img [src]="proficiencyDice" alt="Proficiency Success" class="w-12 h-12">
`
})
export class DiceComponent {
proficiencyDice: SafeUrl;
constructor(private sanitizer: DomSanitizer) {
// Import the SVG content directly
const svgContent = require('@swrpg-online/art/dice/narrative/D12-Proficiency-Success.svg');
this.proficiencyDice = this.sanitizer.bypassSecurityTrustUrl(svgContent);
}
}
To make this work, add the following to your angular.json
:
{
"projects": {
"your-project": {
"architect": {
"build": {
"options": {
"assets": [
{
"glob": "**/*",
"input": "node_modules/@swrpg-online/art/dice",
"output": "/assets/dice"
}
]
}
}
}
}
}
}
The package includes framework-agnostic TypeScript support:
// React usage
import type { SVGProps } from 'react';
import { ProficiencyDice } from '@swrpg-online/art/dice/narrative/D12-Proficiency-Success.svg';
const Dice: React.FC<SVGProps<SVGSVGElement>> = ProficiencyDice;
// Angular usage
import type { SafeUrl } from '@angular/platform-browser';
const svgContent: string = require('@swrpg-online/art/dice/narrative/D12-Proficiency-Success.svg');
const safeUrl: SafeUrl = sanitizer.bypassSecurityTrustUrl(svgContent);
dice/
- Contains dice-related SVG and PNG assetsnarrative/
- Narrative dice SVGs (Proficiency, Challenge, etc.)numeric/
- Numeric dice SVGs (Aurebesh and Arabic styles)aotc/
- Attack of the Clones styleanh/
- A New Hope style
These art assets are available under a dual-license model:
-
Open Source License (CC BY-NC-SA 4.0)
- Free for use in open source projects
- Requires attribution
- Non-commercial use only
- Share-alike (derivatives must use the same license)
- See the LICENSE file for full details
-
Commercial License
- Available for commercial use
- Requires a separate license agreement
- Contact information available in CONTACT.md
I'm open to other licensing models, feel free to open an issue to discuss. The goal is to recoup design costs while still providing to the open source and swrpg communities.
- You must provide attribution to the original creator
- You must include a link to this repository
- You must indicate any modifications made to the assets
- Your project must be open source and use the same CC BY-NC-SA 4.0 license for derivative works
- Contact the creator through the information provided in CONTACT.md
- Discuss your specific use case and requirements
- Obtain a commercial license before using the assets
While this is primarily an asset repository, suggestions and improvements are welcome. Please open an issue to discuss any proposed changes.
For questions about licensing or usage, please refer to the CONTACT.md file.