-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstatic_setup.py
More file actions
73 lines (61 loc) · 1.79 KB
/
static_setup.py
File metadata and controls
73 lines (61 loc) · 1.79 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
import os
def create_static_structure():
"""Create the static folder structure"""
# Define the structure
static_dirs = [
'static',
'static/css',
'static/js',
'static/images'
]
# Create directories
for directory in static_dirs:
os.makedirs(directory, exist_ok=True)
print(f"Created directory: {directory}")
# Create basic CSS file if it doesn't exist
css_file = 'static/css/style.css'
if not os.path.exists(css_file):
with open(css_file, 'w') as f:
f.write("""/* Vance Finance Custom Styles */
.navbar-brand {
font-weight: bold;
}
.card {
border: none;
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
.btn {
border-radius: 5px;
}
.alert {
border-radius: 5px;
}
""")
print(f"Created file: {css_file}")
# Create basic JavaScript file if it doesn't exist
js_file = 'static/js/script.js'
if not os.path.exists(js_file):
with open(js_file, 'w') as f:
f.write("""// Vance Finance JavaScript
console.log('Vance Finance loaded');
// Auto-hide alerts after 5 seconds
document.addEventListener('DOMContentLoaded', function() {
const alerts = document.querySelectorAll('.alert');
alerts.forEach(function(alert) {
setTimeout(function() {
alert.style.opacity = '0';
setTimeout(function() {
alert.remove();
}, 300);
}, 5000);
});
});
""")
print(f"Created file: {js_file}")
# Create wiki CSS file
wiki_css_file = 'static/css/wiki.css'
if not os.path.exists(wiki_css_file):
print(f"Wiki CSS file will be created separately: {wiki_css_file}")
print("Static structure setup complete!")
if __name__ == '__main__':
create_static_structure()