Skip to content

Commit

Permalink
添加设置项,更新说明文档
Browse files Browse the repository at this point in the history
  • Loading branch information
sangyuxiaowu committed Nov 16, 2022
1 parent 74bd1fc commit 15d495a
Show file tree
Hide file tree
Showing 15 changed files with 249 additions and 18 deletions.
3 changes: 3 additions & 0 deletions Hacker/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
<setting name="uInfo" serializeAs="String">
<value />
</setting>
<setting name="Opacity" serializeAs="String">
<value>100</value>
</setting>
</Hacker.Properties.Settings>
</userSettings>
</configuration>
1 change: 0 additions & 1 deletion Hacker/Hacker.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@
</ItemGroup>
<ItemGroup>
<Content Include="hack.ico" />
<Content Include="html\love.html" />
<None Include="Resources\hack.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
Expand Down
1 change: 1 addition & 0 deletions Hacker/Main.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions Hacker/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ public Main(IntPtr intPtr)

private void Main_Load(object sender, EventArgs e)
{
// 不透明度生效
if (Properties.Settings.Default.Opacity > 9 && Properties.Settings.Default.Opacity < 100) {
this.Opacity = (double)Properties.Settings.Default.Opacity / 100;
}

var url = Properties.Settings.Default.uInfo;
bool isLocal = Properties.Settings.Default.isLocal;
// 未设置或未空,则默认
Expand Down Expand Up @@ -122,5 +127,9 @@ private void Main_FormClosed(object sender, FormClosedEventArgs e)
}
}

private void picLogo_Click(object sender, EventArgs e)
{
Application.Exit();
}
}
}
4 changes: 2 additions & 2 deletions Hacker/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.1.0.0")]
[assembly: AssemblyFileVersion("1.1.0.0")]
[assembly: AssemblyVersion("1.2.0.0")]
[assembly: AssemblyFileVersion("1.2.0.0")]
12 changes: 12 additions & 0 deletions Hacker/Properties/Settings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Hacker/Properties/Settings.settings
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,8 @@
<Setting Name="uInfo" Type="System.String" Scope="User">
<Value Profile="(Default)" />
</Setting>
<Setting Name="Opacity" Type="System.Int32" Scope="User">
<Value Profile="(Default)">100</Value>
</Setting>
</Settings>
</SettingsFile>
34 changes: 32 additions & 2 deletions Hacker/SetConfig.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Hacker/SetConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ private void btnOk_Click(object sender, EventArgs e)
}
Properties.Settings.Default.isLocal = radLocal.Checked;
Properties.Settings.Default.uInfo = txtInfo.Text;
Properties.Settings.Default.Opacity = optBar.Value;
Properties.Settings.Default.Save();
Application.Exit();
}
Expand All @@ -68,6 +69,7 @@ private void SetConfig_Load(object sender, EventArgs e)
var url = Properties.Settings.Default.uInfo;
bool isLocal = Properties.Settings.Default.isLocal;

optBar.Value = Properties.Settings.Default.Opacity;
labTip.Text = isLocal?"点击下方文本框选择一个网页文件":"请在下方输入一个网址";
radLocal.Checked= isLocal;
radNet.Checked= !isLocal;
Expand Down
1 change: 1 addition & 0 deletions Hacker/html/hacker.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<!DOCTYPE HTML>
<head>
<title>Hacker Typer</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<style id="pagestyle">
@font-face{font-family:Bitwise;src:url(customfont.eot)}
body{
Expand Down
7 changes: 4 additions & 3 deletions Hacker/html/love.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="renderer" content="webkit" />
<title>爱的表白墙</title>
<meta name="keywords" content="桑桑,宁宁">
<meta name="description" content="桑桑爱宁宁,记录爱你的每一天!">
<style>
body{margin:0;padding:0;background:#ffe;font-size:12px;overflow:auto}
#mainDiv{width:100%;height:100%}
Expand Down Expand Up @@ -59,7 +57,10 @@
function adjustWordsPosition(){$('#words').css("position","absolute");$('#words').css("top",$("#garden").position().top+195);$('#words').css("left",$("#garden").position().left+70);}
function adjustCodePosition(){$('#code').css("margin-top",($("#garden").height()-$("#code").height())/2);}
function showLoveU(){$('#loveu').fadeIn(3000);}
var offsetX,offsetY;$(function(){offsetX=$("#loveHeart").width()/2;offsetY=$("#loveHeart").height()/2-55;var together=new Date();together.setFullYear(2018,2,9);together.setHours(20);together.setMinutes(0);together.setSeconds(0);together.setMilliseconds(0);if(!document.createElement('canvas').getContext){var msg=document.createElement("div");msg.id="errorMsg";msg.innerHTML="Your browser doesn't support HTML5!<br/>Recommend use Chrome 14+/IE 9+/Firefox 7+/Safari 4+";document.body.appendChild(msg);$("#code").css("display","none")
var offsetX,offsetY;$(function(){offsetX=$("#loveHeart").width()/2;offsetY=$("#loveHeart").height()/2-55;var together=new Date();
together.setFullYear(2018,2,9);
together.setHours(20,0,0,0);
if(!document.createElement('canvas').getContext){var msg=document.createElement("div");msg.id="errorMsg";msg.innerHTML="Your browser doesn't support HTML5!<br/>Recommend use Chrome 14+/IE 9+/Firefox 7+/Safari 4+";document.body.appendChild(msg);$("#code").css("display","none")
$("#copyright").css("position","absolute");$("#copyright").css("bottom","10px");document.execCommand("stop");}else{setTimeout(function(){startHeartAnimation();},5000);timeElapse(together);setInterval(function(){timeElapse(together);},500);adjustCodePosition();$("#code").typewriter();}});
</script>

Expand Down
Loading

0 comments on commit 15d495a

Please sign in to comment.