diff --git a/nepalingo-web/src/components/Header.tsx b/nepalingo-web/src/components/Header.tsx
index 34e0ae4..7803b40 100644
--- a/nepalingo-web/src/components/Header.tsx
+++ b/nepalingo-web/src/components/Header.tsx
@@ -1,6 +1,5 @@
import React from 'react';
import styles from './header.module.css';
-
const Header: React.FC = () => {
return (
diff --git a/nepalingo-web/src/components/button/Button.tsx b/nepalingo-web/src/components/button/Button.tsx
new file mode 100644
index 0000000..a6f6c2e
--- /dev/null
+++ b/nepalingo-web/src/components/button/Button.tsx
@@ -0,0 +1,21 @@
+import React, { forwardRef } from 'react';
+
+interface ButtonProps extends React.ButtonHTMLAttributes
{
+
+}
+
+const Button = forwardRef((props, ref) => {
+ const { className, children, ...rest } = props;
+
+ const buttonClasses = `bg-blue-500 hover:md:bg-opacity-80 text-white font-bold py-2 px-4 rounded ${className}`;
+
+ return (
+
+ );
+});
+
+Button.displayName = 'Button';
+
+export default Button;
diff --git a/nepalingo-web/src/components/card/Card.tsx b/nepalingo-web/src/components/card/Card.tsx
new file mode 100644
index 0000000..f55a964
--- /dev/null
+++ b/nepalingo-web/src/components/card/Card.tsx
@@ -0,0 +1,60 @@
+import React, { useState } from 'react';
+
+const Card: React.FC<{
+ Word: string;
+ TranslatedWord: string;
+ Pronunciation: string;
+ DevenagiriSpelling: string;
+ ImageUrl?: string;
+ PronounciationUrl?: string;
+}> = ({ Word, TranslatedWord, Pronunciation, DevenagiriSpelling, ImageUrl, PronounciationUrl }) => {
+ const [isFlipped, setIsFlipped] = useState(false);
+ const [audio, setAudio] = useState(null);
+
+ const handleFlip = () => {
+ setIsFlipped(!isFlipped);
+ };
+
+ const handlePronunciation = (event: React.MouseEvent) => {
+ event.stopPropagation();
+ if (PronounciationUrl) {
+ if (audio) {
+ if (!audio.paused) {
+ audio.pause();
+ audio.currentTime = 0;
+ } else {
+ audio.play();
+ }
+ } else {
+ const newAudio = new Audio(PronounciationUrl);
+ setAudio(newAudio);
+ newAudio.play();
+ }
+ }
+ };
+
+ return (
+
+
+
+ {!isFlipped &&
{Word}
}
+
+
+
+ {ImageUrl &&
}
+
{TranslatedWord}
+
{DevenagiriSpelling}
+
{Pronunciation}
+ {PronounciationUrl && (
+
+ )}
+
+
+
+
+ );
+};
+
+export default Card;
diff --git a/nepalingo-web/src/index.css b/nepalingo-web/src/index.css
index bd6213e..d544329 100644
--- a/nepalingo-web/src/index.css
+++ b/nepalingo-web/src/index.css
@@ -1,3 +1,19 @@
@tailwind base;
@tailwind components;
-@tailwind utilities;
\ No newline at end of file
+@tailwind utilities;
+
+.backface-hidden {
+ backface-visibility: hidden;
+}
+.flipped .rotateY-180 {
+ transform: rotateY(0deg);
+}
+.flipped .rotateY-0 {
+ transform: rotateY(-180deg);
+}
+.rotateY-180 {
+ transform: rotateY(180deg);
+}
+.rotateY-0 {
+ transform: rotateY(0deg);
+}
\ No newline at end of file