Skip to content

Commit

Permalink
Improve event title and language switcher style (#206)
Browse files Browse the repository at this point in the history
* Improve style of event titles and language switcher

* Update gitignore to include Mac-related stuff
  • Loading branch information
am9zZWY authored Nov 26, 2024
1 parent da25a59 commit 3218955
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 5 deletions.
10 changes: 9 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
# PHP
/vendor/

# JetBrains IDE
.idea

# Mac OS
.DS_Store

# Misc
*.env
metas.php
.idea
40 changes: 40 additions & 0 deletions css/i18n.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
.language-switcher {
position: relative;
display: inline-block;
}

.language-switcher select {
appearance: none;
-webkit-appearance: none;
-moz-appearance: none;
padding: 8px 32px 8px 12px;
font-size: 16px;
border: 1px solid var(--primary-color);
border-radius: 6px;
background-color: white;
cursor: pointer;
min-width: 140px;
transition: all 0.2s ease;
}

.language-switcher::after {
content: '▼';
font-size: 12px;
color: #666;
position: absolute;
right: 12px;
top: 50%;
transform: translateY(-50%);
pointer-events: none;
}

.language-switcher select:hover {
border-color: #999;
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.language-switcher select:focus {
outline: none;
border-color: var(--primary-color);
box-shadow: var(--box-shadow);
}
16 changes: 14 additions & 2 deletions css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,18 @@ a .link.color-border {
background-color: initial;
}

.box .name {
font-size: 100%;
color: var(--text-color);
word-break: break-word;
overflow-wrap: break-word;
hyphens: auto;
text-align: center;
line-height: 1.5;
white-space: pre-wrap;
max-width: 100%;
}

.box.today {
background-color: var(--success-color-light);
}
Expand Down Expand Up @@ -166,11 +178,11 @@ p.date {
height: 150px;
}

p.name {
.box .name {
font-size: 70%;
}

p.date {
.box .date {
font-size: 50%;
}
}
Expand Down
5 changes: 3 additions & 2 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ function sortByDate(Event $a, Event $b): int
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="stylesheet" href="css/style.css<?= $FILE_REVISION; ?>">
<link rel="stylesheet" href="css/icons.css<?= $FILE_REVISION; ?>">
<link rel="stylesheet" href="css/i18n.css<?= $FILE_REVISION; ?>">
<title><?= $i18n['title'] ?></title>
</head>

Expand All @@ -47,8 +48,8 @@ function sortByDate(Event $a, Event $b): int

<div class="container">
<label>
<div class="select-container">
<select id="lang-selection" aria-description="Select language">
<div class="language-switcher">
<select id="lang-selection" aria-label="Select language">
<option value='de' <?= $i18n->getLanguage() === 'de' ? 'selected' : '' ?>>🇩🇪 Deutsch</option>
<option value="en" <?= $i18n->getLanguage() === 'en' ? 'selected' : '' ?>>🇬🇧 English</option>
</select>
Expand Down

0 comments on commit 3218955

Please sign in to comment.