Skip to content
Snippets Groups Projects
Verified Commit 4aabeb10 authored by Louis's avatar Louis :fire:
Browse files

Create tiles for banimate, musicbox and autotile

parents
No related branches found
No related tags found
No related merge requests found
Pipeline #455 passed with stage
in 23 seconds
Showing with 386 additions and 0 deletions
.DS_Store
node_modules
/build
/.svelte-kit
/package
.env
.env.*
!.env.example
vite.config.js.timestamp-*
vite.config.ts.timestamp-*
/.idea
/public
\ No newline at end of file
image: node:latest
pages:
stage: deploy
script:
- npm ci
- npm run build
artifacts:
paths:
- public
only:
- trunk
\ No newline at end of file
.npmrc 0 → 100644
engine-strict=true
.DS_Store
node_modules
/build
/.svelte-kit
/package
.env
.env.*
!.env.example
# Ignore files for PNPM, NPM and YARN
pnpm-lock.yaml
package-lock.json
yarn.lock
{
"useTabs": true,
"singleQuote": true,
"trailingComma": "none",
"printWidth": 100,
"plugins": ["prettier-plugin-svelte"],
"pluginSearchDirs": ["."],
"overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }]
}
# create-svelte
Everything you need to build a Svelte project, powered by [`create-svelte`](https://github.com/sveltejs/kit/tree/master/packages/create-svelte).
## Creating a project
If you're seeing this, you've probably already done this step. Congrats!
```bash
# create a new project in the current directory
npm create svelte@latest
# create a new project in my-app
npm create svelte@latest my-app
```
## Developing
Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server:
```bash
npm run dev
# or start the server and open the app in a new browser tab
npm run dev -- --open
```
## Building
To create a production version of your app:
```bash
npm run build
```
You can preview the production build with `npm run preview`.
> To deploy your app, you may need to install an [adapter](https://kit.svelte.dev/docs/adapters) for your target environment.
This diff is collapsed.
{
"name": "rust-libs-site",
"version": "0.0.1",
"private": true,
"scripts": {
"dev": "vite dev",
"build": "vite build",
"preview": "vite preview",
"test": "playwright test",
"lint": "prettier --plugin-search-dir . --check .",
"format": "prettier --plugin-search-dir . --write ."
},
"devDependencies": {
"@playwright/test": "^1.28.1",
"@sveltejs/adapter-auto": "^2.0.0",
"@sveltejs/adapter-static": "^2.0.2",
"@sveltejs/kit": "^1.5.0",
"autoprefixer": "^10.4.14",
"postcss": "^8.4.22",
"prettier": "^2.8.0",
"prettier-plugin-svelte": "^2.8.1",
"svelte": "^3.54.0",
"tailwindcss": "^3.3.1",
"vite": "^4.2.0"
},
"type": "module"
}
/** @type {import('@playwright/test').PlaywrightTestConfig} */
const config = {
webServer: {
command: 'npm run build && npm run preview',
port: 4173
},
testDir: 'tests'
};
export default config;
export default {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
}
@tailwind base;
@tailwind components;
@tailwind utilities;
\ No newline at end of file
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Rust Libs</title>
<link rel="icon" href="%sveltekit.assets%/favicon.png" />
<base target="_parent">
<meta name="viewport" content="width=device-width" />
%sveltekit.head%
</head>
<body data-sveltekit-preload-data="hover">
<div style="display: contents">%sveltekit.body%</div>
</body>
<style>
html, body {
background-color: #16151f;
height: max-content;
}
</style>
</html>
<script>
/**
* @typedef BadgeData
* @property {string} href
* @property {string} src
* @property {string} alt
*/
/**
* @typedef TagData
* @property {string} content
* @property {import('./Tag.svelte').TagType} tag_type
*/
import Tag from "./Tag.svelte";
/**
* @type {string}
*/
export let title;
/**
* @type {string}
*/
export let url;
/**
* @type {string}
*/
export let image;
/**
* @type {BadgeData[]}
*/
export let badges;
/**
* @type {TagData[]}
*/
export let tags
</script>
<div class="w-full space-y-2 bg-white p-4 shadow-lg library-card">
<div class="mb-4 flex items-center">
<div class="mr-4 flex h-12 w-12 items-center justify-center rounded-md bg-orange-500 text-white">
{#if image}
<img class="h-full w-full rounded-md" src="{image}" />
{/if}
</div>
<div>
<h2 class="text-xl font-bold text-gray-800">{title}</h2>
<a class="font-bold text-red-500 hover:text-red-400 hover:underline" href="https://{url}">{url}</a>
</div>
</div>
{#if badges}
<div class="flex flex-wrap space-x-2">
{#each badges as badge}
<a href="{badge.href}"><img alt="{badge.alt}" src="{badge.src}" /></a>
{/each}
</div>
{/if}
<div class="relative">
<div class="absolute inset-0 flex items-center" aria-hidden="true">
<div class="w-full border-t border-gray-300"></div>
</div>
<div class="relative flex justify-start">
<span class="bg-white pr-3 text-base font-semibold leading-6 text-gray-900">About</span>
</div>
</div>
<p class="text-gray-600"><slot /></p>
<div class="flex flex-wrap">
{#each tags as tag}
<Tag tag_type="{tag.tag_type}" content="{tag.content}" />
{/each}
</div>
</div>
<script>
/**
* @param {string} content
*/
export let content
/**
* @typedef {'active' | 'maintenance' | 'abandoned' | 'engine' | 'info'} TagType
* @export
*/
/**
* @param {TagType} tag_type
*/
export let tag_type
</script>
<span
class="mb-2 mr-2 rounded-md px-2 py-1 text-sm font-semibold"
class:text-sky-500={tag_type === 'info'}
class:bg-sky-100={tag_type === 'info'}
class:text-emerald-50={tag_type === 'active'}
class:bg-emerald-500={tag_type === 'active'}
class:text-orange-50={tag_type === 'maintenance'}
class:bg-orange-500={tag_type === 'maintenance'}
class:text-ruby-50={tag_type === 'abandoned'}
class:bg-ruby-500={tag_type === 'abandoned'}
class:text-sky-50={tag_type === 'engine'}
class:bg-sky-500={tag_type === 'engine'}
>{content}</span>
export const prerender = true;
<script>
import "../app.css";
import {onMount} from "svelte";
// A function that gets the current window size and posts it to the parent window
function postWindowSize() {
const payload = {
type: 'window_size',
height: document.querySelector('.library-card').offsetHeight,
src: window.location.href,
}
window.parent.postMessage({ payload }, "*");
}
onMount(function() {
window.removeEventListener('resize', postWindowSize);
window.addEventListener('resize', postWindowSize);
window.removeEventListener('load', postWindowSize)
window.addEventListener('load', postWindowSize)
document.removeEventListener('DOMContentLoaded', postWindowSize);
document.addEventListener('DOMContentLoaded', postWindowSize);
postWindowSize()
})
// if (typeof window !== 'undefined') {
// console.log("REGISTER LISTENER")
// window.removeEventListener('resize', postWindowSize);
// window.addEventListener('resize', postWindowSize);
// window.removeEventListener('load', postWindowSize)
// window.addEventListener('load', postWindowSize)
// document.removeEventListener('DOMContentLoaded', postWindowSize);
// document.addEventListener('DOMContentLoaded', postWindowSize);
// }
</script>
<slot />
\ No newline at end of file
<script>
import MicroBanimate from './micro-banimate/+page.svelte'
import MicroMusicbox from './micro-bevy-musicbox/+page.svelte'
import MicroLDTK from './micro-autotile/+page.svelte'
</script>
<article class="flex flex-col text-white items-center gap-4 p-4">
<MicroBanimate />
<MicroMusicbox />
<MicroLDTK />
</article>
\ No newline at end of file
<script>
import Card from "../../components/Card.svelte";
</script>
<Card
title="Micro Autotile"
image="https://lab.lcr.gr/uploads/-/system/project/avatar/69/noun-tiling-1036560-FFFFFF.png?width=64"
url="lab.lcr.gr/microhacks/micro_autotile"
badges={[
{ href: 'https://crates.io/crates/micro_autotile', src: 'https://img.shields.io/crates/v/micro_autotile?color=%2344a8ff&style=flat-square', alt: 'Crates IO' },
{ href: 'https://docs.rs/micro_autotile', src: 'https://img.shields.io/docsrs/micro_autotile?style=flat-square', alt: 'Docs RS' },
]}
tags={[
{ tag_type: 'active', content: 'Active Development' },
{ tag_type: 'info', content: 'Data' },
{ tag_type: 'info', content: 'Rendering' },
{ tag_type: 'info', content: 'Tilemaps' },
]}
>
An implementation of the LDTK auto-tiling algorithm, for use in
Rust programs at runtime. The representation is compatible with that saved by LDTK, meaning that
definitions can be loaded directly from LDTK JSON exports. Great for either building a
compatible editor into your project, or for using LDTK's rule format to decorate generated
content.
</Card>
\ No newline at end of file
<script>
import Card from "../../components/Card.svelte";
</script>
<Card
title="Bevy Sprite Animation"
image="https://lab.lcr.gr/uploads/-/system/project/avatar/48/noun-zoetrope-1241001-FFFFFF.png?width=64"
url="lab.lcr.gr/microhacks/micro-banimate"
badges={[
{ href: 'https://crates.io/crates/micro_banimate', src: 'https://img.shields.io/crates/v/micro_banimate?color=%2344a8ff&style=flat-square', alt: 'Crates IO' },
{ href: 'https://docs.rs/micro_banimate', src: 'https://img.shields.io/docsrs/micro_banimate?style=flat-square', alt: 'Docs RS' },
]}
tags={[
{ tag_type: 'active', content: 'Active Development' },
{ tag_type: 'engine', content: 'Bevy' },
{ tag_type: 'info', content: '2D' },
{ tag_type: 'info', content: 'Graphics' },
]}
>
Spritesheet based sprite animation for Bevy, with support for single shot override animations and seamless directional animation switching.
Complex sets of animations can be loaded as Bevy assets with hot-reloading support. Simple animations can be defined in code.
</Card>
\ No newline at end of file
<script>
import Card from "../../components/Card.svelte";
</script>
<Card
title="Bevy Musicbox"
image="https://lab.lcr.gr/uploads/-/system/project/avatar/33/noun-record-player-1872358-FFFFFF.png?width=64"
url="lab.lcr.gr/microhacks/micro-bevy-musicbox"
badges={[
{ href: 'https://crates.io/crates/micro_musicbox', src: 'https://img.shields.io/crates/v/micro_musicbox?color=%2344a8ff&style=flat-square', alt: 'Crates IO' },
{ href: 'https://docs.rs/micro_musicbox', src: 'https://img.shields.io/docsrs/micro_musicbox?style=flat-square', alt: 'Docs RS' },
]}
tags={[
{ tag_type: 'active', content: 'Active Development' },
{ tag_type: 'engine', content: 'Bevy' },
{ tag_type: 'info', content: 'Audio' },
{ tag_type: 'info', content: 'Wrappers' },
]}
>
Configures and manages bevy_kira_audio for the common game audio scenario. This includes cross fading relevant tracks, spatial audio, and channel management - giving you
individual control of the audio levels for your music, ambiance, sound effects and UI.
</Card>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment