|
@@ -1,5 +1,8 @@
|
|
|
+using System.Reflection.Metadata;
|
|
|
using System.Web;
|
|
|
using Microsoft.Web.WebView2.Core;
|
|
|
+using Microsoft.Web.WebView2.Core;
|
|
|
+using System.Windows.Forms;
|
|
|
|
|
|
namespace EdgeVoyager
|
|
|
{
|
|
@@ -40,14 +43,14 @@ namespace EdgeVoyager
|
|
|
body {
|
|
|
margin: 0;
|
|
|
padding: 0;
|
|
|
- background-image: url('https://bing.img.run/uhd.php');
|
|
|
+ background-image: url('https://bing.img.run/uhd.php');
|
|
|
background-size: cover;
|
|
|
background-repeat: no-repeat;
|
|
|
background-attachment: fixed;
|
|
|
font-family: Arial, sans-serif;
|
|
|
}
|
|
|
.header {
|
|
|
- background-color: rgba(255, 255, 255, 0.8); /* 磨砂玻璃效果 */
|
|
|
+ background-color: rgba(255, 255, 255, 0.8);
|
|
|
backdrop-filter: blur(10px);
|
|
|
padding: 10px 20px;
|
|
|
display: flex;
|
|
@@ -72,52 +75,62 @@ namespace EdgeVoyager
|
|
|
.welcome-text {
|
|
|
text-align: center;
|
|
|
margin: 20px 0;
|
|
|
- font-size: 36px; /* 加大字体 */
|
|
|
- font-weight: bold; /* 加粗字体 */
|
|
|
- color: #0078D4; /* 颜色设置为0078D4 */
|
|
|
+ font-size: 36px;
|
|
|
+ font-weight: bold;
|
|
|
+ color: #0078D4;
|
|
|
}
|
|
|
.search-container {
|
|
|
display: flex;
|
|
|
justify-content: center;
|
|
|
align-items: center;
|
|
|
margin-top: 20px;
|
|
|
- border-radius: 15px; /* 搜索条圆角 */
|
|
|
- overflow: hidden; /* 隐藏溢出部分,确保圆角效果 */
|
|
|
+ border-radius: 15px;
|
|
|
+ overflow: hidden;
|
|
|
}
|
|
|
.search-input {
|
|
|
- width: 70vw; /* 搜索框宽度为视口宽度的85% */
|
|
|
- max-width: 1000px; /* 搜索框最大宽度不超过1000px */
|
|
|
+ width: 70vw;
|
|
|
+ max-width: 1000px;
|
|
|
padding: 10px;
|
|
|
font-size: 16px;
|
|
|
border: none;
|
|
|
- border-radius: 15px 0 0 15px; /* 搜索框左圆角 */
|
|
|
- height: 20px; /* 设置高度 */
|
|
|
+ border-radius: 15px 0 0 15px;
|
|
|
+ height: 20px;
|
|
|
}
|
|
|
.search-button {
|
|
|
padding: 10px 20px;
|
|
|
+ width: 80px;
|
|
|
font-size: 16px;
|
|
|
cursor: pointer;
|
|
|
border: none;
|
|
|
background-color: #0078D4;
|
|
|
color: white;
|
|
|
- border-radius: 0 15px 15px 0; /* 搜索按钮右圆角 */
|
|
|
- height: 40px; /* 设置高度 */
|
|
|
+ border-radius: 0 15px 15px 0;
|
|
|
+ height: 40px;
|
|
|
+ }
|
|
|
+ .search-engine-select {
|
|
|
+ margin-left: 0px;
|
|
|
+ padding: 10px;
|
|
|
+ font-size: 16px;
|
|
|
+ border: none;
|
|
|
+ border-radius: 0px;
|
|
|
+ background-color: #f2f2f2;
|
|
|
+ cursor: pointer;
|
|
|
}
|
|
|
.acrylic-panel {
|
|
|
- background-color: rgba(255, 255, 255, 0.8); /* 磨砂玻璃效果 */
|
|
|
+ background-color: rgba(255, 255, 255, 0.8);
|
|
|
backdrop-filter: blur(10px);
|
|
|
padding: 20px;
|
|
|
border-radius: 8px;
|
|
|
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
|
|
|
margin: 20px 0;
|
|
|
- width: 90vw; /* 面板宽度为视口宽度的90% */
|
|
|
+ width: 90vw;
|
|
|
margin-left: auto;
|
|
|
margin-right: auto;
|
|
|
- max-width: 1200px; /* 面板最大宽度不超过1200px */
|
|
|
+ max-width: 1200px;
|
|
|
}
|
|
|
@media (max-width: 600px) {
|
|
|
.search-button {
|
|
|
- padding: 8px 16px; /* 在小屏幕设备上调整按钮内边距 */
|
|
|
+ padding: 8px 16px;
|
|
|
}
|
|
|
}
|
|
|
</style>
|
|
@@ -127,29 +140,60 @@ namespace EdgeVoyager
|
|
|
<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>
|
|
|
<div class=""nav-links"">
|
|
|
- <a href=""https://www.lykns.com.cn"" class=""nav-item""> 主站</a>
|
|
|
+ <a href=""https://www.lykns.com.cn"" class=""nav-item"">主站</a>
|
|
|
<a href=""https://its.lykns.com.cn"" class=""nav-item"">云服务</a>
|
|
|
<a href=""https://dev.lykns.com.cn"" class=""nav-item"">Git 服务</a>
|
|
|
<a href=""https://survey.lykns.com.cn"" class=""nav-item"">问卷考试系统</a>
|
|
|
</div>
|
|
|
</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)"" />
|
|
|
+ </svg>
|
|
|
+ </div>
|
|
|
<div class=""welcome-text"">
|
|
|
- 欢迎使用LYKNS EdgeVoyager!
|
|
|
+ 欢迎使用 LYKNS EdgeVoyager!
|
|
|
</div>
|
|
|
<div class=""search-container"">
|
|
|
<input type=""text"" id=""search-input"" class=""search-input"" placeholder=""搜索..."">
|
|
|
+ <select id=""search-engine-select"" class=""search-engine-select"">
|
|
|
+ <option value=""bing"">Bing</option>
|
|
|
+ <option value=""baidu"">百度</option>
|
|
|
+ <option value=""google"">Google</option>
|
|
|
+ </select>
|
|
|
<button onclick=""search()"" class=""search-button"">搜索</button>
|
|
|
</div>
|
|
|
</div>
|
|
|
<script>
|
|
|
function search() {
|
|
|
var query = document.getElementById('search-input').value;
|
|
|
- window.location.href = 'https://cn.bing.com/search?q=' + encodeURIComponent(query);
|
|
|
- }
|
|
|
- </script>
|
|
|
-</body>
|
|
|
-</html>";
|
|
|
+ var engine = document.getElementById('search-engine-select').value;
|
|
|
+ var url = '';
|
|
|
+ if (engine === 'bing') {
|
|
|
+ url = 'https://www.bing.com/search?q=' + encodeURIComponent(query);
|
|
|
+ } else if (engine === 'baidu') {
|
|
|
+ url = 'https://www.baidu.com/s?wd=' + encodeURIComponent(query);
|
|
|
+ } else if (engine === 'google') {
|
|
|
+ url = 'https://www.google.com/search?q=' + encodeURIComponent(query);
|
|
|
+ }";
|
|
|
|
|
|
webView21.CoreWebView2.NavigateToString(htmlString);
|
|
|
Settings1.Default.firstwindow = false;
|
|
@@ -181,8 +225,17 @@ namespace EdgeVoyager
|
|
|
{
|
|
|
if (textBox1.Text.Length > 0)
|
|
|
{
|
|
|
- webView21.CoreWebView2.Navigate("https://cn.bing.com/search?q=" + textBox1.Text);
|
|
|
- webView21.CoreWebView2.Profile.PreferredColorScheme = CoreWebView2PreferredColorScheme.Light;
|
|
|
+ if (comboBox1.Text != "about:blank")
|
|
|
+ {
|
|
|
+ Form1 newForm = new Form1();
|
|
|
+ newForm.webView21.Source = new Uri("https://cn.bing.com/search?q=" + textBox1.Text);
|
|
|
+ newForm.Show();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ webView21.CoreWebView2.Navigate("https://cn.bing.com/search?q=" + textBox1.Text);
|
|
|
+ webView21.CoreWebView2.Profile.PreferredColorScheme = CoreWebView2PreferredColorScheme.Light;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -349,5 +402,62 @@ namespace EdgeVoyager
|
|
|
AboutBox1 aboutBox1 = new AboutBox1();
|
|
|
aboutBox1.ShowDialog();
|
|
|
}
|
|
|
+
|
|
|
+ private void 新建NToolStripMenuItem_Click(object sender, EventArgs e)
|
|
|
+ {
|
|
|
+ Settings1.Default.firstwindow = true;
|
|
|
+ Settings1.Default.Save();
|
|
|
+ Form1 newForm = new Form1();
|
|
|
+ newForm.Show();
|
|
|
+ }
|
|
|
+
|
|
|
+ private void 打开OToolStripMenuItem_Click(object sender, EventArgs e)
|
|
|
+ {
|
|
|
+ OpenFileDialog openFileDialog = new OpenFileDialog();
|
|
|
+ openFileDialog.Filter = "网页文件 (*.html;*.htm)|*.html;*.htm|可缩放矢量图形文件 (*.svg)|*.svg|所有文件 (*.*)|*.*"; // 设置文件筛选器[^5^]
|
|
|
+ if (openFileDialog.ShowDialog() == DialogResult.OK)
|
|
|
+ {
|
|
|
+ string filePath = openFileDialog.FileName;
|
|
|
+ Form1 newForm = new Form1();
|
|
|
+ newForm.webView21.Source = new Uri("file:///" + filePath);
|
|
|
+ newForm.Show();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private async void 保存SToolStripMenuItem_ClickAsync(object sender, EventArgs e)
|
|
|
+ {
|
|
|
+ }
|
|
|
+
|
|
|
+ private async void 打印PToolStripMenuItem_Click(object sender, EventArgs e)
|
|
|
+ {
|
|
|
+ string title = webView21.CoreWebView2.DocumentTitle;
|
|
|
+ try
|
|
|
+ {
|
|
|
+ // 使用默认打印机和页面设置打印当前网页
|
|
|
+ // 传递null作为PrintSettings参数,将使用默认打印设置
|
|
|
+ CoreWebView2PrintStatus printStatus = await webView21.CoreWebView2.PrintAsync(null);
|
|
|
+ if (printStatus == CoreWebView2PrintStatus.Succeeded)
|
|
|
+ {
|
|
|
+ MessageBox.Show(this, "打印 " + title + " 文档到打印机成功", "打印到默认打印机");
|
|
|
+ }
|
|
|
+ else if (printStatus == CoreWebView2PrintStatus.PrinterUnavailable)
|
|
|
+ {
|
|
|
+ MessageBox.Show(this, "打印机不可用,离线或错误状态", "打印到默认打印机");
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ MessageBox.Show(this, "打印 " + title + " 文档到打印机失败", "打印到默认打印机");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ catch (Exception)
|
|
|
+ {
|
|
|
+ MessageBox.Show(this, "打印 " + title + " 文档已在进行中", "打印到默认打印机");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private void 打印预览VToolStripMenuItem_Click(object sender, EventArgs e)
|
|
|
+ {
|
|
|
+ webView21.CoreWebView2.ShowPrintUI();
|
|
|
+ }
|
|
|
}
|
|
|
}
|