Skip to content

Commit 77afbc1

Browse files
committed
fix: resolve merge markers in macos release
1 parent 58ff4af commit 77afbc1

2 files changed

Lines changed: 19 additions & 173 deletions

File tree

Cargo.lock

Lines changed: 0 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/macos/ui/countdown.rs

Lines changed: 19 additions & 165 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,14 @@ const KEGEL_HTML_TEMPLATE: &str = r#"<!DOCTYPE html>
2727
<title>Aligned Kegel Guide</title>
2828
<style>
2929
:root {
30-
--page-bg: radial-gradient(circle at top, #f7f3ea 0%, #ece5d8 46%, #e5dccf 100%);
31-
--card-bg: rgba(255, 250, 243, 0.78);
32-
--card-border: rgba(123, 97, 74, 0.14);
33-
--text-main: #40342d;
34-
--text-sub: #7f6e61;
35-
--text-strong: #241d19;
36-
--text-muted: #8d7c6f;
37-
--font-serif: 'New York', 'Times New Roman', Times, serif;
38-
--font-sans: 'SF Pro Display', 'Helvetica Neue', Helvetica, Arial, sans-serif;
30+
--page-bg: #f2f0e9;
31+
--card-bg: #f2f0e9;
32+
--text-main: #333333;
33+
--text-sub: #757575;
34+
--text-strong: #1f1f1f;
35+
--text-muted: #6b6b6b;
36+
--font-serif: 'Times New Roman', Times, serif;
37+
--font-sans: 'Helvetica Neue', Helvetica, Arial, sans-serif;
3938
--anim-duration: 4s;
4039
}
4140
@@ -47,39 +46,11 @@ const KEGEL_HTML_TEMPLATE: &str = r#"<!DOCTYPE html>
4746
margin: 0;
4847
padding: 0;
4948
height: 100vh;
50-
background: var(--page-bg);
49+
background-color: var(--page-bg);
5150
display: flex;
5251
justify-content: center;
5352
align-items: center;
5453
user-select: none;
55-
-webkit-font-smoothing: antialiased;
56-
text-rendering: optimizeLegibility;
57-
overflow: hidden;
58-
}
59-
60-
body::before,
61-
body::after {
62-
content: "";
63-
position: fixed;
64-
inset: auto;
65-
width: 42vw;
66-
height: 42vw;
67-
border-radius: 50%;
68-
filter: blur(22px);
69-
opacity: 0.5;
70-
pointer-events: none;
71-
}
72-
73-
body::before {
74-
top: -10vw;
75-
left: -8vw;
76-
background: rgba(255, 255, 255, 0.45);
77-
}
78-
79-
body::after {
80-
right: -10vw;
81-
bottom: -12vw;
82-
background: rgba(217, 190, 160, 0.26);
8354
}
8455
8556
.screen {
@@ -95,9 +66,7 @@ const KEGEL_HTML_TEMPLATE: &str = r#"<!DOCTYPE html>
9566
9667
.title {
9768
font-family: var(--font-sans);
98-
font-size: clamp(18px, 2.2vw, 28px);
99-
font-weight: 560;
100-
letter-spacing: 0.02em;
69+
font-size: clamp(18px, 2.4vw, 28px);
10170
color: var(--text-strong);
10271
text-align: center;
10372
}
@@ -106,26 +75,22 @@ const KEGEL_HTML_TEMPLATE: &str = r#"<!DOCTYPE html>
10675
font-family: var(--font-sans);
10776
font-size: clamp(48px, 7vw, 96px);
10877
font-weight: 700;
109-
letter-spacing: -0.04em;
11078
font-variant-numeric: tabular-nums;
11179
color: var(--text-strong);
11280
line-height: 1;
113-
text-shadow: 0 10px 30px rgba(255, 255, 255, 0.42);
11481
}
11582
11683
.card {
117-
background: linear-gradient(180deg, rgba(255,255,255,0.72) 0%, var(--card-bg) 100%);
84+
background-color: var(--card-bg);
11885
width: min(90vw, 600px, calc(70vh * 4 / 3.2));
11986
aspect-ratio: 4 / 3.2;
120-
border-radius: 32px;
121-
border: 1px solid var(--card-border);
87+
border-radius: 0;
12288
display: flex;
12389
flex-direction: column;
12490
justify-content: center;
12591
align-items: center;
12692
position: relative;
127-
box-shadow: 0 26px 60px rgba(73, 52, 37, 0.12);
128-
backdrop-filter: blur(12px);
93+
box-shadow: none;
12994
}
13095
13196
.symbol-area {
@@ -144,10 +109,6 @@ const KEGEL_HTML_TEMPLATE: &str = r#"<!DOCTYPE html>
144109
color: var(--text-main);
145110
display: flex;
146111
align-items: center;
147-
<<<<<<< HEAD
148-
text-shadow: 0 8px 24px rgba(255, 255, 255, 0.28);
149-
=======
150-
>>>>>>> publish-v1.5.0
151112
}
152113
153114
.star {
@@ -194,53 +155,29 @@ const KEGEL_HTML_TEMPLATE: &str = r#"<!DOCTYPE html>
194155
color: var(--text-muted);
195156
text-align: center;
196157
max-width: 80vw;
197-
letter-spacing: 0.02em;
198158
}
199159
200160
.skip-card {
201-
<<<<<<< HEAD
202-
width: min(76vw, 820px);
203-
padding: 18px 20px 20px;
204-
border-radius: 24px;
205-
border: 1px solid rgba(84, 63, 48, 0.1);
206-
background: rgba(255, 252, 248, 0.72);
207-
=======
208161
width: min(80vw, 880px);
209162
padding: 18px 22px 20px;
210163
border: 1px solid rgba(31, 31, 31, 0.12);
211164
background: rgba(255, 255, 255, 0.48);
212-
>>>>>>> publish-v1.5.0
213165
display: flex;
214166
flex-direction: column;
215167
gap: 12px;
216168
transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
217-
<<<<<<< HEAD
218-
box-shadow: 0 18px 42px rgba(76, 56, 38, 0.08);
219-
backdrop-filter: blur(10px);
220-
}
221-
222-
.skip-card.failure {
223-
border-color: rgba(184, 83, 61, 0.5);
224-
box-shadow: 0 18px 36px rgba(184, 83, 61, 0.14);
225-
=======
226169
}
227170
228171
.skip-card.failure {
229172
border-color: rgba(199, 73, 52, 0.55);
230173
box-shadow: 0 16px 36px rgba(199, 73, 52, 0.12);
231-
>>>>>>> publish-v1.5.0
232174
animation: skip-shake 0.42s ease;
233175
}
234176
235177
.skip-title {
236178
font-family: var(--font-sans);
237-
<<<<<<< HEAD
238-
font-size: clamp(13px, 1.6vw, 16px);
239-
letter-spacing: 0.14em;
240-
=======
241179
font-size: clamp(14px, 1.8vw, 18px);
242180
letter-spacing: 0.08em;
243-
>>>>>>> publish-v1.5.0
244181
text-transform: uppercase;
245182
color: var(--text-sub);
246183
}
@@ -262,22 +199,13 @@ const KEGEL_HTML_TEMPLATE: &str = r#"<!DOCTYPE html>
262199
}
263200
264201
.skip-char.matched {
265-
<<<<<<< HEAD
266-
color: #345847;
267-
=======
268202
color: #244c39;
269-
>>>>>>> publish-v1.5.0
270203
transform: translateY(-2px);
271204
}
272205
273206
.skip-char.current {
274-
<<<<<<< HEAD
275-
background: rgba(52, 88, 71, 0.12);
276-
color: #1f2c25;
277-
=======
278207
background: rgba(36, 76, 57, 0.12);
279208
color: #16241b;
280-
>>>>>>> publish-v1.5.0
281209
}
282210
283211
.skip-char.pending {
@@ -298,7 +226,7 @@ const KEGEL_HTML_TEMPLATE: &str = r#"<!DOCTYPE html>
298226
40%, 70% {
299227
transform: translateY(25px) scale(0.82);
300228
opacity: 1;
301-
color: #18120f;
229+
color: #111;
302230
}
303231
}
304232
@@ -350,20 +278,13 @@ const KEGEL_HTML_TEMPLATE: &str = r#"<!DOCTYPE html>
350278
</div>
351279
</div>
352280
<div class="hint" id="hint">__HINT__</div>
353-
<<<<<<< HEAD
354-
__SKIP_CARD__
355-
</div>
356-
<script>
357-
const skipEnabled = __SKIP_ENABLED__;
358-
=======
359281
<div class="skip-card" id="skip-card">
360282
<div class="skip-title" id="skip-title">__SKIP_TITLE__</div>
361283
<div class="skip-phrase" id="skip-phrase">__SKIP_PHRASE_HTML__</div>
362284
<div class="skip-status" id="skip-status">__SKIP_STATUS__</div>
363285
</div>
364286
</div>
365287
<script>
366-
>>>>>>> publish-v1.5.0
367288
let lastFailureSeq = 0;
368289
window.addEventListener('contextmenu', (event) => {
369290
event.preventDefault();
@@ -387,21 +308,9 @@ const KEGEL_HTML_TEMPLATE: &str = r#"<!DOCTYPE html>
387308
}
388309
};
389310
window.setSkipChallenge = (payload) => {
390-
<<<<<<< HEAD
391-
if (!skipEnabled) {
392-
return;
393-
}
394-
const phraseEl = document.getElementById('skip-phrase');
395-
const statusEl = document.getElementById('skip-status');
396-
const panelEl = document.getElementById('skip-card');
397-
if (!phraseEl || !statusEl || !panelEl) {
398-
return;
399-
}
400-
=======
401311
const phraseEl = document.getElementById('skip-phrase');
402312
const statusEl = document.getElementById('skip-status');
403313
const panelEl = document.getElementById('skip-card');
404-
>>>>>>> publish-v1.5.0
405314
if (phraseEl) {
406315
phraseEl.innerHTML = payload.phraseHtml;
407316
}
@@ -420,14 +329,6 @@ const KEGEL_HTML_TEMPLATE: &str = r#"<!DOCTYPE html>
420329
</html>
421330
"#;
422331

423-
const SKIP_CARD_TEMPLATE: &str = r#"
424-
<div class="skip-card" id="skip-card">
425-
<div class="skip-title" id="skip-title">__SKIP_TITLE__</div>
426-
<div class="skip-phrase" id="skip-phrase">__SKIP_PHRASE_HTML__</div>
427-
<div class="skip-status" id="skip-status">__SKIP_STATUS__</div>
428-
</div>
429-
"#;
430-
431332
fn escape_html(value: &str) -> String {
432333
let mut escaped = String::with_capacity(value.len());
433334
for ch in value.chars() {
@@ -477,34 +378,16 @@ fn build_kegel_html(
477378
title: &str,
478379
countdown: &str,
479380
hint: &str,
480-
<<<<<<< HEAD
481-
skip_section: Option<(&str, String, String)>,
482-
=======
483381
skip_title: &str,
484382
skip_phrase_html: &str,
485383
skip_status: &str,
486-
>>>>>>> publish-v1.5.0
487384
) -> String {
488385
let mut html = KEGEL_HTML_TEMPLATE.replace("__TITLE__", &escape_html(title));
489386
html = html.replace("__COUNTDOWN__", &escape_html(countdown));
490387
html = html.replace("__HINT__", &escape_html(hint));
491-
<<<<<<< HEAD
492-
if let Some((skip_title, skip_phrase_html, skip_status)) = skip_section {
493-
let skip_card = SKIP_CARD_TEMPLATE
494-
.replace("__SKIP_TITLE__", &escape_html(skip_title))
495-
.replace("__SKIP_PHRASE_HTML__", &skip_phrase_html)
496-
.replace("__SKIP_STATUS__", &escape_html(&skip_status));
497-
html = html.replace("__SKIP_CARD__", &skip_card);
498-
html.replace("__SKIP_ENABLED__", "true")
499-
} else {
500-
html = html.replace("__SKIP_CARD__", "");
501-
html.replace("__SKIP_ENABLED__", "false")
502-
}
503-
=======
504388
html = html.replace("__SKIP_TITLE__", &escape_html(skip_title));
505389
html = html.replace("__SKIP_PHRASE_HTML__", skip_phrase_html);
506390
html.replace("__SKIP_STATUS__", &escape_html(skip_status))
507-
>>>>>>> publish-v1.5.0
508391
}
509392

510393
fn update_kegel_countdown(webview: &WKWebView, text: &str) {
@@ -611,20 +494,9 @@ global_block! {
611494
#[allow(clippy::too_many_lines)]
612495
pub fn show_countdown_window(delegate: &RestGapDelegate, seconds: u64, play_start_sound: bool) {
613496
let mtm = delegate.mtm();
614-
<<<<<<< HEAD
615-
let (texts, allow_skip_break) = with_state(|state| {
616-
(
617-
Texts::new(state.config.effective_language()),
618-
state.config.allow_skip_break,
619-
)
620-
});
621-
let skip_challenge = allow_skip_break.then(SkipChallenge::random);
622-
let skip_snapshot = skip_challenge.as_ref().map(SkipChallenge::snapshot);
623-
=======
624497
let texts = Texts::new(with_state(|state| state.config.effective_language()));
625498
let skip_challenge = SkipChallenge::random();
626499
let skip_snapshot = skip_challenge.snapshot();
627-
>>>>>>> publish-v1.5.0
628500

629501
// 关闭已存在的倒计时窗口
630502
close_countdown_window();
@@ -664,19 +536,9 @@ pub fn show_countdown_window(delegate: &RestGapDelegate, seconds: u64, play_star
664536
&texts.countdown_title(),
665537
&format_countdown(seconds),
666538
texts.countdown_hint(),
667-
<<<<<<< HEAD
668-
skip_snapshot.as_ref().map(|snapshot| {
669-
(
670-
texts.countdown_skip_title(),
671-
render_skip_phrase_html(snapshot),
672-
skip_status_text(&texts, snapshot),
673-
)
674-
}),
675-
=======
676539
texts.countdown_skip_title(),
677540
&render_skip_phrase_html(&skip_snapshot),
678541
&skip_status_text(&texts, &skip_snapshot),
679-
>>>>>>> publish-v1.5.0
680542
);
681543
let html = NSString::from_str(&html);
682544
for frame in frames {
@@ -731,11 +593,7 @@ pub fn show_countdown_window(delegate: &RestGapDelegate, seconds: u64, play_star
731593
with_state(|state| {
732594
state.countdown_windows = windows_for_state;
733595
state.countdown_webviews = webviews;
734-
<<<<<<< HEAD
735-
state.countdown_skip_challenge = skip_challenge;
736-
=======
737596
state.countdown_skip_challenge = Some(skip_challenge);
738-
>>>>>>> publish-v1.5.0
739597
state.countdown_skip_requested = false;
740598
});
741599

@@ -746,15 +604,11 @@ pub fn show_countdown_window(delegate: &RestGapDelegate, seconds: u64, play_star
746604

747605
// 仅在倒计时窗口存在时安装本地键盘监听器,
748606
// 避免非休息时任何额外开销。
749-
let key_monitor = if allow_skip_break {
750-
unsafe {
751-
NSEvent::addLocalMonitorForEventsMatchingMask_handler(
752-
NSEventMask::KeyDown,
753-
&COUNTDOWN_KEY_MONITOR,
754-
)
755-
}
756-
} else {
757-
None
607+
let key_monitor = unsafe {
608+
NSEvent::addLocalMonitorForEventsMatchingMask_handler(
609+
NSEventMask::KeyDown,
610+
&COUNTDOWN_KEY_MONITOR,
611+
)
758612
};
759613

760614
// 设置结束时间

0 commit comments

Comments
 (0)