Skip to content
358 changes: 358 additions & 0 deletions lesson_19/template/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,358 @@
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}

body {
font-family: 'Poppins', sans-serif;
line-height: 1.6;
color: #333;
background-color: #ffffff;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
font-family: 'Montserrat', sans-serif;
font-weight: 700;
margin-bottom: 1rem;
}

h2 {
font-size: 2.5rem;
font-weight: 800;
color: #2c3e50;
}

h3 {
font-size: 1.5rem;
font-weight: 700;
color: #2c3e50;
margin-bottom: 1rem;
}

p {
font-size: 1.1rem;
line-height: 1.7;
color: #555;
margin-bottom: 1.5rem;
}

/* Highlight Text */
.highlight {
color: #e74c3c;
font-style: normal;
font-weight: 900;
}

/* Header Styles */
.header {
background-color: #ffffff;
padding: 1rem 2rem;
display: flex;
justify-content: space-between;
align-items: center;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
position: sticky;
top: 0;
z-index: 1000;
}

.header-logo img {
height: 50px;
width: auto;
}

.header-top-menu {
display: flex;
list-style: none;
gap: 2rem;
}

.header-top-menu li a {
text-decoration: none;
color: #2c3e50;
font-weight: 600;
font-size: 1rem;
transition: color 0.3s ease;
}

.header-top-menu li a:hover {
color: #e74c3c;
}

.sign-up-button {
background-color: #e74c3c;
color: white;
padding: 0.75rem 1.5rem;
text-decoration: none;
border-radius: 5px;
font-weight: 600;
transition: all 0.3s ease;
border: 2px solid #e74c3c;
}

.sign-up-button:hover {
background-color: transparent;
color: #e74c3c;
transform: translateY(-2px);
box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
}

/* Main Content */
.main {
min-height: calc(100vh - 120px);
}

.content {
max-width: 1200px;
margin: 0 auto;
}

/* Hero Section */
.hero-section {
background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
color: white;
padding: 4rem 2rem;
text-align: center;
position: relative;
overflow: hidden;
}

.hero-section::before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="tech" patternUnits="userSpaceOnUse" width="100" height="100"><circle cx="50" cy="50" r="2" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23tech)"/></svg>');
opacity: 0.3;
}

.hero-content {
position: relative;
z-index: 2;
max-width: 800px;
margin: 0 auto;
}

.hero-title {
font-size: 3rem;
font-weight: 800;
margin-bottom: 2rem;
line-height: 1.2;
}

.hero-title .highlight {
color: #e74c3c;
position: relative;
}

.hero-title .highlight::after {
content: '';
position: absolute;
bottom: -5px;
left: 0;
right: 0;
height: 3px;
background-color: #e74c3c;
border-radius: 2px;
}

.hero-text {
font-size: 1.3rem;
line-height: 1.7;
opacity: 0.95;
max-width: 700px;
margin: 0 auto;
}

.hero-text span {
font-weight: 600;
color: #e74c3c;
}

/* Programs Section */
.programs-section {
padding: 4rem 2rem;
background-color: #f8f9fa;
}

.programs-section h2 {
text-align: center;
margin-bottom: 3rem;
font-size: 2.5rem;
}

.programs {
list-style: none;
display: grid;
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
gap: 2rem;
max-width: 1000px;
margin: 0 auto;
}

.program {
background: white;
padding: 2rem;
border-radius: 10px;
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
transition: all 0.3s ease;
border-top: 4px solid #e74c3c;
}

.program:hover {
transform: translateY(-5px);
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.program h3 {
color: #2c3e50;
margin-bottom: 1rem;
font-size: 1.4rem;
}

.program p {
color: #666;
font-size: 1rem;
line-height: 1.6;
}

/* Footer */
.footer {
background-color: #2c3e50;
color: white;
text-align: center;
padding: 2rem;
font-size: 1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
.header {
flex-direction: column;
gap: 1rem;
padding: 1rem;
}

.header-top-menu {
flex-direction: column;
gap: 1rem;
text-align: center;
}

.hero-title {
font-size: 2rem;
}

.hero-text {
font-size: 1.1rem;
}

.programs-section h2 {
font-size: 2rem;
}

.programs {
grid-template-columns: 1fr;
gap: 1.5rem;
}

.program {
padding: 1.5rem;
}
}

@media (max-width: 480px) {
.header {
padding: 0.5rem;
}

.hero-section {
padding: 2rem 1rem;
}

.hero-title {
font-size: 1.8rem;
}

.programs-section {
padding: 2rem 1rem;
}

.program {
padding: 1rem;
}
}

/* Additional Interactive Elements */
.header-top-menu li a::after {
content: '';
position: absolute;
bottom: -5px;
left: 0;
width: 0;
height: 2px;
background-color: #e74c3c;
transition: width 0.3s ease;
}

.header-top-menu li {
position: relative;
}

.header-top-menu li a:hover::after {
width: 100%;
}

/* Smooth scrolling */
html {
scroll-behavior: smooth;
}

/* Focus styles for accessibility */
.sign-up-button:focus,
.header-top-menu li a:focus {
outline: 2px solid #e74c3c;
outline-offset: 2px;
}

/* Animation for hero content */
@keyframes fadeInUp {
from {
opacity: 0;
transform: translateY(30px);
}
to {
opacity: 1;
transform: translateY(0);
}
}

.hero-content {
animation: fadeInUp 0.8s ease-out;
}

/* Animation for program cards */
@keyframes fadeInScale {
from {
opacity: 0;
transform: scale(0.9);
}
to {
opacity: 1;
transform: scale(1);
}
}

.program {
animation: fadeInScale 0.6s ease-out;
animation-fill-mode: both;
}

.program:nth-child(1) { animation-delay: 0.1s; }
.program:nth-child(2) { animation-delay: 0.2s; }
.program:nth-child(3) { animation-delay: 0.3s; }
.program:nth-child(4) { animation-delay: 0.4s; }
Original file line number Diff line number Diff line change
@@ -1,25 +1,30 @@
package com.codedifferently.lesson25.factory;

import com.codedifferently.lesson25.models.LibraryDataModel;
import com.codedifferently.lesson25.repository.LibraryGuestRepository;
import com.codedifferently.lesson25.repository.MediaItemRepository;
import java.io.IOException;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.codedifferently.lesson25.models.LibraryDataModel;
import com.codedifferently.lesson25.repository.LibraryGuestRepository;
import com.codedifferently.lesson25.repository.LibraryUserRepository;
import com.codedifferently.lesson25.repository.MediaItemRepository;

/** A data loader that loads library data from a database. */
@Service
public final class LibraryDbDataLoader implements LibraryDataLoader {

@Autowired private MediaItemRepository mediaItemsRepository;
@Autowired private LibraryGuestRepository libraryGuestRepository;
@Autowired private LibraryUserRepository libraryUserRepository;

@Override
public LibraryDataModel loadData() throws IOException {
var model = new LibraryDataModel();

model.mediaItems = mediaItemsRepository.findAll();
model.guests = libraryGuestRepository.findAll();
model.users = libraryUserRepository.findAll();

return model;
}
Expand Down
Loading
Loading