Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 19 additions & 2 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,27 @@ <h1>AI チャット</h1>
</li>
</template>
</ul>
<div id="cook-time">
<div id="cook-time-container">
10分
<input type="range" min="0" max="100" value="0" step="10" id="cook-time-slider">
<input type="range" min="0" max="100" value="0" step="5" id="cook-time-slider">
100分~
<div id="slider-value">50</div>
</div>
<div id="cook-difficulty">
<form>
<label>
<input type="radio" name="group" value="カンタン" checked>
Option 1
</label>
<label>
<input type="radio" name="group" value="難しくはない">
Option 2
</label>
<label>
<input type="radio" name="group" value="難易度は気にしない">
Option 3
</label>
</form>
</div>
<div id="selectButton"></div>
<div>選択した食材</div>
Expand Down
12 changes: 11 additions & 1 deletion public/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,16 @@ document.addEventListener('click', function(event) {
}
});

//cook-timeのsliderのデザインと値
const cookTimeSlider = document.getElementById('cook-time-slider');
const sliderValue = document.getElementById('slider-value');

sliderValue.textContent = cookTimeSlider.value;

cookTimeSlider.addEventListener('input', () => {
sliderValue.textContent = cookTimeSlider.value + '分';
});

submitButtonElement.onclick = async () => {
const promptText = selectedIngredients.join("と") + "を用いた主菜を含む一食の献立を3つ提案してください";
const aiMessageChunk = await postChat({ promptText });
Expand All @@ -109,4 +119,4 @@ submitButtonElement.onclick = async () => {
console.log("献立 1:", menu1);
console.log("献立 2:", menu2);
console.log("献立 3:", menu3);
};
};
44 changes: 41 additions & 3 deletions public/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@
.button {
border:2px solid black;
border-radius: 2px;
padding: 10px 10px
padding: 10px 10px;
width: 100px;
height:100px;
}

.button:hover{
Expand All @@ -62,8 +64,44 @@
color: #ff0000;
}

#cook-time{
#cook-time-container{
width:360px;
color: #ff0000;
border:2px black;
border:2px solid black;
padding:20px 10px
}

#slider-value {
font-size: 16px;
font-weight: bold;
}


.proposal-container {
width: 80%;
max-width: 600px;
display: flex;
}

.proposal {
background-color: #fff;
border: 1px solid #ddd;
margin-bottom: 10px;
padding: 10px;
cursor: pointer;
position: relative;
}

.proposal-details {
display: none;
padding: 10px;
background-color: #f9f9f9;
border-top: 1px solid #ddd;
position: absolute;
width: calc(100% - 20px);
bottom: 0;
}

.proposal.active .proposal-details {
display: block;
}