Use webpack for bundling

This commit is contained in:
2018-04-29 10:23:42 +03:00
parent 5ebfecb8bc
commit 4e73b218bf
11 changed files with 9100 additions and 875 deletions

View File

@ -1,43 +0,0 @@
(function() {
'use strict';
var notes = [
'Любимый фильм "Три идиота".',
'Люблю кататься на велосипеде.',
'Люблю читать фантастические книги.',
'Люблю шоколад.',
'На день рождения ко мне можно прийти без подарка.',
'Не люблю пьяных людей.',
'Предпочитаю ходить в кино на 2D-сеансы.',
'Проехал на велосипеде 200 километров за день.',
'Работаю программистом.',
'Хотел бы побывать в горах.',
];
function selectRandomNote() {
return notes[Math.floor(Math.random() * notes.length)];
}
function updateNode() {
var el = document.getElementById('about-me-note');
if (el) {
el.innerHTML = selectRandomNote();
}
}
function onKnowBetter(event) {
event.preventDefault();
if (window.yaCounter41913764) {
window.yaCounter41913764.hit(location.href);
}
updateNode();
}
window.addEventListener('DOMContentLoaded', updateNode);
var el = document.getElementById('know-better');
if (el) {
el.addEventListener('click', onKnowBetter);
}
}());

View File

@ -0,0 +1,40 @@
import './style.scss'
const notes = [
'Любимый фильм "Три идиота".',
'Люблю кататься на велосипеде.',
'Люблю читать фантастические книги.',
'Люблю шоколад.',
'На день рождения ко мне можно прийти без подарка.',
'Не люблю пьяных людей.',
'Предпочитаю ходить в кино на 2D-сеансы.',
'Проехал на велосипеде 200 километров за день.',
'Работаю программистом.',
'Хотел бы побывать в горах.',
];
function selectRandomNote() {
return notes[Math.floor(Math.random() * notes.length)];
}
function updateNode() {
const el = document.getElementById('about-me-note');
if (el) {
el.innerHTML = selectRandomNote();
}
}
function onKnowBetter(event) {
event.preventDefault();
if (window.yaCounter41913764) {
window.yaCounter41913764.hit(location.href);
}
updateNode();
}
window.addEventListener('DOMContentLoaded', updateNode);
const el = document.getElementById('know-better');
if (el) {
el.addEventListener('click', onKnowBetter);
}

View File

@ -1,8 +1,8 @@
html, body {
font-size: 18px;
font-family: 'PT Serif', Serif;
font-family: 'PT Serif', serif;
padding: 0;
margin: 0;
margin: 0;
@media (max-width: 839px) {
font-size: 16px;

View File

@ -4,7 +4,6 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="https://fonts.googleapis.com/css?family=PT+Serif:400,700&amp;subset=cyrillic" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="/app.css?v={{ date().timestamp }}">
<title>
{% if page.title is defined %}
{{ page.title }} - {{ site.title }}
@ -14,10 +13,18 @@
</title>
</head>
<body>
<main class="content">
{% block content %}{% endblock %}
</main>
{% include 'counters.twig' %}
<script src="/app.js?v={{ date().timestamp }}"></script>
<script src="/static/layout_default.js?v={{ date().timestamp }}"></script>
{% block js %}
{# extra js scripts here #}
{% endblock %}
</body>
</html>

View File

@ -3,6 +3,10 @@ layout: default
title: Обо мне
---
{% block js %}
<script src="/static/about_me.js"></script>
{% endblock %}
{% block content %}
<section class="about-me">