
    0iO                         d Z ddlZddlZddlmZ ddlmZ ddlmZ  ed      Z	e	j                  dd       d	Zd
ZdZdedededefdZdedefdZd Zedk(  r ej(                   e              yy)u   
Google Display Ad renderer for Angle E (DB+코칭 지원)
Design Concept: #49 Spikes 신뢰/보호 - Trust/protection theme
Uses HTML + Playwright rendering (hybrid-image approach)
    N)Path)async_playwright)Imagez8/home/jay/workspace/output/google-ads/angle-E/productionT)parentsexist_oku  <!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@300;400;500;700;900&display=swap" rel="stylesheet">
<style>
  * { margin: 0; padding: 0; box-sizing: border-box; }
  body {
    width: 1200px;
    height: 628px;
    overflow: hidden;
    font-family: 'Noto Sans KR', sans-serif;
    background: #0A1628;
  }
  .ad-container {
    position: relative;
    width: 1200px;
    height: 628px;
    background: linear-gradient(135deg, #0A1628 0%, #0F2040 45%, #0D1E35 70%, #0A1628 100%);
    display: flex;
    align-items: center;
    overflow: hidden;
  }

  /* Warm glow overlay */
  .warm-glow {
    position: absolute;
    top: -100px;
    left: -100px;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(255,193,7,0.06) 0%, transparent 70%);
    pointer-events: none;
  }
  .warm-glow-right {
    position: absolute;
    bottom: -150px;
    right: -100px;
    width: 700px;
    height: 700px;
    background: radial-gradient(circle, rgba(76,175,80,0.07) 0%, transparent 65%);
    pointer-events: none;
  }

  /* Shield/protection motif - decorative arc */
  .shield-arc {
    position: absolute;
    right: 60px;
    top: 50%;
    transform: translateY(-50%);
    width: 320px;
    height: 320px;
    border: 2px solid rgba(76,175,80,0.18);
    border-radius: 50%;
  }
  .shield-arc::before {
    content: '';
    position: absolute;
    top: 16px; left: 16px; right: 16px; bottom: 16px;
    border: 1.5px solid rgba(76,175,80,0.10);
    border-radius: 50%;
  }
  .shield-arc::after {
    content: '';
    position: absolute;
    top: 36px; left: 36px; right: 36px; bottom: 36px;
    border: 1px solid rgba(255,193,7,0.08);
    border-radius: 50%;
  }

  /* Subtle grid lines */
  .grid-lines {
    position: absolute;
    inset: 0;
    background-image:
      linear-gradient(rgba(76,175,80,0.04) 1px, transparent 1px),
      linear-gradient(90deg, rgba(76,175,80,0.04) 1px, transparent 1px);
    background-size: 60px 60px;
  }

  /* Left content */
  .content-left {
    position: relative;
    z-index: 10;
    padding: 0 0 0 64px;
    flex: 0 0 auto;
    width: 700px;
  }

  .tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,193,7,0.12);
    border: 1px solid rgba(255,193,7,0.35);
    border-radius: 24px;
    padding: 8px 20px;
    margin-bottom: 24px;
  }
  .tag-dot {
    width: 8px;
    height: 8px;
    background: #FFC107;
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(255,193,7,0.7);
  }
  .tag-text {
    font-size: 24px;
    font-weight: 600;
    color: #FFC107;
    letter-spacing: 0.04em;
  }

  .headline {
    font-size: 88px;
    font-weight: 900;
    color: #FFFFFF;
    line-height: 1.05;
    letter-spacing: -0.025em;
    margin-bottom: 16px;
    white-space: nowrap;
  }

  .divider {
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #4CAF50, transparent);
    margin-bottom: 20px;
  }

  .sub-text {
    font-size: 52px;
    font-weight: 500;
    color: rgba(255,255,255,0.75);
    line-height: 1.25;
    letter-spacing: -0.01em;
    margin-bottom: 32px;
    white-space: nowrap;
  }

  /* Bottom CTA */
  .cta-bar {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    background: rgba(76,175,80,0.15);
    border: 1px solid rgba(76,175,80,0.4);
    border-radius: 8px;
    padding: 12px 24px;
  }
  .cta-text {
    font-size: 36px;
    font-weight: 700;
    color: #4CAF50;
    letter-spacing: 0.01em;
    white-space: nowrap;
  }
  .cta-arrow {
    font-size: 32px;
    color: #4CAF50;
  }

  /* Right content - accent */
  .content-right {
    position: relative;
    z-index: 10;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding-right: 50px;
  }

  .accent-number {
    font-size: 96px;
    font-weight: 900;
    color: #4CAF50;
    line-height: 1.0;
    letter-spacing: -0.03em;
    text-align: center;
    text-shadow: 0 0 40px rgba(76,175,80,0.4);
    margin-bottom: 6px;
    white-space: nowrap;
  }
  .accent-label {
    font-size: 40px;
    font-weight: 600;
    color: rgba(255,255,255,0.6);
    text-align: center;
    letter-spacing: 0.02em;
    white-space: nowrap;
  }

  /* Vertical separator */
  .separator {
    position: absolute;
    left: 700px;
    top: 60px;
    bottom: 60px;
    width: 1px;
    background: linear-gradient(180deg, transparent, rgba(76,175,80,0.25) 30%, rgba(76,175,80,0.25) 70%, transparent);
    z-index: 5;
  }
</style>
</head>
<body>
<div class="ad-container">
  <div class="grid-lines"></div>
  <div class="warm-glow"></div>
  <div class="warm-glow-right"></div>
  <div class="shield-arc"></div>
  <div class="separator"></div>

  <div class="content-left">
    <div class="tag">
      <div class="tag-dot"></div>
      <span class="tag-text">T.O.P 사업단</span>
    </div>
    <div class="headline">혼자가 아닙니다</div>
    <div class="divider"></div>
    <div class="sub-text">1:1 밀착 코칭 시스템</div>
    <div class="cta-bar">
      <span class="cta-text">T.O.P 사업단 | 지금 시작하기</span>
      <span class="cta-arrow">→</span>
    </div>
  </div>

  <div class="content-right">
    <div class="accent-number">30여종</div>
    <div class="accent-label">무상 DB 지원</div>
  </div>
</div>
</body>
</html>u  <!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@300;400;500;700;900&display=swap" rel="stylesheet">
<style>
  * { margin: 0; padding: 0; box-sizing: border-box; }
  body {
    width: 1200px;
    height: 1200px;
    overflow: hidden;
    font-family: 'Noto Sans KR', sans-serif;
    background: #0A1628;
  }
  .ad-container {
    position: relative;
    width: 1200px;
    height: 1200px;
    background: linear-gradient(160deg, #0A1628 0%, #0F2240 35%, #0B1A2E 65%, #0A1628 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 64px 80px 56px;
    overflow: hidden;
  }

  /* Background decorative circles - shield motif */
  .circle-bg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 860px;
    height: 860px;
    border: 1.5px solid rgba(76,175,80,0.10);
    border-radius: 50%;
    pointer-events: none;
  }
  .circle-bg-2 {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 660px;
    height: 660px;
    border: 1px solid rgba(76,175,80,0.07);
    border-radius: 50%;
    pointer-events: none;
  }
  .circle-bg-3 {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 1020px;
    height: 1020px;
    border: 1px solid rgba(255,193,7,0.06);
    border-radius: 50%;
    pointer-events: none;
  }

  /* Warm glow */
  .warm-glow {
    position: absolute;
    bottom: -200px;
    left: 50%;
    transform: translateX(-50%);
    width: 900px;
    height: 600px;
    background: radial-gradient(ellipse, rgba(76,175,80,0.08) 0%, transparent 65%);
    pointer-events: none;
  }
  .gold-glow {
    position: absolute;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    width: 700px;
    height: 500px;
    background: radial-gradient(ellipse, rgba(255,193,7,0.06) 0%, transparent 65%);
    pointer-events: none;
  }

  /* Subtle grid */
  .grid-lines {
    position: absolute;
    inset: 0;
    background-image:
      linear-gradient(rgba(76,175,80,0.035) 1px, transparent 1px),
      linear-gradient(90deg, rgba(76,175,80,0.035) 1px, transparent 1px);
    background-size: 80px 80px;
  }

  /* Top section */
  .top-section {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
  }

  .tag {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: rgba(255,193,7,0.10);
    border: 1px solid rgba(255,193,7,0.35);
    border-radius: 28px;
    padding: 10px 28px;
  }
  .tag-dot {
    width: 10px;
    height: 10px;
    background: #FFC107;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(255,193,7,0.7);
  }
  .tag-text {
    font-size: 32px;
    font-weight: 600;
    color: #FFC107;
    letter-spacing: 0.05em;
  }

  .headline {
    font-size: 92px;
    font-weight: 900;
    color: #FFFFFF;
    text-align: center;
    letter-spacing: -0.025em;
    line-height: 1.1;
  }

  /* Middle accent section */
  .middle-section {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
  }

  .accent-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(76,175,80,0.08);
    border: 2px solid rgba(76,175,80,0.35);
    border-radius: 20px;
    padding: 32px 64px;
    margin-bottom: 8px;
  }
  .accent-number {
    font-size: 96px;
    font-weight: 900;
    color: #4CAF50;
    line-height: 1.0;
    letter-spacing: -0.03em;
    text-shadow: 0 0 50px rgba(76,175,80,0.5);
  }
  .accent-sub {
    font-size: 48px;
    font-weight: 700;
    color: #4CAF50;
    letter-spacing: 0.03em;
    margin-top: 4px;
  }

  .sub-text {
    font-size: 64px;
    font-weight: 500;
    color: rgba(255,255,255,0.78);
    text-align: center;
    letter-spacing: -0.01em;
  }

  /* Bullet points section */
  .bullets-section {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 18px;
    width: 100%;
    max-width: 860px;
  }

  .bullet-item {
    display: flex;
    align-items: center;
    gap: 16px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    padding: 18px 32px;
  }
  .bullet-icon {
    width: 14px;
    height: 14px;
    background: #4CAF50;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 8px rgba(76,175,80,0.6);
  }
  .bullet-text {
    font-size: 42px;
    font-weight: 500;
    color: rgba(255,255,255,0.82);
    letter-spacing: -0.01em;
  }

  /* Bottom CTA */
  .bottom-section {
    position: relative;
    z-index: 10;
    width: 100%;
    display: flex;
    justify-content: center;
  }
  .cta-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    background: linear-gradient(135deg, #4CAF50, #45a049);
    border-radius: 12px;
    padding: 22px 60px;
    width: 100%;
    max-width: 860px;
    box-shadow: 0 8px 40px rgba(76,175,80,0.3);
  }
  .cta-text {
    font-size: 44px;
    font-weight: 700;
    color: #FFFFFF;
    letter-spacing: 0.01em;
  }
  .cta-arrow {
    font-size: 40px;
    color: #FFFFFF;
  }
</style>
</head>
<body>
<div class="ad-container">
  <div class="grid-lines"></div>
  <div class="circle-bg"></div>
  <div class="circle-bg-2"></div>
  <div class="circle-bg-3"></div>
  <div class="warm-glow"></div>
  <div class="gold-glow"></div>

  <div class="top-section">
    <div class="tag">
      <div class="tag-dot"></div>
      <span class="tag-text">T.O.P 사업단</span>
    </div>
    <div class="headline">혼자가 아닙니다</div>
  </div>

  <div class="middle-section">
    <div class="accent-badge">
      <div class="accent-number">30여종</div>
      <div class="accent-sub">무상 DB 지원</div>
    </div>
    <div class="sub-text">1:1 밀착 코칭 시스템</div>
  </div>

  <div class="bullets-section">
    <div class="bullet-item">
      <div class="bullet-icon"></div>
      <span class="bullet-text">DB + 코칭 + 매니저 3중 지원</span>
    </div>
    <div class="bullet-item">
      <div class="bullet-icon"></div>
      <span class="bullet-text">1:1 전담 매니저 밀착 케어</span>
    </div>
    <div class="bullet-item">
      <div class="bullet-icon"></div>
      <span class="bullet-text">30여종 무상 DB 즉시 지원</span>
    </div>
  </div>

  <div class="bottom-section">
    <div class="cta-button">
      <span class="cta-text">T.O.P 사업단 | 지금 시작하기</span>
      <span class="cta-arrow">→</span>
    </div>
  </div>
</div>
</body>
</html>u  <!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@300;400;500;700;900&display=swap" rel="stylesheet">
<style>
  * { margin: 0; padding: 0; box-sizing: border-box; }
  body {
    width: 600px;
    height: 500px;
    overflow: hidden;
    font-family: 'Noto Sans KR', sans-serif;
    background: #0A1628;
  }
  .ad-container {
    position: relative;
    width: 600px;
    height: 500px;
    background: linear-gradient(145deg, #0A1628 0%, #0F2040 50%, #0A1628 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 36px 40px 32px;
    overflow: hidden;
  }

  /* Shield circles */
  .circle-bg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 420px;
    height: 420px;
    border: 1.5px solid rgba(76,175,80,0.12);
    border-radius: 50%;
    pointer-events: none;
  }
  .circle-bg-2 {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 300px;
    height: 300px;
    border: 1px solid rgba(255,193,7,0.08);
    border-radius: 50%;
    pointer-events: none;
  }

  /* Warm glow */
  .warm-glow {
    position: absolute;
    bottom: -80px;
    left: 50%;
    transform: translateX(-50%);
    width: 500px;
    height: 300px;
    background: radial-gradient(ellipse, rgba(76,175,80,0.09) 0%, transparent 65%);
    pointer-events: none;
  }

  /* Grid */
  .grid-lines {
    position: absolute;
    inset: 0;
    background-image:
      linear-gradient(rgba(76,175,80,0.04) 1px, transparent 1px),
      linear-gradient(90deg, rgba(76,175,80,0.04) 1px, transparent 1px);
    background-size: 40px 40px;
  }

  /* Top tag */
  .top-section {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }

  .tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,193,7,0.10);
    border: 1px solid rgba(255,193,7,0.35);
    border-radius: 20px;
    padding: 7px 18px;
  }
  .tag-dot {
    width: 7px;
    height: 7px;
    background: #FFC107;
    border-radius: 50%;
    box-shadow: 0 0 6px rgba(255,193,7,0.7);
  }
  .tag-text {
    font-size: 22px;
    font-weight: 600;
    color: #FFC107;
    letter-spacing: 0.05em;
  }

  .headline-small {
    font-size: 34px;
    font-weight: 800;
    color: rgba(255,255,255,0.9);
    text-align: center;
    letter-spacing: -0.02em;
  }

  /* Center accent */
  .center-section {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
  }

  .accent-big {
    font-size: 96px;
    font-weight: 900;
    color: #4CAF50;
    line-height: 1.0;
    letter-spacing: -0.03em;
    text-align: center;
    text-shadow: 0 0 40px rgba(76,175,80,0.5);
  }
  .accent-label {
    font-size: 40px;
    font-weight: 700;
    color: rgba(255,255,255,0.65);
    text-align: center;
    letter-spacing: 0.01em;
  }

  /* Support line */
  .support-line {
    position: relative;
    z-index: 10;
    font-size: 28px;
    font-weight: 500;
    color: rgba(255,255,255,0.6);
    text-align: center;
    letter-spacing: -0.01em;
  }
  .support-line strong {
    color: rgba(255,255,255,0.85);
    font-weight: 700;
  }

  /* CTA */
  .cta-button {
    position: relative;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: linear-gradient(135deg, #4CAF50, #45a049);
    border-radius: 10px;
    padding: 14px 36px;
    width: 100%;
    box-shadow: 0 6px 30px rgba(76,175,80,0.35);
  }
  .cta-text {
    font-size: 30px;
    font-weight: 700;
    color: #FFFFFF;
    letter-spacing: 0.01em;
  }
  .cta-arrow {
    font-size: 28px;
    color: rgba(255,255,255,0.9);
  }
</style>
</head>
<body>
<div class="ad-container">
  <div class="grid-lines"></div>
  <div class="circle-bg"></div>
  <div class="circle-bg-2"></div>
  <div class="warm-glow"></div>

  <div class="top-section">
    <div class="tag">
      <div class="tag-dot"></div>
      <span class="tag-text">T.O.P 사업단</span>
    </div>
    <div class="headline-small">혼자가 아닙니다</div>
  </div>

  <div class="center-section">
    <div class="accent-big">30여종 DB</div>
    <div class="accent-label">무상 지원</div>
  </div>

  <div class="support-line">
    <strong>DB + 코칭 + 매니저</strong> 3중 지원
  </div>

  <div class="cta-button">
    <span class="cta-text">T.O.P 사업단 | 지금 시작하기</span>
    <span class="cta-arrow">→</span>
  </div>
</div>
</body>
</html>html_contentoutput_pathwidthheightc           
        K   t               4 d{   }|j                  j                  dg       d{   }|j                  ||dd       d{   }|j	                  | d       d{    |j                  d	       d{    |j                  |d
dd||d       d{    |j                          d{    ddd      d{    t        d|        y7 7 7 7 {7 d7 E7 /7 !# 1 d{  7  sw Y   1xY ww)z+Render HTML string to PNG using Playwright.Nz--no-sandbox)args)r
   r   g      ?)viewportdevice_scale_factornetworkidle)
wait_untili	  Fr   )xyr
   r   )path	full_pageclipz  Rendered: )	r   chromiumlaunchnew_pageset_contentwait_for_timeout
screenshotcloseprint)r   r	   r
   r   pbrowserpages          F/home/jay/workspace/output/google-ads/angle-E/production/render_ads.pyrender_html_to_pngr#     s    !  Q

))/?)@@%%$7 # & 
 
 |FFF##D)))oo;%UfG
o  	 	 mmo  
L
&'@
 	G)	 	   s   D
C%D
!C5C'C5C)C5/C+0C5C-	 C5)C/*C5C1C5D
C3D
'C5)C5+C5-C5/C51C53D
5D;C><DD

input_pathc                     t        j                  |       }|j                  dt         j                        }|j	                  |dd       t        d|        y)zAResize a 600x500 image to 300x250 using PIL high-quality Lanczos.)i,     PNGT)optimizez  Resized to 300x250: N)r   openresizeLANCZOSsaver   )r$   r	   imgresizeds       r"   resize_to_300x250r/     sF    
**Z
 CjjU]]3GLLedL3	";-
01    c                  4  K   t        d       t        d       t        t        dz        } t        d       t        t        | dd       d {    t        t        dz        }t        d       t        t
        |dd       d {    t        t        d	z        }t        t        d
z        }t        d       t        t        |dd       d {    t        d       t        ||       t        j                  |       t        d       t        d       t        dt                t        t        j                               D ]K  }|j                  dk(  s|j                         j                  dz  }t        d|j                   d| d       M y 7 E7 7 ʭw)Nu'   === Angle E — Display Ad Renderer ===u4   Design: #49 Spikes 신뢰/보호 (Trust/Protection)
zdisplay-1200x628.pngu%   1. Rendering 1200×628 (landscape)...i  it  zdisplay-1200x1200.pngu#   2. Rendering 1200×1200 (square)...z_tmp_600x500.pngzdisplay-300x250.pngu'   3. Rendering 600×500 (for 300×250)...iX  i  u      Resizing to 300×250...z   Temp file removed.z'
=== All ads rendered successfully! ===zOutput directory: z.pngi   z  z: z KB)r   str
OUTPUT_DIRr#   HTML_1200x628HTML_1200x1200HTML_600x500r/   osremovesortediterdirsuffixstatst_sizename)out_1200x628out_1200x1200tmp_600x500out_300x250fsize_kbs         r"   mainrE     sf    	
34	
AB z$::;L	
12
]L$
DDD 
%<<=M	
/0
^]D$
GGG j#556Kj#889K	
34
\;S
AAA	
&'k;/ IIk	!#	
45	zl
+,J&&() /88vffh&&$.GBqvvhb	-./+ E
 H Bs>   A	FF6FFAFFBF=FFF__main__)__doc__asyncior7   pathlibr   playwright.async_apir   PILr   r3   mkdirr4   r5   r6   r2   intr#   r/   rE   __name__run r0   r"   <module>rQ      s     	  1 LM
 
    -l\iV	Vr(3 (S ( (VY ($2# 2C 2/D zGKK r0   