Skip to content
This repository was archived by the owner on Aug 4, 2023. It is now read-only.

Commit b8d6e7d

Browse files
Improved added onclick search and removed on change search to reduce no of request to the server
1 parent 2fedc8e commit b8d6e7d

File tree

8 files changed

+70
-23
lines changed

8 files changed

+70
-23
lines changed

public/index.html

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,33 +5,43 @@
55
<meta charset="utf-8" />
66
<meta name="viewport" content="width=device-width, initial-scale=1" />
77
<meta name="theme-color" content="#000000" />
8-
<meta name="description" content="AnimeTrix is a Free Anime streaming website which you can watch English Subbed and Dubbed Anime online without creating any Account" />
8+
<meta name="description"
9+
content="AnimeTrix is a Free Anime streaming website which you can watch English Subbed and Dubbed Anime online without creating any Account" />
910
<link rel="shortcut icon" href="images/favicon.ico" type="image/x-icon">
1011
<link rel="apple-touch-icon" href="images/apple-touch-icon.png">
1112
<link rel="manifest" href="/manifest.json" />
1213
<script type="module" src="https://unpkg.com/[email protected]/dist/ionicons/ionicons.esm.js"></script>
1314
<script nomodule src="https://unpkg.com/[email protected]/dist/ionicons/ionicons.js"></script>
1415
<link rel="preconnect" rel="preload" href="https://fonts.googleapis.com">
1516
<link rel="preconnect" rel="preload" href="https://fonts.gstatic.com" crossorigin>
16-
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@400;500&display=swap" rel="stylesheet" rel="preload">
17+
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@400;500&display=swap" rel="stylesheet"
18+
rel="preload">
1719

1820

1921
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.2.1/css/all.min.css"
2022
integrity="sha512-MV7K8+y+gLIBoVD59lQIYicR65iaqukzvf/nwasF0nqhPay5w/9lJmVM2hMDcnK1OnMGCdVK+iQrJ7lzPJQd1w=="
2123
crossorigin="anonymous" referrerpolicy="no-referrer" rel="preload" />
2224

2325

24-
<meta property="og:title" content="AnimeTrix">
25-
<meta property="og:description" content="AnimeTrix is a Free Anime streaming website which you can watch English Subbed and Dubbed Anime online without creating any Account">
26-
<meta property="og:image" content="https://user-images.githubusercontent.com/95211406/234815538-17642467-574a-42ec-96d1-75c2a67bebd3.png">
27-
<meta property="og:url" content="https://animetrix.vercel.app/">
28-
<meta property="og:type" content="website">
26+
<meta property="og:title" content="AnimeTrix">
27+
<meta property="og:description"
28+
content="AnimeTrix is a Free Anime streaming website which you can watch English Subbed and Dubbed Anime online without creating any Account">
29+
<meta property="og:image"
30+
content="https://user-images.githubusercontent.com/95211406/234815538-17642467-574a-42ec-96d1-75c2a67bebd3.png">
31+
<meta property="og:url" content="https://animetrix.vercel.app/">
32+
<meta property="og:type" content="website">
33+
34+
<meta property="og:image:width" content="1200">
35+
<meta property="og:image:height" content="600">
36+
37+
<meta name="twitter:card"
38+
content="https://user-images.githubusercontent.com/95211406/234815538-17642467-574a-42ec-96d1-75c2a67bebd3.png">
39+
<meta name="twitter:title" content="Animetrix">
40+
<meta name="twitter:description"
41+
content="AnimeTrix is a Free Anime streaming website which you can watch English Subbed and Dubbed Anime online without creating any Account">
42+
<meta name="twitter:image"
43+
content="https://user-images.githubusercontent.com/95211406/234815538-17642467-574a-42ec-96d1-75c2a67bebd3.png">
2944

30-
<meta name="twitter:card" content="https://user-images.githubusercontent.com/95211406/234815538-17642467-574a-42ec-96d1-75c2a67bebd3.png">
31-
<meta name="twitter:title" content="Animetrix">
32-
<meta name="twitter:description" content="AnimeTrix is a Free Anime streaming website which you can watch English Subbed and Dubbed Anime online without creating any Account">
33-
<meta name="twitter:image" content="https://user-images.githubusercontent.com/95211406/234815538-17642467-574a-42ec-96d1-75c2a67bebd3.png">
34-
3545
<title>Watch Download Anime For Free On AnimeTrix</title>
3646
</head>
3747

public/robot.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
User-agent: *
2+
Disallow:

src/Components/Header.jsx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,13 @@ const Header = forwardRef((props, ref) => {
9898
const handelChange = (e) => {
9999
const val = e.target.value;
100100
setInputVal(val);
101-
props.handelChanges(val);
102101
};
103102

103+
104+
const handleSearchSubmit = () => {
105+
props.handelChanges(inputVal);
106+
}
107+
104108
useImperativeHandle(ref, () => ({
105109
emptySearch() {
106110
setInputVal("");
@@ -177,7 +181,11 @@ const Header = forwardRef((props, ref) => {
177181
placeholder="I am looking for...."
178182
value={inputVal}
179183
onChange={handelChange}
184+
required
180185
/>
186+
<button className="search-submit" onClick={handleSearchSubmit} type="submit">
187+
<i class="fa-solid fa-magnifying-glass">
188+
</i></button>
181189
</div>
182190
{!isLoggedIn ?
183191
<li className="login-tab">
@@ -207,6 +215,9 @@ const Header = forwardRef((props, ref) => {
207215
<div className="mobile-search" ref={menuRef}>
208216
<div className="search-field">
209217
<input type="text" className={`active-search-mobile ${searchActive ? 'active' : ''}`} placeholder="I am looking for" value={inputVal} onChange={handelChange} />
218+
<button className={`search-submit-mobile ${searchActive ? 'active' : ''}`} onClick={handleSearchSubmit} type="submit">
219+
<i class="fa-solid fa-magnifying-glass">
220+
</i></button>
210221
<div className="field-icon-search" onClick={MobileView}>
211222
<ion-icon name="search-outline"></ion-icon>
212223
</div>

src/Components/SearchJSX.jsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,19 @@ export default function SearchJSX(props) {
1313
{Object.keys(props.searchResult).length === 0 ? (
1414
<div align="center">
1515
<h4 className="no-results" style={{
16-
fontSize: "35px", paddingTop:"20px",
16+
fontSize: "35px", paddingTop: "20px",
1717
}}>No Results found</h4>
1818
<br /><br />
1919
</div>
2020
) : (
2121
<div align="center">
22+
{
23+
window.innerWidth > 600 ? null :<> <br /><br /><br /></>
24+
}
25+
2226
<div className="movies-grid" >
23-
{props.searchResult?.results?.map((rec) => (
24-
<Card rec={rec} key={rec.id} ep="false" handelClick={handelClick} />
27+
{props.searchResult?.results?.map((rec) => (
28+
<Card rec={rec} key={rec.id} ep="false" handelClick={handelClick} />
2529
))}
2630
</div>
2731
</div>

src/Pages/movie.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ const Movie = (props) => {
4141
<section className="movies">
4242
<div className="filter-bar">
4343
<div className="heading">
44-
<h3>Anime Movies</h3>
44+
<h3>Movies</h3>
4545
</div>
4646
</div>
4747
<div className="movies-grid" ref={ref}>

src/Pages/topAiring.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const TopAnimeAiring = (props) => {
2121

2222
return (
2323
<>
24-
<Helmet>
24+
<Helmet>
2525
<meta property="og:title" content="AnimeTrix" />
2626
<meta property="og:description" content="AnimeTrix is a Free Anime streaming website which you can watch English Subbed and Dubbed Anime online without creating any Account" />
2727
<meta property="og:image" content="https://user-images.githubusercontent.com/95211406/234815538-17642467-574a-42ec-96d1-75c2a67bebd3.png" />
@@ -36,13 +36,13 @@ const TopAnimeAiring = (props) => {
3636
<title>Watch Download Anime For Free On AnimeTrix</title>
3737
</Helmet>
3838
{Object.keys(props.recent).length === 0 ? (
39-
<OtherPagesCard title="Top-Airing"/>
39+
<OtherPagesCard title="Top-Airing" />
4040
) : (
4141
<>
4242
<section className="movies">
4343
<div className="filter-bar">
4444
<div className="heading">
45-
<h3>Top-Airing</h3>
45+
<h3>Trending</h3>
4646
</div>
4747
</div>
4848

src/css/card.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@
114114
}
115115
}
116116

117-
@media(max-width:535px){
117+
@media(max-width:550px){
118118
.card-head{
119119
height: 300px;
120120
}

src/css/navbar.css

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,28 @@
7272
color: var(--text-color);
7373
width: 300px;
7474
}
75-
75+
.search-submit{
76+
background: transparent;
77+
padding: 2px;
78+
color: var(--button-color);
79+
position: absolute;
80+
left: 86%;
81+
font-size: 20px;
82+
top: calc(35% - 10px);;
83+
bottom: 20px;
84+
}
85+
.search-submit-mobile{
86+
display: none;
87+
}
88+
.search-submit-mobile.active{
89+
display: block;
90+
position: absolute;
91+
bottom: calc(90% - 139px);
92+
right: 16%;
93+
font-size: 25px;
94+
background: transparent;
95+
z-index: 999;
96+
}
7697
.search-btn {
7798
background: none;
7899
border: none;
@@ -270,7 +291,6 @@
270291
left: 0;
271292
right: 0;
272293
margin: auto;
273-
z-index: 9999;
274294
border-radius: 14px;
275295
background-color: var(--search-background);
276296
color: #fff;

0 commit comments

Comments
 (0)