add: docker support
This commit is contained in:
parent
7947b46af5
commit
5d72fa6b64
20
Dockerfile
Normal file
20
Dockerfile
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
# Use the official Bun image as the base image
|
||||||
|
FROM oven/bun:latest
|
||||||
|
|
||||||
|
# Set the working directory inside the container
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
# Copy the package.json and bun.lockb files to the working directory
|
||||||
|
COPY package.json bun.lockb ./
|
||||||
|
|
||||||
|
# Install dependencies
|
||||||
|
RUN bun install
|
||||||
|
|
||||||
|
# Copy the rest of the application code
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
# Expose the port the app runs on
|
||||||
|
EXPOSE 4173
|
||||||
|
|
||||||
|
# Command to run the application
|
||||||
|
CMD ["bun", "go"]
|
15
docker-compose.yml
Normal file
15
docker-compose.yml
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
version: '3.8'
|
||||||
|
|
||||||
|
services:
|
||||||
|
aquavox:
|
||||||
|
build: .
|
||||||
|
ports:
|
||||||
|
- "4173:4173"
|
||||||
|
environment:
|
||||||
|
- NODE_ENV=production
|
||||||
|
volumes:
|
||||||
|
- .:/app
|
||||||
|
command: ["bun", "go"]
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
node_modules:
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "aquavox",
|
"name": "aquavox",
|
||||||
"version": "2.0.2",
|
"version": "2.0.3",
|
||||||
"private": false,
|
"private": false,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite dev",
|
"dev": "vite dev",
|
||||||
|
25
src/lib/graphics/smoothScroll.ts
Normal file
25
src/lib/graphics/smoothScroll.ts
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
import BezierEasing from 'bezier-easing';
|
||||||
|
|
||||||
|
export function smoothScrollTo(element: HTMLElement, to: number, duration: number, timingFunction: Function) {
|
||||||
|
const start = element.scrollTop;
|
||||||
|
const change = to - start;
|
||||||
|
const startTime = performance.now();
|
||||||
|
|
||||||
|
function animateScroll(timestamp: number) {
|
||||||
|
const elapsedTime = timestamp - startTime;
|
||||||
|
const progress = Math.min(elapsedTime / duration, 1);
|
||||||
|
const easedProgress = timingFunction(progress, 0.38, 0, 0.24, 0.99);
|
||||||
|
element.scrollTop = start + change * easedProgress;
|
||||||
|
|
||||||
|
if (elapsedTime < duration) {
|
||||||
|
requestAnimationFrame(animateScroll);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
requestAnimationFrame(animateScroll);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Define your custom Bézier curve function
|
||||||
|
export function customBezier(progress: number, p1x: number, p1y: number, p2x: number, p2y: number) {
|
||||||
|
return BezierEasing(p1x, p1y, p2x, p2y)(progress);
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user