From d768bf83fc08e4b4d4cb158254d7351d8b627eba Mon Sep 17 00:00:00 2001 From: Siddheya Kulkarni Date: Fri, 28 Jun 2024 23:23:31 +0530 Subject: [PATCH] enhanced card component ui --- src/components/shared/Card.jsx | 35 ++++++++++----- src/css/Card.css | 78 ++++++++++++++++++++++++++++++++++ 2 files changed, 103 insertions(+), 10 deletions(-) create mode 100644 src/css/Card.css diff --git a/src/components/shared/Card.jsx b/src/components/shared/Card.jsx index d21d9dd..3220bb0 100644 --- a/src/components/shared/Card.jsx +++ b/src/components/shared/Card.jsx @@ -1,17 +1,32 @@ -import React from 'react' +import React from 'react'; +import PropTypes from 'prop-types'; import { Link } from 'react-router-dom'; +import '../../css/Card.css'; const Card = ({ imgSrc, title, description, path, btnName }) => { return ( -
- image -
-
{title}
-

{description}

- {btnName} +
+
+
{title}
+
+ {title}
+
+

{description}

+ + {btnName} + +
- ) -} + ); +}; -export default Card; +Card.propTypes = { + imgSrc: PropTypes.string.isRequired, + title: PropTypes.string.isRequired, + description: PropTypes.string.isRequired, + path: PropTypes.string.isRequired, + btnName: PropTypes.string.isRequired, +}; + +export default Card; \ No newline at end of file diff --git a/src/css/Card.css b/src/css/Card.css new file mode 100644 index 0000000..a009026 --- /dev/null +++ b/src/css/Card.css @@ -0,0 +1,78 @@ +.glass-card { + width: 300px; + border-radius: 12px; + overflow: hidden; + box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37); + backdrop-filter: blur(2px); + -webkit-backdrop-filter: blur(2px); + background: rgba(10, 10, 10, 0.55); + border: 1px solid rgba(85, 85, 85, 0.18); + transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); +} + +.glass-card:hover { + transform: translateY(-5px); + box-shadow: 0 15px 30px rgba(31, 38, 135, 0.5); +} + +hr.solid { + border-top: 3px solid #bbb; + width: 100%; +} + + +.glass-card-image-container { + position: relative; + padding: 20px; + overflow: hidden; +} + +.glass-card-image { + width: 100%; + height: 100%; + object-fit: cover; + transition: transform 0.5s ease; +} + +.glass-card:hover .glass-card-image { + transform: scale(1.1); +} + +.glass-card-title { + color: #f5f5f5; + font-size: 1.5rem; + font-weight: 700; + text-align: center; + text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3); +} + +.glass-card-content { + padding: 20px; +} + +.glass-card-description { + font-size: 1rem; + margin-bottom: 20px; + line-height: 1.5; + color: #f5f5f5; +} + +.glass-card-button { + display: inline-block; + padding: 5px 10px; + background-color: rgba(135, 67, 67, 0.9); + color: #fff; + text-decoration: none; + border-radius: 6px; + font-weight: 600; + transition: all 0.5s ease; + text-transform: uppercase; + letter-spacing: 1px; + box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); +} + +.glass-card-button:hover { + background: none; + border: 1px solid rgb(135,67,67); + transform: translateX(10px); +} \ No newline at end of file