Floating "New topic" button

Hi, im completely newbie here. how can i make “New Topic” button in floating?

example

3 Likes

That appears to be based on the floating button from Material Design Theme

3 Likes

can u please say which theme i have to use?

1 Like

I can do better than that … I believe this is the CSS (UPDATED):

@mixin buttonShadow {
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.14), 0 4px 8px rgba(0, 0, 0, 0.28);
}

@mixin buttonTransition {
  transition: right 0.5s, bottom 0.5s, border-radius 0.5s, text-indent 0.2s,
    visibility 1s, width 0.2s ease, height 0.5s ease 0.4s, color 0.5s,
    background-color 2s, transform 0.5s;
}

//New Topic Fab
#create-topic.btn-default {
  display: flex;
  align-items: center;
  justify-content: center;
  @include buttonShadow;
  @include buttonTransition;
  padding: 0;
  margin: 0;
  width: 63px;
  height: 63px;
  border-radius: 40px;
  position: fixed;
  bottom: 30px;
  right: 50px;
  z-index: 999;
  background-color: $tertiary;
  color: $secondary;
  white-space: nowrap;
  overflow: hidden;
  .d-icon {
    margin: 0;
  }
  .d-button-label {
    display: inline-block;
    transition: all 0.3s;
    margin: 0 0.25em;
  }

  &:not(:hover):not(:active):not(:focus) {
    .d-button-label {
      opacity: 0;
      width: 0;
      margin: 0;
    }
    .d-icon {
      margin: 0 0.25em;
    }
  }
}

#create-topic.btn-default .fa-plus {
  color: $secondary;
}

#create-topic.btn-default:hover {
  width: 190px;
}
10 Likes

where do i add this? i might be annoying but im new here :neutral_face:

1 Like

Added a link to the Theme above.

You need to go to Admin-> Customise-> Themes

If adding just the CSS for the button create a Theme Component and edit the CSS for Desktop.

Add the component to an existing Theme.

Beginners guide to Themes here.

Full developers guide here

If all this is just too complex or long winded, just add the Theme I linked above following the Beginners guide :slight_smile:

(PS just fixed the CSS above which was missing some dependencies)

6 Likes

Thank you very much sir, now how to make card view like i show in the screenshot?

1 Like

I didnt realize the little red ball was the new topic and had to add the code to see

here’s what I had to change

original

modified

image

Thanks for posting I’ll be playing around with this a bit :wink:

2 Likes

I changed the CSS after shooting from the hip, try it now :slight_smile:

You guys are just too quick! :wink:

(the error is correctly identifying the missing code!)

4 Likes

it worked. just need this more

1 Like

Updated worked without changing :+1:

2 Likes

That I will leave for your research, there’s a lot of nice CSS there :slight_smile:

You can look around meta for aspects of those changes, you may find a lot of snippets.

You might like to ask the site owner.

I will note that the admin has set this as the setting:

image

1 Like

same setting. but mine look different

1 Like

Go through those two guides I link above and search around meta.

1 Like

i have to pull like i do for plugins?

1 Like

All explained in the guides :arrow_up:

e.g. Beginner's guide to using Discourse Themes

4 Likes

Snuck in a minute

working to make it an image

bgb

4 Likes

theme applied but i still didn’t get card view style

Edit: i reload the page in new tap and solved :no_mouth:

1 Like

That’s because it’s a mashup. The Theme in your picture is not identical but I suspect shares the same button code.

You can right click any element and use “Inspect Element” in the browser and it should bring up the developer tools which should give you good insight into the CSS.

1 Like

Thank you Discourse for hosting the open source forum form me to learn,

I was simply taking a minute to check new threads and found out I needed a new, new topic button

:grin:

edit:

too much fun

bg2

3 Likes