|
@@ -6,7 +6,8 @@ namespace EdgeVoyager
|
|
|
{
|
|
|
public partial class Form1 : Form
|
|
|
{
|
|
|
- int zoom = 100;
|
|
|
+ int zoom = 100;
|
|
|
+ private bool isWebView2Focused = false;
|
|
|
private HttpClient httpClient = new HttpClient();
|
|
|
public Form1()
|
|
|
{
|
|
@@ -30,6 +31,8 @@ namespace EdgeVoyager
|
|
|
await webView21.CoreWebView2.ExecuteScriptAsync("window.onload=function(){window.chrome.webview.postMessage('100');};");
|
|
|
webView21.CoreWebView2.Profile.PreferredColorScheme = CoreWebView2PreferredColorScheme.Light;
|
|
|
webView21.CoreWebView2.NewWindowRequested += CoreWebView2_NewWindowRequested;
|
|
|
+ webView21.GotFocus += (s, e) => isWebView2Focused = true;
|
|
|
+ webView21.LostFocus += (s, e) => isWebView2Focused = false;
|
|
|
if (Settings1.Default.firstwindow == true)
|
|
|
{
|
|
|
string htmlString = @"<!DOCTYPE html>
|
|
@@ -42,9 +45,10 @@ namespace EdgeVoyager
|
|
|
body {
|
|
|
margin: 0;
|
|
|
padding: 0;
|
|
|
- background-image: url('https://bing.img.run/uhd.php');
|
|
|
+ background-image: url('https://www.beijing.gov.cn/images/index_top_ch_20190924.jpg');
|
|
|
background-size: cover;
|
|
|
background-repeat: no-repeat;
|
|
|
+background-position: right top;
|
|
|
background-attachment: fixed;
|
|
|
font-family: Arial, sans-serif;
|
|
|
}
|
|
@@ -58,8 +62,8 @@ namespace EdgeVoyager
|
|
|
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
|
|
|
}
|
|
|
.logo {
|
|
|
- width: auto;
|
|
|
- height: auto;
|
|
|
+ width: 48px;
|
|
|
+ height: 48px;
|
|
|
}
|
|
|
.nav-item {
|
|
|
margin-left: 20px;
|
|
@@ -136,8 +140,54 @@ namespace EdgeVoyager
|
|
|
</head>
|
|
|
<body>
|
|
|
<div class=""header"">
|
|
|
- <img src=""https://www.lykns.com.cn/wp-content/uploads/2025/01/pinwheel_48px.png"" alt=""Logo"" class=""logo"">
|
|
|
- <span style=""font-size: 24px; color: #333; margin-left: 0;"">LYKNS </span>
|
|
|
+ <svg class=""logo"" xmlns=""http://www.w3.org/2000/svg"" viewBox=""0 0 48 48"">
|
|
|
+ <linearGradient id=""Z3u55as5xQT0Xm3pZ~tHna"" x1=""27.702"" x2=""35.722"" y1=""18.41"" y2=""26.008"" gradientUnits=""userSpaceOnUse"">
|
|
|
+ <stop offset=""0"" stop-color=""#0e5fa4""/>
|
|
|
+ <stop offset=""1"" stop-color=""#1595df""/>
|
|
|
+ </linearGradient>
|
|
|
+ <path fill=""url(#Z3u55as5xQT0Xm3pZ~tHna)"" d=""M24,6l18,16v17.586c0,0.891-1.077,1.337-1.707,0.707L24,24V6z""/>
|
|
|
+ <linearGradient id=""Z3u55as5xQT0Xm3pZ~tHnb"" x1=""16.667"" x2=""22.667"" y1=""27"" y2=""27"" gradientTransform=""matrix(-3 0 0 -1 92 42)"" gradientUnits=""userSpaceOnUse"">
|
|
|
+ <stop offset=""0"" stop-color=""#50e6ff""/>
|
|
|
+ <stop offset=""1"" stop-color=""#32bdef""/>
|
|
|
+ </linearGradient>
|
|
|
+ <path fill=""url(#Z3u55as5xQT0Xm3pZ~tHnb)"" d=""M24,6l18,16c-7.249-2.341-14-2-18,2V6z""/>
|
|
|
+ <linearGradient id=""Z3u55as5xQT0Xm3pZ~tHnc"" x1=""18.483"" x2=""27.736"" y1=""19.517"" y2=""10.264"" gradientUnits=""userSpaceOnUse"">
|
|
|
+ <stop offset=""0"" stop-color=""#0e5fa4""/>
|
|
|
+ <stop offset=""1"" stop-color=""#1595df""/>
|
|
|
+ </linearGradient>
|
|
|
+ <path fill=""url(#Z3u55as5xQT0Xm3pZ~tHnc)"" d=""M6,24L22,6h17.586c0.891,0,1.337,1.077,0.707,1.707L24,24H6z""/>
|
|
|
+ <linearGradient id=""Z3u55as5xQT0Xm3pZ~tHnd"" x1=""3"" x2=""9"" y1=""24"" y2=""24"" gradientTransform=""matrix(0 3 -1 0 39 -3)"" gradientUnits=""userSpaceOnUse"">
|
|
|
+ <stop offset=""0"" stop-color=""#50e6ff""/>
|
|
|
+ <stop offset=""1"" stop-color=""#32bdef""/>
|
|
|
+ </linearGradient>
|
|
|
+ <path fill=""url(#Z3u55as5xQT0Xm3pZ~tHnd)"" d=""M6,24L22,6c-2.341,7.249-2,14,2,18H6z""/>
|
|
|
+ <linearGradient id=""Z3u55as5xQT0Xm3pZ~tHne"" x1=""19.748"" x2=""7.491"" y1=""29.748"" y2=""17.491"" gradientUnits=""userSpaceOnUse"">
|
|
|
+ <stop offset=""0"" stop-color=""#0e5fa4""/>
|
|
|
+ <stop offset=""1"" stop-color=""#1595df""/>
|
|
|
+ </linearGradient>
|
|
|
+ <path fill=""url(#Z3u55as5xQT0Xm3pZ~tHne)"" d=""M24,42L6,26V8.414c0-0.891,1.077-1.337,1.707-0.707L24,24V42z""/>
|
|
|
+ <linearGradient id=""Z3u55as5xQT0Xm3pZ~tHnf"" x1=""6"" x2=""12"" y1=""33"" y2=""33"" gradientTransform=""matrix(3 0 0 1 -12 0)"" gradientUnits=""userSpaceOnUse"">
|
|
|
+ <stop offset=""0"" stop-color=""#50e6ff""/>
|
|
|
+ <stop offset=""1"" stop-color=""#32bdef""/>
|
|
|
+ </linearGradient>
|
|
|
+ <path fill=""url(#Z3u55as5xQT0Xm3pZ~tHnf)"" d=""M24,42L6,26c7.249,2.341,14,2,18-2V42z""/>
|
|
|
+ <linearGradient id=""Z3u55as5xQT0Xm3pZ~tHng"" x1=""28.457"" x2=""19.623"" y1=""29.543"" y2=""38.377"" gradientUnits=""userSpaceOnUse"">
|
|
|
+ <stop offset=""0"" stop-color=""#0e5fa4""/>
|
|
|
+ <stop offset=""1"" stop-color=""#1595df""/>
|
|
|
+ </linearGradient>
|
|
|
+ <path fill=""url(#Z3u55as5xQT0Xm3pZ~tHng)"" d=""M24,24L7.707,40.293C7.077,40.923,7.523,42,8.414,42H26l7.529-8.471L24,24z""/>
|
|
|
+ <linearGradient id=""Z3u55as5xQT0Xm3pZ~tHnh"" x1=""24"" x2=""33.529"" y1=""33"" y2=""33"" gradientUnits=""userSpaceOnUse"">
|
|
|
+ <stop offset=""0"" stop-color=""#50e6ff""/>
|
|
|
+ <stop offset=""1"" stop-color=""#32bdef""/>
|
|
|
+ </linearGradient>
|
|
|
+ <path fill=""url(#Z3u55as5xQT0Xm3pZ~tHnh)"" d=""M33.529,33.529L24,24c4,4,4.341,10.751,2,18L33.529,33.529z""/>
|
|
|
+ <linearGradient id=""Z3u55as5xQT0Xm3pZ~tHni"" x1=""24.517"" x2=""23.183"" y1=""24.517"" y2=""23.183"" gradientUnits=""userSpaceOnUse"">
|
|
|
+ <stop offset=""0"" stop-color=""#ffd000""/>
|
|
|
+ <stop offset=""1"" stop-color=""#fede00""/>
|
|
|
+ </linearGradient>
|
|
|
+ <circle cx=""24"" cy=""24"" r=""2"" fill=""url(#Z3u55as5xQT0Xm3pZ~tHni)""/>
|
|
|
+ </svg>
|
|
|
+ <span style=""font-size: 24px; color: #333; margin-left: 10px;"">LYKNS</span>
|
|
|
<div class=""nav-links"">
|
|
|
<a href=""https://www.lykns.com.cn"" class=""nav-item"">主站</a>
|
|
|
<a href=""https://its.lykns.com.cn"" class=""nav-item"">云服务</a>
|
|
@@ -147,25 +197,24 @@ namespace EdgeVoyager
|
|
|
</div>
|
|
|
<div class=""acrylic-panel"">
|
|
|
<div style=""text-align:center;"">
|
|
|
- <?xml version=""1.0"" encoding=""utf-8""?>
|
|
|
<svg xmlns=""http://www.w3.org/2000/svg"" viewBox=""0 0 48 48"" width=""128"" height=""128"">
|
|
|
- <linearGradient id=""_EnvA6UXZqPqJP5nSvD1Ka"" x1=""12.209"" x2=""34.197"" y1=""42.462"" y2=""7.83"" gradientTransform=""matrix(1 0 0 -1 0 47.89)"" gradientUnits=""userSpaceOnUse"">
|
|
|
- <stop offset=""0"" stop-color=""#737b80"" />
|
|
|
- <stop offset="".473"" stop-color=""#686f74"" />
|
|
|
- <stop offset=""1"" stop-color=""#575c61"" />
|
|
|
- </linearGradient>
|
|
|
- <path fill=""url(#_EnvA6UXZqPqJP5nSvD1Ka)"" d=""M44,24c0,11.044-8.956,20-20,20S4,35.044,4,24S12.956,4,24,4S44,12.956,44,24z"" />
|
|
|
- <linearGradient id=""_EnvA6UXZqPqJP5nSvD1Kb"" x1=""16.956"" x2=""31.044"" y1=""37.138"" y2=""10.642"" gradientTransform=""matrix(1 0 0 -1 0 47.89)"" gradientUnits=""userSpaceOnUse"">
|
|
|
- <stop offset=""0"" stop-color=""#ccc"" />
|
|
|
- <stop offset="".758"" stop-color=""#f2f2f2"" />
|
|
|
- <stop offset=""1"" stop-color=""#fff"" />
|
|
|
- </linearGradient>
|
|
|
- <path fill=""url(#_EnvA6UXZqPqJP5nSvD1Kb)"" d=""M39,24c0,8.287-6.713,15-15,15S9,32.287,9,24S15.713,9,24,9S39,15.713,39,24z"" />
|
|
|
- <linearGradient id=""_EnvA6UXZqPqJP5nSvD1Kc"" x1=""19.774"" x2=""28.226"" y1=""31.838"" y2=""15.942"" gradientTransform=""matrix(1 0 0 -1 0 47.89)"" gradientUnits=""userSpaceOnUse"">
|
|
|
- <stop offset=""0"" stop-color=""#21ad64"" />
|
|
|
- <stop offset=""1"" stop-color=""#088242"" />
|
|
|
- </linearGradient>
|
|
|
- <circle cx=""24"" cy=""24"" r=""9"" fill=""url(#_EnvA6UXZqPqJP5nSvD1Kc)"" />
|
|
|
+ <linearGradient id=""_EnvA6UXZqPqJP5nSvD1Ka"" x1=""12.209"" x2=""34.197"" y1=""42.462"" y2=""7.83"" gradientTransform=""matrix(1 0 0 -1 0 47.89)"" gradientUnits=""userSpaceOnUse"">
|
|
|
+ <stop offset=""0"" stop-color=""#737b80"" />
|
|
|
+ <stop offset="".473"" stop-color=""#686f74"" />
|
|
|
+ <stop offset=""1"" stop-color=""#575c61"" />
|
|
|
+ </linearGradient>
|
|
|
+ <path fill=""url(#_EnvA6UXZqPqJP5nSvD1Ka)"" d=""M44,24c0,11.044-8.956,20-20,20S4,35.044,4,24S12.956,4,24,4S44,12.956,44,24z"" />
|
|
|
+ <linearGradient id=""_EnvA6UXZqPqJP5nSvD1Kb"" x1=""16.956"" x2=""31.044"" y1=""37.138"" y2=""10.642"" gradientTransform=""matrix(1 0 0 -1 0 47.89)"" gradientUnits=""userSpaceOnUse"">
|
|
|
+ <stop offset=""0"" stop-color=""#ccc"" />
|
|
|
+ <stop offset="".758"" stop-color=""#f2f2f2"" />
|
|
|
+ <stop offset=""1"" stop-color=""#fff"" />
|
|
|
+ </linearGradient>
|
|
|
+ <path fill=""url(#_EnvA6UXZqPqJP5nSvD1Kb)"" d=""M39,24c0,8.287-6.713,15-15,15S9,32.287,9,24S15.713,9,24,9S39,15.713,39,24z"" />
|
|
|
+ <linearGradient id=""_EnvA6UXZqPqJP5nSvD1Kc"" x1=""19.774"" x2=""28.226"" y1=""31.838"" y2=""15.942"" gradientTransform=""matrix(1 0 0 -1 0 47.89)"" gradientUnits=""userSpaceOnUse"">
|
|
|
+ <stop offset=""0"" stop-color=""#21ad64"" />
|
|
|
+ <stop offset=""1"" stop-color=""#088242"" />
|
|
|
+ </linearGradient>
|
|
|
+ <circle cx=""24"" cy=""24"" r=""9"" fill=""url(#_EnvA6UXZqPqJP5nSvD1Kc)"" />
|
|
|
</svg>
|
|
|
</div>
|
|
|
<div class=""welcome-text"">
|
|
@@ -192,7 +241,12 @@ namespace EdgeVoyager
|
|
|
url = 'https://www.baidu.com/s?wd=' + encodeURIComponent(query);
|
|
|
} else if (engine === 'google') {
|
|
|
url = 'https://www.google.com/search?q=' + encodeURIComponent(query);
|
|
|
- }";
|
|
|
+ }
|
|
|
+ window.open(url, '_blank');
|
|
|
+ }
|
|
|
+ </script>
|
|
|
+</body>
|
|
|
+</html>";
|
|
|
|
|
|
webView21.CoreWebView2.NavigateToString(htmlString);
|
|
|
Settings1.Default.firstwindow = false;
|
|
@@ -587,5 +641,88 @@ namespace EdgeVoyager
|
|
|
return ex.Message;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ private void 剪切TToolStripMenuItem_Click(object sender, EventArgs e)
|
|
|
+ {
|
|
|
+ if (comboBox1.Focused)
|
|
|
+ {
|
|
|
+ if (comboBox1.SelectedText != "")
|
|
|
+ {
|
|
|
+ Clipboard.SetText(comboBox1.SelectedText);
|
|
|
+ comboBox1.Text = comboBox1.Text.Remove(comboBox1.SelectionStart, comboBox1.SelectionLength);
|
|
|
+ comboBox1.Focus();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else if (textBox1.Focused)
|
|
|
+ {
|
|
|
+ if (textBox1.SelectedText != "")
|
|
|
+ {
|
|
|
+ Clipboard.SetText(textBox1.SelectedText);
|
|
|
+ textBox1.Text = textBox1.Text.Remove(textBox1.SelectionStart, textBox1.SelectionLength);
|
|
|
+ textBox1.Focus();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private async void 复制CToolStripMenuItem_Click(object sender, EventArgs e)
|
|
|
+ {
|
|
|
+ if (comboBox1.Focused)
|
|
|
+ {
|
|
|
+ if (comboBox1.SelectedText != "")
|
|
|
+ {
|
|
|
+ Clipboard.SetText(comboBox1.SelectedText);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else if (textBox1.Focused)
|
|
|
+ {
|
|
|
+ if (textBox1.SelectedText != "")
|
|
|
+ {
|
|
|
+ Clipboard.SetText(textBox1.SelectedText);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else if (isWebView2Focused)
|
|
|
+ {
|
|
|
+ string script = "window.getSelection().toString();";
|
|
|
+ string selectedText = await webView21.CoreWebView2.ExecuteScriptAsync(script);
|
|
|
+ selectedText = selectedText.Trim('"');
|
|
|
+ if (!string.IsNullOrEmpty(selectedText))
|
|
|
+ {
|
|
|
+ Clipboard.SetText(selectedText);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private async void 粘贴PToolStripMenuItem_Click(object sender, EventArgs e)
|
|
|
+ {
|
|
|
+ if (comboBox1.Focused)
|
|
|
+ {
|
|
|
+ if (comboBox1.SelectionLength > 0)
|
|
|
+ {
|
|
|
+ string clipboardText = Clipboard.GetText();
|
|
|
+ comboBox1.Text = comboBox1.Text.Remove(comboBox1.SelectionStart, comboBox1.SelectionLength) + clipboardText;
|
|
|
+ comboBox1.SelectionStart = comboBox1.Text.Length;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ string clipboardText = Clipboard.GetText();
|
|
|
+ comboBox1.Text += clipboardText;
|
|
|
+ comboBox1.SelectionStart = comboBox1.Text.Length;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else if (textBox1.Focused)
|
|
|
+ {
|
|
|
+ textBox1.Paste();
|
|
|
+ }
|
|
|
+ else if (isWebView2Focused)
|
|
|
+ {
|
|
|
+ string script = "document.execCommand('paste', false, null);";
|
|
|
+ await webView21.CoreWebView2.ExecuteScriptAsync(script);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private async void 全选AToolStripMenuItem_Click(object sender, EventArgs e)
|
|
|
+ {
|
|
|
+ //await webView21.CoreWebView2.ExecuteScriptAsync("document.execCommand('selectAll', false, null);");
|
|
|
+ }
|
|
|
}
|
|
|
}
|