From dc3462a864d5a84270d5761e6ec65ed7bf0f54ed Mon Sep 17 00:00:00 2001 From: xzeldon Date: Wed, 29 Jan 2025 04:55:18 +0300 Subject: [PATCH] refactor: restructure --- Dockerfile | 17 -- config/Dockerfile | 14 ++ .../docker-compose.yml | 6 +- {nginx => config}/nginx.conf | 0 index.html | 171 ++++++++++-------- src/{font => assets}/Inter.woff2 | Bin src/css/animation.css | 9 - src/css/font.css | 19 -- src/{app.js => effects.js} | 0 src/main.js | 12 +- src/styles/animations.css | 9 + src/{css/style.css => styles/base.css} | 0 src/{css/button.css => styles/components.css} | 0 src/styles/typography.css | 19 ++ 14 files changed, 148 insertions(+), 128 deletions(-) delete mode 100644 Dockerfile create mode 100644 config/Dockerfile rename docker-compose.yml => config/docker-compose.yml (56%) rename {nginx => config}/nginx.conf (100%) rename src/{font => assets}/Inter.woff2 (100%) delete mode 100644 src/css/animation.css delete mode 100644 src/css/font.css rename src/{app.js => effects.js} (100%) create mode 100644 src/styles/animations.css rename src/{css/style.css => styles/base.css} (100%) rename src/{css/button.css => styles/components.css} (100%) create mode 100644 src/styles/typography.css diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 5805431..0000000 --- a/Dockerfile +++ /dev/null @@ -1,17 +0,0 @@ -FROM node:20-slim as build - -WORKDIR /opt - -COPY ./package.json /opt/package.json -COPY ./package-lock.json /opt/package-lock.json - -RUN npm ci - -COPY . . - -RUN npm run build - -FROM nginx:1.24-alpine-slim - -COPY ./nginx/nginx.conf /etc/nginx/conf.d/default.conf -COPY --from=build /opt/dist /usr/share/nginx/html diff --git a/config/Dockerfile b/config/Dockerfile new file mode 100644 index 0000000..0573f78 --- /dev/null +++ b/config/Dockerfile @@ -0,0 +1,14 @@ +FROM node:24-slim as build + +WORKDIR /opt + +COPY package*.json ./ +RUN npm ci + +COPY . . +RUN npm run build + +FROM nginx:1.24-alpine-slim + +COPY config/nginx.conf /etc/nginx/conf.d/default.conf +COPY --from=build /opt/dist /usr/share/nginx/html \ No newline at end of file diff --git a/docker-compose.yml b/config/docker-compose.yml similarity index 56% rename from docker-compose.yml rename to config/docker-compose.yml index 0cbda48..b8c91ba 100644 --- a/docker-compose.yml +++ b/config/docker-compose.yml @@ -6,7 +6,9 @@ services: container_name: zeldon-site build: context: . - dockerfile: Dockerfile + dockerfile: config/Dockerfile ports: - - 3123:80 + - "3123:80" restart: unless-stopped + volumes: + - ./config/nginx.conf:/etc/nginx/conf.d/default.conf:ro diff --git a/nginx/nginx.conf b/config/nginx.conf similarity index 100% rename from nginx/nginx.conf rename to config/nginx.conf diff --git a/index.html b/index.html index 678022e..fa9b331 100644 --- a/index.html +++ b/index.html @@ -1,81 +1,102 @@ - + + + + - - - + + + + - - - - + + + - - - + zeldØƞ + - zeldØƞ - + + + + + + - - - - - - - - - - - -
-
- -
- - -
-
-
- - - - - \ No newline at end of file + +
+
+ +
+ + +
+
+
+ + + + diff --git a/src/font/Inter.woff2 b/src/assets/Inter.woff2 similarity index 100% rename from src/font/Inter.woff2 rename to src/assets/Inter.woff2 diff --git a/src/css/animation.css b/src/css/animation.css deleted file mode 100644 index f356513..0000000 --- a/src/css/animation.css +++ /dev/null @@ -1,9 +0,0 @@ -@keyframes fadein { - from { - opacity: 0; - } - - to { - opacity: 1.0; - } -} \ No newline at end of file diff --git a/src/css/font.css b/src/css/font.css deleted file mode 100644 index 15b62ae..0000000 --- a/src/css/font.css +++ /dev/null @@ -1,19 +0,0 @@ -@font-face { - font-family: "Inter Var"; - font-weight: 400 900; - font-display: swap; - font-style: normal; - src: url("/src/font/Inter.woff2") format("woff2"); -} - -html { - font-family: "Inter Var", sans-serif; - font-size: 17px; - box-sizing: border-box; -} - -.greeting { - font-variation-settings: "wght" 400; - letter-spacing: 0rem; - line-height: 1.7rem; -} \ No newline at end of file diff --git a/src/app.js b/src/effects.js similarity index 100% rename from src/app.js rename to src/effects.js diff --git a/src/main.js b/src/main.js index f070ad7..f5bde0e 100644 --- a/src/main.js +++ b/src/main.js @@ -1,10 +1,10 @@ -import "./css/style.css"; -import "./css/font.css"; -import "./css/animation.css"; -import "./css/button.css"; +import "./styles/base.css"; +import "./styles/typography.css"; +import "./styles/animations.css"; +import "./styles/components.css"; -import "./app"; -import { add3DRotationEffect, updateGreeting, updateTime } from "./app"; +import "./effects"; +import { add3DRotationEffect, updateGreeting, updateTime } from "./effects"; import { importJsAsModule } from "./utils"; const initialize = async () => { diff --git a/src/styles/animations.css b/src/styles/animations.css new file mode 100644 index 0000000..b23419a --- /dev/null +++ b/src/styles/animations.css @@ -0,0 +1,9 @@ +@keyframes fadein { + from { + opacity: 0; + } + + to { + opacity: 1; + } +} diff --git a/src/css/style.css b/src/styles/base.css similarity index 100% rename from src/css/style.css rename to src/styles/base.css diff --git a/src/css/button.css b/src/styles/components.css similarity index 100% rename from src/css/button.css rename to src/styles/components.css diff --git a/src/styles/typography.css b/src/styles/typography.css new file mode 100644 index 0000000..761e332 --- /dev/null +++ b/src/styles/typography.css @@ -0,0 +1,19 @@ +@font-face { + font-family: "Inter Var"; + font-weight: 400 900; + font-display: swap; + font-style: normal; + src: url("/src/assets/Inter.woff2") format("woff2"); +} + +html { + font-family: "Inter Var", sans-serif; + font-size: 17px; + box-sizing: border-box; +} + +.greeting { + font-variation-settings: "wght" 400; + letter-spacing: 0rem; + line-height: 1.7rem; +}