-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCodeClouds.cs
120 lines (99 loc) · 3.62 KB
/
CodeClouds.cs
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
113
114
115
116
117
118
119
120
using Guna.UI2.WinForms;
namespace Coders_Space
{
public partial class CodeClouds : Form
{
private int currentLabelIndex = 0;
private String[] txts = { "#Create", "#Contribute", "#Store", "#Share" };
private Guna2Button selectedButton;
public CodeClouds()
{
InitializeComponent();
InitWebView();
selectedButton = buttonGitHub;
UpdateButtonColors();
label1.Text = txts[currentLabelIndex];
}
void timer_Tick(object sender, EventArgs e)
{
currentLabelIndex = (currentLabelIndex + 1) % txts.Length;
label1.Text = txts[currentLabelIndex];
}
async void InitWebView()
{
await webView21.EnsureCoreWebView2Async(null);
webView21.CoreWebView2.Navigate("https://github.com/");
}
private void UpdateButtonColors()
{
foreach (Guna2Button button in guna2Panel2.Controls.OfType<Guna2Button>())
{
if (button != selectedButton)
{
button.BackColor = Color.Transparent;
button.FillColor = Color.Transparent;
}
else
{
button.BorderRadius = 15;
button.FillColor = Color.FromArgb(71, 207, 115);
button.BackColor = Color.Transparent;
}
}
}
private void buttonGitHub_Click(object sender, EventArgs e)
{
selectedButton = (Guna2Button)sender;
UpdateButtonColors();
webView21.CoreWebView2.Navigate("https://github.com/");
}
private void buttonGitLab_Click(object sender, EventArgs e)
{
selectedButton = (Guna2Button)sender;
UpdateButtonColors();
webView21.CoreWebView2.Navigate("https://gitlab.com/");
}
private void buttonBitBucket_Click(object sender, EventArgs e)
{
selectedButton = (Guna2Button)sender;
UpdateButtonColors();
webView21.CoreWebView2.Navigate("https://bitbucket.org/");
}
private void buttonCodePen_Click(object sender, EventArgs e)
{
selectedButton = (Guna2Button)sender;
UpdateButtonColors();
webView21.CoreWebView2.Navigate("https://codepen.io/");
}
private void buttonReplIt_Click(object sender, EventArgs e)
{
selectedButton = (Guna2Button)sender;
UpdateButtonColors();
webView21.CoreWebView2.Navigate("https://repl.it/");
}
private void buttonGist_Click(object sender, EventArgs e)
{
selectedButton = (Guna2Button)sender;
UpdateButtonColors();
webView21.CoreWebView2.Navigate("https://gist.github.com/");
}
private void buttonPasteCode_Click(object sender, EventArgs e)
{
selectedButton = (Guna2Button)sender;
UpdateButtonColors();
webView21.CoreWebView2.Navigate("https://pastecode.io/");
}
private void buttonJSFiddle_Click(object sender, EventArgs e)
{
selectedButton = (Guna2Button)sender;
UpdateButtonColors();
webView21.CoreWebView2.Navigate("https://jsfiddle.net/");
}
private void buttonCodeSandbox_Click(object sender, EventArgs e)
{
selectedButton = (Guna2Button)sender;
UpdateButtonColors();
webView21.CoreWebView2.Navigate("https://codesandbox.io/");
}
}
}