├── .npmrc
├── tsconfig.json
├── .prettierignore
├── postcss.config.js
├── src
├── components
│ ├── Footer.astro
│ ├── ActiveLink.astro
│ └── Header.astro
├── env.d.ts
├── js
│ ├── glsl
│ │ ├── main.vert
│ │ └── main.frag
│ └── modules
│ │ └── scene.ts
├── pages
│ ├── about.astro
│ └── index.astro
└── layouts
│ └── Layout.astro
├── tailwind.config.js
├── .vscode
├── launch.json
├── extensions.json
└── settings.json
├── .gitignore
├── .editorconfig
├── .prettierrc.js
├── astro.config.mjs
├── public
└── favicon.svg
├── package.json
├── README.md
└── .eslintrc.js
/.npmrc:
--------------------------------------------------------------------------------
1 | engine-strict = true
2 |
--------------------------------------------------------------------------------
/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "astro/tsconfigs/strict"
3 | }
--------------------------------------------------------------------------------
/.prettierignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | package-lock.json
3 | yarn.lock
4 | pnpm-lock.yaml
5 | dist/
6 |
--------------------------------------------------------------------------------
/postcss.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | plugins: {
3 | 'tailwindcss/nesting': {},
4 | },
5 | };
6 |
--------------------------------------------------------------------------------
/src/components/Footer.astro:
--------------------------------------------------------------------------------
1 | ---
2 | ---
3 |
4 |
7 |
--------------------------------------------------------------------------------
/src/env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 | ///
3 |
--------------------------------------------------------------------------------
/src/js/glsl/main.vert:
--------------------------------------------------------------------------------
1 | attribute vec2 uv;
2 | attribute vec2 position;
3 | varying vec2 vUv;
4 |
5 | void main() {
6 | vUv = uv;
7 | gl_Position = vec4(position, 0, 1);
8 | }
9 |
--------------------------------------------------------------------------------
/src/pages/about.astro:
--------------------------------------------------------------------------------
1 | ---
2 | import Layout from '../layouts/Layout.astro';
3 | ---
4 |
5 |
6 | About page
7 |
8 |
--------------------------------------------------------------------------------
/tailwind.config.js:
--------------------------------------------------------------------------------
1 | /** @type {import('tailwindcss').Config} */
2 | module.exports = {
3 | content: ['./src/**/*.{astro,html,js,jsx,md,mdx,svelte,ts,tsx,vue}'],
4 | theme: {
5 | extend: {},
6 | },
7 | plugins: [],
8 | };
9 |
--------------------------------------------------------------------------------
/.vscode/launch.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": "0.2.0",
3 | "configurations": [
4 | {
5 | "command": "./node_modules/.bin/astro dev",
6 | "name": "Development server",
7 | "request": "launch",
8 | "type": "node-terminal"
9 | }
10 | ]
11 | }
12 |
--------------------------------------------------------------------------------
/src/js/glsl/main.frag:
--------------------------------------------------------------------------------
1 | precision highp float;
2 | uniform float uTime;
3 | uniform vec3 uColor;
4 | uniform float uOffset;
5 | varying vec2 vUv;
6 |
7 | void main() {
8 | gl_FragColor.rgb = 0.3 + 0.3 * cos(vUv.xyx * uOffset + uTime) + uColor;
9 | gl_FragColor.a = 1.0;
10 | }
11 |
--------------------------------------------------------------------------------
/.vscode/extensions.json:
--------------------------------------------------------------------------------
1 | {
2 | "recommendations": [
3 | "astro-build.astro-vscode",
4 | "bradlc.vscode-tailwindcss",
5 | "EditorConfig.EditorConfig",
6 | "dbaeumer.vscode-eslint",
7 | "esbenp.prettier-vscode"
8 | ],
9 | "unwantedRecommendations": []
10 | }
11 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # build output
2 | dist/
3 |
4 | # generated types
5 | .astro/
6 |
7 | # dependencies
8 | node_modules/
9 |
10 | # logs
11 | npm-debug.log*
12 | yarn-debug.log*
13 | yarn-error.log*
14 | pnpm-debug.log*
15 |
16 | # environment variables
17 | .env
18 | .env.production
19 |
20 | # macOS-specific files
21 | .DS_Store
22 |
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | root = true
2 |
3 | [*]
4 | charset = utf-8
5 | end_of_line = lf
6 | insert_final_newline = true
7 | trim_trailing_whitespace = true
8 | indent_style = space
9 | indent_size = 2
10 |
11 | [*.{md,markdown}]
12 | trim_trailing_whitespace = false
13 |
14 | [*.{css,scss,sass}]
15 | indent_style = tab
16 | indent_size = 4
17 |
--------------------------------------------------------------------------------
/.prettierrc.js:
--------------------------------------------------------------------------------
1 | /**
2 | * @type {import('prettier').Options}
3 | **/
4 | module.exports = {
5 | singleQuote: true,
6 | semi: true,
7 | plugins: [require.resolve('prettier-plugin-astro')],
8 | overrides: [
9 | {
10 | files: '*.astro',
11 | options: {
12 | parser: 'astro',
13 | },
14 | },
15 | ],
16 | };
17 |
--------------------------------------------------------------------------------
/src/pages/index.astro:
--------------------------------------------------------------------------------
1 | ---
2 | import Layout from '../layouts/Layout.astro';
3 | ---
4 |
5 |
6 | Home page
7 |
8 |
9 |
16 |
--------------------------------------------------------------------------------
/src/components/ActiveLink.astro:
--------------------------------------------------------------------------------
1 | ---
2 | export interface Props {
3 | href: string;
4 | className?: string;
5 | activeClassName?: string;
6 | }
7 |
8 | const { href, className, activeClassName } = Astro.props;
9 |
10 | const isActive = href === Astro.url.pathname;
11 | ---
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/astro.config.mjs:
--------------------------------------------------------------------------------
1 | // @ts-check
2 | import { defineConfig } from 'astro/config';
3 | import tailwind from '@astrojs/tailwind';
4 | // import relativeLinks from 'astro-relative-links';
5 |
6 | // https://astro.build/config
7 | export default defineConfig({
8 | scopedStyleStrategy: 'class',
9 | integrations: [
10 | tailwind(),
11 | // relativeLinks(),
12 | ],
13 | devToolbar: {
14 | enabled: false,
15 | },
16 | });
17 |
--------------------------------------------------------------------------------
/src/layouts/Layout.astro:
--------------------------------------------------------------------------------
1 | ---
2 | import Footer from '../components/Footer.astro';
3 | import Header from '../components/Header.astro';
4 |
5 | export interface Props {
6 | title: string;
7 | }
8 |
9 | const { title } = Astro.props;
10 | ---
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 | {title}
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/src/components/Header.astro:
--------------------------------------------------------------------------------
1 | ---
2 | import ActiveLink from './ActiveLink.astro';
3 | ---
4 |
5 |
6 | Hello
7 |
35 |
36 |
--------------------------------------------------------------------------------
/public/favicon.svg:
--------------------------------------------------------------------------------
1 |
14 |
--------------------------------------------------------------------------------
/.vscode/settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "eslint.validate": [
3 | "javascript",
4 | "javascriptreact",
5 | "astro", // Enable .astro
6 | "typescript", // Enable .ts
7 | "typescriptreact" // Enable .tsx
8 | ],
9 | "[html]": {
10 | "editor.defaultFormatter": "esbenp.prettier-vscode"
11 | },
12 | "[javascript]": {
13 | "editor.defaultFormatter": "esbenp.prettier-vscode"
14 | },
15 | "[json]": {
16 | "editor.defaultFormatter": "esbenp.prettier-vscode"
17 | },
18 | "[markdown]": {
19 | "files.trimTrailingWhitespace": false
20 | },
21 | "[typescript]": {
22 | "editor.defaultFormatter": "esbenp.prettier-vscode"
23 | },
24 | "[typescriptreact]": {
25 | "editor.defaultFormatter": "esbenp.prettier-vscode"
26 | },
27 | "editor.codeActionsOnSave": {
28 | "source.fixAll.eslint": "explicit"
29 | },
30 | "editor.formatOnSave": true,
31 | "editor.defaultFormatter": "esbenp.prettier-vscode"
32 | }
33 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "bulge-effect",
3 | "version": "0.0.2",
4 | "engines": {
5 | "node": ">= 18"
6 | },
7 | "scripts": {
8 | "dev": "astro dev",
9 | "start": "astro dev",
10 | "build": "astro check && astro build",
11 | "preview": "astro preview",
12 | "astro": "astro"
13 | },
14 | "dependencies": {
15 | "@astrojs/check": "^0.9.3",
16 | "@astrojs/tailwind": "^5.1.0",
17 | "astro": "^4.13.3",
18 | "astro-relative-links": "^0.4.0",
19 | "gsap": "^3.12.5",
20 | "lil-gui": "^0.19.2",
21 | "ogl": "^1.0.8",
22 | "tailwindcss": "^3.4.9",
23 | "typescript": "^5.6.2"
24 | },
25 | "devDependencies": {
26 | "@typescript-eslint/parser": "^8.0.1",
27 | "eslint": "^9.9.0",
28 | "eslint-plugin-astro": "^1.2.3",
29 | "eslint-plugin-tailwindcss": "^3.17.4",
30 | "glsl-noise": "^0.0.0",
31 | "glslify": "^7.1.1",
32 | "prettier": "^3.3.3",
33 | "prettier-plugin-astro": "^0.14.1"
34 | }
35 | }
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Astro template builder to quickly generate 2D shaders in the browser.
2 |
3 | ```
4 | npm create astro@latest -- --template ixkaito/astro-2d-shader-template
5 | ```
6 |
7 | ## 🚀 Project Structure
8 |
9 | Inside of your Astro project, you'll see the following folders and files:
10 |
11 | ```
12 | /
13 | ├── public/
14 | │ └── favicon.svg
15 | ├── src/
16 | │ ├── components/
17 | │ │ └── ActiveLink.astro
18 | │ │ └── Footer.astro
19 | │ │ └── Header.astro
20 | │ ├── layouts/
21 | │ │ └── Layout.astro
22 | │ └── pages/
23 | │ └── about.astro
24 | │ └── index.astro
25 | └── package.json
26 | ```
27 |
28 | Astro looks for `.astro` or `.md` files in the `src/pages/` directory. Each page is exposed as a route based on its file name.
29 |
30 | There's nothing special about `src/components/`, but that's where we like to put any Astro/React/Vue/Svelte/Preact components.
31 |
32 | Any static assets, like images, can be placed in the `public/` directory.
33 |
34 | ## 🧞 Commands
35 |
36 | All commands are run from the root of the project, from a terminal:
37 |
38 | | Command | Action |
39 | | :--------------------- | :----------------------------------------------- |
40 | | `npm install` | Installs dependencies |
41 | | `npm run dev` | Starts local dev server at `localhost:3000` |
42 | | `npm run build` | Build your production site to `./dist/` |
43 | | `npm run preview` | Preview your build locally, before deploying |
44 | | `npm run astro ...` | Run CLI commands like `astro add`, `astro check` |
45 | | `npm run astro --help` | Get help using the Astro CLI |
46 |
47 | ## 👀 Want to learn more?
48 |
49 | Feel free to check [our documentation](https://docs.astro.build) or jump into our [Discord server](https://astro.build/chat).
50 |
--------------------------------------------------------------------------------
/.eslintrc.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | plugins: ['tailwindcss'],
3 | extends: ['plugin:tailwindcss/recommended'],
4 | settings: {
5 | tailwindcss: {
6 | classRegex: '^(active)?[cC]lass(Name)?$',
7 | },
8 | },
9 | parserOptions: {
10 | sourceType: 'module',
11 | ecmaVersion: 2022,
12 | },
13 | overrides: [
14 | {
15 | // Define the configuration for `.astro` file.
16 | files: ['*.astro'],
17 | extends: ['plugin:astro/recommended'],
18 | // Enable this plugin
19 | plugins: ['astro'],
20 | env: {
21 | // Enables global variables available in Astro components.
22 | node: true,
23 | 'astro/astro': true,
24 | es2020: true,
25 | },
26 | // Allows Astro components to be parsed.
27 | parser: 'astro-eslint-parser',
28 | // Parse the script in `.astro` as TypeScript by adding the following configuration.
29 | // It's the setting you need when using TypeScript.
30 | parserOptions: {
31 | parser: '@typescript-eslint/parser',
32 | extraFileExtensions: ['.astro'],
33 | // The script of Astro components uses ESM.
34 | sourceType: 'module',
35 | },
36 | rules: {
37 | // Enable recommended rules
38 | 'astro/no-conflict-set-directives': 'error',
39 | 'astro/no-unused-define-vars-in-style': 'error',
40 |
41 | // override/add rules settings here, such as:
42 | // "astro/no-set-html-directive": "error"
43 | },
44 | },
45 | {
46 | // Define the configuration for `