-
Notifications
You must be signed in to change notification settings - Fork 64
Replace hero image with carousel slider #544
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
83d2a39
5fed52f
351a1e0
16b968c
e5f1ca4
b8d3d3b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,9 +3,31 @@ | |
--- | ||
<div class="home"> | ||
{% assign t = site.data.locales[page.lang][page.lang] %} {% if page.title %} {% assign header = page.title %} {% else %} {% assign header = site.title %} {% endif %} | ||
<article class="hero"> | ||
<div class="hero-text">{{ t.index.lead }}</div> | ||
</article> | ||
<header> | ||
<div id="postSlider" class="carousel slide slider-container" data-bs-ride="carousel"> | ||
<div class="carousel-inner"> | ||
{% for post in site.posts %} | ||
<div class="carousel-item {% if forloop.first %}active{% endif %}"> | ||
<div class="email-circle"> | ||
<img src="{{ post.featured_image | default: post.content | split: '!' | first | split: '(' | last | split: ')' | first | default: 'default-image.jpg' }}" alt="{{ post.title }}"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is creating some issues in that the default image is not being selected. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Gotcha! Working on it. Thanks |
||
</div> | ||
<h3 class="post-title">{{ post.title }}</h3> | ||
<p class="post-summary">{{ post.excerpt | strip_html | truncatewords: 20 }}</p> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This creates some interesting issues... Perhaps we can request a description on each article (I mentioned this in the comments) |
||
</div> | ||
{% endfor %} | ||
</div> | ||
|
||
<!-- Controls --> | ||
<button class="carousel-control-prev" type="button" data-bs-target="#postSlider" data-bs-slide="prev"> | ||
<span class="carousel-control-prev-icon" aria-hidden="true"></span> | ||
<span class="visually-hidden">Previous</span> | ||
</button> | ||
<button class="carousel-control-next" type="button" data-bs-target="#postSlider" data-bs-slide="next"> | ||
<span class="carousel-control-next-icon" aria-hidden="true"></span> | ||
<span class="visually-hidden">Next</span> | ||
</button> | ||
</div> | ||
</header> | ||
{{ content }} | ||
|
||
<img src="{{'/assets/images/dcus.jpg' | relative_url }}" alt="DjangoCon US 2023"/> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -517,3 +517,50 @@ ul.speaking-list { | |
max-width: 60%; | ||
} | ||
} | ||
header { | ||
padding: 40px 20px; | ||
margin-bottom: 20px; | ||
/* background-color: black; */ | ||
} | ||
.slider-container { | ||
min-height: 300px; | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
/* background-image: url("/assets/images/hero-bpd-background.jpg"); */ | ||
background-color: #222; | ||
padding: 40px; | ||
border-radius: 10px; | ||
margin: 0 auto; | ||
width: 85%; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This width inside the container makes the carousel smaller than everything around it. I'd suggest making it 100%. |
||
/* max-width: 1000px; */ | ||
} | ||
.email-circle { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is this called email circle... Naming is important... I hope we can name it something that matches the description. |
||
width: 200px; | ||
height: 200px; | ||
background-color: #fff; | ||
border-radius: 50%; | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
margin: 0 auto 15px; | ||
overflow: hidden; | ||
} | ||
.email-circle img { | ||
width: 100%; | ||
height: 100%; | ||
object-fit: cover; | ||
} | ||
.carousel-item { | ||
text-align: center; | ||
} | ||
.post-title { | ||
font-size: 25px; | ||
font-weight: bold; | ||
color: white; | ||
margin-bottom: 10px; | ||
} | ||
.post-summary { | ||
font-size: 15px; | ||
color: #f1f1f1; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,7 @@ def page_url(xprocess, url_port): | |
url, port = url_port | ||
|
||
class Starter(ProcessStarter): | ||
timeout = 4 | ||
timeout = 20 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah so your server wasn't ready yet. This is a good solution... great work troubleshooting and catching this!! |
||
# Start the process | ||
args = [ | ||
"bundle", | ||
|
@@ -99,3 +99,16 @@ def test_mailto_bpdevs(page_url: tuple[Page, str]) -> None: | |
page.goto(live_server_url) | ||
mailto = page.get_by_role("link", name="email") | ||
expect(mailto).to_have_attribute("href", "mailto:contact@blackpythondevs.com") | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Some tests that we have coded for that I would like to see. Test 1:
Test 2
Test 3
Test 4
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks Jay. I'll get to implementing these changes right away |
||
|
||
def test_carousel_displayed(page_url: tuple[Page, str]) -> None: | ||
page, live_server_url = page_url | ||
page.goto(live_server_url) | ||
|
||
carousel = page.locator(".carousel") | ||
expect(carousel).to_be_visible() | ||
|
||
next_button = page.locator(".carousel-control-next") | ||
prev_button = page.locator(".carousel-control-prev") | ||
expect(next_button).to_be_visible() | ||
expect(prev_button).to_be_visible() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You chose to use bootstrap. Interesting... I wonder what the load time difference is between using bootstrap versus a solution that uses css with transitions and animations.
Adding bootstrap for a singular component doesn't feel great.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Youβre absolutely right; I hadnβt fully considered the impact of load time when choosing Bootstrap. I felt custom CSS might be re-inventing the wheel.
Iβll look into using a custom CSS and explore the impact both has on our load time. Thanks for the insight