Skip to content

Commit

Permalink
auto scroll and gradients
Browse files Browse the repository at this point in the history
  • Loading branch information
Hk669 committed Jul 14, 2024
1 parent 13df5c2 commit 0145f5e
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 3 deletions.
Binary file modified chroma/a14c490e-0fdc-41af-93aa-dc1de2615a2b/length.bin
Binary file not shown.
3 changes: 3 additions & 0 deletions client/src/App.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
/* App.css */
html {
scroll-behavior: smooth;
}

body {
font-family: 'Inter', sans-serif;
Expand Down
5 changes: 5 additions & 0 deletions client/src/components/Footer/Footer.css
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ body, html {
background-color: white;
padding: 20px 0;
width: 100%;
position: fixed; /* Make the footer stick to the bottom */
bottom: 0; /* Align it to the bottom */
left: 0;
right: 0;
z-index: 1000; /* Ensure it appears above other content */
}

.footer-content {
Expand Down
8 changes: 7 additions & 1 deletion client/src/components/Recommendation/Recommendation.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,18 @@
border-radius: 8px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
box-sizing: border-box; /* Include padding and border in width */
margin-top: 30px;
}

.reco-container h2 {
margin-left: 1rem;
margin-bottom: 20px;
}

.repo-ul a {
color: #000000;
}

.repo-ul {
width: 100%; /* Ensure the ul takes full width */
padding: 0; /* Remove default padding */
Expand Down Expand Up @@ -40,7 +46,7 @@
}

.repo-card:hover {
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
box-shadow: 4px 4px 8px rgba(9, 109, 224, 0.1);
}

.repo-info h3 {
Expand Down
16 changes: 14 additions & 2 deletions client/src/components/Recommendation/Recommendation.jsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,32 @@
import React from "react";
import "./Recommendation.css";
import { formatDistanceToNow } from "date-fns";
import { useEffect, useRef } from "react";

export const Recommendation = ({ recommendations }) => {
const recoRef = useRef(null);

useEffect(() => {
if (recommendations.length > 0 && recoRef.current) {
recoRef.current.scrollIntoView({ behavior: "smooth" });
}
}, [recommendations]);


const timeAgo = (date) =>
formatDistanceToNow(new Date(date), { addSuffix: true });

return (
<div className="reco-container">
<div className="reco-container" ref={recoRef}>
<h2>Recommendations</h2>
<ul className="repo-ul">
{recommendations.map((repo, index) => (
<li key={index}>
<div className="repo-card">
<div className="repo-info">
<h3>{repo.full_name}</h3>
<a href={repo.repo_url}>
<h3>{repo.full_name}</h3>
</a>
<p>{repo.description}</p>
<div className="topics-container">
<span>Topics: </span>
Expand Down
4 changes: 4 additions & 0 deletions client/src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
/* --f-p: 'Roboto', sans-serif; */
}

html {
scroll-behavior: smooth;
}

* {
margin: 0;
padding: 0;
Expand Down

0 comments on commit 0145f5e

Please sign in to comment.