-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
184 lines (180 loc) · 7.02 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>default-beauty.css</title>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Overpass%20Mono">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Open+Sans">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.0.4/css/all.css">
<link rel="stylesheet" href="https://unpkg.com/[email protected]/normalize.css">
<link rel="stylesheet" href="default-beauty.css"><!-- https://oleksiyrudenko.github.io/default-beauty.css/default-beauty.css -->
</head>
<body>
<header id="header-element">
<nav>
<a href="./">[ Home ]</a>
<a href="#" title="Switch structural elements to divs" onclick="switchStructuralElementsToDivAndBackAgain();">[
<code><header/main/footer></code> <=> <code><div></code> ]</a>
<a href="#" id="stylesheets-off" onclick="switchStyling();switchStylesheetControls();">[ Turn Default Beauty off ]</a>
<a href="#" id="stylesheets-on" onclick="switchStyling();switchStylesheetControls();">[ <strong>My eyes are bleeding! Bring the beauty back!</strong> ]</a>
</nav>
</header>
<main id="main-element">
<h1>Default-Beauty.css</h1>
<h2>An implicit replacement for browsers' default styling</h2>
<p>
<a href="https://github.com/OleksiyRudenko/default-beauty.css" target="_blank">Default-Beauty.css</a>
makes default browsers' styling prettier in an implicit manner.
Not really beautiful but rather anything you might live with until you are in resource to improve
your app visuals.
</p>
<p>
You do not need to define any CSS classes or inline styles to have your HTML rendered prettier.
</p>
<p>
Just <strong><code>yarn add normalize.css && yarn add default-beauty.css</code></strong>
</p>
<hr/>
<p>
This page is an example of the approach employed. Click links on the top to switch between modes.
</p>
<p>
<a href="https://github.com/OleksiyRudenko/default-beauty.css/blob/master/README.md" target="_blank">
<strong>Read more about default-beauty.css »</strong></a>
</p>
<hr/>
<hr/>
<h2>HTML elements render examples</h2>
<p>
Some inline <code>code</code>.
</p>
<p>Pre-formatted block:</p>
<pre>
:root {
font-family: Helvetica, "Open Sans", Arial, sans-serif;
--color-light: #efefef;
--color-dark: #333;
}
</pre>
<h3>Header 3</h3>
<strong><u>Please, do not expect any controls below to fire any actions. They are here to just give you a look and feel.</u></strong>
<div>
<button>Button default</button>
<button type="button">Button button</button>
<input type="button" value="Button input">
<input type="submit" value="Submit">
<input type="reset" value="Reset">
</div>
<div>
<label for="text-input">Label</label>
<input type="text" value="Text" id="text-input">
<input type="number" value="12345">
<input type="month" value="2018-01">
<input type="date" value="2081-01-29">
</div>
<div>
<input type="file">
<select>
<option>normalize.css</option>
<option>default-beauty.css</option>
</select>
</div>
<h4>Header 4</h4>
<fieldset>
<legend>Your favourite type</legend>
<div>
<input type="radio" name="inputtype" id="radio1"><label for="radio1">Text</label>
<input type="radio" name="inputtype" id="radio2" checked><label for="radio2">Date</label>
<input type="radio" name="inputtype" id="radio3"><label for="radio3">Number</label>
</div>
</fieldset>
<fieldset>
<legend>Choose whatever you like</legend>
<div>
<input type="checkbox" name="like[]" id="checkbox1" checked><label for="checkbox1">HTML</label>
<input type="checkbox" name="like[]" id="checkbox2" checked><label for="checkbox2">CSS</label>
<input type="checkbox" name="like[]" id="checkbox3" checked><label for="checkbox3">JS</label>
</div>
</fieldset>
<h5>Header 5. Table</h5>
<table>
<thead>
<tr><th>Column 1</th><th>Column 2</th><th>Last column</th></tr>
</thead>
<tbody>
<tr><td>Data 1.1</td><td>Data 2.1</td><td>Data 3.1</td></tr>
<tr><td>Data 1.2</td><td>Data 2.2</td><td>Data 3.2</td></tr>
<tr><td>Data 1.3</td><td colspan="2">Data 2.3 spanned</td></tr>
<tr><td colspan="2">Data spanned across 2 columns</td><td>Data 3.4</td></tr>
</tbody>
<tfoot>
<tr><td>footer 1</td><td>footer 2</td><td>footer 3</td></tr>
</tfoot>
</table>
</main>
<footer id="footer-element">
<address>
Beauty House<br/>
Css Lane, 3<br/>
w3c
</address>
<p>
<small>
Styled with
<a href="https://github.com/necolas/normalize.css" target="_blank">
normalize.css <i class="fab fa-github-square"></i>
</a>
and
<a href="https://github.com/OleksiyRudenko/default-beauty.css" target="_blank">
<i class="fas fa-heart"></i> Default-Beauty.css <i class="fab fa-github-square"></i>
</a>
</small>
</p>
</footer>
<script>
const structuralElementsIds = [
'header',
'main',
'footer'
];
document.addEventListener("DOMContentLoaded", function(event) {
const elSSswitch = [document.getElementById('stylesheets-off'), document.getElementById('stylesheets-on')];
elSSswitch[0].style.cursor = 'pointer';
elSSswitch[1].style.display = 'none';
});
function switchStyling() {
const stylesheets = document.querySelectorAll('[rel="stylesheet"]');
let stylesheet = [];
for (let item of stylesheets) {
stylesheet.push(item.sheet || item.styleSheet); // IE compatibility
}
stylesheet.forEach(item => { item.disabled = ! item.disabled});
}
function switchStylesheetControls() {
const elSSswitch = [document.getElementById('stylesheets-off'), document.getElementById('stylesheets-on')];
elSSswitch.forEach(el => {
el.style.display = el.style.display === 'none' ? 'inline-block' : 'none';
});
}
function switchStructuralElementsToDivAndBackAgain() {
const els = structuralElementsIds.map(elId => {
return document.getElementById(elId + '-element');
});
els.forEach(el => {
const elType = el.id.split('-')[0];
// create new element
const newElement = document.createElement(el.tagName === 'DIV' ? elType : 'DIV');
// copy contents of old element
newElement.innerHTML = el.innerHTML;
// remove old element
el.remove();
// assign id to the new element
newElement.id = elType + '-element';
// append new element
document.body.appendChild(newElement);
});
}
</script>
</body>
</html>