Looks less shitty on mobile

This commit is contained in:
Simon Einzinger 2024-09-20 21:27:33 +02:00
parent 94f09418d9
commit 8ce3471e62
2 changed files with 74 additions and 32 deletions

View file

@ -4,7 +4,7 @@
<div class="duty-container"> <div class="duty-container">
<div class="duty-section"> <div class="duty-section">
<div class="icon-top-right"> <div class="icon-top-right">
<i class="fa-solid fa-volleyball"></i> <i class="fa-solid fa-house"></i>
</div> </div>
<div class="section-header"> <div class="section-header">
<h3>Hallendienst</h3> <h3>Hallendienst</h3>
@ -58,18 +58,24 @@ export default {
</script> </script>
<style scoped> <style scoped>
* {
box-sizing: border-box;
}
.duties { .duties {
text-align: center; text-align: center;
margin-top: 40px; margin-top: 40px;
padding: 0 15px; /* Add padding to prevent cut-off */
} }
h2 { h2 {
color: #34495e; color: #34495e;
margin-bottom: 20px; margin-bottom: 20px;
font-size: 2.2em; font-size: 2em;
font-weight: bold; font-weight: bold;
text-transform: uppercase; text-transform: uppercase;
letter-spacing: 2px; letter-spacing: 2px;
text-align: center; /* Ensure h2 is centered */
} }
.duty-container { .duty-container {
@ -78,6 +84,8 @@ h2 {
align-items: flex-start; align-items: flex-start;
gap: 20px; gap: 20px;
flex-wrap: wrap; flex-wrap: wrap;
width: 100%;
margin: 0 auto; /* Center the container */
} }
.duty-section { .duty-section {
@ -91,6 +99,7 @@ h2 {
position: relative; position: relative;
overflow: hidden; overflow: hidden;
transition: transform 0.3s ease, box-shadow 0.3s ease; transition: transform 0.3s ease, box-shadow 0.3s ease;
margin: 0 auto; /* Center the card */
} }
.duty-section::before { .duty-section::before {
@ -110,13 +119,13 @@ h2 {
box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15); box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
} }
.section-header { .icon-top-right {
display: flex; position: absolute;
align-items: center; top: 10px;
justify-content: center; right: 10px;
margin-bottom: 15px; font-size: 1.8em;
z-index: 2; color: #2980b9;
position: relative; opacity: 0.7;
} }
h3 { h3 {
@ -145,25 +154,25 @@ li:hover {
background-color: #ecf0f1; background-color: #ecf0f1;
} }
.icon-top-right {
position: absolute;
top: 10px;
right: 10px;
font-size: 2em;
color: #2980b9;
opacity: 0.7;
}
@media (max-width: 768px) { @media (max-width: 768px) {
.duty-container { .duty-container {
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
width: 100%;
padding: 0 15px;
} }
.duty-section { .duty-section {
width: 100%; max-width: 100%; /* Take full width on small screens */
max-width: 90%; margin: 0 auto; /* Center the card */
margin-bottom: 20px; }
h2 {
font-size: 1.8em;
}
.icon-top-right {
font-size: 1.5em;
} }
} }
</style> </style>

View file

@ -10,15 +10,15 @@
<div class="icon-top-right"> <div class="icon-top-right">
<i class="fa-solid fa-volleyball"></i> <i class="fa-solid fa-volleyball"></i>
</div> </div>
<h3>{{ formatDate(game.date) }} - Spiel{{ game.gameNr }}</h3> <h3>{{ formatDate(game.date) }} - Spiel {{ game.gameNr }}</h3>
<div class="teams"> <div class="teams">
<div class="team"> <div class="team">
<span>🏅</span> <i :class="getIconClass(game.team1)"></i>
<p>{{ game.team1 }}</p> <p>{{ game.team1 }}</p>
</div> </div>
<p class="versus">VS</p> <p class="versus">VS</p>
<div class="team"> <div class="team">
<span>🏅</span> <i :class="getIconClass(game.team2)"></i>
<p>{{ game.team2 }}</p> <p>{{ game.team2 }}</p>
</div> </div>
</div> </div>
@ -28,7 +28,7 @@
</p> </p>
</div> </div>
</div> </div>
<p v-else>Keine anstehended Spiele</p> <p v-else>No upcoming games</p>
</div> </div>
</template> </template>
@ -50,6 +50,11 @@ export default {
}, },
}, },
methods: { methods: {
getIconClass(team) {
return team === "DJK Saarbrücken-Rastpfuhl"
? "fas fa-trophy"
: "fas fa-poo";
},
formatDate(dateStr) { formatDate(dateStr) {
const date = new Date(dateStr); const date = new Date(dateStr);
return date.toLocaleDateString(undefined, { return date.toLocaleDateString(undefined, {
@ -63,18 +68,24 @@ export default {
</script> </script>
<style scoped> <style scoped>
* {
box-sizing: border-box;
}
.games { .games {
margin-top: 40px; margin-top: 40px;
text-align: center; text-align: center;
padding: 0 15px;
} }
h2 { h2 {
color: #34495e; color: #34495e;
margin-bottom: 20px; margin-bottom: 20px;
font-size: 2.2em; font-size: 2em;
font-weight: bold; font-weight: bold;
text-transform: uppercase; text-transform: uppercase;
letter-spacing: 2px; letter-spacing: 2px;
text-align: center;
} }
.game-cards { .game-cards {
@ -82,6 +93,8 @@ h2 {
flex-direction: column; flex-direction: column;
gap: 20px; gap: 20px;
align-items: center; align-items: center;
width: 100%;
justify-content: center;
} }
.game-card { .game-card {
@ -94,6 +107,7 @@ h2 {
text-align: left; text-align: left;
position: relative; position: relative;
overflow: hidden; overflow: hidden;
margin: 0 auto;
transition: transform 0.3s ease, box-shadow 0.3s ease; transition: transform 0.3s ease, box-shadow 0.3s ease;
} }
@ -118,14 +132,14 @@ h2 {
position: absolute; position: absolute;
top: 10px; top: 10px;
right: 10px; right: 10px;
font-size: 2em; font-size: 1.8em;
color: #2980b9; color: #2980b9;
opacity: 0.7; opacity: 0.7;
} }
.game-card h3 { .game-card h3 {
color: #16a085; color: #16a085;
font-size: 1.5em; font-size: 1.3em;
z-index: 2; z-index: 2;
position: relative; position: relative;
} }
@ -142,17 +156,22 @@ h2 {
.team { .team {
display: flex; display: flex;
align-items: center; align-items: center;
font-size: 1.2em; font-size: 1.1em;
width: 40%; width: 40%;
} }
.team i {
margin-right: 10px;
font-size: 1.5em;
color: #2980b9; /* Color of the icon */
}
.team span { .team span {
margin-right: 10px; margin-right: 10px;
font-size: 1.5em; font-size: 1.5em;
} }
.versus { .versus {
font-size: 1.3em; font-size: 1.2em;
color: #e74c3c; color: #e74c3c;
font-weight: bold; font-weight: bold;
z-index: 2; z-index: 2;
@ -169,9 +188,15 @@ h2 {
} }
@media (max-width: 768px) { @media (max-width: 768px) {
.game-card { .game-cards {
width: 100%; width: 100%;
max-width: 90%; padding: 0 15px;
justify-content: center;
}
.game-card {
max-width: 100%;
margin: 0 auto;
} }
h2 { h2 {
@ -189,5 +214,13 @@ h2 {
width: 100%; width: 100%;
text-align: center; text-align: center;
} }
.icon-top-right {
font-size: 1.5em;
}
.game-card h3 {
font-size: 1.2em;
}
} }
</style> </style>