scratch-www/src/views/preview/preview.scss

647 lines
14 KiB
SCSS
Raw Normal View History

@import "../../colors";
@import "../../frameless";
/* stage size constants */
$player-width: 482px;
$player-height: 406px;
$stage-width: 480px;
2018-09-24 10:58:39 -04:00
$small: "screen and (max-width : #{$mobile}-1)";
$medium-and-small: "screen and (max-width : #{$tablet}-1)";
/* override view padding for share banner */
#view {
Initial implementation for displaying comments on project page (#1997) * Create Comment component, start styling it * Restructure PreviewPresentation to better match mockup * Add padding, border to comment bubble * add padding to bottom row of comment * Tweak alignment of avatar and comment content * Add margin to lower project page container * Use border-box box sizing for comment bubble * Make user avatar a link * Add initial implementation of comment tail * Align username row properly, fix comment bubble width * Use ::before pseudoelement for comment tail * Remove unused props to Comment component * Add CommentContainer to handle comment replies * Use CommentContainer instead of Comment in PreviewPresentation * Remove debug data from CommentContainer * Fetch top level comments from the API * Force comment container to stretch to bottom of view div * Remove unused api import in CommentContainer * Long words in comments should not overflow page * Remove @ before username in comment title * Fix word wrapping on Firefox * Refactor CommentContainer into a class * Properly export CommentContainer component * Make replies column take up proper width * Pass project ID to CommentContainer * Fetch comment replies in CommentContainer * Initial implementation for loading more comments * Add "Load More" button to Presentation * Initial implementation of collapsing threads longer than 3 replies * Remove console log from preview.js redux * Tweak last comment gradient color * Only show three total replies in collapsed state * Match scratchr2 behavior for thread collapsing * Use width calc instead of margin and width 100% * Fix styling for load more button * Make comment border gray to match the wireframe * Allow clicking through comment fade gradient * Add comment compose component * style comment compose box * Style post, cancel buttons on comment compose component * Add margin to create comment container * Tweak styling for characters remaining text * Tweak placeholder text * Add more margin to comment avatar * Add icons and styling to delete, report text * Refactor px -> rem where possible in comment styles * Change comment time color to dark gray * Tweak margin and border radius * Add reply icon to preview comments * Clean up unused imports, console.log in compose-comment component * Remove console statement in preview.jsx * Add some clarifying comments to unfinished parts of comments * Remove direct passing of comment api response to CommentContainer * CommentContainer should not pass api response directly * Rename CommentContainer to TopLevelComment * First pass at getReplies for comments in redux * Move reply fetching into redux actions instead of in TopLevelComment * Refactor getReplies logic to behave better * Remove components not directly related to reading comments * Hide load more button if all comments are loaded This uses the project info returned by the API * Use same gradient as add to studio modal on comment thread
2018-08-06 11:52:18 -04:00
padding: 0;
}
.gui {
position: absolute;
top: 0;
z-index: 11;
margin: 0;
width: 100%;
height: 100%;
}
.preview {
.project-title {
font-size: 1.75rem;
font-weight: 500;
&.has-error {
.validation-message {
2018-09-12 17:28:27 -04:00
right: 0;
}
}
&.no-edit {
/* titles of projects you don't own should not
show the full title if this is too long */
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}
.project-header {
margin-right: 2rem;
min-width: 0;
flex-grow: 1;
justify-content: flex-start;
2018-05-30 10:27:22 -04:00
align-items: flex-start;
flex-wrap: nowrap;
2018-05-30 10:27:22 -04:00
.inplace-input {
height: calc(3rem - 4px);
}
}
img {
&.avatar {
border: 0;
border-radius: 5px;
width: 3rem;
2018-05-30 10:27:22 -04:00
height: 3rem;
&.remix {
margin-right: .5em;
2018-05-30 10:27:22 -04:00
width: 2rem;
height: 2rem;
}
}
}
.title {
margin-left: 1rem;
min-width: 0;
text-align: left;
font-size: .8rem;
flex-grow: 1;
}
2018-08-23 14:31:44 -04:00
.validation-message {
display: block;
position: absolute;
2018-09-13 10:49:59 -04:00
z-index: 1;
$arrow-border-width: 1rem;
2018-09-12 17:28:27 -04:00
margin-top: $arrow-border-width;
border: 1px solid $active-gray;
border-radius: 5px;
background-color: $ui-orange;
padding: 1rem;
max-width: 18.75rem;
min-height: 1rem;
overflow: visible;
color: $type-white;
font-size: 1rem;
@media #{$medium-and-small} {
margin-top: calc($arrow-border-width / 2);
2018-09-13 10:49:59 -04:00
width: 100%;
}
&:before {
display: block;
position: absolute;
2018-09-13 10:49:59 -04:00
top: -.5rem;
left: calc(50% - calc(#{$arrow-border-width} / 2));
2018-09-12 17:28:27 -04:00
transform: rotate(135deg);
border-bottom: 1px solid $active-gray;
border-left: 1px solid $active-gray;
border-radius: 5px;
background-color: $ui-orange;
width: $arrow-border-width;
height: $arrow-border-width;
content: "";
@media #{$medium-and-small} {
display: none;
}
}
}
.row {
&.has-error {
.inplace-input,
.inplace-textarea {
border: 1px solid $ui-orange;
}
}
.col-sm-9 {
position: relative;
}
}
.project-buttons {
2018-08-30 15:44:17 -04:00
flex-shrink: 0;
}
.button {
margin-left: 1rem;
}
.comments-container {
2018-09-26 16:45:42 -04:00
padding-right: 1.5rem;
2018-09-17 11:19:22 -04:00
min-width: 65%;
2018-09-26 16:39:37 -04:00
max-width: 100%;
flex: 1;
2018-09-17 11:19:22 -04:00
@media #{$medium-and-small} {
2018-09-26 16:39:37 -04:00
padding: 0;
2018-09-26 16:45:42 -04:00
width: 100%;
2018-09-17 11:19:22 -04:00
}
.comment, .comment-top-row, .comment-bottom-row {
2018-09-26 16:45:42 -04:00
flex-direction: row;
2018-09-17 11:19:22 -04:00
}
.comment-bubble {
2018-09-26 16:45:42 -04:00
text-align: left;
2018-09-17 11:19:22 -04:00
}
}
.remix-button,
.see-inside-button {
margin-top: 0;
font-size: .875rem;
font-weight: normal;
&:before {
display: inline-block;
margin-right: .5rem;
background-repeat: no-repeat;
background-position: center center;
background-size: contain;
2018-05-30 10:27:22 -04:00
width: 1.25rem;
height: 1.25rem;
vertical-align: middle;
content: "";
}
}
.remix-button {
background-color: $ui-aqua;
&:before {
background-image: url("/svgs/project/remix-white.svg");
}
}
.see-inside-button {
&:before {
background-image: url("/svgs/project/see-inside-white.svg");
}
}
.preview-row {
margin-top: 1rem;
justify-content: space-between;
align-items: flex-start;
flex-wrap: nowrap;
&.wrap-to-col {
@media #{$medium-and-small} {
width: 100%;
flex-wrap: wrap-reverse;
flex-direction: column;
justify-content: center;
}
}
}
.guiPlayer {
display: inline-block;
width: $player-width;
@media #{$small} {
2018-09-26 17:26:19 -04:00
width: 100%;
2018-09-26 17:26:19 -04:00
.stage-wrapper {
max-width: 100%;
}
}
}
2018-09-25 17:16:02 -04:00
.force-center {
@media #{$medium-and-small} {
align-self: center;
}
}
.project-notes {
margin-left: 1rem;
height: $player-height;
align-items: flex-start;
flex: 1;
flex-flow: column;
@media #{$medium-and-small} {
margin-top: 1rem;
margin-left: 0;
width: 100%;
}
> .description-block:first-child {
margin-top: 1rem;
}
}
.share-date {
2018-05-30 10:27:22 -04:00
margin-right: .75rem;
vertical-align: middle;
line-height: 2rem;
color: $type-gray;
font-size: .875rem;
@media #{$small} {
margin-top: 1rem;
width: 100%;
2018-09-25 17:39:42 -04:00
order: 100;
}
}
.subactions {
margin-left: 1.5rem;
justify-content: flex-end;
align-items: flex-start;
flex: 1;
}
.remix-credit {
margin-bottom: 1rem;
border: 1px solid $ui-blue-10percent;
border-radius: 8px;
background-color: $ui-blue-10percent;
padding: .5rem;
width: calc(100% - 1rem);
flex-wrap: nowrap;
align-items: flex-start;
}
.credit-text {
font-size: .875rem;
flex-shrink: 1;
}
.description-block {
display: flex;
width: 100%;
min-height: 0;
flex-direction: column;
align-items: flex-start;
flex: 1;
}
.project-textlabel {
margin: 0 0 .5rem 0;
2018-05-30 10:27:22 -04:00
font-size: 1rem;
font-weight: bold;
}
.project-description {
margin-bottom: .75rem;
border: 1px solid $ui-blue-10percent;
border-radius: 8px;
background-color: $ui-blue-10percent;
padding: .5rem;
width: calc(100% - (1rem + 2px));
overflow: auto;
white-space: pre-line;
2018-05-30 10:27:22 -04:00
font-size: 1rem;
// flex-grow
flex: 1;
}
.project-description.last {
margin-bottom: 0;
}
.project-description-edit {
display: flex;
2018-05-30 10:27:22 -04:00
margin-bottom: .75rem;
border: 1px solid $ui-blue-10percent;
border-radius: 8px;
background-color: $ui-blue-10percent;
padding: .5rem;
width: 100%;
white-space: pre-line;
// flex-grow
flex: 1;
2018-05-30 10:27:22 -04:00
&.last {
margin-bottom: 0;
}
&.textarea-row {
border: 0;
background-color: inherit;
padding: 0;
}
&.has-error {
.validation-message {
transform: translate(26rem, 0);
}
}
& > .grow {
display: flex;
flex: 1;
}
}
.copyleft {
display: inline-block;
transform: scale(-1, 1);
margin: 0;
text-align: right;
@media #{$medium-and-small} {
padding: 0;
}
}
.stats {
line-height: 2rem;
justify-content: flex-start;
}
.stats, .subactions, .action-buttons {
2018-09-25 17:39:42 -04:00
@media #{$medium-and-small} {
margin: 0;
justify-content: center;
flex-direction: row;
}
& > div, .action-button {
@media #{$medium-and-small} {
padding: 0 1rem;
}
}
}
.stats, .subactions {
2018-09-25 17:39:42 -04:00
@media #{$medium-and-small} {
width: 100%;
}
}
.subactions {
2018-09-25 17:39:42 -04:00
@media #{$medium-and-small} {
margin-top: 1rem;
}
}
.project-loves,
.project-favorites,
.project-remixes,
.project-views {
display: inline;
padding-right: 2rem;
2018-05-30 10:27:22 -04:00
font-size: 1rem;
font-weight: bold;
&:before {
display: inline-block;
2018-05-30 10:27:22 -04:00
margin-right: .5rem;
background-repeat: no-repeat;
background-position: center center;
background-size: contain;
width: 1.5rem;
height: 1.5rem;
2018-05-30 10:27:22 -04:00
vertical-align: -.25rem;
content: "";
}
}
.project-loves {
cursor: pointer;
&:before {
2018-05-30 10:27:22 -04:00
opacity: .5;
background-image: url("/svgs/project/love-gray.svg");
}
}
.project-loves.loved {
&:before {
2018-05-30 10:27:22 -04:00
opacity: 1;
background-image: url("/svgs/project/love-red.svg");
}
}
.project-favorites {
cursor: pointer;
&:before {
2018-05-30 10:27:22 -04:00
opacity: .5;
background-image: url("/svgs/project/fav-gray.svg");
}
}
.project-favorites.favorited {
&:before {
2018-05-30 10:27:22 -04:00
opacity: 1;
background-image: url("/svgs/project/fav-yellow.svg");
}
}
.project-remixes {
&:before {
2018-05-30 10:27:22 -04:00
opacity: .5;
background-image: url("/svgs/project/remix-gray.svg");
}
}
.project-views {
&:before {
2018-05-30 10:27:22 -04:00
opacity: .5;
background-image: url("/svgs/project/views-gray.svg");
}
}
.action-buttons {
display: flex;
margin-top: 0;
color: $type-white;
font-size: .8rem;
font-weight: 500;
justify-content: flex-end;
flex-wrap: wrap;
}
.action-button {
margin: 0 0 0 .5rem;
border-radius: 19px;
background-color: $ui-blue;
2018-05-30 10:27:22 -04:00
padding: 0 .75rem;
height: 2rem;
text-decoration: none;
line-height: .875rem;
font-size: .75rem;
font-weight: normal;
// &:hover {
// transition: background-color .25s ease;
// border-color: transparent;
// background-color: $active-gray;
// }
//
// &:active {
// border: 0 solid transparent;
// box-shadow: inset 0 0 5px $box-shadow-gray;
// background-color: $active-dark-gray;
// padding: calc(.75em + 1px) calc(1.5em + 1px);
// }
//
// &.report {
// border: 1px solid $ui-coral;
// background-color: $ui-coral;
//
// &:hover {
// transition: background-color .25s ease;
// border-color: transparent;
// background-color: $active-gray;
// }
//
// &:active {
// border: 0 solid transparent;
// box-shadow: inset 0 0 5px $box-shadow-gray;
// background-color: $active-dark-gray;
// padding: calc(.75em + 1px) calc(1.5em + 1px);
// }
// }
}
Initial implementation for displaying comments on project page (#1997) * Create Comment component, start styling it * Restructure PreviewPresentation to better match mockup * Add padding, border to comment bubble * add padding to bottom row of comment * Tweak alignment of avatar and comment content * Add margin to lower project page container * Use border-box box sizing for comment bubble * Make user avatar a link * Add initial implementation of comment tail * Align username row properly, fix comment bubble width * Use ::before pseudoelement for comment tail * Remove unused props to Comment component * Add CommentContainer to handle comment replies * Use CommentContainer instead of Comment in PreviewPresentation * Remove debug data from CommentContainer * Fetch top level comments from the API * Force comment container to stretch to bottom of view div * Remove unused api import in CommentContainer * Long words in comments should not overflow page * Remove @ before username in comment title * Fix word wrapping on Firefox * Refactor CommentContainer into a class * Properly export CommentContainer component * Make replies column take up proper width * Pass project ID to CommentContainer * Fetch comment replies in CommentContainer * Initial implementation for loading more comments * Add "Load More" button to Presentation * Initial implementation of collapsing threads longer than 3 replies * Remove console log from preview.js redux * Tweak last comment gradient color * Only show three total replies in collapsed state * Match scratchr2 behavior for thread collapsing * Use width calc instead of margin and width 100% * Fix styling for load more button * Make comment border gray to match the wireframe * Allow clicking through comment fade gradient * Add comment compose component * style comment compose box * Style post, cancel buttons on comment compose component * Add margin to create comment container * Tweak styling for characters remaining text * Tweak placeholder text * Add more margin to comment avatar * Add icons and styling to delete, report text * Refactor px -> rem where possible in comment styles * Change comment time color to dark gray * Tweak margin and border radius * Add reply icon to preview comments * Clean up unused imports, console.log in compose-comment component * Remove console statement in preview.jsx * Add some clarifying comments to unfinished parts of comments * Remove direct passing of comment api response to CommentContainer * CommentContainer should not pass api response directly * Rename CommentContainer to TopLevelComment * First pass at getReplies for comments in redux * Move reply fetching into redux actions instead of in TopLevelComment * Refactor getReplies logic to behave better * Remove components not directly related to reading comments * Hide load more button if all comments are loaded This uses the project info returned by the API * Use same gradient as add to studio modal on comment thread
2018-08-06 11:52:18 -04:00
.comments-header {
padding: 0 0 1rem 0;
justify-content: space-between;
h4 {
font-size: 1.25rem;
}
}
.studio-button,
.copy-link-button,
.report-button {
&:before {
display: inline-block;
2018-05-30 10:27:22 -04:00
margin-right: .25rem;
background-repeat: no-repeat;
background-position: center center;
background-size: contain;
2018-05-30 10:27:22 -04:00
width: .875rem;
height: .875rem;
vertical-align: bottom;
content: "";
}
}
2018-09-12 17:28:27 -04:00
.studio-button {
&:before {
background-image: url("/svgs/project/studio-add-white.svg");
}
}
.copy-link-button {
&:before {
background-image: url("/svgs/project/copy-link-white.svg");
}
}
.report-button {
background-color: $ui-coral;
&:before {
background-image: url("/svgs/project/report-white.svg");
}
}
2018-06-13 16:45:06 -04:00
Initial implementation for displaying comments on project page (#1997) * Create Comment component, start styling it * Restructure PreviewPresentation to better match mockup * Add padding, border to comment bubble * add padding to bottom row of comment * Tweak alignment of avatar and comment content * Add margin to lower project page container * Use border-box box sizing for comment bubble * Make user avatar a link * Add initial implementation of comment tail * Align username row properly, fix comment bubble width * Use ::before pseudoelement for comment tail * Remove unused props to Comment component * Add CommentContainer to handle comment replies * Use CommentContainer instead of Comment in PreviewPresentation * Remove debug data from CommentContainer * Fetch top level comments from the API * Force comment container to stretch to bottom of view div * Remove unused api import in CommentContainer * Long words in comments should not overflow page * Remove @ before username in comment title * Fix word wrapping on Firefox * Refactor CommentContainer into a class * Properly export CommentContainer component * Make replies column take up proper width * Pass project ID to CommentContainer * Fetch comment replies in CommentContainer * Initial implementation for loading more comments * Add "Load More" button to Presentation * Initial implementation of collapsing threads longer than 3 replies * Remove console log from preview.js redux * Tweak last comment gradient color * Only show three total replies in collapsed state * Match scratchr2 behavior for thread collapsing * Use width calc instead of margin and width 100% * Fix styling for load more button * Make comment border gray to match the wireframe * Allow clicking through comment fade gradient * Add comment compose component * style comment compose box * Style post, cancel buttons on comment compose component * Add margin to create comment container * Tweak styling for characters remaining text * Tweak placeholder text * Add more margin to comment avatar * Add icons and styling to delete, report text * Refactor px -> rem where possible in comment styles * Change comment time color to dark gray * Tweak margin and border radius * Add reply icon to preview comments * Clean up unused imports, console.log in compose-comment component * Remove console statement in preview.jsx * Add some clarifying comments to unfinished parts of comments * Remove direct passing of comment api response to CommentContainer * CommentContainer should not pass api response directly * Rename CommentContainer to TopLevelComment * First pass at getReplies for comments in redux * Move reply fetching into redux actions instead of in TopLevelComment * Refactor getReplies logic to behave better * Remove components not directly related to reading comments * Hide load more button if all comments are loaded This uses the project info returned by the API * Use same gradient as add to studio modal on comment thread
2018-08-06 11:52:18 -04:00
.project-lower-container {
margin-top: 1rem;
background-color: $ui-blue-10percent;
padding: 1rem 0;
min-height: 12rem;
}
.create-comment {
margin-bottom: 2rem;
}
.load-more-button {
margin-left: 0;
width: 100%;
}
2018-06-13 16:45:06 -04:00
.extension-list {
justify-content: flex-start;
2018-09-21 13:52:42 -04:00
flex-direction: row;
@media #{$medium-and-small} {
justify-content: center;
}
2018-06-13 16:45:06 -04:00
}
Initial implementation for displaying comments on project page (#1997) * Create Comment component, start styling it * Restructure PreviewPresentation to better match mockup * Add padding, border to comment bubble * add padding to bottom row of comment * Tweak alignment of avatar and comment content * Add margin to lower project page container * Use border-box box sizing for comment bubble * Make user avatar a link * Add initial implementation of comment tail * Align username row properly, fix comment bubble width * Use ::before pseudoelement for comment tail * Remove unused props to Comment component * Add CommentContainer to handle comment replies * Use CommentContainer instead of Comment in PreviewPresentation * Remove debug data from CommentContainer * Fetch top level comments from the API * Force comment container to stretch to bottom of view div * Remove unused api import in CommentContainer * Long words in comments should not overflow page * Remove @ before username in comment title * Fix word wrapping on Firefox * Refactor CommentContainer into a class * Properly export CommentContainer component * Make replies column take up proper width * Pass project ID to CommentContainer * Fetch comment replies in CommentContainer * Initial implementation for loading more comments * Add "Load More" button to Presentation * Initial implementation of collapsing threads longer than 3 replies * Remove console log from preview.js redux * Tweak last comment gradient color * Only show three total replies in collapsed state * Match scratchr2 behavior for thread collapsing * Use width calc instead of margin and width 100% * Fix styling for load more button * Make comment border gray to match the wireframe * Allow clicking through comment fade gradient * Add comment compose component * style comment compose box * Style post, cancel buttons on comment compose component * Add margin to create comment container * Tweak styling for characters remaining text * Tweak placeholder text * Add more margin to comment avatar * Add icons and styling to delete, report text * Refactor px -> rem where possible in comment styles * Change comment time color to dark gray * Tweak margin and border radius * Add reply icon to preview comments * Clean up unused imports, console.log in compose-comment component * Remove console statement in preview.jsx * Add some clarifying comments to unfinished parts of comments * Remove direct passing of comment api response to CommentContainer * CommentContainer should not pass api response directly * Rename CommentContainer to TopLevelComment * First pass at getReplies for comments in redux * Move reply fetching into redux actions instead of in TopLevelComment * Refactor getReplies logic to behave better * Remove components not directly related to reading comments * Hide load more button if all comments are loaded This uses the project info returned by the API * Use same gradient as add to studio modal on comment thread
2018-08-06 11:52:18 -04:00
.remix-list,
.studio-list {
flex-direction: column;
2018-08-28 17:01:36 -04:00
.list-title {
2018-08-24 09:25:04 -04:00
margin-left: 1rem;
font-size: 1.2rem;
font-weight: bold;
align-self: flex-start;
}
.creator-image img {
max-width: 2rem;
max-height: 2rem;
}
.thumbnail-column {
display: inline-block;
width: 100%;
2018-09-27 10:31:32 -04:00
/* TODO: the following can be transferred to
src/components/thumbnailcolumn/thumbnailcolumn.scss
after testing */
@media #{$medium-and-small} {
flex-direction: row;
.thumbnail {
display: inline-block;
}
}
}
@media #{$medium-and-small} {
margin-top: 1rem;
}
}
}
.report-text textarea {
// override min-height from default settings (for teacher registration)
min-height: 8rem;
}