mirror of
				https://github.com/Maks1mS/free-ozon-dpr.git
				synced 2025-11-03 22:51:22 +03:00 
			
		
		
		
	chore: improve ux and dx (#1)
* move to src * hide popup at startup * add eslint
This commit is contained in:
		
							
								
								
									
										16
									
								
								eslint.config.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										16
									
								
								eslint.config.js
									
									
									
									
									
										Normal 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
									
									
									
								
							
							
						
						
									
										887
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							@@ -6,9 +6,13 @@
 | 
			
		||||
  "scripts": {
 | 
			
		||||
    "dev": "vite",
 | 
			
		||||
    "build": "vite build",
 | 
			
		||||
    "preview": "vite preview"
 | 
			
		||||
    "preview": "vite preview",
 | 
			
		||||
    "lint": "eslint"
 | 
			
		||||
  },
 | 
			
		||||
  "devDependencies": {
 | 
			
		||||
    "@eslint/js": "^9.4.0",
 | 
			
		||||
    "eslint": "^9.4.0",
 | 
			
		||||
    "globals": "^15.4.0",
 | 
			
		||||
    "vite": "^5.2.0",
 | 
			
		||||
    "vite-plugin-radar": "^0.9.6",
 | 
			
		||||
    "vite-plugin-webfont-dl": "^3.9.4"
 | 
			
		||||
 
 | 
			
		||||
@@ -6,6 +6,14 @@
 | 
			
		||||
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
 | 
			
		||||
    <link href="https://fonts.googleapis.com/css2?family=Roboto&display=swap" rel="stylesheet">
 | 
			
		||||
    <title>БЕСПЛАТНЫЕ ПВЗ ОЗОН В ДНР</title>
 | 
			
		||||
    <style>
 | 
			
		||||
      #popup {
 | 
			
		||||
        display: none;
 | 
			
		||||
      }
 | 
			
		||||
      .ol-overlay-container > #popup {
 | 
			
		||||
        display: unset;
 | 
			
		||||
      }
 | 
			
		||||
    </style>
 | 
			
		||||
  </head>
 | 
			
		||||
  <body>
 | 
			
		||||
    <div id="map" class="map"></div>
 | 
			
		||||
@@ -4,7 +4,7 @@ import map from "./map";
 | 
			
		||||
 | 
			
		||||
import "./popup";
 | 
			
		||||
 | 
			
		||||
import mergedData from "./merged-data.json";
 | 
			
		||||
import mergedData from "../merged-data.json";
 | 
			
		||||
import { createFeatures } from "./features";
 | 
			
		||||
import VectorSource from "ol/source/Vector";
 | 
			
		||||
import VectorLayer from "ol/layer/Vector";
 | 
			
		||||
@@ -4,7 +4,7 @@ import View from 'ol/View';
 | 
			
		||||
import TileLayer from 'ol/layer/Tile';
 | 
			
		||||
import { fromLonLat } from 'ol/proj';
 | 
			
		||||
import { XYZ } from 'ol/source';
 | 
			
		||||
import { createXYZ } from 'ol/tilegrid';
 | 
			
		||||
// import { createXYZ } from 'ol/tilegrid';
 | 
			
		||||
 | 
			
		||||
const MAP_TARGET = 'map';
 | 
			
		||||
const MAP_CENTER = fromLonLat([37.57725139554275, 48.02287702854201]);
 | 
			
		||||
@@ -4,7 +4,7 @@ import QRCode from "qrcode";
 | 
			
		||||
import { el } from "./utils";
 | 
			
		||||
import { toLonLat } from "ol/proj";
 | 
			
		||||
 | 
			
		||||
const container = el("popup");
 | 
			
		||||
const popup = el("popup");
 | 
			
		||||
const closer = el("popup-closer");
 | 
			
		||||
 | 
			
		||||
const popupName = el("popup-name");
 | 
			
		||||
@@ -15,7 +15,7 @@ const popupSource = el("popup-source");
 | 
			
		||||
const popupOperationTime = el("popup-operation-time");
 | 
			
		||||
 | 
			
		||||
const overlay = new Overlay({
 | 
			
		||||
  element: container,
 | 
			
		||||
  element: popup,
 | 
			
		||||
  autoPan: true,
 | 
			
		||||
  autoPanAnimation: {
 | 
			
		||||
    duration: 250,
 | 
			
		||||
@@ -1,13 +1,17 @@
 | 
			
		||||
import webfontDownload from 'vite-plugin-webfont-dl';
 | 
			
		||||
import { VitePluginRadar } from 'vite-plugin-radar'
 | 
			
		||||
import webfontDownload from "vite-plugin-webfont-dl";
 | 
			
		||||
import { VitePluginRadar } from "vite-plugin-radar";
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
  root: "src",
 | 
			
		||||
  build: {
 | 
			
		||||
    outDir: "../dist",
 | 
			
		||||
  },
 | 
			
		||||
  plugins: [
 | 
			
		||||
    webfontDownload(),
 | 
			
		||||
    VitePluginRadar({    
 | 
			
		||||
    VitePluginRadar({
 | 
			
		||||
      metrica: {
 | 
			
		||||
        id: process.env.YANDEX_METRICA_ID
 | 
			
		||||
        id: process.env.YANDEX_METRICA_ID,
 | 
			
		||||
      },
 | 
			
		||||
    })
 | 
			
		||||
    }),
 | 
			
		||||
  ],
 | 
			
		||||
};
 | 
			
		||||
};
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user