Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow separately defining css #34

Merged
merged 2 commits into from
Aug 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
145 changes: 145 additions & 0 deletions examples/views/file_upload/file_upload.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
.upload-wrapper {
width: 500px;
margin: 0 auto;
}

.file-item {
display: flex;
padding: 8px;
border: 1px solid #ddd;
border-radius: 8px;
margin-bottom: 8px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.file-thumbnail {
width: 64px;
height: 64px;
border-radius: 4px;
margin-right: 10px;
overflow: hidden;
display: flex;
justify-content: center;
align-items: center;
}

.file-thumbnail img {
width: 100%;
height: 100%;
object-fit: cover;
}

.file-info {
flex-grow: 1;
}

.file-info p {
margin: 0;
font-size: 14px;
color: #333;
}

.file-item.error {
background-color: #f8d7da;
}

.file-progress {
height: 6px;
background-color: #e0e0e0;
border-radius: 3px;
overflow: hidden;
margin: 4px 0;
}

.file-progress-bar {
height: 100%;
background-color: #4caf50;
border-radius: 3px;
}

.file-cancel {
background-color: transparent;
border: none;
cursor: pointer;
font-size: 18px;
color: #999;
margin-left: 10px;
}

.uploaded-files {
margin-top: 20px;
}

.upload-button-container {
text-align: right;
}

.photo-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
gap: 10px;
}

.photo-grid .photo-item {
background: white;
padding: 10px;
border-radius: 4px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
display: flex;
flex-direction: column;
align-items: center;
position: relative;
overflow: hidden;
}

.photo-grid .photo-item::before {
content: "";
display: block;
padding-bottom: 100%;
}

.photo-grid .photo-item img {
width: 100%;
height: 100%;
object-fit: cover;
position: absolute;
top: 0;
left: 0;
}

.photo-caption {
margin-top: auto;
padding: 5px 0;
font-size: 12px;
color: #333;
background-color: white;
width: 100%;
text-align: center;
border-top: 1px solid #ddd;
position: absolute;
bottom: 0;
}

.error-text {
color: #721c24;
font-size: 12px;
}

.error-message {
background-color: #f8d7da;
color: #721c24;
border: 1px solid #f5c6cb;
padding: 10px;
border-radius: 4px;
margin-bottom: 20px;
}

button {
margin-right: 0;
}

.upload-instructions {
font-size: 0.9em;
font-style: oblique;
color: #999;
}
151 changes: 2 additions & 149 deletions examples/views/file_upload/file_upload.html
Original file line number Diff line number Diff line change
@@ -1,151 +1,3 @@
<style>
.upload-wrapper {
width: 500px;
margin: 0 auto;
}

.file-item {
display: flex;
padding: 8px;
border: 1px solid #ddd;
border-radius: 8px;
margin-bottom: 8px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.file-thumbnail {
width: 64px;
height: 64px;
border-radius: 4px;
margin-right: 10px;
overflow: hidden;
display: flex;
justify-content: center;
align-items: center;
}

.file-thumbnail img {
width: 100%;
height: 100%;
object-fit: cover;
}

.file-info {
flex-grow: 1;
}

.file-info p {
margin: 0;
font-size: 14px;
color: #333;
}

.file-item.error {
background-color: #f8d7da;
}

.file-progress {
height: 6px;
background-color: #e0e0e0;
border-radius: 3px;
overflow: hidden;
margin: 4px 0;
}

.file-progress-bar {
height: 100%;
background-color: #4caf50;
border-radius: 3px;
}

.file-cancel {
background-color: transparent;
border: none;
cursor: pointer;
font-size: 18px;
color: #999;
margin-left: 10px;
}

.uploaded-files {
margin-top: 20px;
}

.upload-button-container {
text-align: right;
}

.photo-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
gap: 10px;
}

.photo-grid .photo-item {
background: white;
padding: 10px;
border-radius: 4px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
display: flex;
flex-direction: column;
align-items: center;
position: relative;
overflow: hidden;
}

.photo-grid .photo-item::before {
content: "";
display: block;
padding-bottom: 100%;
}

.photo-grid .photo-item img {
width: 100%;
height: 100%;
object-fit: cover;
position: absolute;
top: 0;
left: 0;
}

.photo-caption {
margin-top: auto;
padding: 5px 0;
font-size: 12px;
color: #333;
background-color: white;
width: 100%;
text-align: center;
border-top: 1px solid #ddd;
position: absolute;
bottom: 0;
}

.error-text {
color: #721c24;
font-size: 12px;
}

.error-message {
background-color: #f8d7da;
color: #721c24;
border: 1px solid #f5c6cb;
padding: 10px;
border-radius: 4px;
margin-bottom: 20px;
}

button {
margin-right: 0;
}

.upload-instructions {
font-size: 0.9em;
font-style: oblique;
color: #999;
}
</style>

<div class="upload-wrapper">
<div class="upload-header">
<h1>📁 File Upload with PyView</h1>
Expand All @@ -154,7 +6,8 @@ <h1>📁 File Upload with PyView</h1>
style="border: 2px dashed #ccc; padding: 10px; margin: 10px 0; width: 500px">
<p class="upload-instructions">Add up to
{{upload_config.constraints.max_files}} photos (max
{{upload_config.constraints.max_file_size | readable_size}})</p>
{{upload_config.constraints.max_file_size | readable_size}})
</p>
{{upload_config | live_file_input}}
<span class=" upload-instructions">
... or drag and drop files here
Expand Down
Loading
Loading