Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
Y
yinzhuang
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
xuchentao
yinzhuang
Commits
b902ad30
Commit
b902ad30
authored
Aug 03, 2026
by
xuchentao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: adapt consultation actions by device
parent
28d3cf79
Pipeline
#441
passed with stage
in 22 seconds
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
69 additions
and
0 deletions
+69
-0
ContactDialog.astro
src/components/ContactDialog.astro
+37
-0
Base.astro
src/layouts/Base.astro
+15
-0
global.css
src/styles/global.css
+17
-0
No files found.
src/components/ContactDialog.astro
0 → 100644
View file @
b902ad30
---
import { site } from "../data/site";
---
<dialog class="contact-dialog" data-contact-dialog aria-labelledby="contact-dialog-title">
<div class="contact-dialog__panel">
<button class="contact-dialog__close" type="button" data-contact-dialog-close aria-label="关闭联系方式弹窗">×</button>
<div class="contact-dialog__heading">
<div class="eyebrow"><span></span>CONTACT INZUNG</div>
<h2 id="contact-dialog-title">联系我们</h2>
</div>
<div class="contact-dialog__grid">
<article>
<span>01</span>
<h3>全国客服热线</h3>
<strong class="contact-dialog__primary">{site.contact.phone}</strong>
<p>产品咨询、定制沟通、门店与售后服务</p>
</article>
<article>
<span>02</span>
<h3>公司地址</h3>
<address>{site.contact.address}</address>
</article>
<article>
<span>03</span>
<h3>抖音账号</h3>
{site.contact.douyin.map((name) => <strong class="contact-dialog__social">{name}</strong>)}
<p>关注产品上新与门店内容</p>
</article>
<article>
<span>04</span>
<h3>官方网站</h3>
<a class="contact-dialog__primary contact-dialog__website" href={`https://${site.contact.website}/`} target="_blank" rel="noopener noreferrer">{site.contact.website}</a>
<p>银妆银饰官方信息窗口</p>
</article>
</div>
</div>
</dialog>
src/layouts/Base.astro
View file @
b902ad30
...
...
@@ -4,6 +4,7 @@ import logo from "../../pic/LOGO-白底红字.png";
import favicon from "../../pic/LOGO-红底白字-底较大.png";
import { getImage } from "astro:assets";
import { site } from "../data/site";
import ContactDialog from "../components/ContactDialog.astro";
interface Props {
title: string;
...
...
@@ -70,6 +71,7 @@ const allLd = [organizationLd, ...pageLd.filter((item) => Object.keys(item).leng
<body>
<a
class=
"skip-link"
href=
"#main-content"
>
跳到主要内容
</a>
<slot
/>
<ContactDialog
/>
<script
is:inline
>
const
header
=
document
.
querySelector
(
'[data-header]'
);
const
syncHeader
=
()
=>
header
?.
classList
.
toggle
(
'is-scrolled'
,
window
.
scrollY
>
20
);
...
...
@@ -79,6 +81,19 @@ const allLd = [organizationLd, ...pageLd.filter((item) => Object.keys(item).leng
}),
{
threshold
:
0.1
})
:
null
;
document
.
querySelectorAll
(
'[data-reveal]'
).
forEach
((
el
)
=>
observer
?
observer
.
observe
(
el
)
:
el
.
classList
.
add
(
'is-visible'
));
document
.
querySelectorAll
(
'[data-mobile-nav] a'
).
forEach
((
link
)
=>
link
.
addEventListener
(
'click'
,
()
=>
link
.
closest
(
'details'
)?.
removeAttribute
(
'open'
)));
const
contactDialog
=
document
.
querySelector
(
'[data-contact-dialog]'
);
const
isMobileDevice
=
()
=>
matchMedia
(
'(max-width: 760px), (hover: none) and (pointer: coarse)'
).
matches
;
document
.
addEventListener
(
'click'
,
(
event
)
=>
{
const
phoneLink
=
event
.
target
.
closest
(
'a[href^="tel:"]'
);
if
(
!
phoneLink
||
isMobileDevice
()
||
!
contactDialog
)
return
;
event
.
preventDefault
();
contactDialog
.
showModal
();
});
contactDialog
?.
querySelector
(
'[data-contact-dialog-close]'
)?.
addEventListener
(
'click'
,
()
=>
contactDialog
.
close
());
contactDialog
?.
addEventListener
(
'click'
,
(
event
)
=>
{
if
(
event
.
target
===
contactDialog
)
contactDialog
.
close
();
});
</script>
</body>
</html>
src/styles/global.css
View file @
b902ad30
...
...
@@ -32,6 +32,23 @@ h1, h2, h3 { color: var(--ink); font-family: var(--serif); font-weight: 700; lin
.skip-link
{
position
:
fixed
;
z-index
:
1000
;
left
:
16px
;
top
:
-80px
;
padding
:
10px
18px
;
background
:
var
(
--ink
);
color
:
#fff
;
}
.skip-link
:focus
{
top
:
16px
;
}
.contact-dialog
{
width
:
min
(
calc
(
100%
-
48px
),
920px
);
max-height
:
calc
(
100vh
-
48px
);
padding
:
0
;
overflow
:
auto
;
background
:
var
(
--cream
);
border
:
0
;
color
:
var
(
--text
);
box-shadow
:
0
30px
90px
rgba
(
30
,
25
,
22
,
.32
);
}
.contact-dialog
::backdrop
{
background
:
rgba
(
30
,
25
,
22
,
.7
);
backdrop-filter
:
blur
(
5px
);
}
.contact-dialog__panel
{
position
:
relative
;
padding
:
42px
;
}
.contact-dialog__close
{
position
:
absolute
;
top
:
18px
;
right
:
18px
;
display
:
grid
;
width
:
42px
;
height
:
42px
;
padding
:
0
;
place-items
:
center
;
background
:
transparent
;
border
:
1px
solid
var
(
--border
);
color
:
var
(
--ink
);
font-size
:
28px
;
font-weight
:
300
;
line-height
:
1
;
}
.contact-dialog__close
:hover
{
background
:
var
(
--primary
);
border-color
:
var
(
--primary
);
color
:
#fff
;
}
.contact-dialog__heading
{
padding-right
:
50px
;
}
.contact-dialog__heading
h2
{
margin
:
13px
0
30px
;
font-size
:
clamp
(
36px
,
5vw
,
54px
);
}
.contact-dialog__grid
{
display
:
grid
;
grid-template-columns
:
repeat
(
2
,
1
fr
);
border-top
:
1px
solid
var
(
--border
);
border-left
:
1px
solid
var
(
--border
);
}
.contact-dialog__grid
article
{
min-height
:
218px
;
padding
:
27px
;
background
:
#fff
;
border-right
:
1px
solid
var
(
--border
);
border-bottom
:
1px
solid
var
(
--border
);
}
.contact-dialog__grid
article
>
span
{
color
:
var
(
--gold-deep
);
font-family
:
var
(
--serif
);
}
.contact-dialog__grid
h3
{
margin
:
25px
0
9px
;
font-size
:
20px
;
}
.contact-dialog__grid
p
{
margin
:
12px
0
0
;
color
:
var
(
--muted
);
font-size
:
13px
;
}
.contact-dialog__grid
address
{
color
:
var
(
--ink
);
font-size
:
16px
;
font-style
:
normal
;
line-height
:
1.7
;
}
.contact-dialog__primary
{
display
:
block
;
color
:
var
(
--primary
);
font-family
:
var
(
--serif
);
font-size
:
clamp
(
25px
,
3vw
,
35px
);
font-weight
:
700
;
line-height
:
1.35
;
}
.contact-dialog__website
{
width
:
fit-content
;
border-bottom
:
1px
solid
currentColor
;
font-size
:
24px
;
}
.contact-dialog__social
{
display
:
block
;
color
:
var
(
--ink
);
font-size
:
16px
;
}
[
data-reveal
]
{
opacity
:
0
;
transform
:
translateY
(
24px
);
transition
:
opacity
.8s
ease
,
transform
.8s
cubic-bezier
(
.2
,
.7
,
.2
,
1
);
}
[
data-reveal
]
.is-visible
{
opacity
:
1
;
transform
:
none
;
}
@media
(
prefers-reduced-motion
:
reduce
)
{
html
{
scroll-behavior
:
auto
;
}
[
data-reveal
]
{
opacity
:
1
;
transform
:
none
;
transition
:
none
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment