Skip to content

Commit

Permalink
feat: re-integrate webdev week 1
Browse files Browse the repository at this point in the history
  • Loading branch information
Joshua-Zou committed Jul 22, 2023
1 parent dfe1af9 commit 417de8c
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 116 deletions.
5 changes: 4 additions & 1 deletion src/components/PreviewStandalone.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,11 @@ class CodeEditor extends ModuleComponent {
<div class="vertical-divider"></div>
${this.state.codePreview}
<style>
${this.isLive ? `
.tab-panel-hidden-mobile {
display: block !important;
}
#code-frame {
position: fixed;
top: 0;
Expand Down
2 changes: 1 addition & 1 deletion src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@
if (isDemo) data.previewIndex = 0;
modulePage.setComponent(new Preview({}, modulePage, true), data);
}
request.data.base64EncodedCode = window.atob(request.data.base64EncodedCode)
request.data.base64EncodedCode = window.atob(decodeURIComponent(request.data.base64EncodedCode))

showPage({
type: "project",
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
133 changes: 20 additions & 113 deletions src/data/modules/webdev/0.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/utils/renderMdd.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ module.exports = function renderMdd(mddString) {
let language = e.slice(3, e.indexOf("\n"))
let content = e.slice(e.indexOf("\n"), -3).trim()
let name = language.split("-")[1]?.trim() || "";
if (name === "LIVE") return `<div class="image-wrapper info-text"><iframe src="#/live-demo/${language.split("-")[0]}/${window.btoa(content)}" style="width: 100%; height: 250px; border-radius: 10px; display: block; margin-left: auto; margin-right: auto;" onload="resizeIframe(this)"></iframe></div>`
if (name === "LIVE") return `<div class="image-wrapper info-text"><iframe src="#/live-demo/${language.split("-")[0]}/${encodeURIComponent(window.btoa(content))}" style="width: 100%; height: 250px; border-radius: 10px; display: block; margin-left: auto; margin-right: auto;" onload="resizeIframe(this)"></iframe></div>`

let component = new codeBlock({ code: codeBlockHelper.escapeHtml(content), language: language.split("-")[0], name: name })
return `<div class="codeblock-wrapper">
Expand Down

1 comment on commit 417de8c

@vercel
Copy link

@vercel vercel bot commented on 417de8c Jul 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

devnetic – ./

devnetic-cmeone.vercel.app
devnetic.appdevleague.org
devnetic-git-main-cmeone.vercel.app

Please sign in to comment.