Use webpack for bundling
This commit is contained in:
@ -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);
|
||||
}
|
||||
|
||||
}());
|
40
source/_assets/about_me/index.js
Normal file
40
source/_assets/about_me/index.js
Normal 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);
|
||||
}
|
@ -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;
|
@ -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&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>
|
||||
|
@ -3,6 +3,10 @@ layout: default
|
||||
title: Обо мне
|
||||
---
|
||||
|
||||
{% block js %}
|
||||
<script src="/static/about_me.js"></script>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<section class="about-me">
|
||||
|
Reference in New Issue
Block a user