Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Mock Browser#168

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
You-J wants to merge22 commits intostaging
base:staging
Choose a base branch
Loading
from@ui/mock-browser
Draft
Show file tree
Hide file tree
Changes from1 commit
Commits
Show all changes
22 commits
Select commitHold shift + click to select a range
7b4d1c8
setup structure
You-JOct 9, 2021
6cc4ca3
update readme
You-JOct 9, 2021
f40aa14
set storybook for component
You-JOct 9, 2021
0868ced
update directory names
softmarshmallowOct 9, 2021
c1fbac2
add global show / hide navigation animation by preview scroll
softmarshmallowOct 9, 2021
9cb8135
adjust animation
softmarshmallowOct 9, 2021
4f58c4b
stash add component using storybook
You-JOct 9, 2021
baf7622
add scroll anim trigger to code area & add 2line tab under root nav app
softmarshmallowOct 9, 2021
6b7058a
shadow on only code preview screen
softmarshmallowOct 9, 2021
50b30e5
Merge pull request #167 from gridaco/app-navigation
softmarshmallowOct 9, 2021
97c8c33
update root scripts
softmarshmallowOct 9, 2021
38a1d4c
fix storybook issue
You-JOct 9, 2021
9575cd1
fix storybook emotion version issue
You-JOct 9, 2021
4ad55b6
add storybook root
You-JOct 9, 2021
66f7cdb
add refresh btn
You-JOct 9, 2021
9d94a2f
rename
You-JOct 9, 2021
48f42c1
add component index
You-JOct 9, 2021
4cf0316
add address bar
You-JOct 9, 2021
1e970d9
stash add browser bar
You-JOct 9, 2021
2f809f8
Merge branch '@ui/mock-browser' of https://github.com/gridaco/assista…
You-JOct 9, 2021
cc394da
stash add attr in browser-bar
You-JOct 10, 2021
bcef2a9
fix unconfirmed design invisible
You-JOct 10, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
PrevPrevious commit
NextNext commit
shadow on only code preview screen
  • Loading branch information
@softmarshmallow
softmarshmallow committedOct 9, 2021
commit6b7058a3c0984f1454e9aedf06ecc5306c2f7e85
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -11,6 +11,7 @@ export function update_hide_by_scroll_position_and_velocity({
top_sensitivity: 0.01,
bottom_sensitivity: 0.01,
define_intense_velocity: 1,
do_show_on_bottom_hit: true,
},
}: {
scrollYProgress: ScrollMotionValues["scrollYProgress"];
Expand All@@ -21,6 +22,7 @@ export function update_hide_by_scroll_position_and_velocity({
top_sensitivity: number;
bottom_sensitivity: number;
define_intense_velocity: number;
do_show_on_bottom_hit: boolean;
};
}) {
const velocity = scrollYProgress.getVelocity();
Expand All@@ -37,8 +39,10 @@ export function update_hide_by_scroll_position_and_velocity({
const scroll_progress_percentage = scrollYProgress.get();

if (scroll_progress_percentage >= 1 - options.bottom_sensitivity) {
// bottom = show
on_change(false);
if (options.do_show_on_bottom_hit) {
// bottom = show
on_change(false);
}
} else if (scroll_progress_percentage <= options.top_sensitivity) {
switch (direction) {
// top + down = hide
Expand DownExpand Up@@ -90,6 +94,7 @@ export function useScrollTriggeredAnimation(el: RefObject<HTMLElement>) {
setHide(hide);
},
options: {
do_show_on_bottom_hit: false,
top_sensitivity: 0.05,
bottom_sensitivity: 0.1,
define_intense_velocity: 50,
Expand Down
10 changes: 8 additions & 2 deletionsapp/lib/main/index.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -114,6 +114,7 @@ function TabNavigationApp(props: { savedLayout: NavigationStoreState }) {
props.savedLayout.workmodeSet
);
const [tabIndex, setTabIndex] = useState<number>(0);
const [screen, setScreen] = useState<WorkScreen>();
const [expansion, setExpansion] = useState<boolean>(true);
const isTabVisible = expansion;
const on_workmode_select = (workmode: WorkMode) => {
Expand All@@ -140,6 +141,7 @@ function TabNavigationApp(props: { savedLayout: NavigationStoreState }) {

const handleTabChange = (index: number) => {
const screen = tabs_as_page_configs[index];
setScreen(screen.id);
on_work_select(index, screen.id);
history.replace(screen.path); // since it is a movement between tabs, we don't use push. we use replace to avoid the history stack to be too long.
};
Expand All@@ -155,6 +157,8 @@ function TabNavigationApp(props: { savedLayout: NavigationStoreState }) {
}
);

const shadow_required = screen == WorkScreen.code || !isTabVisible;

return (
// root flex styled container for the whole app
<div
Expand All@@ -167,8 +171,10 @@ function TabNavigationApp(props: { savedLayout: NavigationStoreState }) {
<AppbarContainerMotion hidden={whole_navigation_hidden}>
<div
style={{
zIndex: 99,
boxShadow: "0px 4px 24px rgba(0, 0, 0, 0.25)",
zIndex: 1,
boxShadow: shadow_required
? "0px 4px 24px rgba(0, 0, 0, 0.25)"
: undefined,
}}
>
<PrimaryWorkmodeWrapper>
Expand Down
1 change: 1 addition & 0 deletionspackages/ui-previewer/preview-responsive/index.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -58,4 +58,5 @@ const PlainIframe = styled.iframe<{ scale: number; margin: number }>`
border: none;
transform: ${(props) => `scale(${props.scale})`};
transform-origin: 0 0;
z-index: -1;
`;
2 changes: 0 additions & 2 deletionspackages/ui-previewer/preview/index.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -51,7 +51,6 @@ export function Preview(props: Props) {
const initialPreviewHeight = 200;
const previewWrapPadding = 0;
return (
// <Container>
<PreviewWrap
id="preview-wrap"
ref={previewRefWrap}
Expand All@@ -71,7 +70,6 @@ export function Preview(props: Props) {
</PreviewWrap>
);
}
// {/* </Container> */}

function Content({ props, wrapWidth }: { props: Props; wrapWidth: number }) {
switch (props.type) {
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp