diff --git a/README.md b/README.md
index c6bd6ea..9e94155 100644
--- a/README.md
+++ b/README.md
@@ -1,10 +1,11 @@
# Skylo Frontend
-Skylo is a digital card game, which has some similarities to the popular card game Skyjo ;)
+This is a tribute to the creator of my favorite game, Skyjo! Please purchase the original game to discover the true gaming experience: https://www.magilano.com/produkt/skyjo/
-Play latest release here: https://skyjo.voltvector.org/
+Play latest release here: https://skylo-game.com
This is the frontend of this web based game using:
+
- Typescript
- React
- Vite
@@ -21,8 +22,6 @@ When two players have joined the same session they can start the game:
Game play:

-

-
Backend: https://github.com/pb-coding/skyjo-be
diff --git a/index.html b/index.html
index 994d2b6..ff148e0 100644
--- a/index.html
+++ b/index.html
@@ -7,7 +7,12 @@
rel="stylesheet"
as="style"
/>
-
+
+
+
Play Skylo!
diff --git a/package-lock.json b/package-lock.json
index 8d8a526..4da8e93 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -32,7 +32,7 @@
"eslint": "^8.45.0",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.3",
- "postcss": "^8.4.30",
+ "postcss": "^8.4.31",
"tailwindcss": "^3.3.3",
"typescript": "^5.0.2",
"vite": "^4.4.5",
diff --git a/package.json b/package.json
index d6fb39e..59ec13d 100644
--- a/package.json
+++ b/package.json
@@ -34,7 +34,7 @@
"eslint": "^8.45.0",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.3",
- "postcss": "^8.4.30",
+ "postcss": "^8.4.31",
"tailwindcss": "^3.3.3",
"typescript": "^5.0.2",
"vite": "^4.4.5",
diff --git a/src/App.css b/src/App.css
deleted file mode 100644
index e69de29..0000000
diff --git a/src/components/CardFanAnimation.tsx b/src/components/CardFanAnimation.tsx
new file mode 100644
index 0000000..46ca232
--- /dev/null
+++ b/src/components/CardFanAnimation.tsx
@@ -0,0 +1,43 @@
+import { FC, useRef, useEffect } from "react";
+
+const CardFanAnimation: FC = () => {
+ const cardContainerRef = useRef(null);
+
+ useEffect(() => {
+ const container = cardContainerRef.current;
+ if (!container) return;
+ const cards = Array.from(container.children) as HTMLImageElement[];
+ const angle = -30;
+ const angleIncrement = 20;
+
+ cards.forEach((card, index) => {
+ const calculatedAngle = angle + index * angleIncrement;
+ const rotation = `rotate(${calculatedAngle}deg)`;
+ const translateX = `translate(${index * -40 + 40}px)`;
+ const translateY = `translateY(${
+ Math.abs(calculatedAngle) * 3.5 - 20
+ }px)`;
+ card.style.transform = `${rotation} ${translateX} ${translateY}`;
+ });
+ }, []);
+
+ const imageClasses = "w-40 transition-transform duration-1000";
+
+ return (
+
+ );
+};
+
+export default CardFanAnimation;
diff --git a/src/components/Indicators.tsx b/src/components/Indicators.tsx
index d3177ca..acedacd 100644
--- a/src/components/Indicators.tsx
+++ b/src/components/Indicators.tsx
@@ -1,9 +1,9 @@
import { FC } from "react";
export const ConnectedIndicator: FC = () => (
-
+
);
export const DisconnectedIndicator: FC = () => (
-
+
);
diff --git a/src/components/SessionManager.tsx b/src/components/SessionManager.tsx
index 2cda9be..530bdf2 100644
--- a/src/components/SessionManager.tsx
+++ b/src/components/SessionManager.tsx
@@ -3,6 +3,7 @@ import { socket } from "../socket";
import { ConnectedIndicator, DisconnectedIndicator } from "./Indicators";
import Button from "../global/Button";
+import CardFanAnimation from "./CardFanAnimation";
type SessionManagerProps = {
isConnected: boolean;
@@ -48,12 +49,12 @@ export const SessionManager: FC = ({
return (
-
-
-
- Skylo
+
+
+
+ SKYLO
-
+
Play Skylo online with your friends!
@@ -61,13 +62,13 @@ export const SessionManager: FC
= ({
diff --git a/src/components/VoiceChat.tsx b/src/components/VoiceChat.tsx
index 9a177d1..ff75fed 100644
--- a/src/components/VoiceChat.tsx
+++ b/src/components/VoiceChat.tsx
@@ -154,7 +154,7 @@ const VoiceChat: FC
= ({ session }) => {
{/* */}
-
+
);
diff --git a/src/global/Button.tsx b/src/global/Button.tsx
index be33f99..a553293 100644
--- a/src/global/Button.tsx
+++ b/src/global/Button.tsx
@@ -9,7 +9,7 @@ const Button: FC
= ({ variant, children, ...rest }) => {
if (variant === "secondary") {
return (
{children}
@@ -18,7 +18,7 @@ const Button: FC = ({ variant, children, ...rest }) => {
}
return (
{children}
diff --git a/src/global/RoundChip.tsx b/src/global/RoundChip.tsx
index cc1aa9f..0ea696c 100644
--- a/src/global/RoundChip.tsx
+++ b/src/global/RoundChip.tsx
@@ -7,7 +7,7 @@ type RoundChipProps = {
const RoundChip: FC = ({ description, children }) => {
return (
-
+
{children}
{description}
diff --git a/src/global/icons/HeadsetIcon.tsx b/src/global/icons/HeadsetIcon.tsx
index 93a9677..a1831df 100644
--- a/src/global/icons/HeadsetIcon.tsx
+++ b/src/global/icons/HeadsetIcon.tsx
@@ -1,9 +1,13 @@
import { FC } from "react";
-const HeadsetIcon: FC = () => {
+type HeadsetIconProps = {
+ enabled: boolean;
+};
+
+const HeadsetIcon: FC = ({ enabled }) => {
return (
{
>
-
+ {!enabled && }
);
};
diff --git a/tailwind.config.js b/tailwind.config.js
index 7e058f2..e954363 100644
--- a/tailwind.config.js
+++ b/tailwind.config.js
@@ -1,10 +1,13 @@
/** @type {import('tailwindcss').Config} */
-import colors from "tailwindcss/colors";
+
+import color from "tailwindcss/colors";
+
export default {
content: [
"./pages/**/*.{js,ts,jsx,tsx,mdx}",
"./components/**/*.{js,ts,jsx,tsx,mdx}",
"./app/**/*.{js,ts,jsx,tsx,mdx}",
+ "./src/**/*.{js,ts,jsx,tsx,mdx}",
"./node_modules/flowbite-react/**/*.js",
],
theme: {
@@ -18,18 +21,21 @@ export default {
95: "0.95",
},
colors: {
- transparent: "transparent",
- current: "currentColor",
- black: colors.black,
- white: colors.white,
- emerald: colors.emerald,
- indigo: colors.indigo,
- yellow: colors.yellow,
- stone: colors.stone,
- sky: colors.sky,
- neutral: colors.neutral,
- gray: colors.gray,
- slate: colors.slate,
+ "theme-bg": color.teal[400],
+ "theme-primary": color.green[800],
+ "theme-primary-hover": color.green[700],
+ "theme-secondary": color.red[400],
+ "theme-secondary-hover": color.red[300],
+ "theme-tertiary": color.teal[200],
+ "theme-font": color.gray[800],
+ "theme-accent": color.yellow[500],
+ },
+ fontFamily: {
+ theme: ["Alegreya", "serif"],
+ },
+ dropShadow: {
+ white: "2px 2px 2px rgba(255, 255, 255, 1)",
+ black: "2px 2px 2px rgba(0, 0, 0, 1)",
},
},
},