Skip to content

Commit d93d959

Browse files
add some css designe
1 parent 3dc149f commit d93d959

20 files changed

+197
-46
lines changed
128 Bytes
Binary file not shown.
-106 Bytes
Binary file not shown.

gallery/scan_dir_class.py

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,25 @@
22

33
class ScanDir:
44

5-
PATH = "c:/Users/George/venv/myProjects/gallery-pic";
5+
PATH = "c:/Users/George/venv/myProjects/gallery-pic"
66

7-
def scan_dir(self):
7+
def scanDirFunc(self):
88
files = os.listdir(self.PATH)
9-
10-
# for f in files:
11-
# print(f)
12-
files = files[:20]
13-
return files;
9+
return files[:20]
10+
11+
def getFirstFile(self, files, first_file = True):
12+
files_content = []
13+
for file in files:
14+
if(os.path.isdir(self.PATH + '/' + file) == False):
15+
continue
16+
files_in_dir = os.listdir(self.PATH + '/' + file)
17+
if(first_file == True):
18+
files_in_dir = files_in_dir[0]
19+
files_content.append({
20+
'dir': file,
21+
'files_in_dir': file+'/'+files_in_dir
22+
})
23+
return files_content
24+
25+
1426

15-
def getFirstFile(self, file):
16-
if(os.path.isdir(self.PATH + '/' + file)):
17-
return self.PATH + '/' + file + '/' + os.listdir(self.PATH + '/' + file)[0]
18-
else:
19-
return None

gallery/views.py

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,12 @@
44

55

66
def index(request):
7-
files_content = []
8-
files = ScanDir().scan_dir()
9-
for file in files:
10-
first_file = ScanDir().getFirstFile(file)
11-
if (first_file):
12-
files_content.append({
13-
'dir': file,
14-
'first_file': first_file
15-
})
16-
return render(request, 'index.html', {'var_test': 's', 'files': ScanDir().scan_dir(), 'complete_list': files_content})
7+
files = ScanDir().scanDirFunc()
8+
return render(request, 'index.html', {
9+
'var_test': 's',
10+
'files': files,
11+
'complete_list': ScanDir().getFirstFile(files)
12+
})
1713

1814
def view(request):
1915
return render(request, 'view.html', {'var_test': 's2'})
File renamed without changes.

media/css/bootstrap.min.css

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

media/css/bootstrap.min.css.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

media/css/custom.css

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
2+
html,
3+
body {
4+
margin: 0;
5+
padding: 0;
6+
}
7+
8+
.ex2 {
9+
height: 388px;
10+
overflow: hidden;
11+
}
12+
13+
.ex3 {
14+
height: 50px;
15+
overflow: hidden;
16+
}
17+
18+
/* body { background-color: black; } */
19+
20+
header {
21+
padding: 1em;
22+
background-color: #333;
23+
text-align: center;
24+
}
25+
/* h1 { color:#fff;} */
26+
a:link,
27+
a:visited {
28+
text-decoration: none;
29+
font-family: sans-serif;
30+
/* color: white; */
31+
}
32+
33+
/* a:hover { color: #ddd; } */
34+
35+
#author { float: left; }
36+
37+
#repo { float: right; }
38+
39+
#title {
40+
display: inline-block;
41+
font-weight: bold;
42+
}
43+
44+
.gallery {
45+
-webkit-column-count: 3;
46+
-moz-column-count: 3;
47+
column-count: 3;
48+
-webkit-column-width: 33%;
49+
-moz-column-width: 33%;
50+
column-width: 33%;
51+
}
52+
.gallery .pics {
53+
-webkit-transition: all 350ms ease;
54+
transition: all 350ms ease; }
55+
.gallery .animation {
56+
-webkit-transform: scale(1);
57+
-ms-transform: scale(1);
58+
transform: scale(1);
59+
}
60+
61+
@media (max-width: 450px) {
62+
.gallery {
63+
-webkit-column-count: 1;
64+
-moz-column-count: 1;
65+
column-count: 1;
66+
-webkit-column-width: 100%;
67+
-moz-column-width: 100%;
68+
column-width: 100%;
69+
}
70+
}
71+
72+
@media (max-width: 400px) {
73+
.btn.filter {
74+
padding-left: 1.1rem;
75+
padding-right: 1.1rem;
76+
}
77+
}

media/css/jquery.ui.min.css

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

media/js/axios.min.js

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)