Skip to content

Commit

Permalink
feat: add pixi template
Browse files Browse the repository at this point in the history
  • Loading branch information
painfulexistence committed Apr 23, 2024
1 parent 405877c commit 6127293
Show file tree
Hide file tree
Showing 9 changed files with 195 additions and 0 deletions.
14 changes: 14 additions & 0 deletions templates/pixi/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
root = true

[*]
indent_style = space
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = false

[*.{js,ts,jsx,tsx}]
indent_size = 2

[*.{json,yml}]
indent_size = 2
8 changes: 8 additions & 0 deletions templates/pixi/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
*.md
*.yml
*.toml
.prettierrc
.editorconfig

.github/
.devcontainer
6 changes: 6 additions & 0 deletions templates/pixi/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"semi": true,
"singleQuote": false,
"trailingComma": "none",
"endOfLine": "lf"
}
4 changes: 4 additions & 0 deletions templates/pixi/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// {
// "editor.formatOnSave": true
// "editor.defaultFormatter": "esbenp.prettier-vscode"
// }
24 changes: 24 additions & 0 deletions templates/pixi/gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
12 changes: 12 additions & 0 deletions templates/pixi/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>My App</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.js"></script>
</body>
</html>
17 changes: 17 additions & 0 deletions templates/pixi/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "{{name}}",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite build",
"preview": "vite preview"
},
"devDependencies": {
"vite": "^5.2.0"
},
"dependencies": {
"pixi.js": "^8.1.0"
}
}
14 changes: 14 additions & 0 deletions templates/pixi/src/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { Application, Graphics } from "pixi.js";
import "./style.css";

const app = new Application();
await app.init({ width: 800, height: 450, antialias: true });
document.getElementById("app").appendChild(app.canvas);

const graphics = new Graphics();
graphics.rect(375, 200, 50, 50);
graphics.fill(0xffffff);

app.stage.addChild(graphics);

app.ticker.add((ticker) => {});
96 changes: 96 additions & 0 deletions templates/pixi/src/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
:root {
font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
line-height: 1.5;
font-weight: 400;

color-scheme: light dark;
color: rgba(255, 255, 255, 0.87);
background-color: #242424;

font-synthesis: none;
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}

a {
font-weight: 500;
color: #646cff;
text-decoration: inherit;
}
a:hover {
color: #535bf2;
}

body {
margin: 0;
display: flex;
place-items: center;
min-width: 320px;
min-height: 100vh;
}

h1 {
font-size: 3.2em;
line-height: 1.1;
}

#app {
max-width: 1280px;
margin: 0 auto;
padding: 2rem;
text-align: center;
}

.logo {
height: 6em;
padding: 1.5em;
will-change: filter;
transition: filter 300ms;
}
.logo:hover {
filter: drop-shadow(0 0 2em #646cffaa);
}
.logo.vanilla:hover {
filter: drop-shadow(0 0 2em #f7df1eaa);
}

.card {
padding: 2em;
}

.read-the-docs {
color: #888;
}

button {
border-radius: 8px;
border: 1px solid transparent;
padding: 0.6em 1.2em;
font-size: 1em;
font-weight: 500;
font-family: inherit;
background-color: #1a1a1a;
cursor: pointer;
transition: border-color 0.25s;
}
button:hover {
border-color: #646cff;
}
button:focus,
button:focus-visible {
outline: 4px auto -webkit-focus-ring-color;
}

@media (prefers-color-scheme: light) {
:root {
color: #213547;
background-color: #ffffff;
}
a:hover {
color: #747bff;
}
button {
background-color: #f9f9f9;
}
}

0 comments on commit 6127293

Please sign in to comment.