Skip to content

Commit

Permalink
Merge pull request #576 from SrijaVuppala295/resource
Browse files Browse the repository at this point in the history
Enhanced UI with inline hover effects, color changes, and shadow transitions for resource and video cards.
  • Loading branch information
sakeel-103 authored Nov 9, 2024
2 parents 6d414aa + ef64cac commit b86f90b
Show file tree
Hide file tree
Showing 2 changed files with 96 additions and 65 deletions.
94 changes: 59 additions & 35 deletions src/app/components/resources/resources.component.css
Original file line number Diff line number Diff line change
@@ -1,18 +1,32 @@
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;700&display=swap');

*{

margin: 0px;
padding: 0px;
}
body {
font-family: "Montserrat", sans-serif;
font-weight: 400;
margin: 0;
padding: 0;
background-color: #2c85de;
}
/* Video Card Hover Effect */
.video-card:hover {
transform: scale(1.03);
box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
background-color: #e8f4ff;
color: #27ae60;
}

/* :host {
display: flex;
flex-direction: column;
background-color: #f0f4f8;
min-height: 100vh;
} */
/* Resource Item Hover Effect */
.resource-item:hover {
transform: scale(1.03);
box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
background-color: #d1e7fd;
color: #27ae60;
}

.resources-container {
display: flex;
Expand All @@ -23,17 +37,16 @@ body {

.sidebar {
width: 250px;
height: 100rem;
background-color: #333;
background: linear-gradient(135deg, #333, #555);
color: #fff;
padding: 20px;
border-radius: 10px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.sidebar h2 {
font-size: 1.5rem;
margin-bottom: 1rem;
font-size: 1.6rem;
margin-bottom: 1.5rem;
color: #ff66b2;
}

Expand All @@ -46,29 +59,32 @@ body {
padding: 12px;
cursor: pointer;
transition: background-color 0.3s, color 0.3s;
border-radius: 4px;
border-radius: 6px;
}

.sidebar li:hover {
background-color: #555;
background-color: #ff66b2;
color: #fff;
}

.main-content {
margin-left: 20px;
padding: 20px;
flex: 1;
background-color: #ffffff;
border-radius: 10px;
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

header {
text-align: center;
margin-bottom: 3rem;
margin-bottom: 2.5rem;
}

h1 {
color: #2c3e50;
font-size: 2.5rem;
margin-bottom: 1rem;
font-size: 2.7rem;
font-weight: 700;
}

.intro {
Expand All @@ -82,7 +98,7 @@ h1 {
display: flex;
flex-direction: column;
align-items: center;
margin-bottom: 2rem;
margin-bottom: 2.5rem;
}

.search-input {
Expand All @@ -105,51 +121,56 @@ h1 {
display: flex;
flex-wrap: wrap;
justify-content: center;
gap: 0.5rem;
gap: 0.6rem;
}

.category-filter button {
background-color: #ecf0f1;
color: #3498db;
background: linear-gradient(135deg, #3498db, #2980b9);
color: #fff;
border: none;
padding: 0.5rem 1rem;
padding: 0.5rem 1.2rem;
border-radius: 20px;
cursor: pointer;
transition: background-color 0.3s ease, color 0.3s ease;
font-weight: 500;
transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.category-filter button.active,
.category-filter button:hover {
background-color: #3498db;
color: white;
transform: translateY(-3px);
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.category-filter button.active {
background: linear-gradient(135deg, #2ecc71, #27ae60);
color: #fff;
}

.video-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
gap: 2rem;
gap: 1.5rem;
margin-bottom: 3rem;
}

.video-card {
background-color: white;
border-radius: 10px;
border-radius: 12px;
overflow: hidden;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
transition: transform 0.3s ease, box-shadow 0.3s ease;
padding: 1rem;
cursor: pointer;
}

.video-card:hover {
transform: translateY(-5px);
box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
}

.card-thumbnail img {
width: 100%;
height: auto;
border-radius: 8px;
border-radius: 10px;
margin-bottom: 1rem;
}

Expand All @@ -167,20 +188,21 @@ h1 {
font-size: 1.8rem;
color: #2c3e50;
margin-bottom: 1.5rem;
border-bottom: 2px solid #3498db;
border-bottom: 3px solid #3498db;
padding-bottom: 0.5rem;
}

.resource-item {
background-color: #f9f9f9;
padding: 1rem;
border-radius: 5px;
border-radius: 6px;
border: 1px solid #bdc3c7;
transition: background-color 0.3s ease;
transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.resource-item:hover {
background-color: #ecf0f1;
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.resource-item h4 {
Expand All @@ -193,17 +215,19 @@ h1 {
text-decoration: none;
color: #3498db;
font-weight: bold;
transition: color 0.3s ease;
transition: color 0.3s ease, transform 0.3s ease;
}

.resource-link:hover {
color: #2980b9;
transform: translateX(5px);
}

footer {
text-align: center;
margin-top: 3rem;
color: #7f8c8d;
font-size: 1rem;
}

@media (max-width: 768px) {
Expand All @@ -226,4 +250,4 @@ footer {
height: auto;
margin-bottom: 20px;
}
}
}
67 changes: 37 additions & 30 deletions src/app/components/resources/resources.component.html
Original file line number Diff line number Diff line change
@@ -1,64 +1,71 @@
<app-navbar></app-navbar>
<div class="resources-container">
<aside class="sidebar">
<h2>Creators</h2>
<ul>
<li *ngFor="let author of authors" (click)="filterByAuthor(author)">
<div class="resources-container" style="display: flex; flex-direction: row; margin-top: 100px; height: calc(100% - 100px);">
<!-- <aside class="sidebar" style="width: 250px; height: 100rem; background-color: #333; color: #fff; padding: 20px; border-radius: 10px; box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);">
<h2 style="font-size: 1.5rem; margin-bottom: 1rem; color: #ff66b2;">Creators</h2>
<ul style="list-style: none; padding: 0;">
<li *ngFor="let author of authors" (click)="filterByAuthor(author)"
style="padding: 12px; cursor: pointer; transition: background-color 0.3s, color 0.3s; border-radius: 4px;">
{{ author }}
</li>
</ul>
</aside>
<div class="main-content">
<header>
<h1>Learning Resources for Graph Theory</h1>
<p class="intro">
Enhance your understanding of graph theory with our curated resources, including video tutorials and
helpful articles.
</aside> -->
<div class="main-content" style="margin-left: 20px; padding: 20px; flex: 1;">
<header style="text-align: center; margin-bottom: 3rem;">
<h1 style="color: #0a3c6e; font-size: 2.5rem; margin-bottom: 1rem;">Learning Resources for Graph Theory</h1>
<p class="intro" style="color: #34495e; font-size: 1.2rem; max-width: 800px; margin: 0 auto;">
Enhance your understanding of graph theory with our curated resources, including video tutorials and helpful articles.
</p>
</header>

<div *ngIf="errorMessage" class="error-message">
<div *ngIf="errorMessage" class="error-message" style="color: red; font-size: 1.1rem; text-align: center;">
<p>{{ errorMessage }}</p>
</div>

<div class="search-filter-container" *ngIf="!errorMessage">
<div class="search-filter-container" *ngIf="!errorMessage" style="display: flex; flex-direction: column; align-items: center; margin-bottom: 2rem;">
<input type="text" [(ngModel)]="searchTerm" (input)="applyFilters()" placeholder="Search resources..."
class="search-input">
<div class="category-filter">
class="search-input" style="width: 100%; max-width: 500px; padding: 0.8rem; font-size: 1rem; border: 2px solid #bdc3c7; border-radius: 25px; margin-bottom: 1rem; transition: border-color 0.3s ease;">
<div class="category-filter" style="display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem;">
<button *ngFor="let category of categories" (click)="filterByCategory(category)"
[class.active]="category === selectedCategory">
[class.active]="category === selectedCategory"
style="background-color: #ecf0f1; color: #3498db; border: none; padding: 0.5rem 1rem; border-radius: 20px; cursor: pointer; transition: background-color 0.3s ease, color 0.3s ease;">
{{ category }}
</button>
</div>
</div>

<!-- Videos Section -->
<div *ngIf="!apiError">
<div class="video-grid">
<div *ngFor="let video of filteredVideos" class="video-card" (click)="goToVideo(video.link)">
<div class="card-thumbnail">
<img [src]="video.thumbnail" alt="{{ video.title }}">
<div class="video-grid" style="display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 2rem; margin-bottom: 3rem;">
<div *ngFor="let video of filteredVideos" class="video-card" (click)="goToVideo(video.link)"
style="background-color: #f5f8fa; border-radius: 10px; overflow: hidden; box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); padding: 1rem; cursor: pointer; transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s; display: flex; flex-direction: column; align-items: center;"
onmouseover="this.style.backgroundColor='#e0f7fa'; this.style.transform='scale(1.03)'; this.style.boxShadow='0 8px 16px rgba(0, 0, 0, 0.2)';"
onmouseout="this.style.backgroundColor='#f5f8fa'; this.style.transform='scale(1)'; this.style.boxShadow='0 4px 6px rgba(0, 0, 0, 0.1)';">
<div class="card-thumbnail" style="background-color: #d6e4f0; border-radius: 8px; padding: 5px;">
<img [src]="video.thumbnail" alt="{{ video.title }}" style="width: 100%; height: auto; border-radius: 8px; margin-bottom: 1rem;">
</div>
<h2>{{ video.title }}</h2>
<h2 style="font-size: 1.2rem; color: #2c3e50; text-align: center;">{{ video.title }}</h2>
</div>
</div>

<div *ngIf="filteredVideos.length === 0" class="no-results">
<div *ngIf="filteredVideos.length === 0" class="no-results" style="text-align: center; color: #7f8c8d;">
<p>No videos found. Please try adjusting your search or filters.</p>
</div>
</div>

<!-- Resources Section (Always Visible) -->
<div class="resources-list">
<h3>Additional Resources:</h3>
<div class="resource-item" *ngFor="let resource of resources">
<h4>{{ resource.title }}</h4>
<a [href]="resource.link" target="_blank" class="resource-link">Visit Resource</a>
<div class="resources-list" style="width: 100%; background-color: #ffffff; padding: 2rem; border: 1px solid #bdc3c7; border-radius: 10px; margin-bottom: 3rem; box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);">
<h3 style="font-size: 1.8rem; color: #2c3e50; margin-bottom: 1.5rem; border-bottom: 2px solid #1e628f; padding-bottom: 0.5rem;">Additional Resources:</h3>
<div class="resource-item" *ngFor="let resource of resources"
style="background-color: #eef5fc; padding: 1rem; border-radius: 5px; border: 1px solid #d1e7fd; transition: background-color 0.3s ease, box-shadow 0.3s, transform 0.3s; margin-bottom: 1rem; cursor: pointer;"
onmouseover="this.style.backgroundColor='#e6f5ff'; this.style.transform='scale(1.03)'; this.style.boxShadow='0 8px 16px rgba(0, 0, 0, 0.2)';"
onmouseout="this.style.backgroundColor='#eef5fc'; this.style.transform='scale(1)'; this.style.boxShadow='0 4px 8px rgba(0, 0, 0, 0.1)';">
<h4 style="font-size: 1.2rem; color: #2c3e50; margin-bottom: 0.5rem;">{{ resource.title }}</h4>
<a [href]="resource.link" target="_blank" class="resource-link" style="text-decoration: none; color: #3498db; font-weight: bold; transition: color 0.3s ease;">Visit Resource</a>
</div>
</div>

<footer>
<footer style="text-align: center; margin-top: 3rem; color: #4c5455;">
<p>Continue exploring graph theory through our selected resources and video tutorials!</p>
</footer>
</div>
</div>
</div>

0 comments on commit b86f90b

Please sign in to comment.