View Javadoc
1   package de.spiritscorp.datasync.theme;
2   
3   /*-
4    * 		Data Sync
5    *
6    * 		Copyright ©   2022    The Spirit
7    * 		@email                        thespirit@spiritscorp.network
8    *
9    * 		This program is free software; you can redistribute it and/or modify
10   * 		it under the terms of the GNU General Public License as published by
11   * 		the Free Software Foundation; either version 3 of the License, or
12   * 		(at your option) any later version.
13   *
14   * 		This program is distributed in the hope that it will be useful,
15   * 		but WITHOUT ANY WARRANTY; without even the implied warranty of
16   * 		MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
17   * 		See the GNU General Public License for more details.
18   *
19   * 		You should have received a copy of the GNU General Public License
20   * 		along with this program. If not, see <http://www.gnu.org/licenses/>.
21   */
22  
23  import javafx.scene.Scene;
24  
25  /**
26   * NordLightTheme provides a clean, modern light theme based on the Nord color palette.
27   */
28  public class NordicLightTheme implements AppTheme {
29  	@Override
30  	public void apply( final Scene scene ) {
31  		scene.getRoot().setStyle( "-fx-font-size: 14; -fx-font-family: 'Comic Sans MS', 'Segoe UI'; -fx-background-color: #f4f6f9; -fx-text-fill: #2e44a4;" );
32  		final String css = """
33  				/* Extended JavaFX Controls */
34  				.tooltip { -fx-background-color: #88c0d0 !important; -fx-text-fill: #2e44a4 !important; -fx-font-weight: normal !important; }
35  				.label { -fx-text-fill: #2e44a4; }
36  				.button { -fx-background-color: #88c0d0; -fx-text-fill: #2e44a4; -fx-background-radius: 12px; -fx-border-radius: 12px; -fx-cursor: hand; }
37  				.button:hover { -fx-background-color: #2e44a4; -fx-text-fill: #88c0d0; }
38  
39  				/* List View */
40  				.list-view { -fx-background-color: #e0e0e7; -fx-border-color: #d8dee9; -fx-border-width: 1px; }
41  				.list-cell { -fx-background-color: #e0e0e7; -fx-text-fill: #2e44a4; -fx-padding: 12px; -fx-border-color: #d8dee9; -fx-border-width: 0 0 1px 0; -fx-cursor: hand; }
42  				.list-cell:hover { -fx-background-color: #88c0d0; }
43  				.list-cell:selected { -fx-background-color: #88c0d0; -fx-text-fill: #2e44a4 !important; -fx-font-weight: bold; }
44  
45  				/* Form Inputs & Dropdowns */
46  				.text-field, .text-area, .text-area .content { -fx-background-color: #ffffff; -fx-text-fill: #2e3440; -fx-border-color: #d8dee9; -fx-background-radius: 10px; -fx-border-radius: 10px; }
47  				.text-field:focused, .combo-box:focused, .text-area:focused { -fx-border-color: #3498db; }
48  
49  				/* Dropdown Menu Button */
50  				 .menu-button, .menu-item { -fx-background-color: #88c0d0; -fx-text-fill: #2e44a4; -fx-border-color: #2c3e50; -fx-background-radius: 16px; -fx-border-radius: 16px; -fx-cursor: hand; }
51  				.menu-button .label { -fx-text-fill: #2e44a4 !important; }
52  				.menu-button:hover { -fx-background-color: #2e44a4;  -fx-border-color: #3498db; }
53  				.menu-button:hover .label { -fx-text-fill: #88c0d0 !important; }
54  
55  				/* Context Menu */
56  				.context-menu { -fx-background-color: #b9c0c7 !important; -fx-border-color: #bdc3c7 !important; -fx-border-width: 1px !important; -fx-padding: 5px !important; -fx-border-radius: 10px !important; }
57  				.context-menu .menu-item { -fx-background-color: #b9c0c7 !important;  -fx-background-radius: 16px; -fx-border-radius: 16px;}
58  				.context-menu .menu-item .label { -fx-text-fill: #2c3e50 !important; }
59  				.context-menu .menu-item:focused, .context-menu .menu-item:hover { -fx-background-color: #3498db !important; -fx-cursor: hand; }
60  				.context-menu .menu-item:focused .label, .context-menu .menu-item:hover .label { -fx-text-fill: #b9c0c7 !important; }
61  				.context-menu .separator .line { -fx-border-color: #9da3a7 !important; }
62  
63  				/* Table View */
64  				.table-view { -fx-background-color: #ffffff; -fx-border-color: #88c0d0; }
65  				.table-view .column-header, .table-view .filler { -fx-background-color: #e5e9f0; -fx-border-color: #88c0d0; }
66  				.table-view .column-header .label { -fx-text-fill: #2e44a4; }
67  				.table-row-cell { -fx-background-color: #ffffff; -fx-text-fill: #2e4494; }
68  				.table-row-cell:odd { -fx-background-color: #f8fafc; }
69  				.table-row-cell:selected { -fx-background-color: #88c0d0; }
70  				.table-row-cell:selected .text { -fx-fill: #000000; }
71  
72  				/* Scroll Pane */
73  				.scroll-pane{ -fx-background-color: #f4f6f9; -fx-background: #e0e0e7 !important; -fx-text-fill: #2e44a4; -fx-border-color: #bdc3c7 !important; -fx-border-width: 1px !important; }
74  				.scroll-pane .viewport{ -fx-background-color: #f4f6f9; -fx-background: #e0e0e7 !important; -fx-text-fill: #2e44a4; }
75  				.scroll-pane .label { -fx-text-fill: #2e44a4 !important; }
76  				.scroll-pane .scroll-bar:vertical, .scroll-pane .scroll-bar:horizontal { -fx-background-color: #f4f6f9 !important; }
77  				.scroll-pane .scroll-bar .thumb { -fx-background-color: #bdc3c7 !important; -fx-border-color: #95a5a6 !important; -fx-background-radius: 4px !important; }
78  
79  				/* Progress Bar */
80  				.progress-bar .track { -fx-background-color: #e5e9f0; -fx-background-radius: 4px; }
81  				.progress-bar .bar { -fx-background-color: #81a1c1; -fx-background-radius: 4px; }
82  
83  				/* Dialog */
84  				.dialog-pane { -fx-background-color: #ffffff; }
85  
86  				/* Combo Box */
87  				.combo-box { -fx-background-color: #78b0c0; -fx-border-color: #95a5a6; -fx-text-fill: #2e44a4 !important;
88  				-fx-background-radius: 10px; -fx-border-radius: 10px; -fx-cursor: hand;
89  				}
90  				.combo-box:hover { -fx-border-color: #000000; }
91  				.combo-box .list-cell { -fx-background-color: #ffffff; -fx-text-fill: #2e44a4; -fx-background-radius: 10px; -fx-border-radius: 10px; -fx-cursor: hand; }
92  				.combo-box .list-cell:hover, .combo-box .list-cell:selected { -fx-background-color: #88c0d0; -fx-text-fill: #2e44a4 !important; }
93  
94  				/* Check Box */
95  				.check-box .box { -fx-background-color: #ffffff; -fx-border-color: #d8dee9;  -fx-background-radius: 8px; -fx-border-radius: 8px;  -fx-cursor: hand; }
96  				.check-box:hover .box { -fx-border-color: #3498db; -fx-background-color: rgb(52, 152, 219, 0.15); }
97  				.check-box .text { -fx-fill: #2e44a4;  -fx-background-color: #2e44a4; -fx-cursor: hand;}
98  				.check-box:selected .mark { -fx-background-color: #81a1c1; }
99  
100 				/* Icons */
101 				.menu-icon { -fx-icon-color: black; }
102 				.job-icon { -fx-icon-color: #3498db; }
103 				.button-icon { -fx-icon-color: white; }
104 
105 				/* Sidebar View */
106 				.sidebar-title-label { -fx-font-size: 11px; -fx-font-weight: bold; }
107 				.drag-over-target { -fx-border-color: #2ecc71 transparent transparent transparent; -fx-border-width: 3px 0 0 0; }
108 				.add-job-button { -fx-background-color: #2ecc71; -fx-text-fill: white; -fx-font-weight: bold; -fx-padding: 11px; }
109 				.exit-button { -fx-background-color: #e74c3c; -fx-text-fill: white; -fx-font-weight: bold; -fx-padding: 11px; }
110 
111 				/* Workspace View */
112 				.console-text-area { -fx-font-family: 'Consolas', monospace; -fx-font-size: 12px; }
113 				.workspace-header-label { -fx-font-size: 22px; -fx-font-weight: bold; }
114 				.context-info-label { -fx-font-size: 15px; -fx-font-style: italic; -fx-padding: 0 0 8px 0; }
115 				.action-button { -fx-background-color: #2ecc71; -fx-text-fill: white; -fx-font-weight: bold; -fx-padding: 10px 20px; }
116 				.cancel-button { -fx-background-color: #95a5a6; -fx-text-fill: white; -fx-font-weight: bold; -fx-padding: 10px 20px; }
117 
118 				/* Duplicate Button */
119 				.delete-button { -fx-background-color: #e74c3c; -fx-text-fill: white; }
120 
121 				/* Config Menu */
122 				.settings-grid { -fx-background-color: #e0e0e7; }
123 				.mode-label { -fx-font-weight: bold; }
124 				.params-title-label { -fx-font-size: 14px; -fx-font-weight: bold; }
125 				.global-title-label { -fx-font-size: 14px; -fx-font-weight: bold; }
126 				.save-button { -fx-background-color: #2ecc71; -fx-text-fill: white; -fx-font-weight: bold; -fx-padding: 10px 24px; }
127 
128 				/* Directory rendering */
129 				.dir-title-label { -fx-font-size: 14px; -fx-font-weight: bold; }
130 				.multi-src-label { -fx-font-weight: bold; }
131 				.multi-src-list, .multi-src-list .list-cell { -fx-background-color: white; -fx-border-color: #e0e0e0; -fx-border-width: 0 0 1px 0; }
132 				.multi-src-list .list-cell:hover { -fx-background-color: #f5f6fa; }
133 				.multi-src-list .list-cell:selected {  -fx-background-color: #88c0d0; -fx-text-fill: #2e44a4 !important; -fx-font-weight: bold; }
134 
135 				/*Special button hover */
136 				.cancel-button:hover { -fx-background-color: #7f8c8d;  -fx-text-fill: #d6e0fa;  -fx-icon-color: #d6e0fa; }
137 				.action-button:hover, .save-button:hover, .add-job-button:hover { -fx-background-color: #1abc9c; -fx-text-fill: #d6e0fa; -fx-icon-color: #d6e0fa; }
138 				.delete-button:hover, .exit-button:hover { -fx-background-color: #c0392b; -fx-text-fill: #d6e0fa; -fx-icon-color: #d6e0fa; }
139 
140 				/* Info View */
141 				.info-box { -fx-background-color: #e0e0e7; -fx-padding: 15px; }
142 				.app-title-label { -fx-font-size: 18px; -fx-font-weight: bold; }
143 				.legal-text { -fx-font-family: monospace; }
144 
145 				/* Status messages */
146 				.status-success { -fx-text-fill: #22aa22; -fx-font-weight: bold; }
147 				.status-error { -fx-text-fill: #ff3333; -fx-font-weight: bold; }
148 				.status-warning { -fx-text-fill: #ffaa00; -fx-font-weight: bold; }
149 				""";
150 		scene.getStylesheets().clear();
151 		scene.getStylesheets().add( "data:text/css," + css.replace( "\n", "" ).replace( " ", "%20" ) );
152 	}
153 
154 	@Override
155 	public String getName() { return "Nordic Light"; }
156 
157 	@Override
158 	public String toString() {
159 		return getName();
160 	}
161 }