Skip to content

Commit

Permalink
fix slide 4
Browse files Browse the repository at this point in the history
  • Loading branch information
attorri committed Jan 10, 2025
1 parent d448a39 commit 16da4f1
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 8 deletions.
2 changes: 1 addition & 1 deletion _includes/banner.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ <h2 class="usa-hero__heading"><span class="font-ui-lg text-normal text-primary-d
<section class="carousel-screen usa-graphic-list padding-y-4 abstract-background-cdoc-symposium">
<div class="grid-container">
<div class="grid-gap-banner">
<div class="usa-hero__callout wide-content-box carousel-content-box">
<div class="usa-hero__callout wide-content-box carousel-content-box" style="margin-left: -40px;">
<h2 class="usa-hero__heading"><span class="font-ui-lg text-normal text-primary-darker text-bold">2024 CDOC Symposium</span>
</h2>
<p class="text-gray-70 font-sans-md text-bold">The CDO Council’s inaugural symposium marked a significant milestone, highlighting data’s vital role as a strategic enabler in modernizing agency missions and enhancing capabilities, while fostering collaboration for effective federal program delivery.
Expand Down
18 changes: 13 additions & 5 deletions alter_img.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,27 @@
from PIL import Image, ImageDraw

def reposition_white_section(in_, out_, shift_pixels):
def reposition_box(in_, out_, shift_pixels):

img = Image.open(in_)
img_width, img_height = img.size

img = img.convert("RGBA")
pixels = img.load()

def is_color_close(pixel, target_color, margin):
count = 0
for i in range(3):
if abs(pixel[i]-target_color[i])<= margin:
count+=1
return count==3


white_bounds = None
target_color = (66, 144, 181, 1)
for x in range(img_width):
for y in range(img_height):
r, g, b, a = pixels[x, y]
if (r, g, b) == (255, 255, 255):
if is_color_close((r,g,b,a), target_color, 10):
if not white_bounds:
white_bounds = [x, y, x, y]
else:
Expand All @@ -28,7 +36,7 @@ def reposition_white_section(in_, out_, shift_pixels):
x1, y1, x2, y2 = white_bounds
white_section = img.crop((x1, y1, x2, y2))
draw = ImageDraw.Draw(img)
draw.rectangle([x1, y1, x2, y2], fill=(27,50,82,255))
draw.rectangle([x1, y1, x2, y2], fill=(2, 13, 56, 255))
new_x1 = max(0, x1 - shift_pixels)
new_x2 = new_x1 + (x2 - x1)
img.paste(white_section, (new_x1, y1, new_x2, y2), white_section)
Expand All @@ -39,6 +47,6 @@ def reposition_white_section(in_, out_, shift_pixels):
input_img = "input.png"
output_img = "output.png"

shift_pixels = 250
shift_pixels = 1000

reposition_white_section(input_img, output_img, shift_pixels)
reposition_box(input_img, output_img, shift_pixels)
4 changes: 2 additions & 2 deletions assets/css/banner.scss
Original file line number Diff line number Diff line change
Expand Up @@ -245,10 +245,10 @@
}

.abstract-background-cdoc-symposium{
background-image: url(../images/background/cdoc-symposium-carousel.jpg);
background-image: url(../images/background/2025_data_powers_mission1.png);
background-color: #172636;
background-repeat: no-repeat;
background-position: top center;
background-position: 35%;
background-size: cover;
}

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 16da4f1

Please sign in to comment.