{"title\_suggestion": "Create and fill crafting habit bottles"}
HTML
<div class="crafting-container">
<h1>đź§´ My Crafting Habit Bottles</h1>
<p class="instruction">
Tap each bottle to fill it based on your crafting habits!<br>
Empty means "not me", overflow means "this is totally me!" đź’§
</p>
<div id="bottleBox" class="bottle-grid"></div>
<button id="submitBtn">
✨ Create My Crafting Bottle
</button>
<div id="resultArea">
<h2>
đź§´ My Crafting Habit Bottles
</h2>
<div id="resultBox" class="bottle-grid"></div>
<p>
Every bottle tells my crafting story ✨
</p>
<button id="saveBtn">
📸 Save My Image
</button>
</div>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/html2canvas/1.4.1/html2canvas.min.js"></script>
CSS
body{
font-family:Arial,sans-serif;
background:#fff8f2;
margin:0;
padding:15px;
}
.crafting-container{
max-width:900px;
margin:auto;
text-align:center;
}
h1{
font-size:26px;
}
.instruction{
font-size:14px;
color:#666;
line-height:1.5;
}
.bottle-grid{
display:grid;
grid-template-columns:
repeat(6,1fr);
gap:15px;
margin-top:25px;
}
.habit-card{
background:white;
border-radius:14px;
padding:8px 5px;
box-shadow:
0 2px 8px rgba(0,0,0,.08);
}
.bottle{
width:45px;
height:90px;
margin:15px auto 8px;
border:3px solid #555;
border-radius:
12px 12px 18px 18px;
position:relative;
background:white;
cursor:pointer;
overflow:visible;
}
.bottle:before{
content:"";
position:absolute;
width:20px;
height:10px;
border:3px solid #555;
border-bottom:none;
top:-13px;
left:9px;
border-radius:
5px 5px 0 0;
}
.water{
position:absolute;
bottom:0;
left:0;
width:100%;
background:
linear-gradient(
180deg,
#ffc1df,
#ff7eb8
);
transition:
height .4s;
border-radius:
0 0 15px 15px;
}
.level-0{
height:0%;
}
.level-1{
height:20%;
}
.level-2{
height:50%;
}
.level-3{
height:75%;
}
.level-4,
.level-5{
height:100%;
}
/* Overflow */
.level-5:before{
content:"";
position:absolute;
width:50px;
height:14px;
left:-3px;
top:-8px;
background:#ff7eb8;
border-radius:50%;
animation:
wave 1s infinite;
}
.level-5:after{
content:"";
position:absolute;
width:8px;
height:15px;
right:3px;
top:-3px;
background:#ff7eb8;
border-radius:50%;
animation:
drip 1.4s infinite;
}
@keyframes wave{
50%{
transform:scaleX(1.2);
}
}
@keyframes...
JavaScript
const habits=[
"I organize my workspace before crafting",
"I have my own favorite crafting tools",
"I collect tiny leftover pieces",
"I save materials because they may be useful someday",
"I keep my crafting supplies neatly organized",
"I watch crafting tutorials for inspiration",
"I save DIY ideas whenever I see something interesting",
"I take photos of my crafting progress",
"I share my finished creations with others",
"I add my own creative touches",
"I customize colors and details",
"I spend extra time perfecting small details",
"I craft while listening to music or podcasts",
"I enjoy crafting with a drink beside me",
"I lose track of time while crafting",
"I use crafting as a way to relax",
"I enjoy the process more than finishing quickly",
"I always want to start a new project",
"I like trying new crafting techniques",
"I explore different types of crafts",
"I make handmade gifts for others",
"I keep my first handmade creation",
"I decorate my space with handmade creations",
"I create seasonal or holiday crafts"
];
const levels=[
"Empty",
"A little",
"Half full",
"More than half",
"Full",
"Overflow"
];
const box=
document.getElementById("bottleBox");
let states=[];
habits.forEach((habit,index)=>{
states[index]=0;
const card=
document.createElement("div");
card.className="habit-card";
card.innerHTML=`
<div class="bottle">
<div class="water level-0"></div>
</div>
<div class="habit-title">
${habit}
</div>
<div class="status">
Empty
</div>
`;
const bottle=
card.querySelector(".bottle");
const water=
card.querySelector(".water");
bottle.onclick=function(){
states[index]++;
if(states[index]>5){
states[index]=0;
}
water.className=
"water level-"+states[index];
};
box.appendChild(card);
});
// create...