Skip to content
This repository has been archived by the owner on Jun 1, 2023. It is now read-only.

Commit

Permalink
update px2vw remote call
Browse files Browse the repository at this point in the history
  • Loading branch information
mcdmaster committed Oct 24, 2021
1 parent 1a0bc58 commit 741dd42
Show file tree
Hide file tree
Showing 22 changed files with 928 additions and 852 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,10 @@ $default-boxdiff: 35px;

@function px2vw($px, $vw: 0) {
@if $vw > 0 {
@return ceil($px / $vw * 100000vw) / 1000;
} @else {
$shft-px: 100000 * $px;
@return div(#{$shft-px % $vw == 0} + div($shft-px, $vw), 1000)
}
@else {
@return $px * 1px;
}
}
Expand Down Expand Up @@ -132,16 +134,16 @@ $default-boxdiff: 35px;
&.parent {
border-top: px2vw($bdw, $vw) solid $green-1;
border-left: px2vw($bdw, $vw) solid $green-1;
padding-left: px2vw($boxdiff, $vw) - px2vw($bdw, $vw) * 2;
padding-left: px2vw($boxdiff, $vw) - px2vw($bdw * 2, $vw);

&::after {
width: px2vw($boxdiff - $bdw, $vw);
border-bottom: px2vw($bdw, $vw) solid $green-1;
}

> .content {
margin-left: -(px2vw($boxdiff, $vw) - px2vw($bdw, $vw) * 2);
width: calc(100% + #{(px2vw($boxdiff, $vw) - px2vw($bdw, $vw) * 2)});
margin-left: px2vw($bdw * 2, $vw) - px2vw($boxdiff, $vw);
width: calc(100% + #{(px2vw($boxdiff, $vw) - px2vw($bdw * 2, $vw))});
}
}
}
Expand Down
13 changes: 8 additions & 5 deletions assets/variables.scss → assets/_variables.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@use "sass:math";

// ==================
// color
$green-1: #008830;
Expand All @@ -12,8 +14,8 @@ $gray-5: #f8f9fa;
$white: #fff;
$link: #006ca8;
$focus: #1976d2;
$notice: #B19201;
$alert: #AD2121;
$notice: #b19201;
$alert: #ad2121;

// ==================
// shadow
Expand Down Expand Up @@ -63,7 +65,7 @@ $chinese-hant: "PingFang TC", "Microsoft JhengHei", "Source Han Sans TC", "Noto
// ==================
// font-size
@mixin font-size($size, $important: false) {
font-size: ($size / 10) + rem #{if($important, "!important", "")};
font-size: math.div($size, 10) + rem #{if($important, "!important", "")};
}

@mixin card-h1 {
Expand Down Expand Up @@ -111,7 +113,8 @@ $chinese-hant: "PingFang TC", "Microsoft JhengHei", "Source Han Sans TC", "Noto
@mixin button-text($size: 'md', $font-size: 14) {
@if ($size == 'sm') {
padding: 5px 8px;
} @else {
}
@else {
padding: 24px 36px;
}

Expand Down Expand Up @@ -183,5 +186,5 @@ $chinese-hant: "PingFang TC", "Microsoft JhengHei", "Source Han Sans TC", "Noto
$expansion-panel-content-padding: 0;
$expansion-panel-header-padding: 10px 0;
$expansion-panel-header-min-height: 26px;
$expansion-panel-active-header-min-height: 26px;
$expansion-panel-active-header-min-height: 026px;
$expansion-panel-header-font-size: .875rem;
2 changes: 2 additions & 0 deletions assets/global.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* stylelint-enable no-unknown */

:root {
box-sizing: border-box;
font-size: 62.5%;
Expand Down
4 changes: 3 additions & 1 deletion components/_shared/SideNavigation/MenuList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
>
<custom-expansion-panel v-if="itemTitles[i].isExpand" :id="`menu-${i}`">
<template #icon>
<v-icon size="2.4rem">{{ mdiChevronRight }}</v-icon>
<v-icon size="2.4rem">
{{ mdiChevronRight }}
</v-icon>
</template>
<template #title>
<span class="MenuTitle">{{ setMenuTitle(slug) }}</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@
/>
</section>
<div :class="$style.link">
<v-icon color="#D9D9D9">{{ mdiChevronRight }}</v-icon>
<v-icon color="#D9D9D9">
{{ mdiChevronRight }}
</v-icon>
<app-link
to="https://www.fukushihoken.metro.tokyo.lg.jp/hodo/saishin/hassei.html"
>
Expand Down
8 changes: 6 additions & 2 deletions components/index/CardsFeatured/MonitoringComment/Card.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@
</li>
</ul>
<section class="MonitoringCommentFrame">
<h4 class="MonitoringCommentFrame-title">{{ $t('感染状況') }}</h4>
<h4 class="MonitoringCommentFrame-title">
{{ $t('感染状況') }}
</h4>
<frame
:level="monitoringComment['総括コメント-感染状況'].level - 1"
:comment="commentMonitoring('総括コメント-感染状況')"
Expand All @@ -48,7 +50,9 @@
<div class="MonitoringCommentImage">
<random-image />
<div class="MonitoringCommentLink">
<v-icon color="#D9D9D9">{{ mdiChevronRight }}</v-icon>
<v-icon color="#D9D9D9">
{{ mdiChevronRight }}
</v-icon>
<app-link
to="https://www.fukushihoken.metro.tokyo.lg.jp/iryo/kansen/corona_portal/info/monitoring.html"
>
Expand Down
4 changes: 3 additions & 1 deletion components/index/CardsTab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
exact
@click="change"
>
<v-icon class="TabIcon">{{ mdiChartTimelineVariant }}</v-icon>
<v-icon class="TabIcon">
{{ mdiChartTimelineVariant }}
</v-icon>
{{ item.label }}
</v-tab>
<v-tabs-items v-model="tab" touchless>
Expand Down
4 changes: 3 additions & 1 deletion components/index/SiteTopUpper/Consultation/StaticInfo.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<template>
<div class="StaticInfo">
<h3 class="StaticInfo-Text">{{ text }}</h3>
<h3 class="StaticInfo-Text">
{{ text }}
</h3>
<div v-if="btnText" class="StaticInfo-Button">
<app-link :to="url" class="StaticInfo-Link">
{{ btnText }}
Expand Down
7 changes: 5 additions & 2 deletions components/index/SiteTopUpper/StayingPopulation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@
{{ $t('都内の滞在人口の増減状況(毎週月曜日更新)') }}
</h3>
<div class="StayingPopulation-link">
<v-icon color="#D9D9D9">{{ mdiChevronRight }}</v-icon>
<v-icon color="#D9D9D9">
{{ mdiChevronRight }}
</v-icon>
<app-link
to="https://www.seisakukikaku.metro.tokyo.lg.jp/information/corona-people-flow-analysis.html#top"
>{{ $t('詳細はこちら') }}
>
{{ $t('詳細はこちら') }}
</app-link>
</div>
</div>
Expand Down
4 changes: 3 additions & 1 deletion components/index/_shared/CardsLazyRow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
<div v-else class="DataBlock">
<custom-expansion-panel id="hide-cards">
<template #icon>
<v-icon size="2.4rem">{{ mdiChevronRight }}</v-icon>
<v-icon size="2.4rem">
{{ mdiChevronRight }}
</v-icon>
</template>
<template #title>
<span class="expansion-panel-text">
Expand Down
4 changes: 3 additions & 1 deletion components/index/_shared/DataView/ExpantionPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
<div>
<custom-expansion-panel v-if="showDetails" :id="id" @click="toggleDetails">
<template #icon>
<v-icon size="2.4rem">{{ mdiChevronRight }}</v-icon>
<v-icon size="2.4rem">
{{ mdiChevronRight }}
</v-icon>
</template>
<template #title>
<span class="expansion-panel-text">{{ $t('テーブルを表示') }}</span>
Expand Down
3 changes: 2 additions & 1 deletion components/index/_shared/DataView/Share.vue
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,9 @@
class="EmbedCode-Copy"
:aria-label="$t('クリップボードにコピー')"
@click="copyEmbedCode"
>{{ mdiClipboardOutline }}</v-icon
>
{{ mdiClipboardOutline }}
</v-icon>
{{ graphEmbedValue }}
</div>
</section>
Expand Down
4 changes: 3 additions & 1 deletion components/index/_shared/DataViewDataSetPanel.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<template>
<div class="DataView-DataSet">
<h4 v-if="title" class="DataView-DataSet-title">{{ title }}</h4>
<h4 v-if="title" class="DataView-DataSet-title">
{{ title }}
</h4>
<div class="DataView-DataSet-info">
<template v-if="lText">
<p class="DataView-DataSet-summary">
Expand Down
109 changes: 66 additions & 43 deletions nuxt.config.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
/* eslint-disable simple-import-sort/imports -- `@nuxt/types` import should occur after import of `path` */
import fs from 'fs'
import path from 'path'
import 'regenerator-runtime/runtime'
import 'core-js/stable'
import fs, {
readFileSync /* eslint-disable-line @typescript-eslint/no-unused-vars */,
} from 'fs'
import path, {
resolve /* eslint-disable-line @typescript-eslint/no-unused-vars */,
} from 'path'

import { NuxtConfig } from '@nuxt/types'
// eslint-disable-next-line no-restricted-imports
import { NuxtRouteConfig } from '@nuxt/types/config/router'
import i18n from './nuxt-i18n.config'
// @ts-ignore
import { Settings } from '@/types/cardRoutesSettings'
Expand All @@ -15,11 +22,6 @@ const cardData = JSON.parse(
)

const config: NuxtConfig = {
// Since nuxt@2.14.5, there have been significant changes.
// We dealt with typical two (2) out of them:
// 1) The "mode:" directive got deprecated (seen right below);
// 2) Autoprefixer has been included so that we can lessen upgrade burden.
// mode: 'universal',
target: 'static',
components: true,
/*
Expand Down Expand Up @@ -62,6 +64,10 @@ const config: NuxtConfig = {
property: 'note:card',
content: 'summary_large_image',
},
{
name: 'tabs',
content: 'no',
},
],
link: [
{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' },
Expand All @@ -78,16 +84,34 @@ const config: NuxtConfig = {
** Customize the progress-bar color
*/
loading: { color: '#fff' },
/*
** Global CSS
*/
css: ['@/assets/global.scss'],
styleResources: {
/*
** Global CSS/SCSS/SASS
*/
css: ['@/assets/global.scss'],
/*
** Pulled out from vuild.styleResources block w/ according module uninstalled
** https://github.com/nuxt-community/style-resources-module/issues/88
*/
scss: [
'@/assets/global.scss',
'@/assets/variables.scss',
'@/assets/monitoringItemsTableCommon.scss',
'*.vue',
],
sass: [
'@/assets/global.scss',
'@/assets/variables.scss',
'@/assets/monitoringItemsTableCommon.scss',
],
hoistUseStatements: true,
},
/*
** Plugins to load before mounting the App
*/
plugins: [
{
src: '@/plugins/vue-chart.ts',
src: '@/plugins/vue-chart',
ssr: true,
},
{
Expand All @@ -108,14 +132,13 @@ const config: NuxtConfig = {
async: true,
typescript: {
enable: true,
memoryLimit: 4096,
memoryLimit: 5120,
},
},
},
],
'@nuxtjs/google-analytics',
'@nuxtjs/gtm',
'nuxt-purgecss',
],
/*
** Nuxt.js modules
Expand All @@ -125,7 +148,7 @@ const config: NuxtConfig = {
// Doc: https://github.com/nuxt-community/dotenv-module
['@nuxtjs/dotenv', { filename: `.env.${environment}` }],
['@nuxtjs/i18n', i18n],
'nuxt-svg-loader',
'@nuxtjs/svg',
['vue-scrollto/nuxt', { duration: 1000, offset: -72 }],
'nuxt-webfontloader',
],
Expand Down Expand Up @@ -159,35 +182,33 @@ const config: NuxtConfig = {
pageTracking: true,
enabled: true,
},
/*
* nuxt-i18n による自動リダイレクトを停止したためコメントアウト
* @todo 「Cookieがあるときのみ、その言語にリダイレクトする」を実装する場合は復活させる
* 実装しない場合は以下の記述を完全に削除する
*/
/* optionalCookies: [
{
name: 'i18n_redirected',
label: 'i18n Redirection Cookie',
description:
'For automatically switching UI languages in accordance with locale preferences in the web browser configuration.',
cookies: ['i18n_redirected']
}
], */
build: {
filenames: {
chunk: ({ isDev }) => (isDev ? '[name].js' : '[id].[contenthash].js'),
loaders: {
file: {
regExp: /\.[mc]?js$/,
name: ({ isDev }: any): string => {
return isDev ? '[name].[ext]' : '[id].[contenthash].[ext]'
},
},
},
babel: {
presets() {
return [
[
'@nuxt/babel-preset-app',
{
corejs: { version: '3.16' },
corejs: {
version: 3,
useBuiltins: 'entry',
},
},
],
]
},
plugins: [
// https://github.com/altgifted/babel-plugin-transform-scss/blob/master/lib/index.js
'babel-plugin-transform-scss',
],
},
postcss: {
preset: {
Expand Down Expand Up @@ -217,7 +238,7 @@ const config: NuxtConfig = {
theme_color: '#00a040',
background_color: '#ffffff',
display: 'standalone',
Scope: '/',
scope: '/',
start_url: '/',
splash_pages: null,
},
Expand Down Expand Up @@ -252,15 +273,17 @@ const config: NuxtConfig = {
},
},
router: {
extendRoutes(routes) {
routes.forEach((route) => {
if (
route.name === 'index' ||
route.name === 'monitoring' ||
route.name === 'reference'
) {
route.meta = { tabs: true }
}
extendRoutes(routes: NuxtRouteConfig[]) {
routes.forEach((route: NuxtRouteConfig) => {
return (route.meta = {
tabs: {
type: Boolean,
default:
route.name === 'index' ||
route.name === 'monitoring' ||
route.name === 'reference',
},
})
})
},
},
Expand Down
Loading

0 comments on commit 741dd42

Please sign in to comment.