Skip to content

Commit

Permalink
Update CSS for constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
hcodes committed Oct 31, 2024
1 parent b1f9deb commit bdc7517
Show file tree
Hide file tree
Showing 7 changed files with 52 additions and 24 deletions.
6 changes: 3 additions & 3 deletions examples/constructor/dist/index.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion examples/constructor/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,7 @@
this.handleDefault = function () {
setRadioValue(_this.elems.area, 'fullscreen');
_this.handleArea();
setRadioValue(_this.elems.backgroundColor, 'white');
setRadioValue(_this.elems.backgroundColor, 'black');
_this.handleBackgroundColor();
_this.elems.debug.checked = false;
_this.handleDebug();
Expand Down Expand Up @@ -686,6 +686,9 @@
bindRadioClick(this.elems.area, this.handleArea);
bindRadioClick(this.elems.backgroundColor, this.handleBackgroundColor);
this.handleDefault();
setTimeout(function () {
document.body.classList.add('animation');
}, 10);
}
Form.prototype.updateSnowflakes = function () {
var params = __assign({}, this.params);
Expand Down
6 changes: 3 additions & 3 deletions examples/constructor/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ <h1 class="header">Falling snowflakes <a href="https://github.com/hcodes/snowfla

<div class="code">
<div class="code__label">Code:</div>
<textarea class="code__textarea"></textarea>
<textarea class="code__textarea"></textarea><br />
<input class="code__copy" type="button" value="Copy" />
</div>

Expand All @@ -31,8 +31,8 @@ <h1 class="header">Falling snowflakes <a href="https://github.com/hcodes/snowfla

<div class="form__group">
<label class="form__label">background:</label>
<label class="form__label_radio"><input class="form__background-color" name="bg" type="radio" value="white" checked /> White</label>
<label class="form__label_radio"><input class="form__background-color" name="bg" type="radio" value="black" /> Black</label>
<label class="form__label_radio"><input class="form__background-color" name="bg" type="radio" value="black" checked /> Black</label>
<label class="form__label_radio"><input class="form__background-color" name="bg" type="radio" value="white" /> White</label>
</div>

<div class="form__group">
Expand Down
6 changes: 4 additions & 2 deletions examples/constructor/src/code.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
right: 15px;
bottom: 0;
height: 180px;
backdrop-filter: blur(10px);
}

.code__label {
Expand All @@ -13,7 +14,6 @@

.code__copy {
margin-top: 4px;
font-size: 16px;
}

.code__textarea {
Expand All @@ -23,6 +23,7 @@
height: 120px;
font-size: 12px;
padding: 5px;
max-width: 270px;
}

.code__copy,
Expand All @@ -31,8 +32,9 @@
}

.body_bg_black .code__textarea {
background: black;
background: #333;
color: white;
border: 1px solid #555;
}

.body_bg_black .code__label {
Expand Down
24 changes: 19 additions & 5 deletions examples/constructor/src/form.css
Original file line number Diff line number Diff line change
@@ -1,18 +1,24 @@
.form__panel {
position: absolute;
z-index: 20;
right: 15px;
top: 15px;
background: rgba(255, 255, 255, .8);
left: 15px;
top: 70px;
background: white;
border: 1px solid #f0f0f0;
border-radius: 4px;
line-height: 1.6;
white-space: nowrap;

color: black;
transition: .5s border-color ease;
border-radius: 10px;
}

.body_bg_black .form__panel {
color: white;
background: #333;
border-color: #555;
}

.form__field {
margin-left: 10px;
}
Expand Down Expand Up @@ -43,11 +49,15 @@
background-color: #f0f0f0;
}

.body_bg_black .form__group:hover {
background-color: #555;
}

.form__title {
font-weight: bold;
text-align: center;
padding: 3px;
border-bottom: 1px solid #f0f0f0;
background: #5ECDEF50;
}

.form__body {
Expand All @@ -61,6 +71,10 @@
border-radius: 0 0 10px 10px;
}

.body_bg_black .form__bottom {
background: #555;
}

.form__layer {
display: none;
position: fixed;
Expand Down
6 changes: 5 additions & 1 deletion examples/constructor/src/form.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ export class Form {
bindRadioClick(this.elems.backgroundColor, this.handleBackgroundColor);

this.handleDefault();

setTimeout(() => {
document.body.classList.add('animation');
}, 10);
}

private updateSnowflakes() {
Expand Down Expand Up @@ -148,7 +152,7 @@ export class Form {
setRadioValue(this.elems.area, 'fullscreen');
this.handleArea();

setRadioValue(this.elems.backgroundColor, 'white');
setRadioValue(this.elems.backgroundColor, 'black');
this.handleBackgroundColor();

this.elems.debug.checked = false;
Expand Down
23 changes: 14 additions & 9 deletions examples/constructor/src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ html, body {
padding: 0;
margin: 0;
border: 0;
}

body.animation {
transition: .5s background-color ease;
}

Expand Down Expand Up @@ -37,21 +39,24 @@ label {
color: #aaa;
font-size: 12px;
border-radius: 5px;
vertical-align: middle;
}

.header {
font-size: 18px;
position: absolute;
left: 50%;
top: 20px;
font-size: 30px;
font-weight: bold;
margin: 0;
padding: 0;
position: absolute;
left: 15px;
top: 15px;
color: #222;
font-weight: normal;
}

.body_bg_black .header {
color: #ddd;
background-color: white;
background-image: linear-gradient(to right, #3980DB, #B69EE2);
color: transparent;
background-clip: text;
transform: translateX(-50%);
white-space: nowrap;
}

.no-support {
Expand Down

0 comments on commit bdc7517

Please sign in to comment.