feat(03-03): add SVG forest background and 4x3 grid HTML/CSS structure

- SVG woodland background with sky gradient, clouds, sun, trees, hills, ground
- 4x3 CSS grid overlay for forest element placement
- Fade-in + scale-up animation keyframes for new elements
This commit is contained in:
2026-03-29 13:40:54 +02:00
parent 420c0e1a1f
commit c9abc9e6a1
2 changed files with 87 additions and 0 deletions
+24
View File
@@ -34,6 +34,30 @@
<img id="forest-greeting-avatar" class="companion-area__avatar" src="" alt="">
<p id="forest-greeting-text" class="companion-area__text"></p>
</div>
<div class="forest__scene" id="forest-scene">
<svg class="forest__bg" viewBox="0 0 800 400" xmlns="http://www.w3.org/2000/svg">
<defs>
<linearGradient id="sky-grad" x1="0" y1="0" x2="0" y2="1">
<stop offset="0%" stop-color="#E8F4FD"/>
<stop offset="100%" stop-color="#F0F8E8"/>
</linearGradient>
</defs>
<rect x="0" y="0" width="800" height="300" fill="url(#sky-grad)"/>
<ellipse cx="150" cy="60" rx="60" ry="25" fill="white" opacity="0.5"/>
<ellipse cx="550" cy="80" rx="70" ry="20" fill="white" opacity="0.4"/>
<circle cx="700" cy="50" r="30" fill="#F8E8A0" opacity="0.6"/>
<g opacity="0.3">
<ellipse cx="80" cy="240" rx="40" ry="60" fill="#7DB87D"/>
<ellipse cx="720" cy="250" rx="35" ry="55" fill="#6DA86D"/>
<ellipse cx="400" cy="230" rx="45" ry="70" fill="#8DC88D"/>
</g>
<ellipse cx="200" cy="320" rx="250" ry="80" fill="#A8D8A8"/>
<ellipse cx="650" cy="330" rx="200" ry="60" fill="#B8E0B0"/>
<rect x="0" y="300" width="800" height="100" fill="#C8E6C0" rx="0"/>
</svg>
<div class="forest__grid" id="forest-grid">
</div>
</div>
<div class="forest__level-map" id="level-map">
<!-- Level cards rendered dynamically -->
</div>
+63
View File
@@ -378,6 +378,69 @@ h3 {
line-height: 1.4;
}
/* Forest Scene */
.forest__scene {
position: relative;
width: 100%;
max-width: 800px;
margin: 0 auto 1.5rem;
border-radius: 16px;
overflow: hidden;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}
.forest__bg {
display: block;
width: 100%;
height: auto;
}
.forest__grid {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
display: grid;
grid-template-columns: repeat(4, 1fr);
grid-template-rows: repeat(3, 1fr);
padding: 1rem;
gap: 0.5rem;
}
.forest__element {
display: flex;
align-items: center;
justify-content: center;
}
.forest__element img {
max-width: 100%;
max-height: 100%;
object-fit: contain;
border-radius: 8px;
filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15));
}
.forest__element--new {
animation: forest-element-appear 1.2s ease-out forwards;
}
@keyframes forest-element-appear {
0% {
opacity: 0;
transform: scale(0.3);
}
60% {
opacity: 1;
transform: scale(1.05);
}
100% {
opacity: 1;
transform: scale(1);
}
}
/* Keyboard */
.keyboard {
display: flex;