File size: 3,094 Bytes
b3b0b53
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
/* wechat-miniprogram-translator/index.wxss */
:root {
    --background-color: #f0f2f5;
    --card-bg: #ffffff;
    --primary-text: #1c1e21;
    --secondary-text: #606770;
    --border-color: #e0e0e0;
    --accent-color: #007bff;
    --mic-button-bg: #28a745;
    --mic-recording-bg: #dc3545;
    /* Note: WeChat Mini Program does not fully support custom font families directly via CSS import. */
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}
page {
    height: 100%;
    background-color: var(--background-color);
}
body {
    /* In Mini Program, use 'page' for root styling, 'body' is not applicable */
}
.container {
    width: 100%;
    max-width: 500px; /* Optimized for mobile width */
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    height: 100vh; /* Use 100vh for full height in Mini Program */
    padding: 1rem;
    box-sizing: border-box;
}

.io-container {
    display: flex;
    flex-direction: column;
    gap: 100rpx; /* Adjust this value as needed */
}
.language-panel {
    background-color: var(--card-bg);
    padding: 0.75rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}
.panel-label {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    text-align: center;
    color: var(--primary-text);
}
.language-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
}
.lang-button {
    display: inline-flex; /* Use inline-flex to allow spacing */
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 44px; /* Set a fixed width for the button */
    height: 44px; /* Set a fixed height to make it a square */
    margin: 5px;
    padding: 0;
    border: 2px solid transparent; /* Start with a transparent border */
    border-radius: 50%; /* Make it a circle */
    background-color: #f0f0f0;
    transition: all 0.2s ease-in-out;
    box-sizing: border-box; /* Ensure padding and border are inside the width/height */
}

.lang-button.selected {
    border-color: #007aff; /* Blue border for selected state */
    transform: scale(1.1); /* Slightly enlarge the selected button */
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.flag-icon {
    width: 32px; /* Adjust flag size to fit inside the circle */
    height: 32px;
    border-radius: 50%; /* Make the flag image itself circular */
    object-fit: cover; /* Ensure the image covers the area nicely */
}

.mic-container {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
}

#mic-btn {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background-color: #007aff;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.4);
    transition: all 0.2s ease;
}

#mic-btn.recording {
    background-color: #ff3b30; /* Red color when recording */
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(255, 59, 48, 0.5);
}