const sampleCollection = [
{
title: 'texts',
showCode: false,
code: `Primary
Success
Warning
Error
Disabled `,
},
{
title: 'buttons',
showCode: false,
code: `Normal
Primary
Success
Warning
Error
Disabled
Select your file
`,
},
{
title: 'radios',
showCode: false,
code: `
Yes
No
Yes
No
`,
},
{
title: 'checkboxes',
showCode: false,
code: `
Enable
Dark
`,
},
{
title: 'inputs',
showCode: false,
code: `
Your name
.input.is-success
.input.is-warning
.input.is-error
.input.is-dark
`,
},
{
title: 'textarea',
showCode: false,
code: `Textarea
`,
},
{
title: 'selects',
showCode: false,
code: `Default select
Select...
To be
Not to be
nes-select.is-success
Select...
To be
Not to be
nes-select.is-warning
Select...
To be
Not to be
nes-select.is-error
Select...
To be
Not to be
nes-select.is-dark
Select...
To be
Not to be
`,
},
{
title: 'containers',
showCode: false,
code: `
Container.is-centered
Good morning. Thou hast had a good night's sleep, I hope.
Container.is-dark
Good morning. Thou hast had a good night's sleep, I hope.
Good morning. Thou hast had a good night's sleep, I hope.
Good morning. Thou hast had a good night's sleep, I hope.
`,
},
{
title: 'dialogs',
note:
'NES.css does not include any JavaScript. If you want to use dialog element other than Chrome, you need polyfill.',
showCode: false,
code: `
Open dark and rounded dialog
`,
},
{
title: 'lists',
showCode: false,
code: `
Good morning.
Thou hast had a good night's sleep, I hope.
Thou hast had a good afternoon
Good night.
Good morning.
Thou hast had a good night's sleep, I hope.
Thou hast had a good afternoon
Good night.
`,
},
{
title: 'tables',
showCode: false,
code: `
Table.is-bordered
Table.is-centered
Table.is-centered
Table.is-centered
Thou hast had a good morning
Thou hast had a good afternoon
Thou hast had a good evening
Thou hast had a good night
Thou hast had a good morning
Thou hast had a good afternoon
Thou hast had a good evening
Thou hast had a good night
Table.is-dark
Table.is-bordered
Thou hast had a good morning
Thou hast had a good afternon
Thou hast had a good morning
Thou hast had a good afternoon
`,
},
{
title: 'progress',
showCode: false,
code: `
`,
},
{
title: 'avatars',
description: 'It is recommended to "image-rendering: pixelated".',
showCode: false,
code: `
`,
},
{
title: 'balloons',
showCode: false,
code: `
Good morning. Thou hast had a good night's sleep, I hope.
Good morning. Thou hast had a good night's sleep, I hope.
`,
},
{
title: 'cursor',
showCode: false,
code: `
This is not a clickable element, but it's an area of the pointer.
`,
},
{
title: 'badges',
showCode: false,
code: `
NES.css
is
a
great
framework!
npm
1.1.0
test
100%
Icons
hi
Text
`,
},
{
title: 'reaction-icons',
showCode: false,
description:
'If you wanto to change icon size, please use "is-small", "is-medium" and "is-large".',
code: ``,
},
{
title: 'sns-icons',
showCode: false,
description:
'If you wanto to change icon size, please use "is-small", "is-medium" and "is-large".',
code: ``,
},
{
title: 'other-icons',
showCode: false,
description:
'If you wanto to change icon size, please use "is-small", "is-medium" and "is-large".',
code: ``,
},
{
title: 'pixel-arts',
showCode: false,
code: ``,
},
{
title: 'Nintendo-characters',
showCode: false,
note:
'Nintendo owns the copyright of these characters. Please comply with the Nintendo guidelines and laws of the applicable jurisdiction.',
code: ``,
},
];
const coreteam = [
{
name: 'B.C.Rikko',
feat: 'Creator of NES.css',
github: 'BcRikko',
twitter: 'bc_rikko',
},
{
name: 'Igor Guastalla',
feat: 'Development support',
github: 'guastallaigor',
twitter: 'guastallaigor',
},
];
const emeriti = [
{
name: 'Trezy',
feat: 'Setup DevOps',
github: 'trezy',
twitter: 'TrezyCodes',
},
{
name: 'Abdullah Samman',
feat: 'Setup test suite',
github: 'evexoio',
},
];
// curl -s 'https://api.github.com/repos/nostalgic-css/NES.css/contributors?per_page=100' | jq '.[].login'
const contributors = [
'4k1k0',
'sombreroEnPuntas',
'Divoolej',
'soph-iest',
'montezume',
'sazzadsazib',
'HiKaylum',
'jdvivar',
'ohlookitsderpy',
'IngwiePhoenix',
'kyu-suke',
'jjspace',
'Baldomo',
'DanSnow',
'ernestomancebo',
'Ilyeo',
'Kartones',
'rrj-dev',
'vicainelli',
'stewartrule',
'kenshinji',
'youngkaneda',
'Takumi0901',
'loo41',
'alexd99',
'alexgleason',
'agarzola',
'AlphaWong',
'brendansparrow',
'Ermakoy',
'fleeting',
'JamesIves',
'jsoref',
'KOREAN139',
'KalobTaulien',
'LukBukkit',
'otaviopace',
'Pedro-Souza',
'iamrameffort',
'scottaohara',
'd0p1s4m4',
'lucasjs',
'musavvirahmed',
'sinofp',
'thisisabhinay',
'tnantoka',
];
new Vue({
el: '#nescss',
data() {
return {
collection: sampleCollection,
coreteam,
emeriti,
contributors,
animateOctocat: false,
copiedBalloon: {
display: 'none',
top: 0,
left: 0,
},
scrollPos: 0,
};
},
filters: {
capitalize(val) {
if (!val) return '';
val = val.toString();
return val.charAt(0).toUpperCase() + val.slice(1);
},
},
mounted() {
document.addEventListener('scroll', () => {
this.scrollPos = document.documentElement.scrollTop || document.body.scrollTop;
});
hljs.initHighlightingOnLoad();
[].forEach.call(document.querySelectorAll('dialog'), (a) => {
dialogPolyfill.registerDialog(a);
});
this.replaceImages();
},
methods: {
copy(event, id) {
this.showCopiedBalloon(event.pageY, event.pageX);
const fake = document.createElement('textarea');
fake.value = this.collection.find(a => a.title === id).code;
fake.setAttribute('readonly', '');
Object.assign(fake.style, {
position: 'absolute',
left: '-9999px',
});
this.$el.appendChild(fake);
fake.select();
document.execCommand('copy');
this.$el.removeChild(fake);
},
startAnimate() {
this.animateOctocat = true;
},
stopAnimate() {
this.animateOctocat = false;
},
showCopiedBalloon(top, left) {
this.copiedBalloon = {
display: 'block',
top: `${top - 100}px`,
left: `${left - 180}px`,
};
setTimeout(() => {
this.copiedBalloon.display = 'none';
}, 1000);
},
replaceImages() {
Array.from(document.querySelectorAll('img.lazy')).forEach((img) => {
img.onload = () => img.classList.remove('lazy');
img.src = img.dataset.src;
});
},
},
});