diff --git a/Stock-Market-Application/src/components/KnowMore.tsx b/Stock-Market-Application/src/components/KnowMore.tsx index e812d99..aa7b7be 100644 --- a/Stock-Market-Application/src/components/KnowMore.tsx +++ b/Stock-Market-Application/src/components/KnowMore.tsx @@ -1,52 +1,78 @@ import * as React from 'react'; -import { useEffect } from 'react'; import { CarouselComponent, CarouselItemsDirective, CarouselItemDirective } from '@syncfusion/ej2-react-navigations'; - +import * as img1 from '../images/1.png'; +import * as img2 from '../images/2.png'; +import * as img3 from '../images/3.png'; +import * as img4 from '../images/4.png'; export default function KnowMore() { - let productDetails = [ - { - ID: 1, - Title: 'Trend Line', - Content: 'A trendline in the stock market is a graphical representation showing the general direction of a stock price movement over time. By connecting significant price points, such as highs or lows, trendlines help identify patterns and trends. They are used by traders and analysts to forecast future price movements and make informed investment decisions. Trendlines can indicate whether a stock is in an upward, downward, or sideways trend.', - ImgPath: 'images/1.jpg', - // URL: 'https://en.wikipedia.org/wiki/San_Francisco' - }, { - ID: 2, - Title: 'Trend Line', - Content: 'A trendline in the stock market is a graphical representation showing the general direction of a stock price movement over time. By connecting significant price points, such as highs or lows, trendlines help identify patterns and trends. They are used by traders and analysts to forecast future price movements and make informed investment decisions. Trendlines can indicate whether a stock is in an upward, downward, or sideways trend.', - ImgPath: 'images/2.jpg', - // URL: 'https://en.wikipedia.org/wiki/London' - }, { - ID: 3, - Title: 'Trend Line', - Content: 'A trendline in the stock market is a graphical representation showing the general direction of a stock price movement over time. By connecting significant price points, such as highs or lows, trendlines help identify patterns and trends. They are used by traders and analysts to forecast future price movements and make informed investment decisions. Trendlines can indicate whether a stock is in an upward, downward, or sideways trend.', - ImgPath: 'images/3.jpg', - // URL: 'https://en.wikipedia.org/wiki/Tokyo' - }, { - ID: 4, - Title: 'Trend Line', - Content: 'A trendline in the stock market is a graphical representation showing the general direction of a stock price movement over time. By connecting significant price points, such as highs or lows, trendlines help identify patterns and trends. They are used by traders and analysts to forecast future price movements and make informed investment decisions. Trendlines can indicate whether a stock is in an upward, downward, or sideways trend.', - ImgPath: 'images/4.jpg', - // URL: 'https://en.wikipedia.org/wiki/Moscow' - } + const productDetails = [ + { + ID: 1, + Content: 'The Syncfusion DataGrid component enables the real-time display of data updates, highlighting changes in values—whether they have increased, decreased, or remained stable compared to previous data. This allows you to easily compare live data changes without any performance impact. The Syncfusion DataGrid is a robust tool for managing data display and processing from your data source. It comes with numerous built-in features and offers extensive customization options to suit your needs.', + DocLink: 'https://ej2.syncfusion.com/react/documentation/grid/getting-started', + DemoLink: 'https://ej2.syncfusion.com/react/demos/#/fluent2/grid/overview', + ImgPath: img1, + }, + { + ID: 2, + Content: 'The Syncfusion DataGrid component efficiently displays real-time data updates and processes data without any performance loss. Additionally, the Syncfusion Chart component is perfect for applying technical analysis using trading formulas such as RSI, EMA, ATR, SMA, TMA, MACD, Bollinger Bands, Stochastic, Accumulation Distribution, and more. The Syncfusion Chart component offers a wide range of features that allow you to visually compare your data, helping you identify both growth opportunities and challenges in your business.', + DocLink: 'https://ej2.syncfusion.com/react/documentation/chart/getting-started', + DemoLink: 'https://ej2.syncfusion.com/react/demos/#/fluent2/chart/overview', + ImgPath: img2, + }, + { + ID: 3, + Content: 'Syncfusion offers a wide range of tools to simplify app development. These include data visualization (charts, maps), data management (grids, spreadsheets), and file handling (PDFs, Excel). You can also find input controls, reporting tools, and various UI components like menus, calendars, and notifications. The tools are customizable, work across multiple platforms, and help you build feature-rich, high-performance applications efficiently.', + DocLink: 'https://ej2.syncfusion.com/react/documentation/introduction', + DemoLink: 'https://ej2.syncfusion.com/', + ImgPath: img3, + }, + { + ID: 4, + Content: 'Syncfusion offers a wide range of tools to simplify app development. These include data visualization (charts, maps), data management (grids, spreadsheets), and file handling (PDFs, Excel). You can also find input controls, reporting tools, and various UI components like menus, calendars, and notifications. The tools are customizable, work across multiple platforms, and help you build feature-rich, high-performance applications efficiently.', + DocLink: 'https://ej2.syncfusion.com/react/documentation/introduction', + DemoLink: 'https://ej2.syncfusion.com/', + ImgPath: img4, + } ]; - let showButtons: any = "Hidden"; const productTemplate = (props: any) => { - return (
- {props.Title} -
-

{props.Title}

-

{props.Content}

-
-
); - }; - return (
-
-
- {/* Render the Carousel Component */} - -
-
-
); -}; \ No newline at end of file + return ( +
+
+
{props.ContentTitle || 'Product Information'}
+
{props.Content}
+

For more information, please refer to the {' '} + + documentation + and {' '} + + demo + . +

+
+
+ + Product + +
+
+ ); + } + + return ( +
+
+
+ + + {productDetails.map(item => ( + productTemplate(item)} /> + ))} + + +
+
+
+ ); +} \ No newline at end of file diff --git a/Stock-Market-Application/src/components/Overview.tsx b/Stock-Market-Application/src/components/Overview.tsx index a33f23a..0412c05 100644 --- a/Stock-Market-Application/src/components/Overview.tsx +++ b/Stock-Market-Application/src/components/Overview.tsx @@ -101,6 +101,15 @@ export default function Overview(props: { changeMarquee: Function, myStockDm: Da args.cell!.classList.add('e-neg'); } } + if (args.cell.classList.contains('e-unboundcell')) { + var myWishList = getWishList(); + if (myWishList.indexOf((args.data as StockDetails).CompanyName) > -1) { + var btn = args.cell.querySelector('.addmywishlist'); + if (btn) { + btn.classList.add('added'); + } + } + } }; const OnSelect = (args: SelectEventArgs) => { @@ -146,26 +155,32 @@ export default function Overview(props: { changeMarquee: Function, myStockDm: Da } }; - function commandClick(args: CommandClickEventArgs) { - if (args.target!.querySelector('.addmywishlist')) { - let myWishList = []; - let predicates: Predicate[] = []; - if (window.localStorage.myStocks) { - let persistQuery = JSON.parse(window.localStorage.myStocks); - if (persistQuery.queries) { - for (let i = 0; i < persistQuery.queries.length; i++) { - if (persistQuery.queries[i].fn === 'onWhere') { - for ( - let j = 0; - j < persistQuery.queries[i].e.predicates.length; - j++ - ) { - myWishList.push(persistQuery.queries[i].e.predicates[j].value); - } + function getWishList() { + let myWishList = []; + if (window.localStorage.myStocks) { + let persistQuery = JSON.parse(window.localStorage.myStocks); + if (persistQuery.queries) { + for (let i = 0; i < persistQuery.queries.length; i++) { + if (persistQuery.queries[i].fn === 'onWhere') { + for ( + let j = 0; + j < persistQuery.queries[i].e.predicates.length; + j++ + ) { + myWishList.push(persistQuery.queries[i].e.predicates[j].value); } } } } + } + return myWishList; + } + + function commandClick(args: CommandClickEventArgs) { + if (args.target!.querySelector('.addmywishlist')) { + args.target.classList.add('added'); + let myWishList = getWishList(); + let predicates: Predicate[] = []; if (myWishList.indexOf((args.rowData as StockDetails).CompanyName) === -1) { myWishList.push((args.rowData as StockDetails).CompanyName); } @@ -175,17 +190,6 @@ export default function Overview(props: { changeMarquee: Function, myStockDm: Da let query: Query = new Query().where(Predicate.or(predicates)); (props.myStockDm as any).persistQuery = query; props.myStockDm.setPersistData({} as any, 'myStocks', query); - if (myWishList.length) { - const myWishlistIcon = args.target.querySelector('.addmywishlist'); - if (myWishlistIcon) { - myWishlistIcon.classList.remove('addmywishlist'); - myWishlistIcon.classList.add('addedmywishlist'); - } - if (args.target.classList.contains('e-primary')) { - args.target.classList.remove('e-primary'); - args.target.classList.add('e-success'); - } - } } if (args.target!.querySelector('.analysis')) { navigate('/stock_analysis', { diff --git a/Stock-Market-Application/src/components/SmartStockPicks.tsx b/Stock-Market-Application/src/components/SmartStockPicks.tsx index b904454..7acc586 100644 --- a/Stock-Market-Application/src/components/SmartStockPicks.tsx +++ b/Stock-Market-Application/src/components/SmartStockPicks.tsx @@ -128,28 +128,43 @@ export default function SmartStockPicks(props: { myStockDm: DataManager }) { args.cell!.classList.add('e-neg'); } } + if (args.cell.classList.contains('e-unboundcell')) { + var myWishList = getWishList(); + if (myWishList.indexOf((args.data as StockDetails).CompanyName) > -1) { + var btn = args.cell.querySelector('.addmywishlist'); + if (btn) { + btn.classList.add('added'); + } + } + } }; - function commandClick(args: CommandClickEventArgs) { - if (args.target!.querySelector('.addmywishlist')) { - let myWishList = []; - let predicates: Predicate[] = []; - if (window.localStorage.myStocks) { - let persistQuery = JSON.parse(window.localStorage.myStocks); - if (persistQuery.queries) { - for (let i = 0; i < persistQuery.queries.length; i++) { - if (persistQuery.queries[i].fn === 'onWhere') { - for ( - let j = 0; - j < persistQuery.queries[i].e.predicates.length; - j++ - ) { - myWishList.push(persistQuery.queries[i].e.predicates[j].value); - } + function getWishList() { + let myWishList = []; + if (window.localStorage.myStocks) { + let persistQuery = JSON.parse(window.localStorage.myStocks); + if (persistQuery.queries) { + for (let i = 0; i < persistQuery.queries.length; i++) { + if (persistQuery.queries[i].fn === 'onWhere') { + for ( + let j = 0; + j < persistQuery.queries[i].e.predicates.length; + j++ + ) { + myWishList.push(persistQuery.queries[i].e.predicates[j].value); } } } } + } + return myWishList; + } + + function commandClick(args: CommandClickEventArgs) { + if (args.target!.querySelector('.addmywishlist')) { + args.target.classList.add('added'); + let myWishList = getWishList(); + let predicates: Predicate[] = []; if (myWishList.indexOf((args.rowData as StockDetails).CompanyName) === -1) { myWishList.push((args.rowData as StockDetails).CompanyName); } diff --git a/Stock-Market-Application/src/style.css b/Stock-Market-Application/src/style.css index 194f971..de7d59d 100644 --- a/Stock-Market-Application/src/style.css +++ b/Stock-Market-Application/src/style.css @@ -3,10 +3,16 @@ content: '\e805'; } -.addedmywishlist.e-icons::before { +.addmywishlist.added.e-icons::before { content: '\e774'; } +.e-unboundcelldiv .e-btn.e-primary:has(.addmywishlist.added.e-icons) { + background-color: #15803d; + color: #fff; + border-color: #15803d; +} + .removemywishlist.e-icons::before { content: '\e87f'; } @@ -341,14 +347,10 @@ text#stockchartdefault_ChartTitle { border-radius: 10px; } -.db-carousel .e-carousel-items .e-carousel-item .card-text { +.kb-carousel .e-carousel-items .e-carousel-item .card-text { color: #374151; } -.db-carousel .e-carousel-items .e-carousel-item .card-text a { - color: #4f46e5; -} - .e-card .e-card-content { color: #333; padding: 0 16px 16px 16px; @@ -402,55 +404,76 @@ text#stockchartdefault_ChartTitle { /* Know More */ -.control-pane .control-section.db-carousel-section { - height: 400px; - overflow-y: scroll; +.kb-carousel .e-carousel-items .e-carousel-item .product-container { + display: flex; + align-items: center; + justify-content: center; + padding: 1rem; + margin-top: 15px; +} + +.kb-carousel .e-carousel-items .e-carousel-item .product-container .heading { + font-size: 1.7em; + color: #1a1a1a; + letter-spacing: 0; + font-weight: 600; + margin: 1.1rem 0 1.6rem; } -.db-carousel-section .carousel-sample { - border-radius: 0.5em; - margin: 0 auto 2em; - max-width: 1000px; +.kb-carousel .e-carousel-items .e-carousel-item .product-container .description { + font-size: 1.5rem; + color: #1a1a1a; + letter-spacing: 0.2px; + line-height: 2.5rem; + padding: 0 0 2rem; + text-align: justify; } -.db-carousel { - background-color: inherit; - border-radius: 0.5em; +.kb-carousel-section .carousel-sample { + margin: 0 auto .5em; + border-radius: 1.5em; + background-color: #f5f9fd; } -.db-carousel .e-carousel-items .e-carousel-item .card-title, -.db-carousel .e-carousel-items .e-carousel-item .card-text { +.kb-carousel .e-carousel-items .e-carousel-item .card-title, +.kb-carousel .e-carousel-items .e-carousel-item .card-text { opacity: 0; text-align: justify; transform: translateY(20px); } -.db-carousel .e-carousel-items .e-carousel-item.e-active .card-title, -.db-carousel .e-carousel-items .e-carousel-item.e-active .card-text { +.kb-carousel .e-carousel-items .e-carousel-item.e-active .card-title, +.kb-carousel .e-carousel-items .e-carousel-item.e-active .card-text { opacity: 1; transform: translateY(0px); } -.db-carousel .e-carousel-items .e-carousel-item .card-title { +.kb-carousel .e-carousel-items .e-carousel-item .card-title { font-size: 20px; transition: transform 0.4s ease 0.2s; } -.db-carousel .e-carousel-items .e-carousel-item .card-text { - font-size: 14px; +.kb-carousel .e-carousel-items .e-carousel-item .card-text { + font-size: 15px; transition: transform 0.4s ease 0.2s; } -.db-carousel .e-carousel-indicators { - height: 3em; +.kb-carousel .e-carousel-indicators { + position: relative; + min-height: 40px; +} + +.kb-carousel .e-carousel-indicators.e-default .e-indicator-bar .e-indicator div { + background-color: #e5e5e5; } -.db-carousel .e-carousel-indicators.e-default .e-indicator-bar .e-indicator div { - background-color: #e7e7e7; +.kb-carousel .e-carousel-indicators.e-default .e-indicator-bar.e-active .e-indicator div { + background-color: #4d8fe4; + border-color: #4d8fe4; } @media screen and (max-width: 480px) { - .db-carousel-section .carousel-sample { + .kb-carousel-section .carousel-sample { width: 100%; height: 440px; }