Skip to content

Commit 3493285

Browse files
committed
Frameless New UI Style
1 parent 3bbad0d commit 3493285

File tree

3 files changed

+63
-37
lines changed

3 files changed

+63
-37
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
1919
![Screenshot](https://raw.githubusercontent.com/webui-dev/webui-logo/main/screenshot.png)
2020

21+
![Screenshot](/examples/C/frameless/webui_frameless.png)
22+
2123
</div>
2224

2325
<div align="center">

examples/C/frameless/main.c

Lines changed: 61 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -10,62 +10,86 @@ const char* html =
1010
" <style>"
1111
" * { margin: 0; padding: 0; box-sizing: border-box; }"
1212
" html, body { height: 100%; width: 100%; overflow: hidden; background: transparent; }"
13+
" #ui-container {"
14+
" height: 100%;"
15+
" width: 100%;"
16+
" background: rgba(30, 30, 30, 0.95);"
17+
" color: #f5f5f5;"
18+
" font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;"
19+
" display: flex;"
20+
" flex-direction: column;"
21+
" border-radius: 10px;"
22+
" backdrop-filter: blur(24px);"
23+
" -webkit-backdrop-filter: blur(24px);"
24+
" border: 1px solid rgba(255, 255, 255, 0.12);"
25+
" overflow: hidden;"
26+
" }"
1327
" #titlebar {"
14-
" height: 40px;"
15-
" background: linear-gradient(to right, #2c3e50, #34495e);"
16-
" color: white;"
28+
" height: 48px;"
29+
" background: rgba(0, 0, 0, 0.25);"
30+
" -webkit-app-region: drag;"
31+
" --webui-app-region: drag;"
1732
" display: flex;"
1833
" align-items: center;"
1934
" justify-content: space-between;"
20-
" padding: 0 15px;"
21-
" box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);"
22-
" -webkit-app-region: drag;"
23-
" --webui-app-region: drag;"
24-
" font-family: Arial, sans-serif;"
35+
" padding: 0 18px;"
36+
" flex-shrink: 0;"
2537
" }"
26-
" #title { font-size: 16px; font-weight: bold; }"
27-
" #buttons { -webkit-app-region: no-drag; }"
28-
" .button {"
29-
" display: inline-block;"
30-
" width: 24px;"
31-
" height: 24px;"
32-
" margin-left: 8px;"
38+
" #title { font-size: 15px; font-weight: 500; }"
39+
" #buttons {"
40+
" -webkit-app-region: no-drag;"
41+
" display: flex;"
42+
" gap: 12px;"
43+
" }"
44+
" #buttons span {"
45+
" width: 14px;"
46+
" height: 14px;"
3347
" border-radius: 50%;"
34-
" text-align: center;"
35-
" line-height: 24px;"
3648
" cursor: pointer;"
37-
" transition: all 0.2s;"
49+
" transition: all 0.15s ease-out;"
3850
" }"
39-
" .minimize { background: #f1c40f; }"
40-
" .maximize { background: #2ecc71; }"
41-
" .close { background: #e74c3c; }"
42-
" .button:hover { filter: brightness(120%); }"
51+
" #buttons span:hover { transform: scale(1.1); filter: brightness(1.15); }"
52+
" .buttons span:active { transform: scale(0.9); filter: brightness(0.9); }"
53+
" .close { background: #ff5f57; }"
54+
" .minimize { background: #ffbd2e; }"
55+
" /* .maximize { background: #28c940; } REMOVED */"
4356
" #content {"
44-
" height: calc(100% - 40px);"
45-
" background: rgba(0, 0, 0, 0.7);"
57+
" flex-grow: 1;"
4658
" display: flex;"
59+
" flex-direction: column;"
4760
" align-items: center;"
4861
" justify-content: center;"
62+
" padding: 20px;"
63+
" text-align: center;"
64+
" overflow: auto;"
4965
" }"
5066
" #message {"
51-
" color: white;"
52-
" font-size: 32px;"
53-
" font-family: Arial, sans-serif;"
54-
" text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);"
67+
" font-size: 38px;"
68+
" font-weight: 200;"
69+
" letter-spacing: 0.5px;"
70+
" text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);"
71+
" }"
72+
" #sub-message {"
73+
" font-size: 16px;"
74+
" font-weight: 300;"
75+
" color: rgba(240, 240, 240, 0.7);"
76+
" margin-top: 12px;"
5577
" }"
5678
" </style>"
5779
" </head>"
5880
" <body>"
59-
" <div id='titlebar'>"
60-
" <span id='title'>WebUI Frameless Window</span>"
61-
" <div id='buttons'>"
62-
" <span class='button minimize' onclick='minimize()'>–</span>"
63-
// " <span class='button maximize' onclick='maximize()'>□</span>"
64-
" <span class='button close' onclick='close_win()'>✕</span>"
81+
" <div id='ui-container'>"
82+
" <div id='titlebar'>"
83+
" <span id='title'>WebUI Frameless WebView Window</span>"
84+
" <div id='buttons'>"
85+
" <span class='button minimize' onclick='minimize()'></span>"
86+
" <span class='button close' onclick='close_win()'></span>"
87+
" </div>"
88+
" </div>"
89+
" <div id='content'>"
90+
" <span id='message'>Welcome to Your WebUI App</span>"
91+
" <span id='sub-message'>This is a stylish, frameless WebUI WebView window.</span>"
6592
" </div>"
66-
" </div>"
67-
" <div id='content'>"
68-
" <span id='message'>This is a WebUI frameless example</span>"
6993
" </div>"
7094
" </body>"
7195
"</html>";
-12.7 KB
Loading

0 commit comments

Comments
 (0)