0
0
mirror of https://github.com/Maks1mS/free-ozon-dpr.git synced 2025-04-17 22:43:43 +03:00

chore: improve ux and dx (#1)

* move to src

* hide popup at startup

* add eslint
This commit is contained in:
Maxim Slipenko 2024-06-08 20:18:09 +03:00 committed by GitHub
parent ccdce54b73
commit deeed2e2ef
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
12 changed files with 930 additions and 11 deletions

16
eslint.config.js Normal file
View File

@ -0,0 +1,16 @@
import globals from "globals";
import pluginJs from "@eslint/js";
export default [
{
// files: ["src/**/*.js"],
ignores: [
"dist/**/*.js",
"!scripts/**/*.js"
],
},
{
languageOptions: { globals: { ...globals.browser, ...globals.node } },
},
pluginJs.configs.recommended,
];

887
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -6,9 +6,13 @@
"scripts": { "scripts": {
"dev": "vite", "dev": "vite",
"build": "vite build", "build": "vite build",
"preview": "vite preview" "preview": "vite preview",
"lint": "eslint"
}, },
"devDependencies": { "devDependencies": {
"@eslint/js": "^9.4.0",
"eslint": "^9.4.0",
"globals": "^15.4.0",
"vite": "^5.2.0", "vite": "^5.2.0",
"vite-plugin-radar": "^0.9.6", "vite-plugin-radar": "^0.9.6",
"vite-plugin-webfont-dl": "^3.9.4" "vite-plugin-webfont-dl": "^3.9.4"

View File

@ -6,6 +6,14 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link href="https://fonts.googleapis.com/css2?family=Roboto&display=swap" rel="stylesheet"> <link href="https://fonts.googleapis.com/css2?family=Roboto&display=swap" rel="stylesheet">
<title>БЕСПЛАТНЫЕ ПВЗ ОЗОН В ДНР</title> <title>БЕСПЛАТНЫЕ ПВЗ ОЗОН В ДНР</title>
<style>
#popup {
display: none;
}
.ol-overlay-container > #popup {
display: unset;
}
</style>
</head> </head>
<body> <body>
<div id="map" class="map"></div> <div id="map" class="map"></div>

View File

@ -4,7 +4,7 @@ import map from "./map";
import "./popup"; import "./popup";
import mergedData from "./merged-data.json"; import mergedData from "../merged-data.json";
import { createFeatures } from "./features"; import { createFeatures } from "./features";
import VectorSource from "ol/source/Vector"; import VectorSource from "ol/source/Vector";
import VectorLayer from "ol/layer/Vector"; import VectorLayer from "ol/layer/Vector";

View File

@ -4,7 +4,7 @@ import View from 'ol/View';
import TileLayer from 'ol/layer/Tile'; import TileLayer from 'ol/layer/Tile';
import { fromLonLat } from 'ol/proj'; import { fromLonLat } from 'ol/proj';
import { XYZ } from 'ol/source'; import { XYZ } from 'ol/source';
import { createXYZ } from 'ol/tilegrid'; // import { createXYZ } from 'ol/tilegrid';
const MAP_TARGET = 'map'; const MAP_TARGET = 'map';
const MAP_CENTER = fromLonLat([37.57725139554275, 48.02287702854201]); const MAP_CENTER = fromLonLat([37.57725139554275, 48.02287702854201]);

View File

@ -4,7 +4,7 @@ import QRCode from "qrcode";
import { el } from "./utils"; import { el } from "./utils";
import { toLonLat } from "ol/proj"; import { toLonLat } from "ol/proj";
const container = el("popup"); const popup = el("popup");
const closer = el("popup-closer"); const closer = el("popup-closer");
const popupName = el("popup-name"); const popupName = el("popup-name");
@ -15,7 +15,7 @@ const popupSource = el("popup-source");
const popupOperationTime = el("popup-operation-time"); const popupOperationTime = el("popup-operation-time");
const overlay = new Overlay({ const overlay = new Overlay({
element: container, element: popup,
autoPan: true, autoPan: true,
autoPanAnimation: { autoPanAnimation: {
duration: 250, duration: 250,

View File

@ -1,13 +1,17 @@
import webfontDownload from 'vite-plugin-webfont-dl'; import webfontDownload from "vite-plugin-webfont-dl";
import { VitePluginRadar } from 'vite-plugin-radar' import { VitePluginRadar } from "vite-plugin-radar";
export default { export default {
root: "src",
build: {
outDir: "../dist",
},
plugins: [ plugins: [
webfontDownload(), webfontDownload(),
VitePluginRadar({ VitePluginRadar({
metrica: { metrica: {
id: process.env.YANDEX_METRICA_ID id: process.env.YANDEX_METRICA_ID,
}, },
}) }),
], ],
}; };