forked from ShineWebOS/ShineOS
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsettings.html
More file actions
83 lines (74 loc) · 2.4 KB
/
Copy pathsettings.html
File metadata and controls
83 lines (74 loc) · 2.4 KB
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
<!DOCTYPE html>
<html>
<head>
<link id="theme-style" rel="stylesheet" href="xenv.css">
<title>Theme Selector</title>
<style>
body {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
background: #f0f0f0;
}
.theme-container {
background: white;
padding: 2rem;
border-radius: 10px;
box-shadow: 0 0 15px rgba(0,0,0,0.1);
}
.theme-option {
margin: 1rem 0;
padding: 1rem;
border: 2px solid #ddd;
border-radius: 8px;
cursor: pointer;
transition: all 0.3s;
}
.theme-option:hover {
border-color: #0078d7;
}
.theme-option.active {
border-color: #0078d7;
background: #f0f8ff;
} </style>
</head>
<body>
<div class="theme-container">
<h2>OS environment</h2>
<div class="theme-option" onclick="selectTheme('busenv')">
<h3>Blue Sky</h3>
<p>Classic interface of ShineOS</p>
</div>
<div class="theme-option" onclick="selectTheme('xenv')">
<h3>EnviX</h3>
<p>Modern desktop experience</p>
</div>
<button onclick="applyAndLaunch()">Save</button>
Restart needed to apply changes!
</div>
<script>
let selectedTheme = localStorage.getItem('shineos-theme') || 'busenv';
function selectTheme(theme) {
selectedTheme = theme;
document.querySelectorAll('.theme-option').forEach(el =>
el.classList.remove('active'));
event.currentTarget.classList.add('active');
}
const savedTheme = localStorage.getItem('shineos-theme') || 'busenv';
document.getElementById('theme-style').href = `${savedTheme}.css`;
function applyAndLaunch() {
localStorage.setItem('shineos-theme', selectedTheme);
window.parent.postMessage('reload', '*');
}
window.onload = () => {
document.querySelectorAll('.theme-option').forEach(el => {
if(el.getAttribute('onclick').includes(selectedTheme)) {
el.classList.add('active');
}
});
};
</script>
</body>
</html>