Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Aug 17 09:32
    User @bjorno43 unbanned @linkin-park
  • Jun 20 21:19
    @bjorno43 banned @shenerd140
  • Apr 25 17:13
    @mstellaluna banned @cmal
  • Jan 08 22:05
    @mstellaluna banned @dertiuss323
  • Nov 07 2018 04:42
    User @texas2010 unbanned @ows-ali
  • Nov 02 2018 16:25
    @texas2010 banned @ows-ali
  • Oct 12 2018 05:50
    @bjorno43 banned @NACH74
  • Oct 05 2018 23:02
    @mstellaluna banned @JomoPipi
  • Sep 16 2018 12:21
    @bjorno43 banned @yash-kedia
  • Sep 16 2018 12:16
    @bjorno43 banned @vnikifirov
  • Sep 05 2018 08:12
    User @bjorno43 unbanned @androuino
  • Sep 05 2018 07:38
    @bjorno43 banned @androuino
  • Aug 23 2018 16:57
    User @bjorno43 unbanned @rahuldkjain
  • Aug 23 2018 16:23
    @bjorno43 banned @rahuldkjain
  • Jul 29 2018 14:13
    User @bjorno43 unbanned @jkyereh
  • Jul 29 2018 01:00
    @bjorno43 banned @jkyereh
  • Jul 10 2018 22:09
    @bjorno43 banned @manafn
  • Jul 06 2018 15:20
    @texas2010 banned @imlegend19
  • Jul 03 2018 12:28
    @bjorno43 banned @vbvmatta
  • Jun 29 2018 13:54
    @bjorno43 banned @OGTechnoBoy
Netrunner21
@Netrunner21
Made some changes to my Wiki Viewer. What do you guys think?
Johnny
@jtan3
@Netrunner21 I like the hover effects !
Netrunner21
@Netrunner21
Thanks. I has taken some time to get everything looking right
It *
mboesiger90
@mboesiger90

So I have this working now but some of the quotes are too long from this API. Is there someway I can add a string.length filter to the filter that goes with the URL or do I have to completely reorder my coding

$(document).ready(function(){
$.ajax({
cache: false,
url: 'https://quotesondesign.com/wp-json/posts?filter[orderby]=rand',
success:function(data){
var post = data.shift();
$(".quote").html(post.content);
$(".author").html("-" + post.title);
}
});
$("#getQuote").on('click', function (e){
e.preventDefault;
$.ajax({
cache: false,
url: 'https://quotesondesign.com/wp-json/posts?filter[orderby]=rand',
success:function(data){
var post = data.shift();
$(".quote").html(post.content);
$(".author").html("-" + post.title);
}
});
});
});
$("#tweet").click(function(){
var tweetQuote = $(".quote").text() + "-" + $(".author").text();
var tweetLink = 'https://twitter.com/intent/tweet?text=' + encodeURIComponent(tweetQuote);
window.open(tweetLink, '_blank')
});

Netrunner21
@Netrunner21
@mboesiger90 Your code only has to send the tweet to twitter. It's ok if it's too long. Interesting though if you truly did want to filter the quotes you could absoluly use a string.length type condition
I used the same API. You could test the length, and if it's too long have your code grab another random link.
mboesiger90
@mboesiger90
yeah I tried that in the filter that I have within my url but that doesnt seem to work
Netrunner21
@Netrunner21
random quote, sorry
mboesiger90
@mboesiger90
oh or you mean make an if statement?
Netrunner21
@Netrunner21
yeah, so basically it checks the length and if it's too long it doesn't get passed on, it reruns the code and grabs another quote.
That API has a lot of long ones though
mboesiger90
@mboesiger90
ok that would work
This API has too many quotes that are too long and then they mess up my layout haha
Pranav Reddy
@ne0ng0d
Guys how do I start working on the portfolio?
Netrunner21
@Netrunner21
I understand, otherwise its a decent API
mboesiger90
@mboesiger90
google ideas and templates to get an idea
Netrunner21
@Netrunner21
@ne0ng0d make a new pen, and add the stuff you want like bootstrap, animate.css, font awesome, jquery, etc.
That's my process of getting started
Honestly though I skipped that one. I'm going to do it when I finish all my projects. The portfolio is layout heavy and I'm not very good at design, hah.
Pranav Reddy
@ne0ng0d
Thanks @Netrunner21
CamperBot
@camperbot
ne0ng0d sends brownie points to @netrunner21 :sparkles: :thumbsup: :sparkles:
:cookie: 327 | @netrunner21 |http://www.freecodecamp.com/netrunner21
Netrunner21
@Netrunner21
@ne0ng0d You're welcome
mboesiger90
@mboesiger90
haha I had so much trouble picking a color scheme for my portfolio and now I hate it anyway so I will definitely be going back to redesign it with my newfound knowledge
Pranav Reddy
@ne0ng0d
but how do I do things like the buttons doing different function adding a menu bar and adding multiple pictures next to each other and adding icons to different websites
Saeed Jassani
@saeedjassani
hello, i need help in "Random Quote Machine" project
how can i change the backgrount color of my bootstrap button?
mboesiger90
@mboesiger90
make a class, assign the class to the button, and change the background-color in the class
Netrunner21
@Netrunner21
@ne0ng0d there are several ways. You can add onclick="function()" to make buttons do things.
Saeed Jassani
@saeedjassani
@mboesiger90 i tried color: white !important;
to btn-default class of bootstrap
Netrunner21
@Netrunner21
@ne0ng0d bootstrap has sample menus that you can copy/paste
Saeed Jassani
@saeedjassani
but the ripple effect goes away
kirbyedy
@kirbyedy
@saeedjassani you have to target the button in css
Netrunner21
@Netrunner21
@ne0ng0d adding multiple pictures would require the use of inline or inline block css styles, and not the block display style. There may be easier ways to do it in bootstrap though, I'm not sure.
kirbyedy
@kirbyedy
color will refer to the text inside the button
mboesiger90
@mboesiger90
@saeedjassani this is my little excerpt. .btnNPos { position: absolute; bottom: 10px; left: 20%; background-color: black; color: #ffffff; }
CamperBot
@camperbot
:bulb: to format code use backticks! ``` more info
kirbyedy
@kirbyedy
most probably you need background-color @saeedjassani
mboesiger90
@mboesiger90
oops sorry i never get that right but that is my css class for the button. The button is black and the text is white
Saeed Jassani
@saeedjassani
oh sorry, document.getElementById('refresh').setAttribute('style', 'background-color:' + colors[0] + '; !important');
i need to color it dynamically
so i have used javascript to change the background color
but the problem is, the ripple effect on the button goes away
<button id="refresh" class="btn btn-default">New Quote</button>
@mboesiger90 @kirbyedy you can see my pen
kirbyedy
@kirbyedy
hmmm well it does change for me