// ==UserScript== // @name Coursera layout optimization // @namespace https://userstyles.world/user/happiness // @version 1.0.0 // @description Move the transcript under the video to the right of the video. // @license unlicense // @grant GM_addStyle // @run-at document-start // @match *://*.www.coursera.org/* // @downloadURL none // ==/UserScript== (function() { let css = ` /* content: video title + notes + video + transcript */ .ItemPageLayout_content_body { padding: unset; } #main { padding-bottom: 0; } .ItemLecture_Video_Title, .ItemLecture_Video_Notes_Navigation { flex-basis: 100%; margin-top: 0; } /* video */ #main > div:first-child > div > div:nth-child(3) { flex-basis: 60%; } /* transcript */ #main > div:first-child > div > div:nth-child(4) { flex-basis: 39%; } /* feedback */ .rc-ItemFeedback, .rc-ShareButtonWithModal { margin-top: 0 !important; } /* transcript */ div[data-testid="ItemLecture_Video_Transcript"] { margin-left: auto; overflow-y: scroll; padding: unset; /* global header: 65.8px; page header: 40+8+16px; video title: 48px; line under video title: 48px; feedback: 36px; */ --offset: calc(65.8px + 40px + 8px + 16px + 48px + 48px + 36px); max-height: calc(100vh - var(--offset)); } .css-xl5mb3 .timestamp { margin-left: unset; padding: unset; } .rc-Phrase>span { font-size: 0.9rem; } .rc-Paragraph { padding: 0 0 0; } /* Hide pause button logo at the begining of the video */ .rc-PlayButton button { opacity: 0; } `; if (typeof GM_addStyle !== "undefined") { GM_addStyle(css); } else { const styleNode = document.createElement("style"); styleNode.appendChild(document.createTextNode(css)); (document.querySelector("head") || document.documentElement).appendChild(styleNode); } })();