1
0
mirror of https://github.com/chinchang/web-maker.git synced 2025-06-07 18:14:57 +02:00

lil more finishing

This commit is contained in:
Kushagra Gour 2018-07-03 01:52:00 +05:30
parent 800504e1fd
commit df4b5a749d
3 changed files with 47 additions and 43 deletions

View File

@ -16,6 +16,9 @@ class JS13K extends Component {
} }
render() { render() {
const codeSizeInKb = this.props.codeSize
? (this.props.codeSize / 1024).toFixed(2)
: 0;
return ( return (
<div class="flex flex-v-center"> <div class="flex flex-v-center">
<img <img
@ -23,13 +26,16 @@ class JS13K extends Component {
alt="JS13K Games logo" alt="JS13K Games logo"
height="24" height="24"
/>{' '} />{' '}
<div class="footer__js13k-text">{this.state.daysLeft} days to go</div> <div class="footer__js13k-days-left">
{this.state.daysLeft} days to go
</div>
<div <div
class="footer__js13k-code-size"
style={{ style={{
color: this.props.codeSize > 10 ? 'crimson' : 'limegreen' color: codeSizeInKb > 10 ? 'crimson' : 'limegreen'
}} }}
> >
{(this.props.codeSize / 1024).toFixed(2)} KB/ 13KB {codeSizeInKb} KB/ 13KB
</div> </div>
</div> </div>
); );
@ -120,9 +126,11 @@ export default class Footer extends Component {
</div> </div>
{this.props.prefs.isJs13kModeOn ? ( {this.props.prefs.isJs13kModeOn ? (
<div class="flex"> <div class="flex flex-v-center">
<JS13K codeSize={this.props.codeSize} /> <JS13K codeSize={this.props.codeSize} />
<button onClick={this.props.onJs13KBtnClick}>Help</button> <button class="dark-btn" onClick={this.props.onJs13KBtnClick}>
JS13KGames Help
</button>
</div> </div>
) : null} ) : null}

View File

@ -1076,11 +1076,11 @@ export default class App extends Component {
var fileContent = getCompleteHtml(html, css, js, item, true); var fileContent = getCompleteHtml(html, css, js, item, true);
var zip = new JSZip(); var zip = new JSZip();
// Add an top-level, arbitrary text file with contents
zip.file('index.html', fileContent); zip.file('index.html', fileContent);
[result[3]].map(externalLib => for (let i = 3; i < result.length; i++) {
zip.file(externalLib.name, externalLib.code) const externalLib = result[i];
); zip.file(externalLib.name, externalLib.code);
}
console.log('ORIGINAL', this.calculateTextSize(fileContent)); console.log('ORIGINAL', this.calculateTextSize(fileContent));

View File

@ -15,8 +15,7 @@ body {
font-size: 87.5%; font-size: 87.5%;
/* speocifically for mobile when keyboard is open */ /* speocifically for mobile when keyboard is open */
position: relative; position: relative;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol';
sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol';
} }
h1 { h1 {
@ -188,7 +187,7 @@ label {
margin-left: 8px; margin-left: 8px;
} }
a > svg { a>svg {
fill: rgba(255, 255, 255, 0.2); fill: rgba(255, 255, 255, 0.2);
} }
@ -224,8 +223,7 @@ textarea {
} }
.btn--primary { .btn--primary {
background: var(--color-button) background: var(--color-button) linear-gradient(180deg, rgba(0, 0, 0, 0.5) 0px, transparent);
linear-gradient(180deg, rgba(0, 0, 0, 0.5) 0px, transparent);
color: white; color: white;
} }
@ -251,7 +249,7 @@ textarea {
outline-offset: 1px; outline-offset: 1px;
} }
.btn-icon > svg { .btn-icon>svg {
width: 20px; width: 20px;
height: 20px; height: 20px;
fill: currentColor; fill: currentColor;
@ -259,7 +257,7 @@ textarea {
margin-right: 8px; margin-right: 8px;
} }
.btn--big > svg { .btn--big>svg {
width: 25px; width: 25px;
height: 25px; height: 25px;
margin-right: 12px; margin-right: 12px;
@ -269,7 +267,7 @@ textarea {
display: none; display: none;
} }
.is-loading > svg { .is-loading>svg {
display: none; display: none;
} }
@ -365,7 +363,7 @@ body:not(.light-version).overlay-visible .main-container {
display: none; display: none;
} }
.layout-4 .code-side + .gutter { .layout-4 .code-side+.gutter {
display: none; display: none;
} }
@ -452,7 +450,7 @@ body:not(.light-version).overlay-visible .main-container {
} }
.code-wrap__header-btn, .code-wrap__header-btn,
.code-wrap__header-btn > svg { .code-wrap__header-btn>svg {
width: 18px; width: 18px;
height: 18px; height: 18px;
} }
@ -558,7 +556,7 @@ li.CodeMirror-hint-active {
/* When demo frame is in detached window */ /* When demo frame is in detached window */
body > #demo-frame { body>#demo-frame {
height: 100%; height: 100%;
/* Because console is no more here */ /* Because console is no more here */
} }
@ -587,7 +585,7 @@ body > #demo-frame {
} }
.btn--dark, .btn--dark,
.main-header__btn-wrap > button { .main-header__btn-wrap>button {
box-sizing: content-box; box-sizing: content-box;
font-size: 0.8em; font-size: 0.8em;
font-weight: bold; font-weight: bold;
@ -600,22 +598,18 @@ body > #demo-frame {
margin-left: 10px; margin-left: 10px;
padding: 0px 8px; padding: 0px 8px;
border: 1px solid rgba(0, 0, 0, 0.9); border: 1px solid rgba(0, 0, 0, 0.9);
background: linear-gradient( background: linear-gradient( 180deg, rgba(0, 0, 0, 0.5) 0, rgba(255, 255, 255, 0.1) 100%);
180deg,
rgba(0, 0, 0, 0.5) 0,
rgba(255, 255, 255, 0.1) 100%
);
/*text-shadow: 0px 1px 1px rgba(0,0,0,1);*/ /*text-shadow: 0px 1px 1px rgba(0,0,0,1);*/
box-shadow: 0 -1px 0px 0 rgba(255, 255, 255, 0.15); box-shadow: 0 -1px 0px 0 rgba(255, 255, 255, 0.15);
text-transform: uppercase; text-transform: uppercase;
} }
.btn--dark > svg { .btn--dark>svg {
fill: #9297b3; fill: #9297b3;
margin-right: 4px; margin-right: 4px;
} }
.main-header__btn-wrap > .is-marked > svg { .main-header__btn-wrap>.is-marked>svg {
fill: crimson; fill: crimson;
} }
@ -623,7 +617,7 @@ body > #demo-frame {
border-color: rgba(146, 151, 179, 0.5); border-color: rgba(146, 151, 179, 0.5);
} }
.main-header__btn-wrap > .is-loading { .main-header__btn-wrap>.is-loading {
pointer-events: none; pointer-events: none;
opacity: 0.4; opacity: 0.4;
} }
@ -688,8 +682,8 @@ body > #demo-frame {
top: 2px; top: 2px;
} }
.footer a > svg, .footer a>svg,
.footer button > svg { .footer button>svg {
transition: 0.3s ease; transition: 0.3s ease;
fill: rgba(255, 255, 255, 0.2); fill: rgba(255, 255, 255, 0.2);
} }
@ -778,7 +772,7 @@ body > #demo-frame {
padding: 0.2rem 0.5rem; padding: 0.2rem 0.5rem;
} }
.modal__close-btn > svg { .modal__close-btn>svg {
fill: black; fill: black;
width: 30px; width: 30px;
height: 30px; height: 30px;
@ -884,8 +878,8 @@ body > #demo-frame {
} }
.overlay-visible .modal-overlay, .overlay-visible .modal-overlay,
.is-modal-visible ~ .modal-overlay, .is-modal-visible~.modal-overlay,
.saved-items-pane.is-open ~ .modal-overlay { .saved-items-pane.is-open~.modal-overlay {
opacity: 1; opacity: 1;
visibility: visible; visibility: visible;
} }
@ -978,7 +972,7 @@ body > #demo-frame {
animation-delay: 0.75s; animation-delay: 0.75s;
} }
.saved-item-tile:nth-child(n + 12) { .saved-item-tile:nth-child(n+12) {
animation-delay: 0.8s; animation-delay: 0.8s;
} }
@ -1168,24 +1162,24 @@ body > #demo-frame {
background: white; background: white;
} }
.dropdown__menu > li > a { .dropdown__menu>li>a {
display: block; display: block;
padding: 6px 15px; padding: 6px 15px;
color: #333; color: #333;
cursor: pointer; cursor: pointer;
} }
.dropdown__menu > li.selected > a, .dropdown__menu>li.selected>a,
.dropdown__menu > li > a:hover { .dropdown__menu>li>a:hover {
background: var(--color-sidebar); background: var(--color-sidebar);
color: white; color: white;
} }
.dropdown__menu > li:not(:last-child) { .dropdown__menu>li:not(:last-child) {
border-bottom: 1px solid rgba(0, 0, 0, 0.05); border-bottom: 1px solid rgba(0, 0, 0, 0.05);
} }
.open > .dropdown__menu, .open>.dropdown__menu,
.dropdown__menu.is-open { .dropdown__menu.is-open {
opacity: 1; opacity: 1;
visibility: visible; visibility: visible;
@ -1469,8 +1463,7 @@ body:not(.is-app) .show-when-app {
width: 80px; width: 80px;
height: 80px; height: 80px;
border-radius: 50%; border-radius: 50%;
background: white background: white url('data:image/svg+xml;charset=UTF-8,<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="width:32px;height:32px" viewBox="0 0 24 24"><path fill="limegreen" d="M12,2A10,10 0 0,1 22,12A10,10 0 0,1 12,22A10,10 0 0,1 2,12A10,10 0 0,1 12,2M11,16.5L18,9.5L16.59,8.09L11,13.67L7.91,10.59L6.5,12L11,16.5Z" /></svg>');
url('data:image/svg+xml;charset=UTF-8,<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="width:32px;height:32px" viewBox="0 0 24 24"><path fill="limegreen" d="M12,2A10,10 0 0,1 22,12A10,10 0 0,1 12,22A10,10 0 0,1 2,12A10,10 0 0,1 12,2M11,16.5L18,9.5L16.59,8.09L11,13.67L7.91,10.59L6.5,12L11,16.5Z" /></svg>');
} }
.bookmarklet { .bookmarklet {
@ -1509,13 +1502,16 @@ body:not(.is-app) .show-when-app {
visibility: visible; visibility: visible;
} }
.footer__js13k-text { .footer__js13k-days-left {
padding: 1px 9px; padding: 1px 9px;
text-transform: uppercase; text-transform: uppercase;
background: #b12a34; background: #b12a34;
color: white; color: white;
border-radius: 3px; border-radius: 3px;
letter-spacing: 0.7px; letter-spacing: 0.7px;
}
.footer__js13k-code-size {
margin-left: 1rem; margin-left: 1rem;
} }