Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

CSS: Extract image_upload_widget.scss with all related upload widget CSS.

jagansivam289258f54aea78
diff --git a/static/js/bundles/app.js b/static/js/bundles/app.js
index 5cc1fa52da2..964c40707bf 100644
--- a/static/js/bundles/app.js
+++ b/static/js/bundles/app.js
@@ -213,6 +213,7 @@ import "../../styles/rendered_markdown.scss";
import "../../styles/zulip.scss";
import "../../styles/alerts.scss";
import "../../styles/settings.scss";
+import "../../styles/image_upload_widget.scss";
import "../../styles/subscriptions.scss";
import "../../styles/drafts.scss";
import "../../styles/input_pill.scss";
diff --git a/static/styles/image_upload_widget.scss b/static/styles/image_upload_widget.scss
new file mode 100644
index 00000000000..430e81a17aa
--- /dev/null
+++ b/static/styles/image_upload_widget.scss
@@ -0,0 +1,235 @@
+/* common CSS for all image upload widget's */
+.avatar-icon-logo-settings {
+ position: relative;
+ border-radius: 5px;
+ box-shadow: 0px 0px 10px hsla(0, 0%, 0%, 0.1);
+
+
+ transition: all 0.3s ease;
+
+ .image-block {
+ background-size: 100%;
+ height: 100%;
+ }
+
+ .settings-page-image-background {
+ content: '';
+ background-color: hsl(0, 0%, 0%);
+ height: 100%;
+ width: 100%;
+ opacity: 0.6;
+ z-index: 99;
+ position: absolute;
+ display: none;
+ cursor: pointer;
+ }
+
+ .settings-page-delete-button {
+ cursor: pointer;
+ color: hsl(0, 0%, 75%);
+ opacity: 0;
+ position: absolute;
+ font-size: 2rem;
+ top: 10px;
+ right: 10px;
+ z-index: 99;
+ }
+
+ .settings-page-delete-button:hover {
+ color: hsl(0, 0%, 100%);
+ }
+
+ .settings-page-delete-button:hover ~ .settings-page-upload-text {
+ visibility: hidden;
+ }
+
+ .settings-page-delete-button:hover ~ .settings-page-delete-text {
+ visibility: visible;
+ }
+
+ .settings-page-delete-text {
+ color: hsl(0, 0%, 100%);
+ font-size: 0.85rem;
+ position: absolute;
+ visibility: hidden;
+ z-index: 99;
+ }
+
+ .settings-page-upload-text {
+ cursor: pointer;
+ font-size: 0.85rem;
+ color: hsl(0, 0%, 85%);
+ position: absolute;
+ z-index: 99;
+ visibility: hidden;
+ }
+
+ .settings-page-upload-text:hover {
+ color: hsl(0, 0%, 100%);
+ }
+
+ .upload-spinner-background {
+ background-color: hsl(0, 0%, 10%);
+ font-size: 0.80rem;
+ width: 100%;
+ opacity: 0.8;
+ height: 100%;
+ position: absolute;
+ visibility: hidden;
+ z-index: 99;
+ cursor: pointer;
+ }
+
+ .image_upload_spinner {
+ position: absolute;
+ z-index: 99;
+ display: block;
+ }
+
+ &:hover {
+ .settings-page-delete-button {
+ opacity: 1;
+ }
+
+ .settings-page-upload-text {
+ visibility: visible;
+ }
+
+ .settings-page-image-background {
+ display: block;
+ }
+ }
+}
+
+.user-avatar-section,
+.realm-logo-section,
+.realm-icon-section {
+ position: relative;
+
+ .inline-block {
+ margin: 5px 20px 0px 0px;
+ vertical-align: top;
+ border-radius: 4px;
+ }
+}
+
+/* SCSS related to settings page user avatar upload widget only */
+#user-avatar-upload-widget {
+
+ .image_upload_button {
+ border-radius: 5px;
+ box-shadow: 0px 0px 10px hsla(0, 0%, 0%, 0.1);
+ z-index: 99;
+ }
+
+ .settings-page-delete-button {
+ font-size: 3rem;
+ }
+
+ .settings-page-delete-text {
+ top: 90px;
+ right: 40px;
+ }
+
+ .settings-page-upload-text {
+ top: 90px;
+ right: 20px;
+ }
+
+ .image_upload_spinner {
+ top: 40%;
+ right: 40%;
+ width: 50px;
+ height: 50px;
+ }
+
+ .image-block {
+ border-radius: 5px;
+ box-shadow: 0px 0px 10px hsla(0, 0%, 0%, 0.1);
+ width: 200px;
+ height: 200px;
+ top: 0px;
+ }
+}
+
+#user-avatar-source {
+ font-size: 1em;
+ z-index: 99;
+ a {
+ position: relative;
+ top: 10px;
+ }
+}
+
+/* SCSS related to settings page realm icon upload widget only */
+#realm-icon-upload-widget {
+
+ .settings-page-delete-text {
+ top: 40px;
+ right: 18px;
+ }
+
+ .settings-page-upload-text {
+ top: 40px;
+ right: 18px;
+ }
+
+ .image_upload_spinner {
+ width: 40px;
+ height: 40px;
+ top: 30%;
+ right: 30%;
+ }
+}
+
+.realm-icon-section {
+ float: none;
+ margin-bottom: 20px;
+ display: inline-block;
+}
+
+/* SCSS related to settings page realm day/night logo upload widget only */
+#realm-day-logo-upload-widget,
+#realm-night-logo-upload-widget {
+ width: 220px;
+ height: 55px;
+ text-align: center;
+ margin: 0px 80px 0px 20px;
+
+ .settings-page-upload-text,
+ .settings-page-delete-text {
+ top: 17px;
+ right: 80px;
+ }
+
+ .upload-spinner-background {
+ left: 0;
+ }
+
+ .image_upload_spinner {
+ width: 45px;
+ height: 55px;
+ top: 5%;
+ right: 40%;
+ }
+}
+
+#realm-day-logo-upload-widget {
+ background-color: hsla(0, 100%, 100%, 1);
+}
+
+#realm-night-logo-upload-widget {
+ background-color: hsl(212, 28%, 18%);
+}
+
+.realm-logo-section {
+ margin-bottom: 20px;
+}
+
+.realm-logo-block {
+ display: inline-block;
+}
+
+.realm-logo-title {
+ padding-left: 30%;
+}
diff --git a/static/styles/settings.scss b/static/styles/settings.scss
index 120375a9caa..2bb8d24ade5 100644
--- a/static/styles/settings.scss
+++ b/static/styles/settings.scss
@@ -110,31 +110,6 @@ h3 .fa-question-circle-o {
}
}
-.realm-icon-section {
- float: none;
- display: inline-block;
-}
-
-.user-avatar-section,
-.realm-logo-section,
-.realm-icon-section {
- position: relative;
-
- .inline-block {
- margin: 5px 20px 0px 0px;
- vertical-align: top;
- border-radius: 4px;
- }
-}
-
-.realm-logo-block {
- display: inline-block;
-}
-
-.realm-logo-title {
- padding-left: 30%;
-}
-
#change_email_modal {
width: 460px;
}
@@ -600,12 +575,7 @@ input[type=checkbox] {
margin-top: 0px;
}
-.realm-logo-section {
- margin-bottom: 20px;
-}
-
-#id_org_profile_preview,
-.realm-icon-section {
+#id_org_profile_preview {
margin-bottom: 20px;
}
@@ -1145,218 +1115,6 @@ input[type=checkbox] {
font-size: 1.2em;
}
-#user-avatar-upload-widget {
-
- .image_upload_button {
- border-radius: 5px;
- box-shadow: 0px 0px 10px hsla(0, 0%, 0%, 0.1);
- z-index: 99;
- }
-
- .settings-page-delete-button {
- font-size: 3rem;
- }
-
- .settings-page-delete-text {
- top: 90px;
- right: 40px;
- }
-
- .settings-page-upload-text {
- top: 90px;
- right: 20px;
- }
-
- .image_upload_spinner {
- top: 40%;
- right: 40%;
- width: 50px;
- height: 50px;
- }
-
- .image-block {
- border-radius: 5px;
- box-shadow: 0px 0px 10px hsla(0, 0%, 0%, 0.1);
- width: 200px;
- height: 200px;
- top: 0px;
- }
-}
-
-#realm-icon-upload-widget {
- .settings-page-delete-text {
- top: 40px;
- right: 18px;
- }
-
- .settings-page-upload-text {
- top: 40px;
- right: 18px;
- }
-
- .image_upload_spinner {
- width: 40px;
- height: 40px;
- top: 30%;
- right: 30%;
- }
-}
-
-#realm-day-logo-upload-widget,
-#realm-night-logo-upload-widget {
- width: 220px;
- height: 55px;
- text-align: center;
- margin: 0px 80px 0px 20px;
-
- .settings-page-upload-text,
- .settings-page-delete-text {
- top: 17px;
- right: 80px;
- }
-
- .upload-spinner-background {
- left: 0;
- }
-
- .image_upload_spinner {
- width: 45px;
- height: 55px;
- top: 5%;
- right: 40%;
- }
-}
-
-#realm-day-logo-upload-widget {
- background-color: hsla(0, 100%, 100%, 1);
-}
-
-#realm-night-logo-upload-widget {
- background-color: hsl(212, 28%, 18%);
-}
-
-.avatar-icon-logo-settings {
- position: relative;
- border-radius: 5px;
- box-shadow: 0px 0px 10px hsla(0, 0%, 0%, 0.1);
-
-
- transition: all 0.3s ease;
-
- .image-block {
- background-size: 100%;
- height: 100%;
- }
-
- .settings-page-image-background {
- content: '';
- background-color: hsl(0, 0%, 0%);
- height: 100%;
- width: 100%;
- opacity: 0.6;
- z-index: 99;
- position: absolute;
- display: none;
- cursor: pointer;
- }
-
- .settings-page-delete-button {
- cursor: pointer;
- color: hsl(0, 0%, 75%);
- opacity: 0;
- position: absolute;
- font-size: 2rem;
- top: 10px;
- right: 10px;
- z-index: 99;
- }
-
- #user_avatar_delete_button {
- font-size: 3rem;
- }
-
- .settings-page-delete-button:hover {
- color: hsl(0, 0%, 100%);
- }
-
- .settings-page-delete-button:hover ~ .settings-page-upload-text {
- visibility: hidden;
- }
-
-
- .settings-page-delete-button:hover ~ .settings-page-delete-text {
- visibility: visible;
- }
-
- .settings-page-delete-text {
- color: hsl(0, 0%, 100%);
- font-size: 0.85rem;
- position: absolute;
- visibility: hidden;
- z-index: 99;
- }
-
- .settings-page-upload-text {
- cursor: pointer;
- font-size: 0.85rem;
- color: hsl(0, 0%, 85%);
- position: absolute;
- z-index: 99;
- visibility: hidden;
- }
-
- .settings-page-upload-text:hover {
- color: hsl(0, 0%, 100%);
- }
-
- .upload-spinner-background {
- background-color: hsl(0, 0%, 10%);
- font-size: 0.80rem;
- width: 100%;
- opacity: 0.8;
- height: 100%;
- position: absolute;
- visibility: hidden;
- z-index: 99;
- cursor: pointer;
- }
-
- .image_upload_spinner {
- position: absolute;
- z-index: 99;
- display: block;
- }
-
- .guest-avatar::after {
- outline: 9px solid hsl(0, 0%, 100%);
- }
-
- &:hover {
- .settings-page-delete-button {
- opacity: 1;
- }
-
- .settings-page-upload-text {
- visibility: visible;
- }
-
- .settings-page-image-background {
- display: block;
- }
- }
-}
-
-
-
-#user-avatar-source {
- font-size: 1em;
- z-index: 99;
- a {
- position: relative;
- top: 10px;
- }
-}
-
#realm-icon-block {
border-radius: 5px;
box-shadow: 0px 0px 10px hsla(0, 0%, 0%, 0.1);