[STYLE] menuのデザインを変更しました。

This commit is contained in:
s-choi
2026-09-18 13:51:59 +09:00
parent 20b4366d91
commit 12550c5b1d
2 changed files with 155 additions and 55 deletions

View File

@@ -1,15 +1,80 @@
table, th, td {border: 1px solid black; border-collapse: collapse;} body {
margin: 0;
padding: 0;
}
td:hover{background-color: lightblue;} #calendar {
width: 100%;
border-collapse: collapse;
table-layout: fixed;
}
th{font-weight: bold; height: 50px;} #calendar th,
#calendar td {
border: 1px solid black;
}
td{text-align: left; vertical-align: text-top; width: 200px; height: 100px; padding: 10px} th {
font-weight: bold;
height: 35px;
font-size: 13px;
text-align: center;
}
.holiday{color: red;} td {
width: 14.28%;
height: 70px;
padding: 5px;
text-align: left;
vertical-align: top;
}
#today{font-weight: bold; background-color: bisque;} td:hover {
background-color: lightblue;
}
.year{font-size: 30px;} .holiday {
color: red;
}
.month{font-size: 50px; font-weight: bold;} #today {
font-weight: bold;
background-color: bisque;
}
.year {
font-size: 20px;
}
.month {
font-size: 30px;
font-weight: bold;
}
.calendar-title {
margin: 15px 10px;
}
.date {
font-size: 13px;
font-weight: bold;
}
.income {
color: blue;
font-size: 10px;
}
.expense {
color: red;
font-size: 10px;
}
.total {
margin: 15px 10px;
padding: 10px;
border-top: 1px solid #ddd;
font-size: 16px;
text-align: right;
}

View File

@@ -2,70 +2,105 @@
<html xmlns:th="http://www.thymeleaf.org"> <html xmlns:th="http://www.thymeleaf.org">
<head> <head>
<meta charset="UTF-8">
<title>Calendar</title> <meta charset="UTF-8">
<link rel="stylesheet" th:href="@{/css/menu.css}"> <meta name="viewport" content="width=device-width, initial-scale=1">
<title>Calendar</title>
<link rel="stylesheet" th:href="@{/css/menu.css}">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.7/dist/css/bootstrap.min.css" rel="stylesheet">
</head> </head>
<body> <body>
<span class="year" th:text="|${year}年|"></span> <div th:replace="~{header :: header}"></div>
<span class="month" th:text="|${month}月|"></span>
<table id="calendar">
<thead> <div class="calendar-title">
<tr>
<th class="holiday">日</th>
<th>月</th>
<th>火</th>
<th>水</th>
<th>木</th>
<th>金</th>
<th>土</th>
</tr>
</thead>
<tbody> <span class="year" th:text="|${year}年|">
</span>
<tr th:each="week : ${#numbers.sequence(0, 5)}"> <span class="month" th:text="|${month}月|">
</span>
<td th:each="weekDay : ${#numbers.sequence(0, 6)}"> </div>
<div th:if="${week * 7 + weekDay - firstDayOfWeek + 1 >= 1 and week * 7 + weekDay - firstDayOfWeek + 1 <= lastDay}">
<div class="date" th:text="${week * 7 + weekDay - firstDayOfWeek + 1}"> <table id="calendar">
</div>
<div th:each="income : ${incomeList}" <thead>
th:if="${income.date.dayOfMonth == week * 7 + weekDay - firstDayOfWeek + 1}"
class="income"
th:text="|収入 +${income.amount}円|"
style="color: blue;">
</div>
<div th:each="expense : ${expenseList}" <tr>
th:if="${expense.date.dayOfMonth == week * 7 + weekDay - firstDayOfWeek + 1}" <th class="holiday">日</th>
class="expense" <th>月</th>
th:text="|支出 -${expense.amount}円|" <th>火</th>
style="color: red;"> <th>水</th>
</div> <th>木</th>
<th>金</th>
<th>土</th>
</tr>
</div> </thead>
</td>
</tr> <tbody>
</tbody> <tr th:each="week : ${#numbers.sequence(0, 5)}">
</table>
<td th:each="weekDay : ${#numbers.sequence(0, 6)}">
<a th:if="${week * 7 + weekDay - firstDayOfWeek + 1 >= 1
and week * 7 + weekDay - firstDayOfWeek + 1 <= lastDay}"
th:href="@{/transaction/detail(
todayDates=${T(java.time.LocalDate).of(year, month, week * 7 + weekDay - firstDayOfWeek + 1)}
)}">
<div th:if="${week * 7 + weekDay - firstDayOfWeek + 1 >= 1 and week * 7 + weekDay - firstDayOfWeek + 1 <= lastDay}">
<div class="date" th:text="${week * 7 + weekDay - firstDayOfWeek + 1}">
</div>
<div th:each="income : ${incomeList}" th:if="${income.date.dayOfMonth == week * 7 + weekDay - firstDayOfWeek + 1}" class="income" th:text="|収入 +${income.amount}円|">
</div>
<div th:each="expense : ${expenseList}" th:if="${expense.date.dayOfMonth == week * 7 + weekDay - firstDayOfWeek + 1}" class="expense" th:text="|支出 -${expense.amount}円|">
</div>
</div>
</a>
</td>
</tr>
</tbody>
</table>
<div class="total">
<div>
<span>収入:</span>
<span th:text="${totalIncome}"></span>
<span>円</span>
</div>
<div>
<span>支出:</span>
<span th:text="${totalExpense}"></span>
<span>円</span>
</div>
</div>
<div>
<h2>
<span th:text="|収入:${totalIncome}|"></span>
<span th:text="|支出:${totalExpense}|"></span>
</h2>
</div>
</body> </body>